Skip to content

WebLocksAPI

Types

lock

type lock = {name: string, mode: lockMode}

Record fields

name
string

lockGrantedCallback

type lockGrantedCallback = lock => Promise.t<JSON.t>

lockInfo

type lockInfo = {
mutable name?: string,
mutable mode?: lockMode,
mutable clientId?: string,
}

Record fields

name
option< string >
mode
option< lockMode >
clientId
option< string >

lockManager

type lockManager = {}

Module

There are methods and helpers defined in LockManager .

lockManagerSnapshot

type lockManagerSnapshot = {
mutable held?: array<lockInfo>,
mutable pending?: array<lockInfo>,
}

Record fields

held
option< array< lockInfo > >
pending
option< array< lockInfo > >

lockMode

type lockMode =
| @as("exclusive") Exclusive
| @as("shared") Shared

lockOptions

type lockOptions = {
mutable mode?: lockMode,
mutable ifAvailable?: bool,
mutable steal?: bool,
mutable signal?: WebAPI.EventAPI.abortSignal,
}

Record fields

mode
option< lockMode >
ifAvailable
option< bool >
steal
option< bool >
signal