@paulirish/trace_engine 0.0.53 → 0.0.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts +13 -0
  2. package/.tmp/tsbuildinfo/analyze-inspector-issues.d.mts.map +1 -0
  3. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
  4. package/analyze-inspector-issues.mjs +60 -0
  5. package/core/common/common.d.ts +1 -0
  6. package/core/common/common.js +1 -0
  7. package/core/host/host.d.ts +1 -0
  8. package/core/host/host.js +1 -0
  9. package/core/platform/ServerTiming.d.ts +31 -0
  10. package/core/platform/ServerTiming.js +212 -0
  11. package/core/platform/ServerTiming.js.map +1 -0
  12. package/core/root/root.d.ts +1 -0
  13. package/core/root/root.js +1 -0
  14. package/core/sdk/sdk.d.ts +1 -0
  15. package/core/sdk/sdk.js +1 -0
  16. package/models/issues_manager/CheckFormsIssuesTrigger.d.ts +1 -0
  17. package/models/issues_manager/CheckFormsIssuesTrigger.js +1 -0
  18. package/models/issues_manager/ContrastCheckTrigger.d.ts +1 -0
  19. package/models/issues_manager/ContrastCheckTrigger.js +1 -0
  20. package/models/issues_manager/DeprecationIssue.d.ts +1 -0
  21. package/models/issues_manager/DeprecationIssue.js +1 -0
  22. package/models/issues_manager/IssueResolver.d.ts +1 -0
  23. package/models/issues_manager/IssueResolver.js +1 -0
  24. package/models/issues_manager/RelatedIssue.d.ts +1 -0
  25. package/models/issues_manager/RelatedIssue.js +1 -0
  26. package/models/issues_manager/SourceFrameIssuesManager.d.ts +1 -0
  27. package/models/issues_manager/SourceFrameIssuesManager.js +1 -0
  28. package/models/trace/LanternComputationData.js +2 -2
  29. package/models/trace/LanternComputationData.js.map +1 -1
  30. package/models/trace/ModelImpl.js +1 -1
  31. package/models/trace/ModelImpl.js.map +1 -1
  32. package/models/trace/extras/Metadata.js +2 -2
  33. package/models/trace/extras/Metadata.js.map +1 -1
  34. package/models/trace/extras/ThirdParties.js +1 -1
  35. package/models/trace/extras/ThirdParties.js.map +1 -1
  36. package/models/trace/extras/TimelineJSProfile.d.ts +13 -0
  37. package/models/trace/extras/TimelineJSProfile.js +55 -0
  38. package/models/trace/extras/TimelineJSProfile.js.map +1 -0
  39. package/models/trace/extras/TraceFilter.js +2 -2
  40. package/models/trace/extras/TraceFilter.js.map +1 -1
  41. package/models/trace/extras/URLForEntry.d.ts +12 -0
  42. package/models/trace/extras/URLForEntry.js +43 -0
  43. package/models/trace/extras/URLForEntry.js.map +1 -0
  44. package/models/trace/extras/extras.d.ts +4 -1
  45. package/models/trace/extras/extras.js +4 -1
  46. package/models/trace/handlers/AuctionWorkletsHandler.js +5 -5
  47. package/models/trace/handlers/AuctionWorkletsHandler.js.map +1 -1
  48. package/models/trace/handlers/ExtensionTraceDataHandler.js +4 -4
  49. package/models/trace/handlers/ExtensionTraceDataHandler.js.map +1 -1
  50. package/models/trace/handlers/FlowsHandler.js +3 -3
  51. package/models/trace/handlers/FlowsHandler.js.map +1 -1
  52. package/models/trace/handlers/FramesHandler.js +7 -7
  53. package/models/trace/handlers/FramesHandler.js.map +1 -1
  54. package/models/trace/handlers/LargestImagePaintHandler.js +2 -2
  55. package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -1
  56. package/models/trace/handlers/LayoutShiftsHandler.d.ts +1 -1
  57. package/models/trace/handlers/LayoutShiftsHandler.js +18 -10
  58. package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -1
  59. package/models/trace/handlers/MetaHandler.js +7 -7
  60. package/models/trace/handlers/MetaHandler.js.map +1 -1
  61. package/models/trace/handlers/NetworkRequestsHandler.js +3 -3
  62. package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
  63. package/models/trace/handlers/PageLoadMetricsHandler.d.ts +2 -2
  64. package/models/trace/handlers/PageLoadMetricsHandler.js +54 -25
  65. package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -1
  66. package/models/trace/handlers/RendererHandler.js +1 -1
  67. package/models/trace/handlers/RendererHandler.js.map +1 -1
  68. package/models/trace/handlers/ServerTimingsHandler.d.ts +9 -0
  69. package/models/trace/handlers/ServerTimingsHandler.js +106 -0
  70. package/models/trace/handlers/ServerTimingsHandler.js.map +1 -0
  71. package/models/trace/handlers/Threads.d.ts +1 -1
  72. package/models/trace/handlers/Threads.js +17 -7
  73. package/models/trace/handlers/Threads.js.map +1 -1
  74. package/models/trace/handlers/UserInteractionsHandler.js +4 -3
  75. package/models/trace/handlers/UserInteractionsHandler.js.map +1 -1
  76. package/models/trace/handlers/WarningsHandler.js +2 -2
  77. package/models/trace/handlers/WarningsHandler.js.map +1 -1
  78. package/models/trace/helpers/SamplesIntegrator.d.ts +1 -1
  79. package/models/trace/helpers/SamplesIntegrator.js +19 -12
  80. package/models/trace/helpers/SamplesIntegrator.js.map +1 -1
  81. package/models/trace/helpers/Trace.js +111 -111
  82. package/models/trace/helpers/Trace.js.map +1 -1
  83. package/models/trace/insights/CLSCulprits.d.ts +1 -1
  84. package/models/trace/insights/CLSCulprits.js +43 -22
  85. package/models/trace/insights/CLSCulprits.js.map +1 -1
  86. package/models/trace/insights/Common.js +4 -3
  87. package/models/trace/insights/Common.js.map +1 -1
  88. package/models/trace/insights/CumulativeLayoutShift.d.ts +57 -0
  89. package/models/trace/insights/CumulativeLayoutShift.js +335 -0
  90. package/models/trace/insights/CumulativeLayoutShift.js.map +1 -0
  91. package/models/trace/insights/DOMSize.js +3 -3
  92. package/models/trace/insights/DOMSize.js.map +1 -1
  93. package/models/trace/insights/DocumentLatency.js +2 -2
  94. package/models/trace/insights/DocumentLatency.js.map +1 -1
  95. package/models/trace/insights/DuplicatedJavaScript.js +2 -2
  96. package/models/trace/insights/DuplicatedJavaScript.js.map +1 -1
  97. package/models/trace/insights/FontDisplay.js +2 -2
  98. package/models/trace/insights/FontDisplay.js.map +1 -1
  99. package/models/trace/insights/ForcedReflow.js +2 -2
  100. package/models/trace/insights/ForcedReflow.js.map +1 -1
  101. package/models/trace/insights/ImageDelivery.js +2 -2
  102. package/models/trace/insights/ImageDelivery.js.map +1 -1
  103. package/models/trace/insights/InsightRunners.d.ts +9 -0
  104. package/models/trace/insights/InsightRunners.js +13 -0
  105. package/models/trace/insights/InsightRunners.js.map +1 -0
  106. package/models/trace/insights/InteractionToNextPaint.js +3 -3
  107. package/models/trace/insights/InteractionToNextPaint.js.map +1 -1
  108. package/models/trace/insights/LCPDiscovery.js +3 -3
  109. package/models/trace/insights/LCPDiscovery.js.map +1 -1
  110. package/models/trace/insights/LCPPhases.js +3 -3
  111. package/models/trace/insights/LCPPhases.js.map +1 -1
  112. package/models/trace/insights/LargestContentfulPaint.d.ts +38 -0
  113. package/models/trace/insights/LargestContentfulPaint.js +113 -0
  114. package/models/trace/insights/LargestContentfulPaint.js.map +1 -0
  115. package/models/trace/insights/LegacyJavaScript.js +2 -2
  116. package/models/trace/insights/LegacyJavaScript.js.map +1 -1
  117. package/models/trace/insights/ModernHTTP.js +2 -2
  118. package/models/trace/insights/ModernHTTP.js.map +1 -1
  119. package/models/trace/insights/NetworkDependencyTree.js +2 -2
  120. package/models/trace/insights/NetworkDependencyTree.js.map +1 -1
  121. package/models/trace/insights/RenderBlocking.js +3 -3
  122. package/models/trace/insights/RenderBlocking.js.map +1 -1
  123. package/models/trace/insights/SlowCSSSelector.js +2 -2
  124. package/models/trace/insights/SlowCSSSelector.js.map +1 -1
  125. package/models/trace/insights/ThirdParties.js +2 -2
  126. package/models/trace/insights/ThirdParties.js.map +1 -1
  127. package/models/trace/insights/ThirdPartyWeb.d.ts +13 -0
  128. package/models/trace/insights/ThirdPartyWeb.js +42 -0
  129. package/models/trace/insights/ThirdPartyWeb.js.map +1 -0
  130. package/models/trace/insights/Viewport.js +2 -2
  131. package/models/trace/insights/Viewport.js.map +1 -1
  132. package/models/trace/insights/types.d.ts +1 -1
  133. package/models/trace/insights/types.js +19 -0
  134. package/models/trace/insights/types.js.map +1 -1
  135. package/models/trace/root-causes/LayoutShift.d.ts +125 -0
  136. package/models/trace/root-causes/LayoutShift.js +519 -0
  137. package/models/trace/root-causes/LayoutShift.js.map +1 -0
  138. package/models/trace/root-causes/RootCauses.d.ts +15 -0
  139. package/models/trace/root-causes/RootCauses.js +12 -0
  140. package/models/trace/root-causes/RootCauses.js.map +1 -0
  141. package/models/trace/root-causes/bundle-tsconfig.json +1 -0
  142. package/models/trace/root-causes/devtools_entrypoint-bundle-typescript-tsconfig.json +42 -0
  143. package/models/trace/root-causes/root-causes-tsconfig.json +55 -0
  144. package/models/trace/root-causes/root-causes.d.ts +1 -0
  145. package/models/trace/root-causes/root-causes.js +5 -0
  146. package/models/trace/root-causes/root-causes.js.map +1 -0
  147. package/models/trace/types/File.d.ts +3 -3
  148. package/models/trace/types/File.js +28 -4
  149. package/models/trace/types/File.js.map +1 -1
  150. package/models/trace/types/TraceEvents.d.ts +6 -6
  151. package/models/trace/types/TraceEvents.js +373 -105
  152. package/models/trace/types/TraceEvents.js.map +1 -1
  153. package/package.json +1 -1
  154. package/test/test-trace-engine.mjs +77 -0
  155. package/third_party/marked/marked.d.ts +1 -0
  156. package/third_party/marked/marked.js +1 -0
  157. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts +0 -4
  158. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RootCauses.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/root-causes/RootCauses.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAI7B,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC;AAWvD,MAAM,OAAO,UAAU;IACZ,YAAY,CAAwB;IAE7C,YAAY,iBAA6C;QACvD,IAAI,CAAC,YAAY,GAAG,IAAI,qBAAqB,CAAC,iBAAiB,CAAC,CAAC;IACnE,CAAC;CACF;AAED,OAAO,EAAC,qBAAqB,EAAC,MAAM,kBAAkB,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as Protocol from '../../../generated/protocol.js';\n\nimport {LayoutShiftRootCauses} from './LayoutShift.js';\n\nexport type RootCauseProtocolInterface = {\n getInitiatorForRequest(url: string): Protocol.Network.Initiator|null,\n pushNodesByBackendIdsToFrontend(backendNodeIds: Protocol.DOM.BackendNodeId[]): Promise<Protocol.DOM.NodeId[]>,\n getNode(nodeId: Protocol.DOM.NodeId): Promise<Protocol.DOM.Node|null>,\n getComputedStyleForNode(nodeId: Protocol.DOM.NodeId): Promise<Protocol.CSS.CSSComputedStyleProperty[]>,\n getMatchedStylesForNode(nodeId: Protocol.DOM.NodeId): Promise<Protocol.CSS.GetMatchedStylesForNodeResponse>,\n fontFaceForSource(url: string): Protocol.CSS.FontFace|undefined,\n};\n\nexport class RootCauses {\n readonly layoutShifts: LayoutShiftRootCauses;\n\n constructor(protocolInterface: RootCauseProtocolInterface) {\n this.layoutShifts = new LayoutShiftRootCauses(protocolInterface);\n }\n}\n\nexport {LayoutShiftRootCauses} from './LayoutShift.js';\n"]}
