UNPKG

jodit

Version:

Jodit is an awesome and useful wysiwyg editor with filebrowser

57 lines (56 loc) 1.55 kB
/*! * Jodit Editor (https://xdsoft.net/jodit/) * Released under MIT see LICENSE.txt in the project root for license information. * Copyright (c) 2013-2026 Valerii Chupurnov. All rights reserved. https://xdsoft.net */ /** * @module storage */ import type { IAsyncStorage, StorageValueType } from "../../../types/index"; /** * Persistent storage using IndexedDB */ export declare class IndexedDBProvider<T = StorageValueType> implements IAsyncStorage<T> { readonly dbName: string; private dbPromise; private readonly DB_VERSION; private readonly storeName; constructor(dbName?: string, storeName?: string); /** * Initialize or get the database connection */ private getDB; /** * Perform a transaction on the store */ private performTransaction; set(key: string, value: T): Promise<this>; delete(key: string): Promise<this>; get<R = T>(key: string): Promise<R | void>; exists(key: string): Promise<boolean>; clear(): Promise<this>; /** * Close the database connection */ close(): Promise<void>; /** * Get all keys in the store */ keys(): Promise<string[]>; /** * Get all values in the store */ values(): Promise<T[]>; /** * Get all entries (key-value pairs) in the store */ entries(): Promise<Array<[ string, T ]>>; } export declare function clearUseIndexedDBCache(): void; /** * Check if IndexedDB is available */ export declare function canUseIndexedDB(): Promise<boolean>;