UNPKG

1.13 kBTypeScriptView Raw
1type JSSelfProfileSampleMarker = 'script' | 'gc' | 'style' | 'layout' | 'paint' | 'other';
2export type JSSelfProfileSample = {
3 timestamp: number;
4 stackId?: number;
5 marker?: JSSelfProfileSampleMarker;
6};
7export type JSSelfProfileStack = {
8 frameId: number;
9 parentId?: number;
10};
11export type JSSelfProfileFrame = {
12 name: string;
13 resourceId?: number;
14 line?: number;
15 column?: number;
16};
17export type JSSelfProfile = {
18 resources: string[];
19 frames: JSSelfProfileFrame[];
20 stacks: JSSelfProfileStack[];
21 samples: JSSelfProfileSample[];
22};
23export interface JSSelfProfiler {
24 sampleInterval: number;
25 stopped: boolean;
26 stop: () => Promise<JSSelfProfile>;
27 addEventListener(event: 'samplebufferfull', callback: (trace: JSSelfProfile) => void): void;
28}
29export declare const JSSelfProfilerConstructor: {
30 new (options: {
31 sampleInterval: number;
32 maxBufferSize: number;
33 }): JSSelfProfiler;
34};
35declare global {
36 interface Window {
37 Profiler: typeof JSSelfProfilerConstructor | undefined;
38 }
39}
40export {};
41//# sourceMappingURL=jsSelfProfiling.d.ts.map
\No newline at end of file