/** * Mirrors timeline events into Chrome DevTools' Performance panel as custom * tracks, via `console.timeStamp(label, start, end, track, group, color)`. * Browsers that ignore those arguments get the same entries as User Timing * marks and measures instead (see {@link userTimingStamp}). * * Start/end are `performance.now()` values. Paired `:start`/`:end` events * become a range; everything else becomes a zero-length marker. */ import type { TimelineEvent } from '../../../types/timeline.js'; type TrackColor = 'primary' | 'primary-light' | 'primary-dark' | 'secondary' | 'secondary-light' | 'secondary-dark' | 'tertiary' | 'tertiary-light' | 'tertiary-dark' | 'error'; export type TimeStamp = (label: string, start: number, end: number, track: string, group: string, color: TrackColor) => void; export interface ChromeTracksSink { push(event: TimelineEvent): void; reset(): void; } interface NavigatorLike { userAgent?: string; userAgentData?: { brands?: readonly { brand: string; version: string; }[]; }; } /** * Whether this browser draws `console.timeStamp`'s track arguments: Chromium * 134 or newer. There's no feature test for the extra arguments (older * Chrome, Firefox and Safari accept the call and ignore them), so this reads * the version. `userAgentData` only exists in secure contexts, so a dev * server reached over plain http on a LAN address falls back to the UA * string's `Chrome/`, which every Chromium browser keeps. */ export declare const chromeTracksSupported: (nav?: NavigatorLike | undefined) => boolean; /** * The same entries as User Timing: a range becomes a measure, a marker a * mark, named `lit: