storybook-addon-fake-api
Version:
This addon will send fake responses to the requests sent from your component
19 lines (18 loc) • 587 B
TypeScript
import { MakeDecoratorResult } from "@storybook/addons";
export declare type Method = "CONNECT" | "DELETE" | "GET" | "HEAD" | "OPTIONS" | "PATCH" | "POST" | "PUT" | "TRACE";
export declare type ResponseType = "Resolve" | "Reject";
export interface IAPI {
enabled?: boolean;
name: string;
url: string;
method: Method;
response: IAPIResponse;
}
export interface IAPIResponse {
status: number;
data: Object | Array<any>;
delay?: number;
type: ResponseType;
}
export declare type IAPIList = Array<IAPI>;
export declare type withAPI = MakeDecoratorResult;