您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

trace_events.d.ts 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. declare module "trace_events" {
  2. /**
  3. * The `Tracing` object is used to enable or disable tracing for sets of
  4. * categories. Instances are created using the
  5. * `trace_events.createTracing()` method.
  6. *
  7. * When created, the `Tracing` object is disabled. Calling the
  8. * `tracing.enable()` method adds the categories to the set of enabled trace
  9. * event categories. Calling `tracing.disable()` will remove the categories
  10. * from the set of enabled trace event categories.
  11. */
  12. export interface Tracing {
  13. /**
  14. * A comma-separated list of the trace event categories covered by this
  15. * `Tracing` object.
  16. */
  17. readonly categories: string;
  18. /**
  19. * Disables this `Tracing` object.
  20. *
  21. * Only trace event categories _not_ covered by other enabled `Tracing`
  22. * objects and _not_ specified by the `--trace-event-categories` flag
  23. * will be disabled.
  24. */
  25. disable(): void;
  26. /**
  27. * Enables this `Tracing` object for the set of categories covered by
  28. * the `Tracing` object.
  29. */
  30. enable(): void;
  31. /**
  32. * `true` only if the `Tracing` object has been enabled.
  33. */
  34. readonly enabled: boolean;
  35. }
  36. interface CreateTracingOptions {
  37. /**
  38. * An array of trace category names. Values included in the array are
  39. * coerced to a string when possible. An error will be thrown if the
  40. * value cannot be coerced.
  41. */
  42. categories: string[];
  43. }
  44. /**
  45. * Creates and returns a Tracing object for the given set of categories.
  46. */
  47. export function createTracing(options: CreateTracingOptions): Tracing;
  48. /**
  49. * Returns a comma-separated list of all currently-enabled trace event
  50. * categories. The current set of enabled trace event categories is
  51. * determined by the union of all currently-enabled `Tracing` objects and
  52. * any categories enabled using the `--trace-event-categories` flag.
  53. */
  54. export function getEnabledCategories(): string;
  55. }