@paulirish/trace_engine 0.0.46 → 0.0.48

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 (100) hide show
  1. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts +4 -0
  2. package/.tmp/tsbuildinfo/models/trace/extras/polyfills.d.ts.map +1 -0
  3. package/.tmp/tsbuildinfo/tsconfig.tsbuildinfo +1 -1
  4. package/core/platform/Constructor.d.ts +3 -0
  5. package/core/platform/Constructor.js +5 -0
  6. package/core/platform/Constructor.js.map +1 -0
  7. package/core/platform/MapUtilities.js +1 -0
  8. package/core/platform/MapUtilities.js.map +1 -1
  9. package/core/platform/MimeType.js +3 -0
  10. package/core/platform/MimeType.js.map +1 -1
  11. package/core/platform/TypescriptUtilities.d.ts +7 -0
  12. package/core/platform/TypescriptUtilities.js.map +1 -1
  13. package/core/platform/platform-tsconfig.json +1 -0
  14. package/core/platform/platform.d.ts +2 -1
  15. package/core/platform/platform.js +2 -1
  16. package/core/platform/platform.js.map +1 -1
  17. package/generated/protocol.d.ts +220 -4
  18. package/locales/en-US.json +10 -10
  19. package/locales/en-XL.json +10 -10
  20. package/models/trace/Processor.d.ts +4 -1
  21. package/models/trace/Processor.js +45 -24
  22. package/models/trace/Processor.js.map +1 -1
  23. package/models/trace/extras/ScriptDuplication.d.ts +1 -1
  24. package/models/trace/extras/ScriptDuplication.js +2 -2
  25. package/models/trace/extras/ScriptDuplication.js.map +1 -1
  26. package/models/trace/extras/extras.d.ts +3798 -0
  27. package/models/trace/extras/extras.js +3798 -0
  28. package/models/trace/handlers/LargestImagePaintHandler.d.ts +1 -1
  29. package/models/trace/handlers/LargestImagePaintHandler.js +3 -3
  30. package/models/trace/handlers/LargestImagePaintHandler.js.map +1 -1
  31. package/models/trace/handlers/LayoutShiftsHandler.d.ts +7 -1
  32. package/models/trace/handlers/LayoutShiftsHandler.js +16 -5
  33. package/models/trace/handlers/LayoutShiftsHandler.js.map +1 -1
  34. package/models/trace/handlers/MetaHandler.js +7 -1
  35. package/models/trace/handlers/MetaHandler.js.map +1 -1
  36. package/models/trace/handlers/PageLoadMetricsHandler.d.ts +5 -0
  37. package/models/trace/handlers/PageLoadMetricsHandler.js +3 -0
  38. package/models/trace/handlers/PageLoadMetricsHandler.js.map +1 -1
  39. package/models/trace/handlers/ScriptsHandler.d.ts +5 -1
  40. package/models/trace/handlers/ScriptsHandler.js +24 -11
  41. package/models/trace/handlers/ScriptsHandler.js.map +1 -1
  42. package/models/trace/handlers/types.d.ts +1 -1
  43. package/models/trace/handlers/types.js.map +1 -1
  44. package/models/trace/insights/CLSCulprits.d.ts +5 -5
  45. package/models/trace/insights/CLSCulprits.js +0 -3
  46. package/models/trace/insights/CLSCulprits.js.map +1 -1
  47. package/models/trace/insights/DOMSize.d.ts +3 -3
  48. package/models/trace/insights/DOMSize.js +1 -4
  49. package/models/trace/insights/DOMSize.js.map +1 -1
  50. package/models/trace/insights/DocumentLatency.d.ts +3 -3
  51. package/models/trace/insights/DocumentLatency.js +1 -4
  52. package/models/trace/insights/DocumentLatency.js.map +1 -1
  53. package/models/trace/insights/DuplicateJavaScript.d.ts +3 -3
  54. package/models/trace/insights/DuplicateJavaScript.js +5 -8
  55. package/models/trace/insights/DuplicateJavaScript.js.map +1 -1
  56. package/models/trace/insights/FontDisplay.d.ts +12 -9
  57. package/models/trace/insights/FontDisplay.js +15 -15
  58. package/models/trace/insights/FontDisplay.js.map +1 -1
  59. package/models/trace/insights/ForcedReflow.d.ts +3 -3
  60. package/models/trace/insights/ForcedReflow.js +1 -4
  61. package/models/trace/insights/ForcedReflow.js.map +1 -1
  62. package/models/trace/insights/ImageDelivery.d.ts +7 -6
  63. package/models/trace/insights/ImageDelivery.js +26 -20
  64. package/models/trace/insights/ImageDelivery.js.map +1 -1
  65. package/models/trace/insights/InteractionToNextPaint.d.ts +3 -3
  66. package/models/trace/insights/InteractionToNextPaint.js +0 -3
  67. package/models/trace/insights/InteractionToNextPaint.js.map +1 -1
  68. package/models/trace/insights/LCPDiscovery.d.ts +4 -3
  69. package/models/trace/insights/LCPDiscovery.js +4 -4
  70. package/models/trace/insights/LCPDiscovery.js.map +1 -1
  71. package/models/trace/insights/LCPPhases.d.ts +4 -4
  72. package/models/trace/insights/LCPPhases.js +1 -4
  73. package/models/trace/insights/LCPPhases.js.map +1 -1
  74. package/models/trace/insights/NetworkDependencyTree.d.ts +9 -3
  75. package/models/trace/insights/NetworkDependencyTree.js +39 -10
  76. package/models/trace/insights/NetworkDependencyTree.js.map +1 -1
  77. package/models/trace/insights/RenderBlocking.d.ts +4 -3
  78. package/models/trace/insights/RenderBlocking.js +4 -4
  79. package/models/trace/insights/RenderBlocking.js.map +1 -1
  80. package/models/trace/insights/SlowCSSSelector.d.ts +3 -3
  81. package/models/trace/insights/SlowCSSSelector.js +0 -3
  82. package/models/trace/insights/SlowCSSSelector.js.map +1 -1
  83. package/models/trace/insights/ThirdParties.d.ts +3 -3
  84. package/models/trace/insights/ThirdParties.js +1 -4
  85. package/models/trace/insights/ThirdParties.js.map +1 -1
  86. package/models/trace/insights/Viewport.d.ts +3 -3
  87. package/models/trace/insights/Viewport.js +11 -9
  88. package/models/trace/insights/Viewport.js.map +1 -1
  89. package/models/trace/insights/types.d.ts +6 -10
  90. package/models/trace/insights/types.js.map +1 -1
  91. package/models/trace/lantern/types/types-tsconfig.json +1 -1
  92. package/models/trace/types/Configuration.d.ts +6 -0
  93. package/models/trace/types/Configuration.js.map +1 -1
  94. package/models/trace/types/File.d.ts +8 -0
  95. package/models/trace/types/File.js.map +1 -1
  96. package/models/trace/types/TraceEvents.d.ts +16 -1
  97. package/models/trace/types/TraceEvents.js +3 -0
  98. package/models/trace/types/TraceEvents.js.map +1 -1
  99. package/models/trace/types/types-tsconfig.json +3 -0
  100. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"File.js","sourceRoot":"","sources":["../../../../../../../front_end/models/trace/types/File.ts"],"names":[],"mappings":"AAAA,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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}\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;AAgH7B,MAAM,UAAU,qBAAqB,CAAC,UAAsB;IAC1D,OAAO,UAAU,CAAC,IAAI,KAAK,YAAY,CAAC;AAC1C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,UAAsB;IAC3D,OAAO,UAAU,CAAC,IAAI,KAAK,aAAa,CAAC;AAC3C,CA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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 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"]}
