import type { Diff } from './diff.ts'; import type { Expectations } from './expectations.ts'; import type { Matcher } from './matchers.ts'; /** A type identifying any constructor */ export type Constructor = new (...args: any[]) => T; /** A type identifying any function */ export type Callable = (...args: readonly any[]) => T; /** A simple _record_ indicating an `object` but never an `array` */ export type NonArrayObject = { [a: string]: T; [b: symbol]: T; [c: number]: never; }; /** Mappings for our _expanded_ {@link typeOf} implementation */ export type TypeMappings = { bigint: bigint; boolean: boolean; function: Callable; number: number; string: string; symbol: symbol; undefined: undefined; array: readonly any[]; buffer: Buffer; date: Date; map: Map; promise: PromiseLike; regexp: RegExp; set: Set; object: NonArrayObject; null: null; }; /** Values returned by our own _expanded_ `{@link typeOf}` */ export type TypeName = keyof TypeMappings; /** Expanded `typeof` implementation returning some extra types */ export declare function typeOf(value: unknown): TypeName; /** Stringify the type of an object (its constructor name) */ export declare function stringifyObjectType(value: object): string; /** Stringify a constructor */ export declare function stringifyConstructor(ctor: Constructor): string; /** Pretty print the value (strings, numbers, booleans) or return the type */ export declare function stringifyValue(value: unknown): string; /** Add the `a`/`an`/... prefix to the type name */ export declare function prefixType(type: TypeName): string; export declare const matcherMarker: unique symbol; export declare function isMatcher(what: any): what is Matcher; export declare class ExpectationError extends Error { remarks?: string; diff?: Diff | undefined; /** * Create an {@link ExpectationError} from a {@link Expectations} instance * and details message, including an optional {@link Diff} */ constructor(expectations: Expectations, details: string, diff?: Diff); } //# sourceMappingURL=types.d.ts.map