MCPcopy
hub / github.com/localForage/localForage / LocalForage

Interface LocalForage

typings/localforage.d.ts:76–118  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74interface LocalForageDbMethods extends LocalForageDbMethodsCore, LocalForageDbMethodsOptional {}
75
76interface LocalForage extends LocalForageDbMethods {
77 LOCALSTORAGE: string;
78 WEBSQL: string;
79 INDEXEDDB: string;
80
81 /**
82 * Set and persist localForage options. This must be called before any other calls to localForage are made, but can be called after localForage is loaded.
83 * If you set any config values with this method they will persist after driver changes, so you can call config() then setDriver()
84 * @param {LocalForageOptions} options?
85 */
86 config(options: LocalForageOptions): boolean;
87 config(options: string): any;
88 config(): LocalForageOptions;
89
90 /**
91 * Create a new instance of localForage to point to a different store.
92 * All the configuration options used by config are supported.
93 * @param {LocalForageOptions} options
94 */
95 createInstance(options: LocalForageOptions): LocalForage;
96
97 driver(): string;
98
99 /**
100 * Force usage of a particular driver or drivers, if available.
101 * @param {string} driver
102 */
103 setDriver(driver: string | string[], callback?: () => void, errorCallback?: (error: any) => void): Promise<void>;
104
105 defineDriver(driver: LocalForageDriver, callback?: () => void, errorCallback?: (error: any) => void): Promise<void>;
106
107 /**
108 * Return a particular driver
109 * @param {string} driver
110 */
111 getDriver(driver: string): Promise<LocalForageDriver>;
112
113 getSerializer(callback?: (serializer: LocalForageSerializer) => void): Promise<LocalForageSerializer>;
114
115 supports(driverName: string): boolean;
116
117 ready(callback?: (error: any) => void): Promise<void>;
118}
119
120declare module "localforage" {
121 let localforage: LocalForage;

Callers 51

test.config.jsFile · 0.65
runner.jsFile · 0.65
dropInstanceFunction · 0.65
dropInstanceFunction · 0.65
dropInstanceFunction · 0.65
main.jsFile · 0.65
test.api.jsFile · 0.65
test.config.jsFile · 0.65
test.drivers.jsFile · 0.65

Implementers 1

LocalForagesrc/localforage.js

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…