fake-permissions
    Preparing search index...

    Interface PermissionStore

    A store for managing permission access.

    interface PermissionStore {
        getMask: (descriptor: PermissionDescriptor) => PermissionMask;
        getStatus: (descriptor: PermissionDescriptor) => PermissionAccessStatus;
        hasAccess: (descriptor: PermissionDescriptor) => boolean;
        isKnownDescriptor: (descriptor: PermissionDescriptor) => boolean;
        isMatchingDescriptor: (
            a: PermissionDescriptor,
            b: PermissionDescriptor,
        ) => boolean;
        requestAccess: (descriptor: PermissionDescriptor) => Promise<boolean>;
        setAccessRequestHandler: (handler: HandleAccessRequest) => void;
        setStatus: (
            descriptor: PermissionDescriptor,
            status: PermissionAccessStatus,
        ) => void;
        subscribe: (subscriber: PermissionStoreSubscriber) => () => void;
    }
    Index

    Properties

    getMask: (descriptor: PermissionDescriptor) => PermissionMask

    Get the permission mask of a permission.

    Type declaration

    A TypeError if the permission is not known to this store.

    getStatus: (descriptor: PermissionDescriptor) => PermissionAccessStatus

    Get the access status of a permission.

    Type declaration

    A TypeError if the permission is not known to this store.

    hasAccess: (descriptor: PermissionDescriptor) => boolean

    Check whether access to a permission is already allowed, without triggering a permission access request.

    Access is considered allowed if the permission's access status is either "ALLOWED", or "GRANTED".

    Type declaration

    A TypeError if the permission is not known to this store.

    isKnownDescriptor: (descriptor: PermissionDescriptor) => boolean

    Check whether a permission is known to this store.

    Type declaration

    isMatchingDescriptor: (
        a: PermissionDescriptor,
        b: PermissionDescriptor,
    ) => boolean

    Check whether one permission descriptor matches another, according to this store.

    Type declaration

    PermissionStoreParameters.isMatchingDescriptor for how to supply custom matching logic.

    requestAccess: (descriptor: PermissionDescriptor) => Promise<boolean>

    Request access to a permission, triggering a permission access request if necessary.

    If the permission's access status is "PROMPT", this will trigger a permission access request and wait for the result before returning. The result is determined by the current access request handler, which can be changed by calling PermissionStore.setAccessRequestHandler.

    Once any access request is completed, this function will return true if the permission's access status is either "ALLOWED", or "GRANTED".

    Type declaration

    A TypeError if the permission is not known to this store.

    setAccessRequestHandler: (handler: HandleAccessRequest) => void

    Change the handler used for permission access requests.

    Type declaration

    setStatus: (
        descriptor: PermissionDescriptor,
        status: PermissionAccessStatus,
    ) => void

    Set the access status of a permission.

    This will also reset the dismissal count for the permission.

    Type declaration

    A TypeError if the permission is not known to this store.

    subscribe: (subscriber: PermissionStoreSubscriber) => () => void

    Subscribe to changes in permission access statuses.

    Type declaration