import type { CallHistoryFilter, FetchMock, RouteName, UserRouteConfig } from 'fetch-mock'; import type { SyncExpectationResult } from 'expect'; export type HumanVerbs = 'Got' | 'Posted' | 'Put' | 'Deleted' | 'FetchedHead' | 'Patched' | 'Fetched'; export type ToHaveFunc = (filter?: CallHistoryFilter, options?: UserRouteConfig) => R; export type ToHaveNthFunc = (n: number, filter?: CallHistoryFilter, options?: UserRouteConfig) => R; export type ToHaveTimesFunc = (times: number, filter?: CallHistoryFilter, options?: UserRouteConfig) => R; export type ToBeDoneFunc = (routes?: RouteName | RouteName[]) => R; export type FetchMockMatchers = { toHaveFetched: ToHaveFunc; toHaveLastFetched: ToHaveFunc; toHaveFetchedTimes: ToHaveTimesFunc; toHaveNthFetched: ToHaveNthFunc; toHaveGot: ToHaveFunc; toHaveLastGot: ToHaveFunc; toHaveGotTimes: ToHaveTimesFunc; toHaveNthGot: ToHaveNthFunc; toHavePosted: ToHaveFunc; toHaveLastPosted: ToHaveFunc; toHavePostedTimes: ToHaveTimesFunc; toHaveNthPosted: ToHaveNthFunc; toHavePut: ToHaveFunc; toHaveLastPut: ToHaveFunc; toHavePutTimes: ToHaveTimesFunc; toHaveNthPut: ToHaveNthFunc; toHaveDeleted: ToHaveFunc; toHaveLastDeleted: ToHaveFunc; toHaveDeletedTimes: ToHaveTimesFunc; toHaveNthDeleted: ToHaveNthFunc; toHaveFetchedHead: ToHaveFunc; toHaveLastFetchedHead: ToHaveFunc; toHaveFetchedHeadTimes: ToHaveTimesFunc; toHaveNthFetchedHead: ToHaveNthFunc; toHavePatched: ToHaveFunc; toHaveLastPatched: ToHaveFunc; toHavePatchedTimes: ToHaveTimesFunc; toHaveNthPatched: ToHaveNthFunc; toBeDone: ToBeDoneFunc; }; export type PatchedFetch = { fetchMock: FetchMock; }; type RawMatcher any> = (input: PatchedFetch | FetchMock, ...args: Parameters) => ReturnType; export type RawFetchMockMatchers = { [k in keyof FetchMockMatchers]: RawMatcher[k]>; }; export type HumanVerbMethodNames = `toHave${M}` | `toHaveLast${M}` | `toHave${M}Times` | `toHaveNth${M}`; export {};