-
Notifications
You must be signed in to change notification settings - Fork 456
Closed
Description
Description
Existing type PermissionName is missing "midi", actual type:
type PermissionName = "geolocation" | "notifications" | "persistent-storage" | "push" | "screen-wake-lock" | "xr-spatial-tracking";
According to MDN documentation, "midi" value is supported by at least 3 browser engines.
Solution
Add "midi" to PermissionName type here:
TypeScript-DOM-lib-generator/inputfiles/addedTypes.jsonc
Lines 335 to 354 in 2939d4f
| "PermissionName": { | |
| "name": "PermissionName", | |
| // This is a subset of the permissions defined in the spec: | |
| // https://w3c.github.io/powerful-features-registry/#registry-table-of-powerful-features | |
| // Please add a feature only when it's supported by multiple engines. | |
| "value": [ | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Geolocation_API#browser_compatibility | |
| "geolocation", | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Notifications_API#browser_compatibility | |
| "notifications", | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Storage_API#browser_compatibility | |
| "persistent-storage", | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Push_API#browser_compatibility | |
| "push", | |
| // https://developer.mozilla.org/en-US/docs/Web/API/Screen_Wake_Lock_API#browser_compatibility | |
| "screen-wake-lock", | |
| // WebXR is also actually Blink-only | |
| // https://developer.mozilla.org/en-US/docs/Web/API/WebXR_Device_API#browser_compatibility | |
| "xr-spatial-tracking" | |
| ] |
Typescript version
5.4.5
Workaround
Force type:
navigator.permissions.query({ name: "midi" as PermissionName })
saschanaz
Metadata
Metadata
Assignees
Labels
No labels