import { type MatcherResult, type MatcherContext } from './expect'; /** * Collection of built-in matcher methods available on every `expect()` call. * Each method returns a {@link MatcherResult} (or `Promise` for async matchers). */ export type BaseMatchers = { /** Loose equality (`==`). Passes when `received == expected`. */ toSimpleEqual(this: MatcherContext, expected: any): MatcherResult; /** Strict identity (`Object.is`). Passes when `Object.is(received, expected)`. */ toEqual(this: MatcherContext, expected: any): MatcherResult; /** Case-insensitive string equality. Both values are lowercased before comparison. */ toCaseInsensitiveEqual(this: MatcherContext, expected: string): MatcherResult; /** Strict identity using `Object.is`. Equivalent to {@link toEqual}. */ toBe(this: MatcherContext, expected: any): MatcherResult; /** Passes when `received > expected`. */ toBeGreaterThan(this: MatcherContext, expected: number): MatcherResult; /** Passes when `received >= expected`. */ toBeGreaterThanOrEqual(this: MatcherContext, expected: number): MatcherResult; /** Passes when `received < expected`. */ toBeLessThan(this: MatcherContext, expected: number): MatcherResult; /** Passes when `received <= expected`. */ toBeLessThanOrEqual(this: MatcherContext, expected: number): MatcherResult; /** Passes when `Number.isNaN(received)`. */ toBeNaN(this: MatcherContext): MatcherResult; /** Passes when `received === null`. */ toBeNull(this: MatcherContext): MatcherResult; /** Passes when `received === undefined`. */ toBeUndefined(this: MatcherContext): MatcherResult; /** Passes when `!!received` is truthy. */ toBeTruthy(this: MatcherContext): MatcherResult; /** Passes when `received.includes(expected)`. Works on strings and arrays. */ toContain(this: MatcherContext, expected: any): MatcherResult; /** * Deep equality with **unordered** array comparison. * Two arrays are considered equal when they contain the same elements regardless of order. */ toDeepEqual(this: MatcherContext, expected: any): MatcherResult; /** * Deep strict equality using Node.js `util.isDeepStrictEqual`. * Array order matters and type coercion is not performed. */ toDeepStrictEqual(this: MatcherContext, expected: any): MatcherResult; /** Strict reference equality (`===`). Passes when `received === expected`. */ toStrictEqual(this: MatcherContext, expected: any): MatcherResult; /** Passes when `received.length === expected`. */ toHaveLength(this: MatcherContext, expected: number): MatcherResult; /** * Passes when `received` has the given property `key`. * When `value` is also provided, the property must additionally equal that value (`Object.is`). */ toHaveProperty(this: MatcherContext, key: string, value?: any): MatcherResult; /** Passes when `received` matches the string or regular expression `expected`. */ toMatch(this: MatcherContext, expected: string | RegExp): MatcherResult; /** * Passes when invoking `received()` throws an error. * When `expected` is provided, the thrown error's message must match it. */ toThrow(this: MatcherContext<() => any>, expected?: string | RegExp): MatcherResult; /** * Passes when the predicate `expected(received)` returns `true`. * @param expected - A function that receives the tested value and returns a boolean. */ toSatisfy(this: MatcherContext, expected: (received: any) => boolean): MatcherResult; /** Passes when the promise `received` resolves with a value equal to `expected`. */ toResolveWith(this: MatcherContext>, expected: any): Promise; /** Passes when the promise `received` rejects with an error message containing `expected`. */ toRejectWith(this: MatcherContext>, expected: string): Promise; /** * Passes when calling `received()` completes without throwing. * Useful for asserting that an async operation finishes successfully. */ toPass(this: MatcherContext<() => any>): Promise; /** Validates `received` against a JSON Schema using AJV. */ toMatchSchema(this: MatcherContext, schema: object): MatcherResult; /** * Passes when `received` and `expected` arrays contain the same members, regardless of order. * Uses deep equality for element comparison. */ toHaveMembers(this: MatcherContext, expected: any[]): MatcherResult; /** * Passes when `received` is a superset of `expected` — every element in `expected` * has a matching element in `received` (deep equality, unordered). */ toIncludeMembers(this: MatcherContext, expected: any[]): MatcherResult; /** * Passes when `typeof received === expected`, or when `expected === 'array'` and * `Array.isArray(received)` is `true`. */ toHaveType(this: MatcherContext, expected: string): MatcherResult; }; /** * Pre-configured `expect` function extended with all {@link BaseMatchers}. * Use this as the primary entry point for writing assertions. */ export declare const expect: { (target: Target): import("./expect").Expect & { toSimpleEqual: (expected: any) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toEqual: (expected: any) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toCaseInsensitiveEqual: (expected: string) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toBe: (expected: any) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toBeGreaterThan: (expected: number) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toBeGreaterThanOrEqual: (expected: number) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toBeLessThan: (expected: number) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toBeLessThanOrEqual: (expected: number) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toBeNaN: () => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toBeNull: () => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toBeUndefined: () => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toBeTruthy: () => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toContain: (expected: any) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toDeepEqual: (expected: any) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toDeepStrictEqual: (expected: any) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toStrictEqual: (expected: any) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toHaveLength: (expected: number) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toHaveProperty: (key: string, value?: any) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toMatch: (expected: string | RegExp) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toThrow: ((this: MatcherContext<() => any>, expected?: string | RegExp) => MatcherResult) extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect : never; toSatisfy: (expected: (received: any) => boolean) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toResolveWith: ((this: MatcherContext>, expected: any) => Promise) extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => Promise> : never; toRejectWith: ((this: MatcherContext>, expected: string) => Promise) extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => Promise> : never; toPass: ((this: MatcherContext<() => any>) => Promise) extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => Promise> : never; toMatchSchema: (schema: object) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; toHaveMembers: ((this: MatcherContext, expected: any[]) => MatcherResult) extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect : never; toIncludeMembers: ((this: MatcherContext, expected: any[]) => MatcherResult) extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect : never; toHaveType: (expected: string) => Target extends (...args: any) => any ? Promise> : import("./expect").Expect; }; extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_1): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher & NewMatcher_1 extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_2): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher & NewMatcher_1 & NewMatcher_2 extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_3): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher & NewMatcher_1 & NewMatcher_2 & NewMatcher_3 extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_4): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher & NewMatcher_1 & NewMatcher_2 & NewMatcher_3 & NewMatcher_4 extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_5): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher & NewMatcher_1 & NewMatcher_2 & NewMatcher_3 & NewMatcher_4 & NewMatcher_5 extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_6): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher & NewMatcher_1 & NewMatcher_2 & NewMatcher_3 & NewMatcher_4 & NewMatcher_5 & NewMatcher_6 extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_7): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher & NewMatcher_1 & NewMatcher_2 & NewMatcher_3 & NewMatcher_4 & NewMatcher_5 & NewMatcher_6 & NewMatcher_7 extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_8): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher & NewMatcher_1 & NewMatcher_2 & NewMatcher_3 & NewMatcher_4 & NewMatcher_5 & NewMatcher_6 & NewMatcher_7 & NewMatcher_8 extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_9): { (target: Target): import("./expect").Expect & (BaseMatchers & NewMatcher & NewMatcher_1 & NewMatcher_2 & NewMatcher_3 & NewMatcher_4 & NewMatcher_5 & NewMatcher_6 & NewMatcher_7 & NewMatcher_8 & NewMatcher_9 extends infer T ? { [Key in keyof T]: T[Key] extends (this: MatcherContext, ...rest: infer Args extends any[]) => MatcherResult | Promise ? (...expected: Args) => ReturnType extends Promise ? Promise> : Target_1 extends (...args: any) => any ? Promise> : import("./expect").Expect : never; } : never); extend, ...rest: any[]) => MatcherResult | Promise; }>(matchers: NewMatcher_10): /*elided*/ any; }; }; }; }; }; }; }; }; }; }; };