Permissions overview
Added in v1.0.0
Table of contents
errors
PermissionsError (class)
Signature
export declare class PermissionsError
Added in v1.0.0
interface
Permissions (interface)
Wrapper on the Permission API (navigator.permissions
) with methods for querying status of permissions.
Signature
export interface Permissions {
readonly [TypeId]: TypeId
/**
* Returns the state of a user permission on the global scope.
*/
readonly query: <Name extends PermissionName>(
name: Name
) => Effect.Effect<
// `name` is identical to the name passed to Permissions.query
// https://developer.mozilla.org/en-US/docs/Web/API/PermissionStatus
Omit<PermissionStatus, "name"> & { name: Name },
PermissionsError
>
}
Added in v1.0.0
layers
layer
A layer that directly interfaces with the navigator.permissions
api
Signature
export declare const layer: Layer.Layer<Permissions>
Added in v1.0.0
tags
Permissions
Signature
export declare const Permissions: Context.Tag<Permissions, Permissions>
Added in v1.0.0
type ids
ErrorTypeId
Signature
export declare const ErrorTypeId: typeof ErrorTypeId
Added in v1.0.0
ErrorTypeId (type alias)
Signature
export type ErrorTypeId = typeof ErrorTypeId
Added in v1.0.0
TypeId
Signature
export declare const TypeId: typeof TypeId
Added in v1.0.0
TypeId (type alias)
Signature
export type TypeId = typeof TypeId
Added in v1.0.0