import { DeepPartial } from 'ts-essentials'; import { Mock } from 'vitest'; type MatcherFn = (actualValue: T) => boolean; interface MatcherLike<_> { asymmetricMatch(other: unknown): boolean; toString(): string; getExpectedType?(): string; toAsymmetricMatcher?(): string; } declare class Matcher implements MatcherLike { readonly asymmetricMatch: MatcherFn; private readonly description; $$typeof: symbol; inverse?: boolean; constructor(asymmetricMatch: MatcherFn, description: string); toString(): string; toAsymmetricMatcher(): string; getExpectedType(): string; } declare class CaptorMatcher { $$typeof: symbol; readonly asymmetricMatch: MatcherFn; readonly value: T; readonly values: T[]; constructor(); getExpectedType(): string; toString(): string; toAsymmetricMatcher(): string; } type MatcherCreator = (expectedValue?: E) => Matcher; type MatchersOrLiterals = { [K in keyof Y]: MatcherLike | Y[K]; }; declare const any: MatcherCreator; declare const anyBoolean: MatcherCreator; declare const anyNumber: MatcherCreator; declare const anyString: MatcherCreator; declare const anyFunction: MatcherCreator; declare const anySymbol: MatcherCreator; declare const anyObject: MatcherCreator; declare const anyArray: MatcherCreator; declare const anyMap: MatcherCreator>; declare const anySet: MatcherCreator>; declare const isA: MatcherCreator; declare const arrayIncludes: MatcherCreator; declare const setHas: MatcherCreator, unknown>; declare const mapHas: MatcherCreator, unknown>; declare const objectContainsKey: MatcherCreator, string>; declare const objectContainsValue: MatcherCreator | ArrayLike>; declare const notNull: MatcherCreator; declare const notUndefined: MatcherCreator; declare const notEmpty: MatcherCreator; declare const captor: () => CaptorMatcher; declare const matches: (matcher: MatcherFn) => Matcher; type FallbackImplementation = (...args: Y) => T; type ProxiedProperty = string | number | symbol; interface GlobalConfig { ignoreProps?: ProxiedProperty[]; } declare const VitestMockExtended: { DEFAULT_CONFIG: GlobalConfig; configure: (config: GlobalConfig) => void; resetConfig: () => void; }; interface CalledWithMock extends Mock> { calledWith: (...args: Y | MatchersOrLiterals) => Mock>; } type _MockProxy = { [K in keyof T]: T[K] extends (...args: infer A) => infer B ? T[K] & CalledWithMock : T[K]; }; type MockProxy = _MockProxy & T; type _DeepMockProxy = { [K in keyof T]: T[K] extends (...args: infer A) => infer B ? T[K] & CalledWithMock : T[K] & _DeepMockProxy; }; type DeepMockProxy = _DeepMockProxy & T; type _DeepMockProxyWithFuncPropSupport = { [K in keyof T]: T[K] extends (...args: infer A) => infer B ? CalledWithMock & DeepMockProxy : DeepMockProxy; }; type DeepMockProxyWithFuncPropSupport = _DeepMockProxyWithFuncPropSupport & T; interface MockOpts { deep?: boolean; useActualToJSON?: boolean; fallbackMockImplementation?: (...args: any[]) => any; } declare const mockClear: (mock: MockProxy) => any; declare const mockReset: (mock: MockProxy) => any; declare function mockDeep(opts: { funcPropSupport?: true; fallbackMockImplementation?: MockOpts['fallbackMockImplementation']; }, mockImplementation?: DeepPartial): DeepMockProxyWithFuncPropSupport; declare function mockDeep(mockImplementation?: DeepPartial): DeepMockProxy; declare const mock: & T = MockProxy & T>(mockImplementation?: DeepPartial, opts?: MockOpts) => MockedReturn; declare const mockFn: any ? AReal : any[], R = T extends (...args: any) => infer RReal ? RReal : any>() => CalledWithMock & T; declare function mocked(obj: T, deep?: false): ReturnType>; declare function mocked(obj: T, deep: true): ReturnType>; declare function mockedFn(obj: T): ReturnType>; declare const stub: () => T; type CalledWithFnArgs = { fallbackMockImplementation?: FallbackImplementation; }; declare const calledWithFn: ({ fallbackMockImplementation, }?: CalledWithFnArgs) => CalledWithMock; export { CaptorMatcher, Matcher, VitestMockExtended, any, anyArray, anyBoolean, anyFunction, anyMap, anyNumber, anyObject, anySet, anyString, anySymbol, arrayIncludes, calledWithFn, captor, isA, mapHas, matches, mock, mockClear, mockDeep, mockFn, mockReset, mocked, mockedFn, notEmpty, notNull, notUndefined, objectContainsKey, objectContainsValue, setHas, stub }; export type { CalledWithMock, DeepMockProxy, GlobalConfig, MatcherCreator, MatcherFn, MatcherLike, MatchersOrLiterals, MockOpts, MockProxy }; //# sourceMappingURL=index.d.cts.map