microsoft / TypeScript-DOM-lib-generator

Tool for generating dom related TypeScript and JavaScript library files
Apache License 2.0
600 stars 417 forks source link

Make Navigator.canShare and Navigator.share methods optional #1748

Closed rjimenezda closed 1 week ago

rjimenezda commented 1 week ago

Hi!

I've recently worked with navigator.share and navigator.canShare and have noticed that the types report them as non-optional.

I saw #837 where it's stated that the w3c says they are non-optional, but the truth is that most desktop browsers do not implement them and are only supported on secure contexts, so they can be undefined in certain cases.

I'm not sure if there's something else that should be changed, let me know.

github-actions[bot] commented 1 week ago

Thanks for the PR!

This section of the codebase is owned by @saschanaz - if they write a comment saying "LGTM" then it will be merged.

chemitaxis commented 1 week ago

Good job @rjimenezda LGTM!

github-actions[bot] commented 1 week ago

Sorry @chemitaxis, you don't have access to these files:

rjimenezda commented 1 week ago

@microsoft-github-policy-service agree company="Genially"

saschanaz commented 1 week ago

As stated in #1486 I'd rather not do this only for this specific API. We could make any not-supported-everywhere things as optional but such breaking change needs agreement from TS team. Discussion can go on in #1486.

rjimenezda commented 1 week ago

Fair enough, I'll close it then.