Skip to main content
Version: 4.x.x

RequestDataMockTypes


import { RequestDataMockTypes } from "@hyper-fetch/core"

Description

Defined in mocker/mocker.types.ts:15

Preview

type RequestDataMockTypes<Response,Request> = RequestMockType<Response> | RequestMockType<Response>[] | (r: Request) => RequestMockType<Response> | (r: Request) => RequestMockType<Response>[] | (r: Request) => Promise<RequestMockType<Response>> | (r: Request) => Promise<RequestMockType<Response>>[];

Structure

{config:{requestSentDuration:number,responseDelay:number,responseReceivedDuration:number,status:number | string,success:boolean},data:Response | Response[] | () => Response,extra:any} | {
config: {
requestSentDuration: number;
responseDelay: number;
responseReceivedDuration: number;
status: number | string;
success: boolean;
};
data: Response | Response[] | () => Response;
extra: any;
}[] | (r: Request) => RequestMockType<Response> | (r: Request) => RequestMockType<Response>[] | (r: Request) => Promise<RequestMockType<Response>> | (r: Request) => Promise<RequestMockType<Response>>[]