1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | declare class Benchmark {
|
10 | static filter<T>(arr: T[], callback: (value: T) => any, thisArg?: any): T[];
|
11 | static filter<T>(arr: T[], filter: string, thisArg?: any): T[];
|
12 | static formatNumber(num: number): string;
|
13 | static join(obj: Object, separator1?: string, separator2?: string): string;
|
14 | static invoke(benches: Benchmark[], name: string | Object, ...args: any[]): any[];
|
15 | static runInContext(context: Object): Function;
|
16 |
|
17 | static each(obj: Object | any[], callback: Function, thisArg?: any): void;
|
18 | static forEach<T>(arr: T[], callback: (value: T) => any, thisArg?: any): void;
|
19 | static forOwn(obj: Object, callback: Function, thisArg?: any): void;
|
20 | static has(obj: Object, path: any[] | string): boolean;
|
21 | static indexOf<T>(arr: T[], value: T, fromIndex?: number): number;
|
22 | static map<T, K>(arr: T[], callback: (value: T) => K, thisArg?: any): K[];
|
23 | static reduce<T, K>(arr: T[], callback: (accumulator: K, value: T) => K, thisArg?: any): K;
|
24 |
|
25 | static options: Benchmark.Options;
|
26 | static platform: Benchmark.Platform;
|
27 | static support: Benchmark.Support;
|
28 | static version: string;
|
29 |
|
30 | constructor(fn: Function | string, options?: Benchmark.Options);
|
31 | constructor(name: string, fn: Function | string, options?: Benchmark.Options);
|
32 | constructor(name: string, options?: Benchmark.Options);
|
33 | constructor(options: Benchmark.Options);
|
34 |
|
35 | id: number;
|
36 | name: string;
|
37 | count: number;
|
38 | cycles: number;
|
39 | hz: number;
|
40 | compiled: Function | string;
|
41 | error: Error;
|
42 | fn: Function | string;
|
43 | aborted: boolean;
|
44 | running: boolean;
|
45 | setup: Function | string;
|
46 | teardown: Function | string;
|
47 |
|
48 | stats: Benchmark.Stats;
|
49 | times: Benchmark.Times;
|
50 |
|
51 | abort(): Benchmark;
|
52 | clone(options: Benchmark.Options): Benchmark;
|
53 | compare(benchmark: Benchmark): number;
|
54 | emit(type: string | Object): any;
|
55 | listeners(type: string): Function[];
|
56 | off(type?: string, listener?: Function): Benchmark;
|
57 | off(types: string[]): Benchmark;
|
58 | on(type?: string, listener?: Function): Benchmark;
|
59 | on(types: string[]): Benchmark;
|
60 | reset(): Benchmark;
|
61 | run(options?: Benchmark.Options): Benchmark;
|
62 | toString(): string;
|
63 | }
|
64 |
|
65 | declare namespace Benchmark {
|
66 | export interface Options {
|
67 | async?: boolean;
|
68 | defer?: boolean;
|
69 | delay?: number;
|
70 | id?: string;
|
71 | initCount?: number;
|
72 | maxTime?: number;
|
73 | minSamples?: number;
|
74 | minTime?: number;
|
75 | name?: string;
|
76 | onAbort?: Function;
|
77 | onComplete?: Function;
|
78 | onCycle?: Function;
|
79 | onError?: Function;
|
80 | onReset?: Function;
|
81 | onStart?: Function;
|
82 | setup?: Function | string;
|
83 | teardown?: Function | string;
|
84 | fn?: Function | string;
|
85 | queued?: boolean;
|
86 | }
|
87 |
|
88 | export interface Platform {
|
89 | description: string;
|
90 | layout: string;
|
91 | product: string;
|
92 | name: string;
|
93 | manufacturer: string;
|
94 | os: string;
|
95 | prerelease: string;
|
96 | version: string;
|
97 | toString(): string;
|
98 | }
|
99 |
|
100 | export interface Support {
|
101 | browser: boolean;
|
102 | timeout: boolean;
|
103 | decompilation: boolean;
|
104 | }
|
105 |
|
106 | export interface Stats {
|
107 | moe: number;
|
108 | rme: number;
|
109 | sem: number;
|
110 | deviation: number;
|
111 | mean: number;
|
112 | sample: any[];
|
113 | variance: number;
|
114 | }
|
115 |
|
116 | export interface Times {
|
117 | cycle: number;
|
118 | elapsed: number;
|
119 | period: number;
|
120 | timeStamp: number;
|
121 | }
|
122 |
|
123 | export class Deferred {
|
124 | constructor(clone: Benchmark);
|
125 |
|
126 | benchmark: Benchmark;
|
127 | cycles: number;
|
128 | elapsed: number;
|
129 | timeStamp: number;
|
130 |
|
131 | resolve(): void;
|
132 | }
|
133 |
|
134 | export interface Target {
|
135 | options: Options;
|
136 | async?: boolean;
|
137 | defer?: boolean;
|
138 | delay?: number;
|
139 | initCount?: number;
|
140 | maxTime?: number;
|
141 | minSamples?: number;
|
142 | minTime?: number;
|
143 | name?: string;
|
144 | fn?: Function;
|
145 | id: number;
|
146 | stats?: Stats;
|
147 | times?: Times;
|
148 | running: boolean;
|
149 | count?: number;
|
150 | compiled?: Function;
|
151 | cycles?: number;
|
152 | hz?: number;
|
153 | }
|
154 |
|
155 | export class Event {
|
156 | constructor(type: string | Object);
|
157 |
|
158 | aborted: boolean;
|
159 | cancelled: boolean;
|
160 | currentTarget: Object;
|
161 | result: any;
|
162 | target: Target;
|
163 | timeStamp: number;
|
164 | type: string;
|
165 | }
|
166 |
|
167 | export class Suite {
|
168 | static options: { name: string };
|
169 |
|
170 | constructor(name?: string, options?: Options);
|
171 |
|
172 | length: number;
|
173 | aborted: boolean;
|
174 | running: boolean;
|
175 |
|
176 | abort(): Suite;
|
177 | add(name: string, fn: Function | string, options?: Options): Suite;
|
178 | add(fn: Function | string, options?: Options): Suite;
|
179 | add(name: string, options?: Options): Suite;
|
180 | add(options: Options): Suite;
|
181 | clone(options: Options): Suite;
|
182 | emit(type: string | Object): any;
|
183 | filter(callback: Function | string): Suite;
|
184 | join(separator?: string): string;
|
185 | listeners(type: string): Function[];
|
186 | off(type?: string, callback?: Function): Suite;
|
187 | off(types: string[]): Suite;
|
188 | on(type?: string, callback?: Function): Suite;
|
189 | on(types: string[]): Suite;
|
190 | push(benchmark: Benchmark): number;
|
191 | reset(): Suite;
|
192 | run(options?: Options): Suite;
|
193 | reverse(): any[];
|
194 | sort(compareFn: (a: any, b: any) => number): any[];
|
195 | splice(start: number, deleteCount?: number): any[];
|
196 | unshift(benchmark: Benchmark): number;
|
197 |
|
198 | each(callback: Function): Suite;
|
199 | forEach(callback: Function): Suite;
|
200 | indexOf(value: any): number;
|
201 | map(callback: Function | string): any[];
|
202 | reduce<T>(callback: Function, accumulator: T): T;
|
203 |
|
204 | pop(): Function;
|
205 | shift(): Benchmark;
|
206 | slice(start: number, end: number): any[];
|
207 | slice(start: number, deleteCount: number, ...values: any[]): any[];
|
208 | }
|
209 | }
|
210 |
|
211 | export = Benchmark;
|
212 |
|
\ | No newline at end of file |