/** * An observer for permission state changes. */ export interface PermissionObserver { /** * Wait for the permission state to change to one of the specified states. * * @param stateOrStates - The desired permission state(s). * @param task - 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 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. * @throws A {@link TypeError} if no states are provided. */ waitForState: (stateOrStates: PermissionState | PermissionState[], task?: () => Promise) => Promise; } /** * Create an observer for a permission. * * @param permissions - The Permissions API to use. * @param descriptor - A descriptor of the permission to observe. * * @returns An observer for the permission. */ export declare function createPermissionObserver(permissions: Permissions, descriptor: PermissionDescriptor): PermissionObserver;