This repository has been archived on 2023-03-02. You can view files and clone it, but cannot push or open issues or pull requests.
react-rest-request/src/endpoint.ts

14 lines
269 B
TypeScript

export enum Method {
GET = 'GET',
PUT = 'PUT',
POST = 'POST',
PATCH = 'PATCH',
DELETE = 'DELETE',
}
export type Endpoint<P = void> = Readonly<{
method: Method;
url: string | ((params: P) => string);
headers?: Record<string, string>;
}>