@@ -120,6 +120,11 @@ interface DOMRectInit {
120
120
y ?: number ;
121
121
}
122
122
123
+ interface DevicePermissionDescriptor extends PermissionDescriptor {
124
+ deviceId ?: string ;
125
+ name : "camera" | "microphone" | "speaker" ;
126
+ }
127
+
123
128
interface EcKeyGenParams extends Algorithm {
124
129
namedCurve : NamedCurve ;
125
130
}
@@ -243,6 +248,11 @@ interface MessageEventInit extends EventInit {
243
248
source ?: MessageEventSource | null ;
244
249
}
245
250
251
+ interface MidiPermissionDescriptor extends PermissionDescriptor {
252
+ name : "midi" ;
253
+ sysex ?: boolean ;
254
+ }
255
+
246
256
interface NavigationPreloadState {
247
257
enabled ?: boolean ;
248
258
headerValue ?: string ;
@@ -287,6 +297,10 @@ interface PerformanceObserverInit {
287
297
entryTypes : string [ ] ;
288
298
}
289
299
300
+ interface PermissionDescriptor {
301
+ name : PermissionName ;
302
+ }
303
+
290
304
interface PipeOptions {
291
305
preventAbort ?: boolean ;
292
306
preventCancel ?: boolean ;
@@ -308,6 +322,11 @@ interface PushEventInit extends ExtendableEventInit {
308
322
data ?: PushMessageDataInit ;
309
323
}
310
324
325
+ interface PushPermissionDescriptor extends PermissionDescriptor {
326
+ name : "push" ;
327
+ userVisibleOnly ?: boolean ;
328
+ }
329
+
311
330
interface PushSubscriptionChangeInit extends ExtendableEventInit {
312
331
newSubscription ?: PushSubscription ;
313
332
oldSubscription ?: PushSubscription ;
@@ -2332,6 +2351,33 @@ declare var PerformanceResourceTiming: {
2332
2351
new ( ) : PerformanceResourceTiming ;
2333
2352
} ;
2334
2353
2354
+ interface PermissionStatusEventMap {
2355
+ "change" : Event ;
2356
+ }
2357
+
2358
+ interface PermissionStatus extends EventTarget {
2359
+ onchange : ( ( this : PermissionStatus , ev : Event ) => any ) | null ;
2360
+ readonly state : PermissionState ;
2361
+ addEventListener < K extends keyof PermissionStatusEventMap > ( type : K , listener : ( this : PermissionStatus , ev : PermissionStatusEventMap [ K ] ) => any , options ?: boolean | AddEventListenerOptions ) : void ;
2362
+ addEventListener ( type : string , listener : EventListenerOrEventListenerObject , options ?: boolean | AddEventListenerOptions ) : void ;
2363
+ removeEventListener < K extends keyof PermissionStatusEventMap > ( type : K , listener : ( this : PermissionStatus , ev : PermissionStatusEventMap [ K ] ) => any , options ?: boolean | EventListenerOptions ) : void ;
2364
+ removeEventListener ( type : string , listener : EventListenerOrEventListenerObject , options ?: boolean | EventListenerOptions ) : void ;
2365
+ }
2366
+
2367
+ declare var PermissionStatus : {
2368
+ prototype : PermissionStatus ;
2369
+ new ( ) : PermissionStatus ;
2370
+ } ;
2371
+
2372
+ interface Permissions {
2373
+ query ( permissionDesc : PermissionDescriptor | DevicePermissionDescriptor | MidiPermissionDescriptor | PushPermissionDescriptor ) : Promise < PermissionStatus > ;
2374
+ }
2375
+
2376
+ declare var Permissions : {
2377
+ prototype : Permissions ;
2378
+ new ( ) : Permissions ;
2379
+ } ;
2380
+
2335
2381
/** Events measuring progress of an underlying process, like an HTTP request (for an XMLHttpRequest, or the loading of the underlying resource of an <img>, <audio>, <video>, <style> or <link>). */
2336
2382
interface ProgressEvent extends Event {
2337
2383
readonly lengthComputable : boolean ;
@@ -4078,6 +4124,7 @@ declare var WorkerLocation: {
4078
4124
4079
4125
/** A subset of the Navigator interface allowed to be accessed from a Worker. Such an object is initialized for each worker and is available via the WorkerGlobalScope.navigator property obtained by calling window.self.navigator. */
4080
4126
interface WorkerNavigator extends NavigatorID , NavigatorOnLine , NavigatorBeacon , NavigatorConcurrentHardware , NavigatorStorage {
4127
+ readonly permissions : Permissions ;
4081
4128
readonly serviceWorker : ServiceWorkerContainer ;
4082
4129
}
4083
4130
@@ -4509,6 +4556,8 @@ type KeyType = "public" | "private" | "secret";
4509
4556
type KeyUsage = "encrypt" | "decrypt" | "sign" | "verify" | "deriveKey" | "deriveBits" | "wrapKey" | "unwrapKey" ;
4510
4557
type NotificationDirection = "auto" | "ltr" | "rtl" ;
4511
4558
type NotificationPermission = "default" | "denied" | "granted" ;
4559
+ type PermissionName = "geolocation" | "notifications" | "push" | "midi" | "camera" | "microphone" | "speaker" | "device-info" | "background-sync" | "bluetooth" | "persistent-storage" | "ambient-light-sensor" | "accelerometer" | "gyroscope" | "magnetometer" | "clipboard" ;
4560
+ type PermissionState = "granted" | "denied" | "prompt" ;
4512
4561
type PushEncryptionKeyName = "p256dh" | "auth" ;
4513
4562
type PushPermissionState = "denied" | "granted" | "prompt" ;
4514
4563
type ReferrerPolicy = "" | "no-referrer" | "no-referrer-when-downgrade" | "same-origin" | "origin" | "strict-origin" | "origin-when-cross-origin" | "strict-origin-when-cross-origin" | "unsafe-url" ;
0 commit comments