Skip to main content Link Search Menu Expand Document (external link)

Permissions.ts overview

Since v1.0.0


Exports Grouped by Category


errors

PermissionsError (class)

Signature

declare class PermissionsError

Source

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
  >
}

Source

Since v1.0.0

layers

layer

A layer that directly interfaces with the navigator.permissions api

Signature

declare const layer: Layer.Layer<Permissions>

Source

Since v1.0.0

tags

Permissions

Signature

declare const Permissions: Context.Tag<Permissions, Permissions>

Source

Since v1.0.0

type ids

ErrorTypeId

Signature

declare const ErrorTypeId: unique symbol

Source

Since v1.0.0

ErrorTypeId (type alias)

Signature

type ErrorTypeId = typeof ErrorTypeId

Source

Since v1.0.0

TypeId

Signature

declare const TypeId: unique symbol

Source

Since v1.0.0

TypeId (type alias)

Signature

type TypeId = typeof TypeId

Source

Since v1.0.0