web-locks.idl (1292B)
1 // GENERATED CONTENT - DO NOT EDIT 2 // Content was automatically extracted by Reffy into webref 3 // (https://github.com/w3c/webref) 4 // Source: Web Locks API (https://w3c.github.io/web-locks/) 5 6 [SecureContext] 7 interface mixin NavigatorLocks { 8 readonly attribute LockManager locks; 9 }; 10 Navigator includes NavigatorLocks; 11 WorkerNavigator includes NavigatorLocks; 12 13 [SecureContext, Exposed=(Window,Worker,SharedStorageWorklet)] 14 interface LockManager { 15 Promise<any> request(DOMString name, 16 LockGrantedCallback callback); 17 Promise<any> request(DOMString name, 18 LockOptions options, 19 LockGrantedCallback callback); 20 21 Promise<LockManagerSnapshot> query(); 22 }; 23 24 callback LockGrantedCallback = Promise<any> (Lock? lock); 25 26 enum LockMode { "shared", "exclusive" }; 27 28 dictionary LockOptions { 29 LockMode mode = "exclusive"; 30 boolean ifAvailable = false; 31 boolean steal = false; 32 AbortSignal signal; 33 }; 34 35 dictionary LockManagerSnapshot { 36 sequence<LockInfo> held; 37 sequence<LockInfo> pending; 38 }; 39 40 dictionary LockInfo { 41 DOMString name; 42 LockMode mode; 43 DOMString clientId; 44 }; 45 46 [SecureContext, Exposed=(Window,Worker,SharedStorageWorklet)] 47 interface Lock { 48 readonly attribute DOMString name; 49 readonly attribute LockMode mode; 50 };