-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathindex.d.ts
38 lines (34 loc) · 1.14 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
interface IOptions {
shouldLog?: boolean;
port?: number;
components?: string[];
}
interface IMeasureDetail {
averageTimeSpentMs: string;
numberOfTimes: number;
totalTimeSpentMs: number;
}
interface IMeasure {
componentName: string; // Name of the component
totalTimeSpent: number; // Total time taken by the component combining all the phases
percentTimeSpent: string; // Percent time
numberOfInstances: number; // Number of instances of the component
mount: IMeasureDetail; // Mount time
render: IMeasureDetail; // Render time
update: IMeasureDetail; // Update time
unmount: IMeasureDetail; // Unmount time
// Time taken in lifecycle hooks
componentWillMount: IMeasureDetail;
componentDidMount: IMeasureDetail;
componentWillReceiveProps: IMeasureDetail;
shouldComponentUpdate: IMeasureDetail;
componentWillUpdate: IMeasureDetail;
componentDidUpdate: IMeasureDetail;
componentWillUnmount: IMeasureDetail;
}
declare module 'react-perf-devtool' {
function registerObserver(
options?: IOptions,
callback?: (measures: Array<IMeasure>) => void
): void
}