@paulirish/trace_engine 0.0.36 → 0.0.37

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 (66) hide show
  1. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
  2. package/generated/protocol.d.ts +21 -3
  3. package/models/trace/Processor.d.ts +1 -1
  4. package/models/trace/Processor.js +4 -4
  5. package/models/trace/Processor.js.map +1 -1
  6. package/models/trace/extras/TimelineJSProfile.d.ts +13 -0
  7. package/models/trace/extras/TimelineJSProfile.js +55 -0
  8. package/models/trace/extras/TimelineJSProfile.js.map +1 -0
  9. package/models/trace/extras/TraceFilter.d.ts +21 -0
  10. package/models/trace/extras/TraceFilter.js +51 -0
  11. package/models/trace/extras/TraceFilter.js.map +1 -0
  12. package/models/trace/extras/TraceTree.d.ts +91 -0
  13. package/models/trace/extras/TraceTree.js +515 -0
  14. package/models/trace/extras/TraceTree.js.map +1 -0
  15. package/models/trace/extras/extras-tsconfig.json +3 -0
  16. package/models/trace/extras/extras.js.map +1 -1
  17. package/models/trace/handlers/LargestImagePaintHandler.d.ts +7 -1
  18. package/models/trace/handlers/LargestImagePaintHandler.js +43 -1
  19. package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -1
  20. package/models/trace/handlers/MetaHandler.js +2 -3
  21. package/models/trace/handlers/MetaHandler.js.map +1 -1
  22. package/models/trace/handlers/NetworkRequestsHandler.js +2 -0
  23. package/models/trace/handlers/NetworkRequestsHandler.js.map +1 -1
  24. package/models/trace/insights/CLSCulprits.d.ts +57 -0
  25. package/models/trace/insights/CLSCulprits.js +335 -0
  26. package/models/trace/insights/CLSCulprits.js.map +1 -0
  27. package/models/trace/insights/Common.d.ts +2 -10
  28. package/models/trace/insights/Common.js +1 -36
  29. package/models/trace/insights/Common.js.map +1 -1
  30. package/models/trace/insights/DocumentLatency.d.ts +3 -3
  31. package/models/trace/insights/DocumentLatency.js.map +1 -1
  32. package/models/trace/insights/FontDisplay.d.ts +3 -3
  33. package/models/trace/insights/FontDisplay.js.map +1 -1
  34. package/models/trace/insights/InteractionToNextPaint.d.ts +3 -3
  35. package/models/trace/insights/InteractionToNextPaint.js.map +1 -1
  36. package/models/trace/insights/LCPDiscovery.d.ts +13 -0
  37. package/models/trace/insights/LCPDiscovery.js +60 -0
  38. package/models/trace/insights/LCPDiscovery.js.map +1 -0
  39. package/models/trace/insights/LCPPhases.d.ts +34 -0
  40. package/models/trace/insights/LCPPhases.js +97 -0
  41. package/models/trace/insights/LCPPhases.js.map +1 -0
  42. package/models/trace/insights/Models.d.ts +10 -0
  43. package/models/trace/insights/Models.js +14 -0
  44. package/models/trace/insights/Models.js.map +1 -0
  45. package/models/trace/insights/RenderBlocking.d.ts +4 -4
  46. package/models/trace/insights/RenderBlocking.js +1 -16
  47. package/models/trace/insights/RenderBlocking.js.map +1 -1
  48. package/models/trace/insights/SlowCSSSelector.d.ts +3 -3
  49. package/models/trace/insights/SlowCSSSelector.js.map +1 -1
  50. package/models/trace/insights/ThirdParties.d.ts +13 -0
  51. package/models/trace/insights/ThirdParties.js +42 -0
  52. package/models/trace/insights/ThirdParties.js.map +1 -0
  53. package/models/trace/insights/Viewport.d.ts +3 -3
  54. package/models/trace/insights/Viewport.js.map +1 -1
  55. package/models/trace/insights/insights-tsconfig.json +5 -4
  56. package/models/trace/insights/insights.d.ts +1 -1
  57. package/models/trace/insights/insights.js +1 -1
  58. package/models/trace/insights/insights.js.map +1 -1
  59. package/models/trace/insights/types.d.ts +9 -9
  60. package/models/trace/insights/types.js.map +1 -1
  61. package/models/trace/trace-tsconfig.json +6 -0
  62. package/models/trace/types/TraceEvents.d.ts +22 -5
  63. package/models/trace/types/TraceEvents.js +5 -3
  64. package/models/trace/types/TraceEvents.js.map +1 -1
  65. package/package.json +1 -1
  66. package/test/test-trace-engine.mjs +12 -16
