| 74 | interface LocalForageDbMethods extends LocalForageDbMethodsCore, LocalForageDbMethodsOptional {} |
| 75 | |
| 76 | interface 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 | |
| 120 | declare module "localforage" { |
| 121 | let localforage: LocalForage; |
no outgoing calls
no test coverage detected
searching dependent graphs…