@nextcloud/dialogs
    Preparing search index...

    Interface StorageManager

    The StorageManager interface of the Storage API provides an interface for managing persistence permissions and estimating available storage. You can get a reference to this interface using either navigator.storage or WorkerNavigator.storage. Available only in secure contexts.

    MDN Reference

    interface StorageManager {
        estimate(): Promise<StorageEstimate>;
        getDirectory(): Promise<FileSystemDirectoryHandle>;
        persist(): Promise<boolean>;
        persisted(): Promise<boolean>;
    }
    Index

    Methods

    • The estimate() method of the StorageManager interface asks the Storage Manager for how much storage the current origin takes up (usage), and how much space is available (quota).

      MDN Reference

      Returns Promise<StorageEstimate>

    • The getDirectory() method of the StorageManager interface is used to obtain a reference to a FileSystemDirectoryHandle object allowing access to a directory and its contents, stored in the origin private file system (OPFS).

      MDN Reference

      Returns Promise<FileSystemDirectoryHandle>

    • The persist() method of the StorageManager interface requests permission to use persistent storage, and returns a Promise that resolves to true if permission is granted and bucket mode is persistent, and false otherwise. The browser may or may not honor the request, depending on browser-specific rules. (For more details, see the guide to Storage quotas and eviction criteria.)

      MDN Reference

      Returns Promise<boolean>

    • The persisted() method of the StorageManager interface returns a Promise that resolves to true if your site's storage bucket is persistent.

      MDN Reference

      Returns Promise<boolean>