Skip to content

Commit 259df3f

Browse files
author
Orta
authored
Merge pull request #837 from saschanaz/webshare
Add Web Share types
2 parents dd663a8 + 3082ecf commit 259df3f

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

baselines/dom.generated.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1697,6 +1697,12 @@ interface ShadowRootInit {
16971697
mode: ShadowRootMode;
16981698
}
16991699

1700+
interface ShareData {
1701+
text?: string;
1702+
title?: string;
1703+
url?: string;
1704+
}
1705+
17001706
interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit {
17011707
error: SpeechSynthesisErrorCode;
17021708
}
@@ -10733,6 +10739,7 @@ interface Navigator extends MSFileSaver, MSNavigatorDoNotTrack, NavigatorAutomat
1073310739
msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;
1073410740
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise<MediaKeySystemAccess>;
1073510741
sendBeacon(url: string, data?: BodyInit | null): boolean;
10742+
share(data?: ShareData): Promise<void>;
1073610743
vibrate(pattern: number | number[]): boolean;
1073710744
}
1073810745

inputfiles/idl/Web Share.widl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
partial interface Navigator {
2+
[SecureContext] Promise<void> share(optional ShareData data = {});
3+
};
4+
5+
dictionary ShareData {
6+
USVString title;
7+
USVString text;
8+
USVString url;
9+
};

inputfiles/idlSources.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -635,6 +635,10 @@
635635
"url": "https://w3c.github.io/webrtc-pc/",
636636
"title": "WebRTC"
637637
},
638+
{
639+
"url": "https://www.w3.org/TR/web-share/",
640+
"title": "Web Share"
641+
},
638642
{
639643
"url": "https://w3c.github.io/speech-api/",
640644
"title": "Web Speech API"

0 commit comments

Comments
 (0)