Namespace: SpawnDev.SpawnJS.JSObjects
Source: JSObjects/LockInfo.cs
MDN Reference: LockInfo on MDN
LockManager lock info https://developer.mozilla.org/en-US/docs/Web/API/LockManager/query#name
| Property | Type | Access | Description |
|---|---|---|---|
LockInfo |
class |
get | LockManager lock info https://developer.mozilla.org/en-US/docs/Web/API/LockManager/query#name |
Mode |
string |
get/set | |
ClientId |
string |
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<LockInfo>(...)or constructornew LockInfo(...)
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}`);
}