After being in draft form for a period of time, the permissions API now appears to be well supported. However, TypeScript still throws an error
Property 'permissions' does not exist on type 'Navigator'
when encountering code like:
if (navigator.permissions) {
/* code */
}
or
navigator.permissions.query({name:'geolocation'})
.then((result) => {
/* code */
})
What is the best way to handle this issue in an Angular 7+ application?
Here's a glimpse into my current tsconfig.json
:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": "./",
"outDir": "./dist/out-tsc",
"resolveJsonModule": true,
"sourceMap": true,
"declaration": false,
"module": "es2015",
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"importHelpers": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"types": [
"node"
],
"lib": [
"es2018",
"dom"
]
}
}