mise API - v0.0.0
    Preparing search index...

    Class BrowserStorageProvider

    An in-memory, non-persisting storage provider suitable for browser environments where persistence is managed by the host application (GUI).

    This provider satisfies the IStorageProvider interface but does not store any data persistently. All data is held in-memory and reset when the application (e.g., browser tab) is refreshed.

    It effectively acts as a dummy or passthrough for storage operations, relying on the external environment to provide necessary context.

    Implements

    Index
    • Checks if a path exists in the in-memory store.

      Parameters

      • path: string

        The virtual path to check.

      Returns Promise<boolean>

      A Promise resolving to true if the path exists, false otherwise.

    • Checks if a path represents a "directory" in the in-memory store. For this non-persisting provider, it checks if any keys start with the path as a prefix.

      Parameters

      • path: string

        The virtual path to check.

      Returns Promise<boolean>

      A Promise resolving to true if it appears to be a directory, false otherwise.

    • Creates a "directory" in the in-memory store. For this non-persisting provider, this is a no-op as directories are not physically managed.

      Parameters

      • path: string

        The virtual path of the directory.

      • Optionaloptions: { recursive?: boolean }

        Optional recursive creation (ignored).

      Returns Promise<void>

      A Promise that resolves when the operation is complete.

    • Reads data associated with a path from the in-memory store.

      Parameters

      • path: string

        The virtual path of the data.

      Returns Promise<string | null>

      A Promise resolving to the data string or null if not found.

    • Reads the contents of a "directory" in the in-memory store. For this non-persisting provider, it simulates by returning keys that start with the path prefix. This is a simplified simulation and does not represent a true filesystem.

      Parameters

      • path: string

        The virtual path of the directory.

      Returns Promise<string[]>

      A Promise resolving to an array of file/directory names within the path.

    • Removes data associated with a path from the in-memory store.

      Parameters

      • path: string

        The virtual path to remove.

      Returns Promise<void>

      A Promise that resolves when the operation is complete.

    • Writes data to the in-memory store associated with a path.

      Parameters

      • path: string

        The virtual path to write to.

      • data: string

        The string data to write.

      Returns Promise<void>

      A Promise that resolves when the operation is complete.