Namespace: SpawnDev.SpawnJS.JSObjects
Source: JSObjects/LockManagerState.cs
MDN Reference: LockManagerState on MDN
An object containing a snapshot of the LockManager state. https://developer.mozilla.org/en-US/docs/Web/API/LockManager/query#return_value
| Property | Type | Access | Description |
|---|---|---|---|
LockManagerState |
class |
get | An object containing a snapshot of the LockManager state. https://developer.mozilla.org/en-US/docs/Web/API/LockManager/query#return_value |
Pending |
LockInfo[] |
get |
SpawnDev.SpawnJS Mapping Note: The JavaScript examples below show the standard Web API usage. In SpawnDev.SpawnJS, the same API is available with C# conventions:
- Properties and methods use PascalCase (e.g.,
readyStatebecomesReadyState)- Events use ActionEvent with
+=/-=(e.g.,addEventListener("click", fn)becomesOnClick += handler)- Async methods return
Task<T>instead ofPromise<T>- Objects should be disposed with
usingstatements- Access via
JS.Get<LockManagerState>(...)or constructornew LockManagerState(...)
const state = await navigator.locks.query();
for (const lock of state.held) {
console.log(`held lock: name ${lock.name}, mode ${lock.mode}`);
}
for (const request of state.pending) {
console.log(`requested lock: name ${request.name}, mode ${request.mode}`);
}