import { CancellablePromise } from '@theintern/common'; import * as Benchmark from 'benchmark'; import Test, { TestFunction, TestProperties } from './Test'; import Deferred from './Deferred'; export default class BenchmarkTest extends Test { test: BenchmarkTestFunction; benchmark: InternBenchmark; constructor(descriptor: BenchmarkTestOptions); timeElapsed: number; async(_timeout?: number, _numCallsUntilResolution?: number): Deferred; run(): CancellablePromise; toJSON(): { [key: string]: any; }; static async(testFunction: BenchmarkDeferredTestFunction, numCallsUntilResolution?: number): BenchmarkTestFunction; } export interface BenchmarkTestFunction extends TestFunction { (this: BenchmarkTest): void | Promise; options?: BenchmarkOptions; } export interface BenchmarkDeferredTestFunction extends BenchmarkTestFunction { (this: BenchmarkTest, deferred: Deferred): void | Promise; options?: BenchmarkOptions; } export interface BenchmarkTestProperties extends TestProperties { test: BenchmarkTestFunction; skip: string; numCallsUntilResolution: number; } export declare type BenchmarkTestOptions = Partial & { name: string; test: BenchmarkTestFunction; options?: BenchmarkOptions; }; export interface BenchmarkOptions extends Benchmark.Options { skip?: string; numCallsUntilResolution?: number; } export interface InternBenchmark extends Benchmark { internTest?: BenchmarkTest; } export declare function isBenchmarkTest(value: any): value is BenchmarkTest;