@c4312/matcha
Version:
A caffeine driven, simple command line for benchmarking
73 lines (72 loc) • 2.06 kB
TypeScript
import { Benchmark } from './reporters';
import { MaybeAsync, IDeferred } from './async';
export interface IOptions {
readonly defer?: boolean;
readonly delay?: number;
readonly initCount?: number;
readonly maxTime?: number;
readonly minSamples?: number;
readonly minTime?: number;
readonly name?: string;
readonly onComplete?: (event: {
target: Benchmark;
}) => void;
readonly onCycle?: (event: {
target: Benchmark;
}) => void;
readonly onStart?: (event: {
target: Benchmark;
}) => void;
readonly onError?: (event: {
target: Benchmark;
}) => void;
readonly onReset?: (event: {
target: Benchmark;
}) => void;
readonly setup?: MaybeAsync;
readonly teardown?: MaybeAsync;
readonly fn?: (deferred: IDeferred) => void;
}
/**
* Benchmark options. A subset of those that Benchmark.js has, and better typed.
*/
export declare class Options implements IOptions {
/**
* Empty options.
*/
static readonly empty: Options;
readonly defer?: boolean;
readonly delay?: number;
readonly initCount?: number;
readonly maxTime?: number;
readonly minSamples?: number;
readonly minTime?: number;
readonly name?: string;
readonly onComplete?: (event: {
target: Benchmark;
}) => void;
readonly onCycle?: (event: {
target: Benchmark;
}) => void;
readonly onStart?: (event: {
target: Benchmark;
}) => void;
readonly onError?: (event: {
target: Benchmark;
}) => void;
readonly onReset?: (event: {
target: Benchmark;
}) => void;
readonly setup?: MaybeAsync;
readonly teardown?: MaybeAsync;
readonly fn?: (deferred: IDeferred) => void;
constructor(options?: IOptions);
/**
* Creates a new set of options by simply overwriting these ones.
*/
assign(options: IOptions): any;
/**
* Creates a new set of options by merging the `other` onto these ones.
*/
merge(other?: IOptions): Options;
}