type BenchmarkFn = () => void; interface DefaultOptions { delay?: number; minIterations?: number; minTime?: number; type?: string; } interface Benchmark { fn: BenchmarkFn; group: string; iterations: number; name: N; } type BenchmarkGroup = Record; interface Stats { elapsed: number; endTime: number; iterations: number; ops: number; tpe: number; startTime: number; } interface Result { error: Error | null; name: N; stats: Stats; } interface ResultsGroup { group: N; results: Result[]; } type Results = Record; interface SuiteRunnerOptions { onComplete?: (results: Results) => void; onGroupComplete?: (resultGroup: ResultsGroup) => void; onGroupStart?: (group: string) => void; onResult?: (result: Result) => void; } interface BenchmarkRunnerOptions { onComplete?: (result: Result) => void; } interface SuiteOptions extends DefaultOptions, SuiteRunnerOptions {} interface NormalizedSuiteOptions extends Required, SuiteRunnerOptions {} interface BenchmarkOptions extends DefaultOptions, BenchmarkRunnerOptions {} interface RunBenchmarkOptions { benchmark: Benchmark; endTime?: number; iterations?: number; startTime?: number; } declare class BencheeSuite implements BencheeSuite { benchmarks: BenchmarkGroup; isRunning: boolean; options: NormalizedSuiteOptions; results: Results; constructor(passedOptions?: SuiteOptions); /** * When a benchmark finishes, store the result. */ _onResult(benchmark: B, error: Error | null, stats: Stats): void; /** * run the benchmark with the options passed */ _runBenchmark(benchmarkOptions: RunBenchmarkOptions): Promise; /** * execute the runs for the benchmarked function */ _runBenchmarkIterations(benchmark: Benchmark, runs: number): void; /** * run a group of benchmarks */ _runGroup(groupBenchmarks: Benchmark[], group?: string): Promise; /** * add a benchmark to the queue to be run */ add(name: string, benchmarkGroup: string | ((...args: any[]) => any), benchmarkFn?: (...args: any[]) => any): this; /** * run the benchmarks in the queue */ run(): Promise; } /** * Create a new benchee suite. */ declare const createSuite: (passedOptions?: SuiteOptions) => BencheeSuite; /** * Benchmark one function standalone, outside the context of a suite. */ declare function benchmark( name: N, fn: BenchmarkFn, options?: BenchmarkOptions, ): Promise>; export { benchmark, createSuite };