@nextcloud/dialogs
    Preparing search index...

    Interface LockManager

    The LockManager interface of the Web Locks API provides methods for requesting a new Lock object and querying for an existing Lock object. To get an instance of LockManager, call navigator.locks. Available only in secure contexts.

    MDN Reference

    interface LockManager {
        query(): Promise<LockManagerSnapshot>;
        request<T>(
            name: string,
            callback: LockGrantedCallback<T>,
        ): Promise<Awaited<T>>;
        request<T>(
            name: string,
            options: LockOptions,
            callback: LockGrantedCallback<T>,
        ): Promise<Awaited<T>>;
    }
    Index

    Methods

    Methods

    • The query() method of the LockManager interface returns a Promise that resolves with an object containing information about held and pending locks.

      MDN Reference

      Returns Promise<LockManagerSnapshot>

    • The request() method of the LockManager interface requests a Lock object with parameters specifying its name and characteristics. The requested Lock is passed to a callback, while the function itself returns a Promise that resolves (or rejects) with the result of the callback after the lock is released, or rejects if the request is aborted.

      MDN Reference

      Type Parameters

      • T

      Parameters

      Returns Promise<Awaited<T>>

    • Type Parameters

      • T

      Parameters

      Returns Promise<Awaited<T>>