sej
    Preparing search index...

    Type Alias Storage

    Storage class for Editor.

    type Storage = {
        clear: () => void;
        debug: boolean;
        get: (callback?: (data: unknown) => void) => void;
        getAsync: () => Promise<unknown | null>;
        key: string;
        set: (data: any, callback?: () => void) => void;
        setAsync: (data: any) => Promise<void>;
        store: LocalForage;
        version: number;
    }

    Implemented by

    Index

    Properties

    clear: () => void

    Clears all items from the storage.

    This method removes all key-value pairs from the storage, effectively resetting it to an empty state.

    debug: boolean

    Whether debugging is enabled.

    false
    
    get: (callback?: (data: unknown) => void) => void

    Retrieves data from the storage and optionally executes a callback with the retrieved data.

    Type declaration

      • (callback?: (data: unknown) => void): void
      • Parameters

        • Optionalcallback: (data: unknown) => void

          An optional callback function that will be called with the retrieved data.

        Returns void

    This method measures the time taken to load the state from IndexedDB and logs it if debugging is enabled.

    getAsync: () => Promise<unknown | null>

    Retrieves an item from the storage asynchronously.

    Type declaration

      • (): Promise<unknown | null>
      • Returns Promise<unknown | null>

        A promise that resolves to the item retrieved from the storage, or null if the item does not exist.

    key: string

    Key for the storage.

    'state'
    
    set: (data: any, callback?: () => void) => void

    Stores the provided data in IndexedDB and optionally executes a callback function.

    Type declaration

      • (data: any, callback?: () => void): void
      • Parameters

        • data: any

          The data to be stored.

        • Optionalcallback: () => void

          An optional callback function to be executed after the data is stored.

        Returns void

    setAsync: (data: any) => Promise<void>

    Asynchronously sets the provided data in the storage.

    Type declaration

      • (data: any): Promise<void>
      • Parameters

        • data: any

          The data to be stored.

        Returns Promise<void>

        A promise that resolves when the data has been stored.

    This method measures the time taken to store the data and logs it to the console if debugging is enabled.

    store: LocalForage

    LocalForage instance for the storage.

    version: number

    Version of the storage.

    1