Skip to content

Commit 257fafa

Browse files
committed
0.4.6
1 parent 33e2e0f commit 257fafa

File tree

5 files changed

+101
-1
lines changed

5 files changed

+101
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,8 @@ The type declarations in this repository include the following specifications (g
116116
- [DeviceOrientation Events](https://w3c.github.io/deviceorientation/)
117117
- [Image Resource](https://w3c.github.io/image-resource/)
118118
- [Long Tasks API](https://w3c.github.io/longtasks/)
119+
- [Region Capture](https://w3c.github.io/mediacapture-region/)
120+
- [Screen Capture](https://w3c.github.io/mediacapture-screen-share/)
119121
- [MediaStream Image Capture](https://w3c.github.io/mediacapture-image/)
120122
- [MediaStream Recording](https://w3c.github.io/mediacapture-record/)
121123
- [Permissions Registry](https://w3c.github.io/permissions-registry/)

index.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
/// <reference path="./w3c/device-orientation.d.ts" />
3434
/// <reference path="./w3c/image-resource.d.ts" />
3535
/// <reference path="./w3c/long-tasks.d.ts" />
36+
/// <reference path="./w3c/mediacapture-region.d.ts" />
37+
/// <reference path="./w3c/mediacapture-screen-share.d.ts" />
3638
/// <reference path="./w3c/mediastream-image-capture-global.d.ts" />
3739
/// <reference path="./w3c/mediastream-image-capture.d.ts" />
3840
/// <reference path="./w3c/mediastream-recording.d.ts" />

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "new-javascript",
3-
"version": "0.4.5",
3+
"version": "0.4.6",
44
"description": "TypeScript type definitions for new JavaScript stuff that isn't yet in TypeScript's standard type definitions",
55
"main": "./index.d.ts",
66
"repository": {

w3c/mediacapture-region.d.ts

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
// Region Capture
3+
// Specification: https://w3c.github.io/mediacapture-region/
4+
// Repository: https://github.com/w3c/mediacapture-region
5+
6+
interface CropTarget { }
7+
8+
declare var CropTarget: {
9+
prototype: CropTarget;
10+
fromElement(element: Element): Promise<CropTarget>;
11+
};
12+
13+
interface BrowserCaptureMediaStreamTrack {
14+
cropTo(cropTarget?: CropTarget): Promise<void>;
15+
clone(): BrowserCaptureMediaStreamTrack;
16+
}
17+
18+
declare var BrowserCaptureMediaStreamTrack: {
19+
prototype: BrowserCaptureMediaStreamTrack;
20+
};
21+
22+
// intentionally the wrong way round since per lib.dom.d.ts, MediaStream.prototype.getVideoTracks() always returns returns MediaStreamTrack[]
23+
interface MediaStreamTrack extends BrowserCaptureMediaStreamTrack { }

w3c/mediacapture-screen-share.d.ts

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
2+
// Screen Capture
3+
// Specification: https://w3c.github.io/mediacapture-screen-share/
4+
// Repository: https://github.com/w3c/mediacapture-screen-share
5+
6+
interface DisplayMediaStreamOptions {
7+
controller?: CaptureController;
8+
selfBrowserSurface?: SelfCapturePreferenceEnum;
9+
systemAudio?: SystemAudioPreferenceEnum;
10+
surfaceSwitching?: SurfaceSwitchingPreferenceEnum;
11+
monitorTypeSurfaces?: MonitorTypeSurfacesEnum;
12+
}
13+
14+
interface MediaTrackSupportedConstraints {
15+
logicalSurface?: boolean;
16+
cursor?: boolean;
17+
restrictOwnAudio?: boolean;
18+
suppressLocalAudioPlayback?: boolean;
19+
}
20+
21+
interface MediaTrackConstraintSet {
22+
logicalSurface?: ConstrainBoolean;
23+
cursor?: ConstrainDOMString;
24+
restrictOwnAudio?: ConstrainBoolean;
25+
suppressLocalAudioPlayback?: ConstrainBoolean;
26+
}
27+
28+
interface MediaTrackSettings {
29+
logicalSurface?: boolean;
30+
cursor?: boolean;
31+
restrictOwnAudio?: boolean;
32+
suppressLocalAudioPlayback?: boolean;
33+
}
34+
35+
interface MediaTrackCapabilities {
36+
logicalSurface?: boolean;
37+
cursor?: string[],
38+
}
39+
40+
interface CaptureController {
41+
setFocusBehavior(focusBehavior: CaptureStartFocusBehavior): void;
42+
}
43+
44+
type CaptureStartFocusBehavior = (
45+
| "focus-capturing-application"
46+
| "focus-captured-surface"
47+
| "no-focus-change"
48+
);
49+
50+
declare var CaptureController: {
51+
prototype: CaptureController;
52+
new(): CaptureController;
53+
}
54+
55+
type SelfCapturePreferenceEnum = (
56+
| "include"
57+
| "exclude"
58+
);
59+
60+
type SystemAudioPreferenceEnum = (
61+
| "include"
62+
| "exclude"
63+
);
64+
65+
type SurfaceSwitchingPreferenceEnum = (
66+
| "include"
67+
| "exclude"
68+
);
69+
70+
type MonitorTypeSurfacesEnum = (
71+
| "include"
72+
| "exclude"
73+
);

0 commit comments

Comments
 (0)