datasquirel/dist/client/fetch/index.d.ts
Benjamin Toby a3561da53d Updates
2025-01-10 20:35:05 +01:00

22 lines
595 B
TypeScript

type FetchApiOptions = {
method: "POST" | "GET" | "DELETE" | "PUT" | "PATCH" | "post" | "get" | "delete" | "put" | "patch";
body?: object | string;
headers?: FetchHeader;
};
type FetchHeader = HeadersInit & {
[key: string]: string | null;
};
export type FetchApiReturn = {
success: boolean;
payload: any;
msg?: string;
[key: string]: any;
};
/**
* # Fetch API
*/
export default function fetchApi(url: string, options?: FetchApiOptions, csrf?: boolean,
/** Key to use to grab local Storage csrf value. */
localStorageCSRFKey?: string): Promise<any>;
export {};