UNPKG

@assertive-ts/core

Version:

A type-safe fluent assertion library

25 lines (24 loc) 1.09 kB
import { ArrayAssertion } from "./ArrayAssertion"; import { Assertion } from "./Assertion"; import { BooleanAssertion } from "./BooleanAssertion"; import { DateAssertion } from "./DateAssertion"; import { ErrorAssertion } from "./ErrorAssertion"; import { AnyFunction, FunctionAssertion } from "./FunctionAssertion"; import { NumberAssertion } from "./NumberAssertion"; import { ObjectAssertion } from "./ObjectAssertion"; import { PromiseAssertion } from "./PromiseAssertion"; import { StringAssertion } from "./StringAssertion"; import { Struct } from "./helpers/types"; export interface Expect { (actual: boolean): BooleanAssertion; (actual: number): NumberAssertion; (actual: string): StringAssertion; (actual: Date): DateAssertion; <T>(actual: T[]): ArrayAssertion<T>; <T>(actual: Promise<T>): PromiseAssertion<T>; <T extends AnyFunction>(actual: T): FunctionAssertion<T>; <T extends Error>(actual: T): ErrorAssertion<T>; <T extends Struct>(actual: T): ObjectAssertion<T>; <T>(actual: T): Assertion<T>; } export declare const expect: Expect;