fake-permissions
    Preparing search index...

    Interface PermissionObserver

    An observer for permission state changes.

    interface PermissionObserver {
        waitForState: (
            stateOrStates: PermissionState | PermissionState[],
            task?: () => Promise<void>,
        ) => Promise<void>;
    }
    Index

    Properties

    Properties

    waitForState: (
        stateOrStates: PermissionState | PermissionState[],
        task?: () => Promise<void>,
    ) => Promise<void>

    Wait for the permission state to change to one of the specified states.

    Type declaration

      • (
            stateOrStates: PermissionState | PermissionState[],
            task?: () => Promise<void>,
        ): Promise<void>
      • Parameters

        • stateOrStates: PermissionState | PermissionState[]

          The desired permission state(s).

        • Optionaltask: () => Promise<void>

          An optional task to execute while waiting for the state change. You can use this to guarantee that certain actions are performed after observation has started.

        Returns Promise<void>

        A promise that resolves when the permission state matches one of the desired states. If the state is already one of the desired states, the promise resolves immediately.

    A TypeError if no states are provided.