local-fake-api
Version:
A simple async local mock API without backend.
10 lines (9 loc) • 326 B
TypeScript
import type { FakeApi } from "../types";
export type StorageType = "localStorage" | "idb";
export interface CreateFakeApiOptions<T> {
primaryKey?: keyof T;
storage?: StorageType;
}
export declare function createFakeApi<T extends {
id?: string;
}>(tableName: string, options?: CreateFakeApiOptions<T>): FakeApi<T>;