@@ -0,0 +1 @@
1
+ {"compilerOptions":{"composite":true,"outDir":".","baseUrl":".","rootDir":"../../../../../../../front_end/models/trace/root-causes"},"files":["../../../../../../../front_end/models/trace/root-causes/root-causes.ts"],"references":[{"path":"./root-causes-tsconfig.json"}]}
@@ -0,0 +1,42 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "checkJs": true,
5
+ "composite": true,
6
+ "declaration": true,
7
+ "experimentalDecorators": true,
8
+ "forceConsistentCasingInFileNames": true,
9
+ "inlineSources": true,
10
+ "lib": [
11
+ "esnext",
12
+ "dom",
13
+ "dom.iterable"
14
+ ],
15
+ "module": "esnext",
16
+ "noEmitOnError": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noImplicitOverride": true,
19
+ "noImplicitReturns": true,
20
+ "noUnusedLocals": false,
21
+ "outDir": ".",
22
+ "rootDir": "../../../../../../../front_end/models/trace/root-causes",
23
+ "skipLibCheck": true,
24
+ "sourceMap": true,
25
+ "strict": true,
26
+ "target": "esnext",
27
+ "tsBuildInfoFile": "devtools_entrypoint-bundle-typescript-tsconfig.json.tsbuildinfo",
28
+ "typeRoots": [],
29
+ "useUnknownInCatchVariables": false
30
+ },
31
+ "files": [
32
+ "../../../../../../../front_end/models/trace/root-causes/root-causes.ts",
33
+ "../../../../../../../front_end/legacy/legacy-defs.d.ts",
34
+ "../../../../../../../front_end/global_typings/global_defs.d.ts",
35
+ "../../../../../../../node_modules/@types/filesystem/index.d.ts"
36
+ ],
37
+ "references": [
38
+ {
39
+ "path": "./root-causes-tsconfig.json"
40
+ }
41
+ ]
42
+ }
@@ -0,0 +1,55 @@
1
+ {
2
+ "compilerOptions": {
3
+ "allowJs": true,
4
+ "checkJs": true,
5
+ "composite": true,
6
+ "declaration": true,
7
+ "experimentalDecorators": true,
8
+ "forceConsistentCasingInFileNames": true,
9
+ "inlineSources": true,
10
+ "lib": [
11
+ "esnext",
12
+ "dom",
13
+ "dom.iterable"
14
+ ],
15
+ "module": "esnext",
16
+ "noEmitOnError": true,
17
+ "noFallthroughCasesInSwitch": true,
18
+ "noImplicitOverride": true,
19
+ "noImplicitReturns": true,
20
+ "noUnusedLocals": false,
21
+ "outDir": ".",
22
+ "rootDir": "../../../../../../../front_end/models/trace/root-causes",
23
+ "skipLibCheck": true,
24
+ "sourceMap": true,
25
+ "strict": true,
26
+ "target": "esnext",
27
+ "tsBuildInfoFile": "root-causes-tsconfig.json.tsbuildinfo",
28
+ "typeRoots": [],
29
+ "useUnknownInCatchVariables": false
30
+ },
31
+ "files": [
32
+ "../../../../../../../front_end/models/trace/root-causes/LayoutShift.ts",
33
+ "../../../../../../../front_end/models/trace/root-causes/RootCauses.ts",
34
+ "../../../../../../../front_end/legacy/legacy-defs.d.ts",
35
+ "../../../../../../../front_end/global_typings/global_defs.d.ts",
36
+ "../../../../../../../node_modules/@types/filesystem/index.d.ts"
37
+ ],
38
+ "references": [
39
+ {
40
+ "path": "../../../core/common/bundle-tsconfig.json"
41
+ },
42
+ {
43
+ "path": "../../../core/platform/bundle-tsconfig.json"
44
+ },
45
+ {
46
+ "path": "../../../core/root/bundle-tsconfig.json"
47
+ },
48
+ {
49
+ "path": "../handlers/bundle-tsconfig.json"
50
+ },
51
+ {
52
+ "path": "../types/bundle-tsconfig.json"
53
+ }
54
+ ]
55
+ }
@@ -0,0 +1 @@
1
+ export * as RootCauses from './RootCauses.js';
@@ -0,0 +1,5 @@
1
+ // Copyright 2023 The Chromium Authors. All rights reserved.
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+ export * as RootCauses from './RootCauses.js';
5
+ //# sourceMappingURL=root-causes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"root-causes.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/root-causes/root-causes.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAE7B,OAAO,KAAK,UAAU,MAAM,iBAAiB,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nexport * as RootCauses from './RootCauses.js';\n"]}
@@ -11,7 +11,7 @@ export interface Breadcrumb {
11
11
  window: TraceWindowMicro;
12
12
  child: Breadcrumb | null;
13
13
  }
