about summary refs log tree commit diff stats
path: root/js/localforage.d.ts
diff options
context:
space:
mode:
authorAndrew Dolgov <fox@fakecake.org>2026-03-29 09:54:51 +0300
committerAndrew Dolgov <fox@fakecake.org>2026-03-29 09:54:51 +0300
commit7d1f357a5e263567707b8f018da17f74c44c6d50 (patch)
treefaefd91113c180f3591002a8fdf291dbfdf6e692 /js/localforage.d.ts
parentd2ea17abf815b6cd754511e27f4853045e0b3ca2 (diff)
downloadthe-epube-ts.tar.gz
the-epube-ts.tar.xz
horrors of ts ts
Diffstat (limited to 'js/localforage.d.ts')
-rw-r--r--js/localforage.d.ts123
1 files changed, 0 insertions, 123 deletions
diff --git a/js/localforage.d.ts b/js/localforage.d.ts
deleted file mode 100644
index 7fb8f58..0000000
--- a/js/localforage.d.ts
+++ /dev/null
@@ -1,123 +0,0 @@
-interface LocalForageDbInstanceOptions {
-    name?: string;
-
-    storeName?: string;
-}
-
-interface LocalForageOptions extends LocalForageDbInstanceOptions {
-    driver?: string | string[];
-
-    size?: number;
-
-    version?: number;
-
-    description?: string;
-}
-
-interface LocalForageDbMethodsCore {
-    getItem<T>(key: string, callback?: (err: any, value: T | null) => void): Promise<T | null>;
-
-    setItem<T>(key: string, value: T, callback?: (err: any, value: T) => void): Promise<T>;
-
-    removeItem(key: string, callback?: (err: any) => void): Promise<void>;
-
-    clear(callback?: (err: any) => void): Promise<void>;
-
-    length(callback?: (err: any, numberOfKeys: number) => void): Promise<number>;
-
-    key(keyIndex: number, callback?: (err: any, key: string) => void): Promise<string>;
-
-    keys(callback?: (err: any, keys: string[]) => void): Promise<string[]>;
-
-    iterate<T, U>(iteratee: (value: T, key: string, iterationNumber: number) => U,
-            callback?: (err: any, result: U) => void): Promise<U>;
-}
-
-interface LocalForageDropInstanceFn {
-    (dbInstanceOptions?: LocalForageDbInstanceOptions, callback?: (err: any) => void): Promise<void>;
-}
-
-interface LocalForageDriverMethodsOptional {
-    dropInstance?: LocalForageDropInstanceFn;
-}
-
-// duplicating LocalForageDriverMethodsOptional to preserve TS v2.0 support,
-// since Partial<> isn't supported there
-interface LocalForageDbMethodsOptional {
-    dropInstance: LocalForageDropInstanceFn;
-}
-
-interface LocalForageDriverDbMethods extends LocalForageDbMethodsCore, LocalForageDriverMethodsOptional {}
-
-interface LocalForageDriverSupportFunc {
-    (): Promise<boolean>;
-}
-
-interface LocalForageDriver extends LocalForageDriverDbMethods {
-    _driver: string;
-
-    _initStorage(options: LocalForageOptions): void;
-
-    _support?: boolean | LocalForageDriverSupportFunc;
-}
-
-interface LocalForageSerializer {
-    serialize<T>(value: T | ArrayBuffer | Blob, callback: (value: string, error: any) => void): void;
-
-    deserialize<T>(value: string): T | ArrayBuffer | Blob;
-
-    stringToBuffer(serializedString: string): ArrayBuffer;
-
-    bufferToString(buffer: ArrayBuffer): string;
-}
-
-interface LocalForageDbMethods extends LocalForageDbMethodsCore, LocalForageDbMethodsOptional {}
-
-interface LocalForage extends LocalForageDbMethods {
-    LOCALSTORAGE: string;
-    WEBSQL: string;
-    INDEXEDDB: string;
-
-    /**
-     * 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.
-     * If you set any config values with this method they will persist after driver changes, so you can call config() then setDriver()
-     * @param {LocalForageOptions} options?
-     */
-    config(options: LocalForageOptions): boolean;
-    config(options: string): any;
-    config(): LocalForageOptions;
-
-    /**
-     * Create a new instance of localForage to point to a different store.
-     * All the configuration options used by config are supported.
-     * @param {LocalForageOptions} options
-     */
-    createInstance(options: LocalForageOptions): LocalForage;
-
-    driver(): string;
-
-    /**
-     * Force usage of a particular driver or drivers, if available.
-     * @param {string} driver
-     */
-    setDriver(driver: string | string[], callback?: () => void, errorCallback?: (error: any) => void): Promise<void>;
-
-    defineDriver(driver: LocalForageDriver, callback?: () => void, errorCallback?: (error: any) => void): Promise<void>;
-
-    /**
-     * Return a particular driver
-     * @param {string} driver
-     */
-    getDriver(driver: string): Promise<LocalForageDriver>;
-
-    getSerializer(callback?: (serializer: LocalForageSerializer) => void): Promise<LocalForageSerializer>;
-
-    supports(driverName: string): boolean;
-
-    ready(callback?: (error: any) => void): Promise<void>;
-}
-
-declare module "localforage" {
-    let localforage: LocalForage;
-    export = localforage;
-}