-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Property 'permissions' does not exist on type 'Navigator' #24923
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The Permissions API is quite in draft status at the moment. It may not make sense to add this, as it is only supported by Chrome-based and Firefox. Adding these yourself should be possible. The API isn't even listed on Edge platform status, and the Chrome status indicates it is just a working draft. |
|
Recently the TS team have merged several draft-status web features into lib.d.ts because future migration to lib.d.ts from DefinitelyTyped packages can be annoying. Read more at #18480 (comment) for the previous discussion. In this case, IMO it can be added to lib.d.ts as the official spec exists and multiple major vendors provide their implementations. |
We also created types for the You can check it on
Feedback is welcome. Update: it was removed from |
@vargavince91 very good job ! Query : Revoke : |
Oh thank you for pointing this out, I'm going to submit a merge request today with the fixes |
@vargavince91 Super nice that you wrote types for it! Do you may also have types for navigator.clipboard? |
I have the same problem, but in some computers (maybe fault of node version) don't recognize the return (navigator as any).permissions.query({
name: 'geolocation'
}).then((permission) => {
console.log(permission);
}); |
@saschanaz or @sandersn I see that these types were updated in the generator, but I dont see them in master am I looking in the wrong place? have they not been released yet? |
@audiolion Take a look in src/lib/dom.generated.d.ts instead. lib/ has the built library files in it, generated by running --LKG if I remember correctly. |
@sandersn sorry for the naïveté, but I dont see src/lib/dom.generated.d.ts in this repo, I see it in the TSJS-lib-generator one, I thought it somehow got translated over here by running the generator? hah. I guess my main issue is that using typescript 3.4.5 (current latest), I cant seem to find those new |
for googling: |
TypeScript Version:
2.7.2
Search Terms:
Property 'permissions' does not exist on type 'Navigator'
Code
Expected behavior:
navigator.permissions
should be definedActual behavior:
navigator.permissions
does not exist.Playground Link:
https://goo.gl/5ckgwD
Related Issues:
#16246
The text was updated successfully, but these errors were encountered: