Skip to content
Effect 4.0 is here. One ecosystem. Zero dependencies.

Permissions

8 exports Since v1.0.0 Source

Errors

Signature

declare class PermissionsError extends any {
constructor();
message: any;
}

Interface

Permissions

interface
Since v1.0.0

Wrapper on the Permission API (navigator.permissions) with methods for querying status of permissions.

Signature

interface Permissions {
readonly [TypeId]: typeof TypeId;
readonly query: <Name extends PermissionName>(name: Name) => Effect<Omit<PermissionStatus, "name"> & {
name: Name;
}, PermissionsError>;
}

Layers

Since v1.0.0

A layer that directly interfaces with the navigator.permissions api

Signature

declare const layer: Layer.Layer<Permissions>

Tags

Signature

declare const Permissions: Tag<Permissions, Permissions>

Type Ids

Signature

declare const ErrorTypeId: unique symbol
Since v1.0.0

Signature

type ErrorTypeId = typeof ErrorTypeId
Since v1.0.0

Signature

declare const TypeId: unique symbol
Since v1.0.0

Signature

type TypeId = typeof TypeId