Skip to content

Commit ee941b3

Browse files
committed
Add augmentable PermissionNameMap
1 parent 2d110ad commit ee941b3

7 files changed

+104
-25
lines changed

baselines/audioworklet.generated.d.ts

+9
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ interface MessageEventInit<T = any> extends EventInit {
3838
source?: MessageEventSource | null;
3939
}
4040

41+
interface PermissionNameMap {
42+
"persistent-storage": "persistent-storage";
43+
"screen-wake-lock": "screen-wake-lock";
44+
"xr-spatial-tracking": "xr-spatial-tracking";
45+
geolocation: "geolocation";
46+
notifications: "notifications";
47+
push: "push";
48+
}
49+
4150
interface PromiseRejectionEventInit extends EventInit {
4251
promise: Promise<any>;
4352
reason?: any;

baselines/dom.generated.d.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -1161,6 +1161,15 @@ interface PermissionDescriptor {
11611161
name: PermissionName;
11621162
}
11631163

1164+
interface PermissionNameMap {
1165+
"persistent-storage": "persistent-storage";
1166+
"screen-wake-lock": "screen-wake-lock";
1167+
"xr-spatial-tracking": "xr-spatial-tracking";
1168+
geolocation: "geolocation";
1169+
notifications: "notifications";
1170+
push: "push";
1171+
}
1172+
11641173
interface PictureInPictureEventInit extends EventInit {
11651174
pictureInPictureWindow: PictureInPictureWindow;
11661175
}
@@ -27977,6 +27986,7 @@ type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmap
2797727986
type OnBeforeUnloadEventHandler = OnBeforeUnloadEventHandlerNonNull | null;
2797827987
type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
2797927988
type PerformanceEntryList = PerformanceEntry[];
27989+
type PermissionName = keyof PermissionNameMap;
2798027990
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
2798127991
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
2798227992
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
@@ -28087,7 +28097,6 @@ type OscillatorType = "custom" | "sawtooth" | "sine" | "square" | "triangle";
2808728097
type OverSampleType = "2x" | "4x" | "none";
2808828098
type PanningModelType = "HRTF" | "equalpower";
2808928099
type PaymentComplete = "fail" | "success" | "unknown";
28090-
type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking";
2809128100
type PermissionState = "denied" | "granted" | "prompt";
2809228101
type PlaybackDirection = "alternate" | "alternate-reverse" | "normal" | "reverse";
2809328102
type PositionAlignSetting = "auto" | "center" | "line-left" | "line-right";

baselines/serviceworker.generated.d.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,15 @@ interface PermissionDescriptor {
451451
name: PermissionName;
452452
}
453453

454+
interface PermissionNameMap {
455+
"persistent-storage": "persistent-storage";
456+
"screen-wake-lock": "screen-wake-lock";
457+
"xr-spatial-tracking": "xr-spatial-tracking";
458+
geolocation: "geolocation";
459+
notifications: "notifications";
460+
push: "push";
461+
}
462+
454463
interface ProgressEventInit extends EventInit {
455464
lengthComputable?: boolean;
456465
loaded?: number;
@@ -8532,6 +8541,7 @@ type NamedCurve = string;
85328541
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
85338542
type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
85348543
type PerformanceEntryList = PerformanceEntry[];
8544+
type PermissionName = keyof PermissionNameMap;
85358545
type PushMessageDataInit = BufferSource | string;
85368546
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
85378547
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
@@ -8585,7 +8595,6 @@ type MediaEncodingType = "record" | "webrtc";
85858595
type NotificationDirection = "auto" | "ltr" | "rtl";
85868596
type NotificationPermission = "default" | "denied" | "granted";
85878597
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "webgpu";
8588-
type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking";
85898598
type PermissionState = "denied" | "granted" | "prompt";
85908599
type PredefinedColorSpace = "display-p3" | "srgb";
85918600
type PremultiplyAlpha = "default" | "none" | "premultiply";

baselines/sharedworker.generated.d.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,15 @@ interface PermissionDescriptor {
421421
name: PermissionName;
422422
}
423423

424+
interface PermissionNameMap {
425+
"persistent-storage": "persistent-storage";
426+
"screen-wake-lock": "screen-wake-lock";
427+
"xr-spatial-tracking": "xr-spatial-tracking";
428+
geolocation: "geolocation";
429+
notifications: "notifications";
430+
push: "push";
431+
}
432+
424433
interface ProgressEventInit extends EventInit {
425434
lengthComputable?: boolean;
426435
loaded?: number;
@@ -8541,6 +8550,7 @@ type NamedCurve = string;
85418550
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
85428551
type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
85438552
type PerformanceEntryList = PerformanceEntry[];
8553+
type PermissionName = keyof PermissionNameMap;
85448554
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
85458555
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
85468556
type ReadableStreamReader<T> = ReadableStreamDefaultReader<T> | ReadableStreamBYOBReader;
@@ -8591,7 +8601,6 @@ type MediaEncodingType = "record" | "webrtc";
85918601
type NotificationDirection = "auto" | "ltr" | "rtl";
85928602
type NotificationPermission = "default" | "denied" | "granted";
85938603
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "webgpu";
8594-
type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking";
85958604
type PermissionState = "denied" | "granted" | "prompt";
85968605
type PredefinedColorSpace = "display-p3" | "srgb";
85978606
type PremultiplyAlpha = "default" | "none" | "premultiply";

baselines/webworker.generated.d.ts

+10-1
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,15 @@ interface PermissionDescriptor {
470470
name: PermissionName;
471471
}
472472

473+
interface PermissionNameMap {
474+
"persistent-storage": "persistent-storage";
475+
"screen-wake-lock": "screen-wake-lock";
476+
"xr-spatial-tracking": "xr-spatial-tracking";
477+
geolocation: "geolocation";
478+
notifications: "notifications";
479+
push: "push";
480+
}
481+
473482
interface PlaneLayout {
474483
offset: number;
475484
stride: number;
@@ -9213,6 +9222,7 @@ type NamedCurve = string;
92139222
type OffscreenRenderingContext = OffscreenCanvasRenderingContext2D | ImageBitmapRenderingContext | WebGLRenderingContext | WebGL2RenderingContext;
92149223
type OnErrorEventHandler = OnErrorEventHandlerNonNull | null;
92159224
type PerformanceEntryList = PerformanceEntry[];
9225+
type PermissionName = keyof PermissionNameMap;
92169226
type PushMessageDataInit = BufferSource | string;
92179227
type ReadableStreamController<T> = ReadableStreamDefaultController<T> | ReadableByteStreamController;
92189228
type ReadableStreamReadResult<T> = ReadableStreamReadValueResult<T> | ReadableStreamReadDoneResult<T>;
@@ -9272,7 +9282,6 @@ type MediaEncodingType = "record" | "webrtc";
92729282
type NotificationDirection = "auto" | "ltr" | "rtl";
92739283
type NotificationPermission = "default" | "denied" | "granted";
92749284
type OffscreenRenderingContextId = "2d" | "bitmaprenderer" | "webgl" | "webgl2" | "webgpu";
9275-
type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking";
92769285
type PermissionState = "denied" | "granted" | "prompt";
92779286
type PredefinedColorSpace = "display-p3" | "srgb";
92789287
type PremultiplyAlpha = "default" | "none" | "premultiply";

inputfiles/addedTypes.jsonc

+52-21
Original file line numberDiff line numberDiff line change
@@ -331,27 +331,6 @@
331331
"color",
332332
"luminosity"
333333
]
334-
},
335-
"PermissionName": {
336-
"name": "PermissionName",
337-
// This is a subset of the permissions defined in the spec:
338-
// https://w3c.github.io/powerful-features-registry/#registry-table-of-powerful-features
339-
// Please add a feature only when it's supported by multiple engines.
340-
"value": [
341-
// https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API#browser_compatibility
342-
"geolocation",
343-
// https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API#browser_compatibility
344-
"notifications",
345-
// https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#browser_compatibility
346-
"persistent-storage",
347-
// https://developer.mozilla.org/en-US/docs/Web/API/Push_API#browser_compatibility
348-
"push",
349-
// https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API#browser_compatibility
350-
"screen-wake-lock",
351-
// WebXR is also actually Blink-only
352-
// https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API#browser_compatibility
353-
"xr-spatial-tracking"
354-
]
355334
}
356335
}
357336
},
@@ -1312,6 +1291,54 @@
13121291
}
13131292
}
13141293
}
1294+
},
1295+
// This is a subset of the permissions defined in the spec:
1296+
// https://w3c.github.io/powerful-features-registry/#registry-table-of-powerful-features
1297+
// Please add a feature only when it's supported by multiple engines.,
1298+
"PermissionNameMap": {
1299+
"name": "PermissionNameMap",
1300+
"exposed": "Window Worker Worklet",
1301+
"members": {
1302+
"member": {
1303+
// https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API#browser_compatibility
1304+
"geolocation": {
1305+
"name": "geolocation",
1306+
"overrideType": "\"geolocation\"",
1307+
"required": 1
1308+
},
1309+
// https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API#browser_compatibility
1310+
"notifications": {
1311+
"name": "notifications",
1312+
"overrideType": "\"notifications\"",
1313+
"required": 1
1314+
},
1315+
// https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#browser_compatibility
1316+
"\"persistent-storage\"": {
1317+
"name": "\"persistent-storage\"",
1318+
"overrideType": "\"persistent-storage\"",
1319+
"required": 1
1320+
},
1321+
// https://developer.mozilla.org/en-US/docs/Web/API/Push_API#browser_compatibility
1322+
"push": {
1323+
"name": "push",
1324+
"overrideType": "\"push\"",
1325+
"required": 1
1326+
},
1327+
// https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API#browser_compatibility
1328+
"\"screen-wake-lock\"": {
1329+
"name": "\"screen-wake-lock\"",
1330+
"overrideType": "\"screen-wake-lock\"",
1331+
"required": 1
1332+
},
1333+
// WebXR is also actually Blink-only
1334+
// https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API#browser_compatibility
1335+
"\"xr-spatial-tracking\"": {
1336+
"name": "\"xr-spatial-tracking\"",
1337+
"overrideType": "\"xr-spatial-tracking\"",
1338+
"required": 1
1339+
}
1340+
}
1341+
}
13151342
}
13161343
}
13171344
},
@@ -1422,6 +1449,10 @@
14221449
{
14231450
"name": "EventListenerOrEventListenerObject",
14241451
"overrideType": "EventListener | EventListenerObject"
1452+
},
1453+
{
1454+
"name": "PermissionName",
1455+
"overrideType": "keyof PermissionNameMap"
14251456
}
14261457
]
14271458
}

inputfiles/knownTypes.json

+3
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"Keyframe",
3030
"MutationRecordType",
3131
"NamedCurve",
32+
"PermissionNameMap",
3233
"Pbkdf2Params",
3334
"PropertyIndexedKeyframes",
3435
"RsaHashedImportParams",
@@ -75,6 +76,7 @@
7576
"ImageBitmapRenderingContextSettings",
7677
"ImportMeta",
7778
"NamedCurve",
79+
"PermissionNameMap",
7880
"Pbkdf2Params",
7981
"RsaHashedImportParams",
8082
"RsaHashedKeyGenParams",
@@ -86,6 +88,7 @@
8688
],
8789
"Worklet": [
8890
"EventListenerOrEventListenerObject",
91+
"PermissionNameMap",
8992
"Transferable",
9093
"ValueTypeMap"
9194
]

0 commit comments

Comments
 (0)