@@ -66,7 +66,7 @@ export interface CallFrame {
66
66
  lineNumber: number;
67
67
  url: string;
68
68
  }
69
- export declare function objectIsCallFrame(object: {}): object is CallFrame;
69
+ export declare function objectIsCallFrame(object: object): object is CallFrame;
70
70
  export interface TraceFrame {
71
71
  frame: string;
72
72
  name: string;
@@ -1092,6 +1092,14 @@ export interface BeginRemoteFontLoad extends UserTiming {
1092
1092
  args: Args & {
1093
1093
  display: string;
1094
1094
  id: number;
1095
+ url?: string;
1096
+ };
1097
+ }
1098
+ export interface RemoteFontLoaded extends UserTiming {
1099
+ name: Name.REMOTE_FONT_LOADED;
1100
+ args: Args & {
1101
+ url: string;
1102
+ name: string;
1095
1103
  };
1096
1104
  }
1097
1105
  export type PairableUserTiming = UserTiming & PairableAsync;
@@ -1606,6 +1614,7 @@ export declare function isSyntheticConsoleTiming(event: Event): event is Synthet
1606
1614
  export declare function isUserTiming(event: Event): event is UserTiming;
1607
1615
  export declare function isDomLoading(event: Event): event is DomLoading;
1608
1616
  export declare function isBeginRemoteFontLoad(event: Event): event is BeginRemoteFontLoad;
1617
+ export declare function isRemoteFontLoaded(event: Event): event is RemoteFontLoaded;
1609
1618
  export declare function isPerformanceMeasure(event: Event): event is PerformanceMeasure;
1610
1619
  export declare function isPerformanceMeasureBegin(event: Event): event is PerformanceMeasureBegin;
1611
1620
  export declare function isPerformanceMark(event: Event): event is PerformanceMark;
@@ -1639,10 +1648,15 @@ export interface PaintImage extends Complete {
1639
1648
  width: number;
1640
1649
  x: number;
1641
1650
  y: number;
1651
+ isCSS: boolean;
1652
+ isPicture?: boolean;
1653
+ loadingAttribute?: string;
1654
+ srcsetAttribute?: string;
1642
1655
  url?: string;
1643
1656
  srcHeight: number;
1644
1657
  srcWidth: number;
1645
1658
  nodeId?: Protocol.DOM.BackendNodeId;
1659
+ frame?: string;
1646
1660
  };
1647
1661
  };
1648
1662
  }
@@ -2152,6 +2166,7 @@ export declare const enum Name {
2152
2166
  LAYOUT_IMAGE_UNSIZED = "LayoutImageUnsized",
2153
2167
  DOM_LOADING = "domLoading",
2154
2168
  BEGIN_REMOTE_FONT_LOAD = "BeginRemoteFontLoad",
2169
+ REMOTE_FONT_LOADED = "RemoteFontLoaded",
2155
2170
  ANIMATION_FRAME = "AnimationFrame",
2156
2171
  ANIMATION_FRAME_PRESENTATION = "AnimationFrame::Presentation",
2157
2172
  SYNTHETIC_NETWORK_REQUEST = "SyntheticNetworkRequest",
@@ -406,6 +406,9 @@ export function isDomLoading(event) {
406
406
  export function isBeginRemoteFontLoad(event) {
407
407
  return event.name === "BeginRemoteFontLoad" /* Name.BEGIN_REMOTE_FONT_LOAD */;
408
408
  }
409
+ export function isRemoteFontLoaded(event) {
410
+ return event.name === "RemoteFontLoaded" /* Name.REMOTE_FONT_LOADED */;
411
+ }
409
412
  export function isPerformanceMeasure(event) {
410
413
  return isUserTiming(event) && isPhaseAsync(event.ph);
411
414
  }