payload-rest-client
Version:
A typesafe rest api client for the payload cms.
13 lines (12 loc) • 400 B
TypeScript
import { ClientOptions } from "./types";
export type FetchMethod = "GET" | "POST" | "PATCH" | "DELETE";
type FetchParams = {
type?: "collection" | "global" | "custom";
slug?: string;
method: FetchMethod;
path: string | string[];
qs: string | null;
body?: any;
};
export declare const fetchFactory: (options: ClientOptions) => (params: FetchParams) => Promise<any>;
export {};