Skip to content

Add Web Share types #837

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

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions baselines/dom.generated.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1697,6 +1697,12 @@ interface ShadowRootInit {
mode: ShadowRootMode;
}

interface ShareData {
text?: string;
title?: string;
url?: string;
}

interface SpeechSynthesisErrorEventInit extends SpeechSynthesisEventInit {
error: SpeechSynthesisErrorCode;
}
Expand Down Expand Up @@ -10727,6 +10733,7 @@ interface Navigator extends MSFileSaver, MSNavigatorDoNotTrack, NavigatorAutomat
msLaunchUri(uri: string, successCallback?: MSLaunchUriCallback, noHandlerCallback?: MSLaunchUriCallback): void;
requestMediaKeySystemAccess(keySystem: string, supportedConfigurations: MediaKeySystemConfiguration[]): Promise<MediaKeySystemAccess>;
sendBeacon(url: string, data?: BodyInit | null): boolean;
share(data?: ShareData): Promise<void>;
vibrate(pattern: number | number[]): boolean;
}

Expand Down
9 changes: 9 additions & 0 deletions inputfiles/idl/Web Share.widl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
partial interface Navigator {
[SecureContext] Promise<void> share(optional ShareData data = {});
};

dictionary ShareData {
USVString title;
USVString text;
USVString url;
};
4 changes: 4 additions & 0 deletions inputfiles/idlSources.json
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,10 @@
"url": "https://w3c.github.io/webrtc-pc/",
"title": "WebRTC"
},
{
"url": "https://www.w3.org/TR/web-share/",
"title": "Web Share"
},
{
"url": "https://w3c.github.io/speech-api/",
"title": "Web Speech API"
Expand Down