Permissions.ts overview
Since v1.0.0
Exports Grouped by Category
errors
PermissionsError (class)
Signature
declare class PermissionsError
Since 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
>
}
Since v1.0.0
layers
layer
A layer that directly interfaces with the navigator.permissions
api
Signature
declare const layer: Layer.Layer<Permissions>
Since v1.0.0
tags
Permissions
Signature
declare const Permissions: Context.Tag<Permissions, Permissions>
Since v1.0.0
type ids
ErrorTypeId
Signature
declare const ErrorTypeId: unique symbol
Since v1.0.0
ErrorTypeId (type alias)
Signature
type ErrorTypeId = typeof ErrorTypeId
Since v1.0.0
TypeId
Signature
declare const TypeId: unique symbol
Since v1.0.0
TypeId (type alias)
Signature
type TypeId = typeof TypeId
Since v1.0.0