Skip to content

Commit

Permalink
0.4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminAster committed Jul 22, 2024
1 parent 33e2e0f commit 257fafa
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ The type declarations in this repository include the following specifications (g
- [DeviceOrientation Events](https://w3c.github.io/deviceorientation/)
- [Image Resource](https://w3c.github.io/image-resource/)
- [Long Tasks API](https://w3c.github.io/longtasks/)
- [Region Capture](https://w3c.github.io/mediacapture-region/)
- [Screen Capture](https://w3c.github.io/mediacapture-screen-share/)
- [MediaStream Image Capture](https://w3c.github.io/mediacapture-image/)
- [MediaStream Recording](https://w3c.github.io/mediacapture-record/)
- [Permissions Registry](https://w3c.github.io/permissions-registry/)
Expand Down
2 changes: 2 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
/// <reference path="./w3c/device-orientation.d.ts" />
/// <reference path="./w3c/image-resource.d.ts" />
/// <reference path="./w3c/long-tasks.d.ts" />
/// <reference path="./w3c/mediacapture-region.d.ts" />
/// <reference path="./w3c/mediacapture-screen-share.d.ts" />
/// <reference path="./w3c/mediastream-image-capture-global.d.ts" />
/// <reference path="./w3c/mediastream-image-capture.d.ts" />
/// <reference path="./w3c/mediastream-recording.d.ts" />
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "new-javascript",
"version": "0.4.5",
"version": "0.4.6",
"description": "TypeScript type definitions for new JavaScript stuff that isn't yet in TypeScript's standard type definitions",
"main": "./index.d.ts",
"repository": {
Expand Down
23 changes: 23 additions & 0 deletions w3c/mediacapture-region.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

// Region Capture
// Specification: https://w3c.github.io/mediacapture-region/
// Repository: https://github.com/w3c/mediacapture-region

interface CropTarget { }

declare var CropTarget: {
prototype: CropTarget;
fromElement(element: Element): Promise<CropTarget>;
};

interface BrowserCaptureMediaStreamTrack {
cropTo(cropTarget?: CropTarget): Promise<void>;
clone(): BrowserCaptureMediaStreamTrack;
}

declare var BrowserCaptureMediaStreamTrack: {
prototype: BrowserCaptureMediaStreamTrack;
};

// intentionally the wrong way round since per lib.dom.d.ts, MediaStream.prototype.getVideoTracks() always returns returns MediaStreamTrack[]
interface MediaStreamTrack extends BrowserCaptureMediaStreamTrack { }
73 changes: 73 additions & 0 deletions w3c/mediacapture-screen-share.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@

// Screen Capture
// Specification: https://w3c.github.io/mediacapture-screen-share/
// Repository: https://github.com/w3c/mediacapture-screen-share

interface DisplayMediaStreamOptions {
controller?: CaptureController;
selfBrowserSurface?: SelfCapturePreferenceEnum;
systemAudio?: SystemAudioPreferenceEnum;
surfaceSwitching?: SurfaceSwitchingPreferenceEnum;
monitorTypeSurfaces?: MonitorTypeSurfacesEnum;
}

interface MediaTrackSupportedConstraints {
logicalSurface?: boolean;
cursor?: boolean;
restrictOwnAudio?: boolean;
suppressLocalAudioPlayback?: boolean;
}

interface MediaTrackConstraintSet {
logicalSurface?: ConstrainBoolean;
cursor?: ConstrainDOMString;
restrictOwnAudio?: ConstrainBoolean;
suppressLocalAudioPlayback?: ConstrainBoolean;
}

interface MediaTrackSettings {
logicalSurface?: boolean;
cursor?: boolean;
restrictOwnAudio?: boolean;
suppressLocalAudioPlayback?: boolean;
}

interface MediaTrackCapabilities {
logicalSurface?: boolean;
cursor?: string[],
}

interface CaptureController {
setFocusBehavior(focusBehavior: CaptureStartFocusBehavior): void;
}

type CaptureStartFocusBehavior = (
| "focus-capturing-application"
| "focus-captured-surface"
| "no-focus-change"
);

declare var CaptureController: {
prototype: CaptureController;
new(): CaptureController;
}

type SelfCapturePreferenceEnum = (
| "include"
| "exclude"
);

type SystemAudioPreferenceEnum = (
| "include"
| "exclude"
);

type SurfaceSwitchingPreferenceEnum = (
| "include"
| "exclude"
);

type MonitorTypeSurfacesEnum = (
| "include"
| "exclude"
);

0 comments on commit 257fafa

Please sign in to comment.