UNPKG

svelte-idb-store

Version:

A library that allows you to sync the value of your Svelte stores with IndexedDB

12 lines (11 loc) 759 B
import { type Writable } from "svelte/store"; import type { IDBStoreArray, IDBStoreObject, OptionsArray, OptionsObject } from "./types"; interface IDBStoreArrayV4<T> extends Writable<T[]>, IDBStoreArray<T> { } interface IDBStoreObjectV4<T extends Record<string, any>> extends Writable<T>, IDBStoreObject<T> { } export declare const idbStoreArray: <T extends Record<string, any>>({ name, key, initialValue, onLoad, onCreate }: OptionsArray<T>) => IDBStoreArrayV4<T>; export declare const idbStoreObject: <T extends Record<string, any>>({ name, initialValue, onLoad, onCreate }: OptionsObject<T>) => IDBStoreObjectV4<T>; export declare const existsDB: (name: string) => Promise<boolean>; export declare const deleteDB: typeof import("idb").deleteDB; export {};