@@ -0,0 +1,13 @@
1
+ import type * as Protocol from '../../../generated/protocol.js';
2
+ import * as Types from '../types/types.js';
3
+ export declare class TimelineJSProfileProcessor {
4
+ static isNativeRuntimeFrame(frame: Protocol.Runtime.CallFrame): boolean;
5
+ static nativeGroup(nativeName: string): string | null;
6
+ static createFakeTraceFromCpuProfile(profile: Protocol.Profiler.Profile, tid: Types.Events.ThreadID): Types.Events.Event[];
7
+ }
8
+ export declare namespace TimelineJSProfileProcessor {
9
+ const enum NativeGroups {
10
+ COMPILE = "Compile",
11
+ PARSE = "Parse"
12
+ }
13
+ }
@@ -0,0 +1,55 @@
1
+ // Copyright 2014 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
+ import * as Types from '../types/types.js';
5
+ // TODO(paulirish): Delete this file.
6
+ // - Move isNativeRuntimeFrame and nativeGroup to TraceEvents.d.ts (or TraceTree)
7
+ // - Move createFakeTraceFromCpuProfile to TimelineLoader
8
+ export class TimelineJSProfileProcessor {
9
+ static isNativeRuntimeFrame(frame) {
10
+ return frame.url === 'native V8Runtime';
11
+ }
12
+ static nativeGroup(nativeName) {
13
+ if (nativeName.startsWith('Parse')) {
14
+ return "Parse" /* TimelineJSProfileProcessor.NativeGroups.PARSE */;
15
+ }
16
+ if (nativeName.startsWith('Compile') || nativeName.startsWith('Recompile')) {
17
+ return "Compile" /* TimelineJSProfileProcessor.NativeGroups.COMPILE */;
18
+ }
19
+ return null;
20
+ }
21
+ static createFakeTraceFromCpuProfile(profile, tid) {
22
+ const events = [];
23
+ const threadName = `Thread ${tid}`;
24
+ appendEvent('TracingStartedInPage', { data: { sessionId: '1' } }, 0, 0, "M" /* Types.Events.Phase.METADATA */);
25
+ appendEvent("thread_name" /* Types.Events.Name.THREAD_NAME */, { name: threadName }, 0, 0, "M" /* Types.Events.Phase.METADATA */, '__metadata');
26
+ if (!profile) {
27
+ return events;
28
+ }
29
+ // Append a root to show the start time of the profile (which is earlier than first sample), so the Performance
30
+ // panel won't truncate this time period.
31
+ // 'JSRoot' doesn't exist in the new engine and is not the name of an actual trace event, but changing it might break other trace processing tools that rely on this, so we stick with this name.
32
+ // TODO(crbug.com/341234884): consider removing this or clarify why it's required.
33
+ appendEvent('JSRoot', {}, profile.startTime, profile.endTime - profile.startTime, "X" /* Types.Events.Phase.COMPLETE */, 'toplevel');
34
+ // TODO: create a `Profile` event instead, as `cpuProfile` is legacy
35
+ appendEvent('CpuProfile', { data: { cpuProfile: profile } }, profile.endTime, 0, "X" /* Types.Events.Phase.COMPLETE */);
36
+ return events;
37
+ function appendEvent(name, args, ts, dur, ph, cat) {
38
+ const event = {
39
+ cat: cat || 'disabled-by-default-devtools.timeline',
40
+ name,
41
+ ph: ph || "X" /* Types.Events.Phase.COMPLETE */,
42
+ pid: Types.Events.ProcessID(1),
43
+ tid,
44
+ ts: Types.Timing.MicroSeconds(ts),
45
+ args,
46
+ };
47
+ if (dur) {
48
+ event.dur = Types.Timing.MicroSeconds(dur);
49
+ }
50
+ events.push(event);
51
+ return event;
52
+ }
53
+ }
54
+ }
55
+ //# sourceMappingURL=TimelineJSProfile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TimelineJSProfile.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/extras/TimelineJSProfile.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAK7B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,qCAAqC;AACrC,mFAAmF;AACnF,2DAA2D;AAC3D,MAAM,OAAO,0BAA0B;IACrC,MAAM,CAAC,oBAAoB,CAAC,KAAiC;QAC3D,OAAO,KAAK,CAAC,GAAG,KAAK,kBAAkB,CAAC;IAC1C,CAAC;IAED,MAAM,CAAC,WAAW,CAAC,UAAkB;QACnC,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;YACnC,mEAAqD;QACvD,CAAC;QACD,IAAI,UAAU,CAAC,UAAU,CAAC,SAAS,CAAC,IAAI,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,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AAI;aACL,CAAC;YAEF,IAAI,GAAG,EAAE,CAAC;gBACR,KAAK,CAAC,GAAG,GAAG,KAAK,CAAC,MAAM,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;YAC7C,CAAC;YACD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YACnB,OAAO,KAAK,CAAC;QACf,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright 2014 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\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\nimport type * as Protocol from '../../../generated/protocol.js';\nimport * as Types from '../types/types.js';\n\n// TODO(paulirish): Delete this file.\n// - Move isNativeRuntimeFrame and nativeGroup to TraceEvents.d.ts (or TraceTree)\n// - Move createFakeTraceFromCpuProfile to TimelineLoader\nexport class TimelineJSProfileProcessor {\n static isNativeRuntimeFrame(frame: Protocol.Runtime.CallFrame): boolean {\n return frame.url === 'native V8Runtime';\n }\n\n static nativeGroup(nativeName: string): string|null {\n if (nativeName.startsWith('Parse')) {\n return TimelineJSProfileProcessor.NativeGroups.PARSE;\n }\n if (nativeName.startsWith('Compile') || nativeName.startsWith('Recompile')) {\n return TimelineJSProfileProcessor.NativeGroups.COMPILE;\n }\n return null;\n }\n\n static createFakeTraceFromCpuProfile(profile: Protocol.Profiler.Profile, tid: Types.Events.ThreadID):\n Types.Events.Event[] {\n const events: Types.Events.Event[] = [];\n\n const threadName = `Thread ${tid}`;\n appendEvent('TracingStartedInPage', {data: {sessionId: '1'}}, 0, 0, Types.Events.Phase.METADATA);\n appendEvent(Types.Events.Name.THREAD_NAME, {name: threadName}, 0, 0, Types.Events.Phase.METADATA, '__metadata');\n if (!profile) {\n return events;\n }\n\n // Append a root to show the start time of the profile (which is earlier than first sample), so the Performance\n // panel won't truncate this time period.\n // 'JSRoot' doesn't exist in the new engine and is not the name of an actual trace event, but changing it might break other trace processing tools that rely on this, so we stick with this name.\n // TODO(crbug.com/341234884): consider removing this or clarify why it's required.\n appendEvent(\n 'JSRoot', {}, profile.startTime, profile.endTime - profile.startTime, Types.Events.Phase.COMPLETE, 'toplevel');\n\n // TODO: create a `Profile` event instead, as `cpuProfile` is legacy\n appendEvent('CpuProfile', {data: {cpuProfile: profile}}, profile.endTime, 0, Types.Events.Phase.COMPLETE);\n return events;\n\n function appendEvent(\n name: string, args: any, ts: number, dur?: number, ph?: Types.Events.Phase, cat?: string): Types.Events.Event {\n const event: Types.Events.Event = {\n cat: cat || 'disabled-by-default-devtools.timeline',\n name,\n ph: ph || Types.Events.Phase.COMPLETE,\n pid: Types.Events.ProcessID(1),\n tid,\n ts: Types.Timing.MicroSeconds(ts),\n args,\n };\n\n if (dur) {\n event.dur = Types.Timing.MicroSeconds(dur);\n }\n events.push(event);\n return event;\n }\n }\n}\n\nexport namespace TimelineJSProfileProcessor {\n export const enum NativeGroups {\n COMPILE = 'Compile',\n PARSE = 'Parse',\n }\n}\n"]}
@@ -0,0 +1,21 @@
1
+ import type * as Handlers from '../handlers/handlers.js';
2
+ import * as Types from '../types/types.js';
3
+ export declare abstract class TraceFilter {
4
+ abstract accept(_event: Types.Events.Event, parsedTrace?: Handlers.Types.ParsedTrace): boolean;
5
+ }
6
+ export declare class VisibleEventsFilter extends TraceFilter {
7
+ private readonly visibleTypes;
8
+ constructor(visibleTypes: string[]);
9
+ accept(event: Types.Events.Event): boolean;
10
+ static eventType(event: Types.Events.Event): Types.Events.Name;
11
+ }
12
+ export declare class InvisibleEventsFilter extends TraceFilter {
13
+ #private;
14
+ constructor(invisibleTypes: Types.Events.Name[]);
15
+ accept(event: Types.Events.Event): boolean;
16
+ }
17
+ export declare class ExclusiveNameFilter extends TraceFilter {
18
+ #private;
19
+ constructor(excludeNames: Types.Events.Name[]);
20
+ accept(event: Types.Events.Event): boolean;
21
+ }
@@ -0,0 +1,51 @@
1
+ // Copyright 2017 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
+ import * as Types from '../types/types.js';
5
+ export class TraceFilter {
6
+ }
7
+ export class VisibleEventsFilter extends TraceFilter {
8
+ visibleTypes;
9
+ constructor(visibleTypes) {
10
+ super();
11
+ this.visibleTypes = new Set(visibleTypes);
12
+ }
13
+ accept(event) {
14
+ if (Types.Extensions.isSyntheticExtensionEntry(event)) {
15
+ return true;
16
+ }
17
+ return this.visibleTypes.has(VisibleEventsFilter.eventType(event));
18
+ }
19
+ static eventType(event) {
20
+ // Any blink.console category events are treated as ConsoleTime events
21
+ if (event.cat.includes('blink.console')) {
22
+ return "ConsoleTime" /* Types.Events.Name.CONSOLE_TIME */;
23
+ }
24
+ // Any blink.user_timing egory events are treated as UserTiming events
25
+ if (event.cat.includes('blink.user_timing')) {
26
+ return "UserTiming" /* Types.Events.Name.USER_TIMING */;
27
+ }
28
+ return event.name;
29
+ }
30
+ }
31
+ export class InvisibleEventsFilter extends TraceFilter {
32
+ #invisibleTypes;
33
+ constructor(invisibleTypes) {
34
+ super();
35
+ this.#invisibleTypes = new Set(invisibleTypes);
36
+ }
37
+ accept(event) {
38
+ return !this.#invisibleTypes.has(VisibleEventsFilter.eventType(event));
39
+ }
40
+ }
41
+ export class ExclusiveNameFilter extends TraceFilter {
42
+ #excludeNames;
43
+ constructor(excludeNames) {
44
+ super();
45
+ this.#excludeNames = new Set(excludeNames);
46
+ }
47
+ accept(event) {
48
+ return !this.#excludeNames.has(event.name);
49
+ }
50
+ }
51
+ //# sourceMappingURL=TraceFilter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TraceFilter.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/extras/TraceFilter.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,yEAAyE;AACzE,6BAA6B;AAG7B,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,MAAM,OAAgB,WAAW;CAEhC;AAED,MAAM,OAAO,mBAAoB,SAAQ,WAAW;IACjC,YAAY,CAAc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CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,KAAK,CAAC,IAAyB,CAAC,CAAC;IAClE,CAAC;CACF","sourcesContent":["// Copyright 2017 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 Handlers from '../handlers/handlers.js';\nimport * as Types from '../types/types.js';\n\nexport abstract class TraceFilter {\n abstract accept(_event: Types.Events.Event, parsedTrace?: Handlers.Types.ParsedTrace): boolean;\n}\n\nexport class VisibleEventsFilter extends TraceFilter {\n private readonly visibleTypes: Set<string>;\n constructor(visibleTypes: string[]) {\n super();\n this.visibleTypes = new Set(visibleTypes);\n }\n\n accept(event: Types.Events.Event): boolean {\n if (Types.Extensions.isSyntheticExtensionEntry(event)) {\n return true;\n }\n return this.visibleTypes.has(VisibleEventsFilter.eventType(event));\n }\n\n static eventType(event: Types.Events.Event): Types.Events.Name {\n // Any blink.console category events are treated as ConsoleTime events\n if (event.cat.includes('blink.console')) {\n return Types.Events.Name.CONSOLE_TIME;\n }\n // Any blink.user_timing egory events are treated as UserTiming events\n if (event.cat.includes('blink.user_timing')) {\n return Types.Events.Name.USER_TIMING;\n }\n return event.name as Types.Events.Name;\n }\n}\n\nexport class InvisibleEventsFilter extends TraceFilter {\n #invisibleTypes: Set<Types.Events.Name>;\n\n constructor(invisibleTypes: Types.Events.Name[]) {\n super();\n this.#invisibleTypes = new Set(invisibleTypes);\n }\n\n accept(event: Types.Events.Event): boolean {\n return !this.#invisibleTypes.has(VisibleEventsFilter.eventType(event));\n }\n}\n\nexport class ExclusiveNameFilter extends TraceFilter {\n #excludeNames: Set<Types.Events.Name>;\n constructor(excludeNames: Types.Events.Name[]) {\n super();\n this.#excludeNames = new Set(excludeNames);\n }\n\n accept(event: Types.Events.Event): boolean {\n return !this.#excludeNames.has(event.name as Types.Events.Name);\n }\n}\n"]}
@@ -0,0 +1,91 @@
1
+ import type * as Protocol from '../../../generated/protocol.js';
2
+ import * as Types from '../types/types.js';
3
+ import type { TraceFilter } from './TraceFilter.js';
4
+ export declare class Node {
5
+ totalTime: number;
6
+ selfTime: number;
7
+ id: string | symbol;
8
+ event: Types.Events.Event | null;
9
+ parent: Node | null;
10
+ groupId: string;
11
+ isGroupNodeInternal: boolean;
12
+ depth: number;
13
+ constructor(id: string | symbol, event: Types.Events.Event | null);
14
+ isGroupNode(): boolean;
15
+ hasChildren(): boolean;
16
+ setHasChildren(_value: boolean): void;
17
+ /**
18
+ * Returns the direct descendants of this node.
19
+ * @returns a map with ordered <nodeId, Node> tuples.
20
+ */
21
+ children(): ChildrenCache;
22
+ searchTree(matchFunction: (arg0: Types.Events.Event) => boolean, results?: Node[]): Node[];
23
+ }
24
+ export declare class TopDownNode extends Node {
25
+ root: TopDownRootNode | null;
26
+ private hasChildrenInternal;
27
+ childrenInternal: ChildrenCache | null;
28
+ parent: TopDownNode | null;
29
+ constructor(id: string | symbol, event: Types.Events.Event | null, parent: TopDownNode | null);
30
+ hasChildren(): boolean;
31
+ setHasChildren(value: boolean): void;
32
+ children(): ChildrenCache;
33
+ private buildChildren;
34
+ getRoot(): TopDownRootNode | null;
35
+ }
36
+ export declare class TopDownRootNode extends TopDownNode {
37
+ readonly filter: (e: Types.Events.Event) => boolean;
38
+ /** This is all events passed in to create the tree, and it's very likely that it included events outside of the passed startTime/endTime as that filtering is done in `Helpers.Trace.forEachEvent` */
39
+ readonly events: Types.Events.Event[];
40
+ readonly startTime: Types.Timing.MilliSeconds;
41
+ readonly endTime: Types.Timing.MilliSeconds;
42
+ eventGroupIdCallback: ((arg0: Types.Events.Event) => string) | null | undefined;
43
+ /** Default behavior is to aggregate similar trace events into one Node based on generateEventID(), eventGroupIdCallback(), etc. Set true to keep nodes 1:1 with events. */
44
+ readonly doNotAggregate: boolean | undefined;
45
+ readonly includeInstantEvents?: boolean;
46
+ totalTime: number;
47
+ selfTime: number;
48
+ constructor(events: Types.Events.Event[], filters: TraceFilter[], startTime: Types.Timing.MilliSeconds, endTime: Types.Timing.MilliSeconds, doNotAggregate?: boolean, eventGroupIdCallback?: ((arg0: Types.Events.Event) => string) | null, includeInstantEvents?: boolean);
49
+ children(): ChildrenCache;
50
+ private grouppedTopNodes;
51
+ getEventGroupIdCallback(): ((arg0: Types.Events.Event) => string) | null | undefined;
52
+ }
53
+ export declare class BottomUpRootNode extends Node {
54
+ private childrenInternal;
55
+ readonly events: Types.Events.Event[];
56
+ private textFilter;
57
+ readonly filter: (e: Types.Events.Event) => boolean;
58
+ readonly startTime: Types.Timing.MilliSeconds;
59
+ readonly endTime: Types.Timing.MilliSeconds;
60
+ private eventGroupIdCallback;
61
+ totalTime: number;
62
+ constructor(events: Types.Events.Event[], textFilter: TraceFilter, filters: TraceFilter[], startTime: Types.Timing.MilliSeconds, endTime: Types.Timing.MilliSeconds, eventGroupIdCallback: ((arg0: Types.Events.Event) => string) | null);
63
+ hasChildren(): boolean;
64
+ filterChildren(children: ChildrenCache): ChildrenCache;
65
+ children(): ChildrenCache;
66
+ private ungrouppedTopNodes;
67
+ private grouppedTopNodes;
68
+ }
69
+ export declare class GroupNode extends Node {
70
+ private readonly childrenInternal;
71
+ isGroupNodeInternal: boolean;
72
+ constructor(id: string, parent: BottomUpRootNode | TopDownRootNode, event: Types.Events.Event);
73
+ addChild(child: BottomUpNode, selfTime: number, totalTime: number): void;
74
+ hasChildren(): boolean;
75
+ children(): ChildrenCache;
76
+ }
77
+ export declare class BottomUpNode extends Node {
78
+ parent: Node;
79
+ private root;
80
+ depth: number;
81
+ private cachedChildren;
82
+ private hasChildrenInternal;
83
+ constructor(root: BottomUpRootNode, id: string, event: Types.Events.Event, hasChildren: boolean, parent: Node);
84
+ hasChildren(): boolean;
85
+ setHasChildren(value: boolean): void;
86
+ children(): ChildrenCache;
87
+ searchTree(matchFunction: (arg0: Types.Events.Event) => boolean, results?: Node[]): Node[];
88
+ }
89
+ export declare function eventStackFrame(event: Types.Events.Event): Protocol.Runtime.CallFrame | null;
90
+ export declare function generateEventID(event: Types.Events.Event): string;
91
+ export type ChildrenCache = Map<string | symbol, Node>;