14
- export declare const enum DataOrigin {
14
+ export declare enum DataOrigin {
15
15
  CPU_PROFILE = "CPUProfile",
16
16
  TRACE_EVENTS = "TraceEvents"
17
17
  }
@@ -21,12 +21,12 @@ export declare const enum DataOrigin {
21
21
  * 2. Pending to event - the creation is started, but the entry that the link points to has not been chosen yet
22
22
  * 3. Link connected - final state, both entries present
23
23
  */
24
- export declare const enum EntriesLinkState {
24
+ export declare enum EntriesLinkState {
25
25
  CREATION_NOT_STARTED = "creation_not_started",
26
26
  PENDING_TO_EVENT = "pending_to_event",
27
27
  CONNECTED = "connected"
28
28
  }
29
- export declare const enum EventKeyType {
29
+ export declare enum EventKeyType {
30
30
  RAW_EVENT = "r",
31
31
  SYNTHETIC_EVENT = "s",
32
32
  PROFILE_CALL = "p",
@@ -1,6 +1,30 @@
1
1
  // Copyright 2023 The Chromium Authors. All rights reserved.
2
2
  // Use of this source code is governed by a BSD-style license that can be
3
3
  // found in the LICENSE file.
4
+ export var DataOrigin;
5
+ (function (DataOrigin) {
6
+ DataOrigin["CPU_PROFILE"] = "CPUProfile";
7
+ DataOrigin["TRACE_EVENTS"] = "TraceEvents";
8
+ })(DataOrigin || (DataOrigin = {}));
9
+ /**
10
+ * The Entries link can have 3 stated:
11
+ * 1. The Link creation is not started yet, meaning only the button that needs to be clicked to start creating the link is visible.
12
+ * 2. Pending to event - the creation is started, but the entry that the link points to has not been chosen yet
13
+ * 3. Link connected - final state, both entries present
14
+ */
15
+ export var EntriesLinkState;
16
+ (function (EntriesLinkState) {
17
+ EntriesLinkState["CREATION_NOT_STARTED"] = "creation_not_started";
18
+ EntriesLinkState["PENDING_TO_EVENT"] = "pending_to_event";
19
+ EntriesLinkState["CONNECTED"] = "connected";
20
+ })(EntriesLinkState || (EntriesLinkState = {}));
21
+ export var EventKeyType;
22
+ (function (EventKeyType) {
23
+ EventKeyType["RAW_EVENT"] = "r";
24
+ EventKeyType["SYNTHETIC_EVENT"] = "s";
25
+ EventKeyType["PROFILE_CALL"] = "p";
26
+ EventKeyType["LEGACY_TIMELINE_FRAME"] = "l";
27
+ })(EventKeyType || (EventKeyType = {}));
4
28
  export function isTimeRangeAnnotation(annotation) {
5
29
  return annotation.type === 'TIME_RANGE';
6
30
  }
@@ -14,7 +38,7 @@ export function traceEventKeyToValues(key) {
14
38
  const parts = key.split('-');
15
39
  const type = parts[0];
16
40
  switch (type) {
17
- case "p" /* EventKeyType.PROFILE_CALL */:
41
+ case EventKeyType.PROFILE_CALL:
18
42
  if (parts.length !== 5 ||
19
43
  !(parts.every((part, i) => i === 0 || typeof part === 'number' || !isNaN(parseInt(part, 10))))) {
20
44
  throw new Error(`Invalid ProfileCallKey: ${key}`);
@@ -26,7 +50,7 @@ export function traceEventKeyToValues(key) {
26
50
  sampleIndex: parseInt(parts[3], 10),
27
51
  protocol: parseInt(parts[4], 10),
28
52
  };
29
- case "r" /* EventKeyType.RAW_EVENT */:
53
+ case EventKeyType.RAW_EVENT:
30
54
  if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {
31
55
  throw new Error(`Invalid RawEvent Key: ${key}`);
32
56
  }
@@ -34,7 +58,7 @@ export function traceEventKeyToValues(key) {
34
58
  type: parts[0],
35
59
  rawIndex: parseInt(parts[1], 10),
36
60
  };
37
- case "s" /* EventKeyType.SYNTHETIC_EVENT */:
61
+ case EventKeyType.SYNTHETIC_EVENT:
38
62
  if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {
39
63
  throw new Error(`Invalid SyntheticEvent Key: ${key}`);
40
64
  }
@@ -42,7 +66,7 @@ export function traceEventKeyToValues(key) {
42
66
  type: parts[0],
43
67
  rawIndex: parseInt(parts[1], 10),
44
68
  };
45
- case "l" /* EventKeyType.LEGACY_TIMELINE_FRAME */: {
69
+ case EventKeyType.LEGACY_TIMELINE_FRAME: {
46
70
  if (parts.length !== 2 || Number.isNaN(parseInt(parts[1], 10))) {
47
71
  throw new Error(`Invalid LegacyTimelineFrame Key: ${key}`);
48
72
  }
@@ -1 +1 @@
1
- {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/File.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAgH7B,MAAM,UAAU,qBAAqB,CAAC,UAAsB;IAC1D,OAAO,UAAU,CAAC,IAAI,KAAK,YAAY,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,UAAsB;IAC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AAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5F,MAAM,IAAI,KAAK,CAAC,yBAAyB,GAAG,EAAE,CAAC,CAAC;YAClD,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACZ,CAAC;QACzB;YACE,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,KAAK,QAAQ,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;gBAC5F,MAAM,IAAI,KAAK,CAAC,+BAA+B,GAAG,EAAE,CAAC,CAAC;YACxD,CAAC;YACD,OAAO;gBACL,IAAI,EAAE,KAAK,CAAC,CAAC,CAAC;gBACd,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACN,CAAC;QAC/B,iDAAuC,CAAC,CAAC,CAAC;YACxC,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;gBAC/D,MAAM,IAAI,KAAK,CAAC,oCAAoC,GAAG,EAAE,CAAC,CAAC;YAC7D,CAAC;YACD,OAAO;gBACL,IAAI;gBACJ,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACjC,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\n\nimport type {TraceWindowMicro} from './Timing.js';\nimport type {Event, LegacyTimelineFrame, ProcessID, SampleIndex, ThreadID} from './TraceEvents.js';\n\nexport interface TraceFile {\n traceEvents: readonly Event[];\n metadata: MetaData;\n}\n\nexport interface Breadcrumb {\n window: TraceWindowMicro;\n child: Breadcrumb|null;\n}\n\nexport const enum DataOrigin {\n CPU_PROFILE = 'CPUProfile',\n TRACE_EVENTS = 'TraceEvents',\n}\n\n/**\n * The Entries link can have 3 stated:\n * 1. The Link creation is not started yet, meaning only the button that needs to be clicked to start creating the link is visible.\n * 2. Pending to event - the creation is started, but the entry that the link points to has not been chosen yet\n * 3. Link connected - final state, both entries present\n */\nexport const enum EntriesLinkState {\n CREATION_NOT_STARTED = 'creation_not_started',\n PENDING_TO_EVENT = 'pending_to_event',\n CONNECTED = 'connected',\n}\n\nexport const enum EventKeyType {\n RAW_EVENT = 'r',\n SYNTHETIC_EVENT = 's',\n PROFILE_CALL = 'p',\n LEGACY_TIMELINE_FRAME = 'l',\n}\n\n/**\n * Represents an object that is saved in the file when user created annotations in the timeline.\n *\n * Expected to add more annotations.\n */\nexport interface SerializedAnnotations {\n entryLabels: EntryLabelAnnotationSerialized[];\n labelledTimeRanges: TimeRangeAnnotationSerialized[];\n linksBetweenEntries: EntriesLinkAnnotationSerialized[];\n}\n\n/**\n * Represents an object that is used to store the Entry Label annotation that is created when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotation {\n type: 'ENTRY_LABEL';\n entry: Event|LegacyTimelineFrame;\n label: string;\n}\n\n/**\n * Represents an object that is used to store the Labelled Time Range Annotation that is created when a user creates a Time Range Selection in the timeline.\n */\nexport interface TimeRangeAnnotation {\n type: 'TIME_RANGE';\n label: string;\n bounds: TraceWindowMicro;\n}\n\nexport interface EntriesLinkAnnotation {\n type: 'ENTRIES_LINK';\n state: EntriesLinkState;\n entryFrom: Event;\n entryTo?: Event;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotationSerialized {\n entry: SerializableKey;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a time range with a label in the timeline.\n */\nexport interface TimeRangeAnnotationSerialized {\n bounds: TraceWindowMicro;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a link between entries in the timeline.\n */\nexport interface EntriesLinkAnnotationSerialized {\n entryFrom: SerializableKey;\n entryTo: SerializableKey;\n}\n\n/**\n * `Annotation` are the user-created annotations that are saved into the metadata.\n * Those annotations are rendered on the timeline by `Overlays.ts`\n *\n * TODO: Implement other OverlayAnnotations (annotated time ranges, links between entries).\n * TODO: Save/load overlay annotations to/from the trace file.\n */\nexport type Annotation = EntryLabelAnnotation|TimeRangeAnnotation|EntriesLinkAnnotation;\n\nexport function isTimeRangeAnnotation(annotation: Annotation): annotation is TimeRangeAnnotation {\n return annotation.type === 'TIME_RANGE';\n}\n\nexport function isEntryLabelAnnotation(annotation: Annotation): annotation is EntryLabelAnnotation {\n return annotation.type === 'ENTRY_LABEL';\n}\n\nexport function isEntriesLinkAnnotation(annotation: Annotation): annotation is EntriesLinkAnnotation {\n return annotation.type === 'ENTRIES_LINK';\n}\n\n// Serializable keys are created for trace events to be able to save\n// references to timeline events in a trace file. These keys enable\n// user modifications that can be saved. See go/cpq:event-data-json for\n// more details on the key format.\nexport type RawEventKey = `${EventKeyType.RAW_EVENT}-${number}`;\nexport type SyntheticEventKey = `${EventKeyType.SYNTHETIC_EVENT}-${number}`;\nexport type ProfileCallKey = `${EventKeyType.PROFILE_CALL}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;\nexport type LegacyTimelineFrameKey = `${EventKeyType.LEGACY_TIMELINE_FRAME}-${number}`;\nexport type SerializableKey = RawEventKey|ProfileCallKey|SyntheticEventKey|LegacyTimelineFrameKey;\n\n// Serializable keys values objects contain data that maps the keys to original Trace Events\nexport interface RawEventKeyValues {\n type: EventKeyType.RAW_EVENT;\n rawIndex: number;\n}\n\nexport interface SyntheticEventKeyValues {\n type: EventKeyType.SYNTHETIC_EVENT;\n rawIndex: number;\n}\n\nexport interface ProfileCallKeyValues {\n type: EventKeyType.PROFILE_CALL;\n processID: ProcessID;\n threadID: ThreadID;\n sampleIndex: SampleIndex;\n protocol: Protocol.integer;\n}\n\nexport interface LegacyTimelineFrameKeyValues {\n type: EventKeyType.LEGACY_TIMELINE_FRAME;\n rawIndex: number;\n}\n\nexport type SerializableKeyValues =\n RawEventKeyValues|ProfileCallKeyValues|SyntheticEventKeyValues|LegacyTimelineFrameKeyValues;\n\nexport interface Modifications {\n entriesModifications: {\n // Entries hidden by the user\n hiddenEntries: SerializableKey[],\n // Entries that parent a hiddenEntry\n expandableEntries: SerializableKey[],\n };\n initialBreadcrumb: Breadcrumb;\n annotations: SerializedAnnotations;\n}\n\n/**\n * Trace metadata that we persist to the file. This will allow us to\n * store specifics for the trace, e.g., which tracks should be visible\n * on load.\n */\nexport interface MetaData {\n source?: 'DevTools';\n startTime?: string;\n emulatedDeviceTitle?: string;\n // Only set if network throttling is active.\n networkThrottling?: string;\n // Only set if network throttling is active.\n networkThrottlingConditions?: Omit<SDK.NetworkManager.Conditions, 'title'>;\n // Only set if CPU throttling is active.\n cpuThrottling?: number;\n hardwareConcurrency?: number;\n dataOrigin?: DataOrigin;\n enhancedTraceVersion?: number;\n modifications?: Modifications;\n cruxFieldData?: CrUXManager.PageResult[];\n /** Currently only stores JS maps, not CSS. This never stores data url source maps. */\n sourceMaps?: MetadataSourceMap[];\n}\n\ninterface MetadataSourceMap {\n url: string;\n /** If not defined, then this was a data url. */\n sourceMapUrl?: string;\n sourceMap: SDK.SourceMap.SourceMapV3;\n}\n\nexport type Contents = TraceFile|Event[];\n\nexport function traceEventKeyToValues(key: SerializableKey): SerializableKeyValues {\n const parts = key.split('-');\n const type = parts[0];\n\n switch (type) {\n case EventKeyType.PROFILE_CALL:\n if (parts.length !== 5 ||\n !(parts.every((part, i) => i === 0 || typeof part === 'number' || !isNaN(parseInt(part, 10))))) {\n throw new Error(`Invalid ProfileCallKey: ${key}`);\n }\n return {\n type: parts[0],\n processID: parseInt(parts[1], 10),\n threadID: parseInt(parts[2], 10),\n sampleIndex: parseInt(parts[3], 10),\n protocol: parseInt(parts[4], 10),\n } as ProfileCallKeyValues;\n case EventKeyType.RAW_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid RawEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as RawEventKeyValues;\n case EventKeyType.SYNTHETIC_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid SyntheticEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as SyntheticEventKeyValues;\n case EventKeyType.LEGACY_TIMELINE_FRAME: {\n if (parts.length !== 2 || Number.isNaN(parseInt(parts[1], 10))) {\n throw new Error(`Invalid LegacyTimelineFrame Key: ${key}`);\n }\n return {\n type,\n rawIndex: parseInt(parts[1], 10),\n };\n }\n\n default:\n throw new Error(`Unknown trace event key: ${key}`);\n }\n}\n"]}
1
+ {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/File.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAmB7B,MAAM,CAAN,IAAY,UAGX;AAHD,WAAY,UAAU;IACpB,wCAA0B,CAAA;IAC1B,0CAA4B,CAAA;AAC9B,CAAC,EAHW,UAAU,KAAV,UAAU,QAGrB;AAED;;;;;GAKG;AACH,MAAM,CAAN,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IAC1B,iEAA6C,CAAA;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IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC;gBAC/D,MAAM,IAAI,KAAK,CAAC,oCAAoC,GAAG,EAAE,CAAC,CAAC;YAC7D,CAAC;YACD,OAAO;gBACL,IAAI;gBACJ,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;aACjC,CAAC;QACJ,CAAC;QAED;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,GAAG,EAAE,CAAC,CAAC;IACvD,CAAC;AACH,CAAC","sourcesContent":["// Copyright 2023 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\nimport type * as SDK from '../../../core/sdk/sdk.js';\nimport type * as Protocol from '../../../generated/protocol.js';\nimport type * as CrUXManager from '../../../models/crux-manager/crux-manager.js';\n\nimport type {TraceWindowMicro} from './Timing.js';\nimport type {Event, LegacyTimelineFrame, ProcessID, SampleIndex, ThreadID} from './TraceEvents.js';\n\nexport interface TraceFile {\n traceEvents: readonly Event[];\n metadata: MetaData;\n}\n\nexport interface Breadcrumb {\n window: TraceWindowMicro;\n child: Breadcrumb|null;\n}\n\nexport enum DataOrigin {\n CPU_PROFILE = 'CPUProfile',\n TRACE_EVENTS = 'TraceEvents',\n}\n\n/**\n * The Entries link can have 3 stated:\n * 1. The Link creation is not started yet, meaning only the button that needs to be clicked to start creating the link is visible.\n * 2. Pending to event - the creation is started, but the entry that the link points to has not been chosen yet\n * 3. Link connected - final state, both entries present\n */\nexport enum EntriesLinkState {\n CREATION_NOT_STARTED = 'creation_not_started',\n PENDING_TO_EVENT = 'pending_to_event',\n CONNECTED = 'connected',\n}\n\nexport enum EventKeyType {\n RAW_EVENT = 'r',\n SYNTHETIC_EVENT = 's',\n PROFILE_CALL = 'p',\n LEGACY_TIMELINE_FRAME = 'l',\n}\n\n/**\n * Represents an object that is saved in the file when user created annotations in the timeline.\n *\n * Expected to add more annotations.\n */\nexport interface SerializedAnnotations {\n entryLabels: EntryLabelAnnotationSerialized[];\n labelledTimeRanges: TimeRangeAnnotationSerialized[];\n linksBetweenEntries: EntriesLinkAnnotationSerialized[];\n}\n\n/**\n * Represents an object that is used to store the Entry Label annotation that is created when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotation {\n type: 'ENTRY_LABEL';\n entry: Event|LegacyTimelineFrame;\n label: string;\n}\n\n/**\n * Represents an object that is used to store the Labelled Time Range Annotation that is created when a user creates a Time Range Selection in the timeline.\n */\nexport interface TimeRangeAnnotation {\n type: 'TIME_RANGE';\n label: string;\n bounds: TraceWindowMicro;\n}\n\nexport interface EntriesLinkAnnotation {\n type: 'ENTRIES_LINK';\n state: EntriesLinkState;\n entryFrom: Event;\n entryTo?: Event;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a label for an entry in the timeline.\n */\nexport interface EntryLabelAnnotationSerialized {\n entry: SerializableKey;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a time range with a label in the timeline.\n */\nexport interface TimeRangeAnnotationSerialized {\n bounds: TraceWindowMicro;\n label: string;\n}\n\n/**\n * Represents an object that is saved in the file when a user creates a link between entries in the timeline.\n */\nexport interface EntriesLinkAnnotationSerialized {\n entryFrom: SerializableKey;\n entryTo: SerializableKey;\n}\n\n/**\n * `Annotation` are the user-created annotations that are saved into the metadata.\n * Those annotations are rendered on the timeline by `Overlays.ts`\n *\n * TODO: Implement other OverlayAnnotations (annotated time ranges, links between entries).\n * TODO: Save/load overlay annotations to/from the trace file.\n */\nexport type Annotation = EntryLabelAnnotation|TimeRangeAnnotation|EntriesLinkAnnotation;\n\nexport function isTimeRangeAnnotation(annotation: Annotation): annotation is TimeRangeAnnotation {\n return annotation.type === 'TIME_RANGE';\n}\n\nexport function isEntryLabelAnnotation(annotation: Annotation): annotation is EntryLabelAnnotation {\n return annotation.type === 'ENTRY_LABEL';\n}\n\nexport function isEntriesLinkAnnotation(annotation: Annotation): annotation is EntriesLinkAnnotation {\n return annotation.type === 'ENTRIES_LINK';\n}\n\n// Serializable keys are created for trace events to be able to save\n// references to timeline events in a trace file. These keys enable\n// user modifications that can be saved. See go/cpq:event-data-json for\n// more details on the key format.\nexport type RawEventKey = `${EventKeyType.RAW_EVENT}-${number}`;\nexport type SyntheticEventKey = `${EventKeyType.SYNTHETIC_EVENT}-${number}`;\nexport type ProfileCallKey = `${EventKeyType.PROFILE_CALL}-${ProcessID}-${ThreadID}-${SampleIndex}-${Protocol.integer}`;\nexport type LegacyTimelineFrameKey = `${EventKeyType.LEGACY_TIMELINE_FRAME}-${number}`;\nexport type SerializableKey = RawEventKey|ProfileCallKey|SyntheticEventKey|LegacyTimelineFrameKey;\n\n// Serializable keys values objects contain data that maps the keys to original Trace Events\nexport interface RawEventKeyValues {\n type: EventKeyType.RAW_EVENT;\n rawIndex: number;\n}\n\nexport interface SyntheticEventKeyValues {\n type: EventKeyType.SYNTHETIC_EVENT;\n rawIndex: number;\n}\n\nexport interface ProfileCallKeyValues {\n type: EventKeyType.PROFILE_CALL;\n processID: ProcessID;\n threadID: ThreadID;\n sampleIndex: SampleIndex;\n protocol: Protocol.integer;\n}\n\nexport interface LegacyTimelineFrameKeyValues {\n type: EventKeyType.LEGACY_TIMELINE_FRAME;\n rawIndex: number;\n}\n\nexport type SerializableKeyValues =\n RawEventKeyValues|ProfileCallKeyValues|SyntheticEventKeyValues|LegacyTimelineFrameKeyValues;\n\nexport interface Modifications {\n entriesModifications: {\n // Entries hidden by the user\n hiddenEntries: SerializableKey[],\n // Entries that parent a hiddenEntry\n expandableEntries: SerializableKey[],\n };\n initialBreadcrumb: Breadcrumb;\n annotations: SerializedAnnotations;\n}\n\n/**\n * Trace metadata that we persist to the file. This will allow us to\n * store specifics for the trace, e.g., which tracks should be visible\n * on load.\n */\nexport interface MetaData {\n source?: 'DevTools';\n startTime?: string;\n emulatedDeviceTitle?: string;\n // Only set if network throttling is active.\n networkThrottling?: string;\n // Only set if network throttling is active.\n networkThrottlingConditions?: Omit<SDK.NetworkManager.Conditions, 'title'>;\n // Only set if CPU throttling is active.\n cpuThrottling?: number;\n hardwareConcurrency?: number;\n dataOrigin?: DataOrigin;\n enhancedTraceVersion?: number;\n modifications?: Modifications;\n cruxFieldData?: CrUXManager.PageResult[];\n /** Currently only stores JS maps, not CSS. This never stores data url source maps. */\n sourceMaps?: MetadataSourceMap[];\n}\n\ninterface MetadataSourceMap {\n url: string;\n /** If not defined, then this was a data url. */\n sourceMapUrl?: string;\n sourceMap: SDK.SourceMap.SourceMapV3;\n}\n\nexport type Contents = TraceFile|Event[];\n\nexport function traceEventKeyToValues(key: SerializableKey): SerializableKeyValues {\n const parts = key.split('-');\n const type = parts[0];\n\n switch (type) {\n case EventKeyType.PROFILE_CALL:\n if (parts.length !== 5 ||\n !(parts.every((part, i) => i === 0 || typeof part === 'number' || !isNaN(parseInt(part, 10))))) {\n throw new Error(`Invalid ProfileCallKey: ${key}`);\n }\n return {\n type: parts[0],\n processID: parseInt(parts[1], 10),\n threadID: parseInt(parts[2], 10),\n sampleIndex: parseInt(parts[3], 10),\n protocol: parseInt(parts[4], 10),\n } as ProfileCallKeyValues;\n case EventKeyType.RAW_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid RawEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as RawEventKeyValues;\n case EventKeyType.SYNTHETIC_EVENT:\n if (parts.length !== 2 || !(typeof parts[1] === 'number' || !isNaN(parseInt(parts[1], 10)))) {\n throw new Error(`Invalid SyntheticEvent Key: ${key}`);\n }\n return {\n type: parts[0],\n rawIndex: parseInt(parts[1], 10),\n } as SyntheticEventKeyValues;\n case EventKeyType.LEGACY_TIMELINE_FRAME: {\n if (parts.length !== 2 || Number.isNaN(parseInt(parts[1], 10))) {\n throw new Error(`Invalid LegacyTimelineFrame Key: ${key}`);\n }\n return {\n type,\n rawIndex: parseInt(parts[1], 10),\n };\n }\n\n default:\n throw new Error(`Unknown trace event key: ${key}`);\n }\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  import type * as Platform from '../../../core/platform/platform.js';
2
2
  import type * as Protocol from '../../../generated/protocol.js';
3
3
  import type { Micro, Milli, Seconds, TraceWindowMicro } from './Timing.js';
4
- export declare const enum Phase {
4
+ export declare enum Phase {
5
5
  BEGIN = "B",
6
6
  END = "E",
7
7
  COMPLETE = "X",
@@ -30,7 +30,7 @@ export declare const enum Phase {
30
30
  export declare function isNestableAsyncPhase(phase: Phase): boolean;
31
31
  export declare function isPhaseAsync(phase: Phase): boolean;
32
32
  export declare function isFlowPhase(phase: Phase): boolean;
33
- export declare const enum Scope {
33
+ export declare enum Scope {
34
34
  THREAD = "t",
35
35
  PROCESS = "p",
36
36
  GLOBAL = "g"
@@ -348,7 +348,7 @@ export interface SyntheticWebSocketConnection extends Complete, SyntheticBased<P
348
348
  tid: ThreadID;
349
349
  s: Scope;
350
350
  }
351
- export declare const enum AuctionWorkletType {
351
+ export declare enum AuctionWorkletType {
352
352
  BIDDER = "bidder",
353
353
  SELLER = "seller",
354
354
  UNKNOWN = "unknown"
@@ -910,7 +910,7 @@ export interface ResourceMarkAsCached extends Instant {
910
910
  };
911
911
  };
912
912
  }
913
- export declare const enum LayoutInvalidationReason {
913
+ export declare enum LayoutInvalidationReason {
914
914
  SIZE_CHANGED = "Size changed",
915
915
  ATTRIBUTE = "Attribute",
916
916
  ADDED_TO_LAYOUT = "Added to layout",
@@ -949,7 +949,7 @@ export interface ScheduleStyleInvalidationTracking extends Instant {
949
949
  };
950
950
  }
951
951
  export declare function isScheduleStyleInvalidationTracking(event: Event): event is ScheduleStyleInvalidationTracking;
952
- export declare const enum StyleRecalcInvalidationReason {
952
+ export declare enum StyleRecalcInvalidationReason {
953
953
  ANIMATION = "Animation"
954
954
  }
955
955
  export interface StyleRecalcInvalidationTracking extends Instant {
@@ -2007,7 +2007,7 @@ export declare function isParseAuthorStyleSheetEvent(event: Event): event is Par
2007
2007
  * chart, some of them we only use for parsing.
2008
2008
  * TODO(crbug.com/1428024): Complete this enum.
2009
2009
  */
2010
- export declare const enum Name {
2010
+ export declare enum Name {
2011
2011
  THREAD_NAME = "thread_name",
2012
2012
  PROGRAM = "Program",
2013
2013
  RUN_TASK = "RunTask",