fake-permissions
    Preparing search index...

    Interface User

    A virtual user that can affect the access status of permissions.

    interface User {
        accessRequestCount: (descriptor?: PermissionDescriptor) => number;
        accessRequests: (
            descriptor?: PermissionDescriptor,
        ) => AccessRequestRecord[];
        blockAccess: (descriptor: PermissionDescriptor) => void;
        clearAccessRequests: (descriptor?: PermissionDescriptor) => void;
        grantAccess: (descriptor: PermissionDescriptor) => void;
        resetAccess: (descriptor: PermissionDescriptor) => void;
        setAccessRequestHandler: (handler: HandleAccessRequest) => void;
    }
    Index

    Properties

    accessRequestCount: (descriptor?: PermissionDescriptor) => number

    Get the number of recorded access requests that this user has received.

    If descriptor is provided, only access requests that match the descriptor will be counted. Otherwise, all access requests will be counted.

    Type declaration

    accessRequests: (descriptor?: PermissionDescriptor) => AccessRequestRecord[]

    Get snapshot records of access requests that this user has received.

    The access request records returned are a snapshot of the access requests received as of now. They are not live records, and will not be updated if the access request is completed later. To get a fresh snapshot of the access requests, call this method again.

    If descriptor is provided, only access requests that match the descriptor will be returned. Otherwise, all access requests will be returned.

    Type declaration

    blockAccess: (descriptor: PermissionDescriptor) => void

    Block access to a permission.

    This is equivalent to manually blocking access to a permission via the browser's permission settings. Calling this method will immediately set the permission's access status to "BLOCKED".

    Type declaration

    clearAccessRequests: (descriptor?: PermissionDescriptor) => void

    Clear recorded access requests that this user has received.

    If descriptor is provided, only access requests that match the descriptor will be cleared. Otherwise, all access requests will be cleared.

    Type declaration

    grantAccess: (descriptor: PermissionDescriptor) => void

    Grant access to a permission.

    This is equivalent to manually allowing access to a permission via the browser's permission settings. Calling this method will immediately set the permission's access status to "GRANTED".

    Type declaration

    resetAccess: (descriptor: PermissionDescriptor) => void

    Reset access to a permission.

    This is equivalent to manually resetting access to a permission via the browser's permission settings. Calling this method will immediately set the permission's access status to "PROMPT".

    Type declaration

    setAccessRequestHandler: (handler: HandleAccessRequest) => void

    Change the handler used for permission access requests.

    Type declaration