react-native-webrtc 124.0.7 → 124.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/settings.local.json +9 -0
- package/.eslintignore +1 -0
- package/CLAUDE.md +714 -0
- package/android/src/main/java/com/oney/WebRTCModule/AbstractVideoCaptureController.java +5 -3
- package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +67 -7
- package/android/src/main/java/com/oney/WebRTCModule/MediaProjectionService.java +24 -3
- package/android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java +4 -4
- package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +8 -0
- package/android/src/main/java/com/oney/WebRTCModule/ThreadUtils.java +8 -0
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +112 -26
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java +56 -28
- package/ios/RCTWebRTC/RCTConvert+WebRTC.m +19 -0
- package/ios/RCTWebRTC/ScreenCapturePickerViewManager.m +22 -23
- package/ios/RCTWebRTC/SerializeUtils.m +6 -0
- package/ios/RCTWebRTC/VideoCaptureController.m +40 -1
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m +16 -9
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.h +2 -0
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +95 -0
- package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +1 -0
- package/lib/commonjs/MediaDevices.js +12 -10
- package/lib/commonjs/MediaDevices.js.map +1 -1
- package/lib/commonjs/MediaStream.js +14 -9
- package/lib/commonjs/MediaStream.js.map +1 -1
- package/lib/commonjs/MediaStreamTrack.js +28 -12
- package/lib/commonjs/MediaStreamTrack.js.map +1 -1
- package/lib/commonjs/MediaStreamTrackEvent.js +2 -2
- package/lib/commonjs/MediaStreamTrackEvent.js.map +1 -1
- package/lib/commonjs/MessageEvent.js +2 -2
- package/lib/commonjs/MessageEvent.js.map +1 -1
- package/lib/commonjs/RTCCertificate.js +25 -0
- package/lib/commonjs/RTCCertificate.js.map +1 -0
- package/lib/commonjs/RTCDataChannel.js +38 -13
- package/lib/commonjs/RTCDataChannel.js.map +1 -1
- package/lib/commonjs/RTCDataChannelEvent.js +2 -2
- package/lib/commonjs/RTCDataChannelEvent.js.map +1 -1
- package/lib/commonjs/RTCErrorEvent.js +2 -2
- package/lib/commonjs/RTCErrorEvent.js.map +1 -1
- package/lib/commonjs/RTCIceCandidateEvent.js +2 -2
- package/lib/commonjs/RTCIceCandidateEvent.js.map +1 -1
- package/lib/commonjs/RTCPeerConnection.js +109 -27
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCRtpEncodingParameters.js +17 -1
- package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/commonjs/RTCTrackEvent.js +2 -2
- package/lib/commonjs/RTCTrackEvent.js.map +1 -1
- package/lib/commonjs/getDisplayMedia.js +2 -1
- package/lib/commonjs/getDisplayMedia.js.map +1 -1
- package/lib/commonjs/index.js +22 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/vendor/event-target-shim/LICENSE +22 -0
- package/lib/commonjs/vendor/event-target-shim/index.d.js +6 -0
- package/lib/commonjs/vendor/event-target-shim/index.d.js.map +1 -0
- package/lib/commonjs/vendor/event-target-shim/index.js +1221 -0
- package/lib/commonjs/vendor/event-target-shim/index.js.map +1 -0
- package/lib/module/MediaDevices.js +11 -9
- package/lib/module/MediaDevices.js.map +1 -1
- package/lib/module/MediaStream.js +13 -8
- package/lib/module/MediaStream.js.map +1 -1
- package/lib/module/MediaStreamTrack.js +25 -9
- package/lib/module/MediaStreamTrack.js.map +1 -1
- package/lib/module/MediaStreamTrackEvent.js +1 -1
- package/lib/module/MediaStreamTrackEvent.js.map +1 -1
- package/lib/module/MessageEvent.js +1 -1
- package/lib/module/MessageEvent.js.map +1 -1
- package/lib/module/RTCCertificate.js +18 -0
- package/lib/module/RTCCertificate.js.map +1 -0
- package/lib/module/RTCDataChannel.js +37 -12
- package/lib/module/RTCDataChannel.js.map +1 -1
- package/lib/module/RTCDataChannelEvent.js +1 -1
- package/lib/module/RTCDataChannelEvent.js.map +1 -1
- package/lib/module/RTCErrorEvent.js +1 -1
- package/lib/module/RTCErrorEvent.js.map +1 -1
- package/lib/module/RTCIceCandidateEvent.js +1 -1
- package/lib/module/RTCIceCandidateEvent.js.map +1 -1
- package/lib/module/RTCPeerConnection.js +103 -21
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCRtpEncodingParameters.js +17 -1
- package/lib/module/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/module/RTCTrackEvent.js +1 -1
- package/lib/module/RTCTrackEvent.js.map +1 -1
- package/lib/module/getDisplayMedia.js +2 -1
- package/lib/module/getDisplayMedia.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/vendor/event-target-shim/LICENSE +22 -0
- package/lib/module/vendor/event-target-shim/index.d.js +52 -0
- package/lib/module/vendor/event-target-shim/index.d.js.map +1 -0
- package/lib/module/vendor/event-target-shim/index.js +1221 -0
- package/lib/module/vendor/event-target-shim/index.js.map +1 -0
- package/lib/typescript/MediaDevices.d.ts +8 -4
- package/lib/typescript/MediaStream.d.ts +5 -1
- package/lib/typescript/MediaStreamTrack.d.ts +7 -1
- package/lib/typescript/MediaStreamTrackEvent.d.ts +1 -1
- package/lib/typescript/MessageEvent.d.ts +1 -1
- package/lib/typescript/RTCCertificate.d.ts +16 -0
- package/lib/typescript/RTCDataChannel.d.ts +13 -1
- package/lib/typescript/RTCDataChannelEvent.d.ts +1 -1
- package/lib/typescript/RTCErrorEvent.d.ts +1 -1
- package/lib/typescript/RTCIceCandidateEvent.d.ts +1 -1
- package/lib/typescript/RTCPeerConnection.d.ts +30 -1
- package/lib/typescript/RTCRtpEncodingParameters.d.ts +4 -0
- package/lib/typescript/RTCTrackEvent.d.ts +1 -1
- package/lib/typescript/getDisplayMedia.d.ts +7 -1
- package/lib/typescript/index.d.ts +4 -1
- package/package.json +2 -3
- package/src/MediaDevices.ts +15 -14
- package/src/MediaStream.ts +17 -9
- package/src/MediaStreamTrack.ts +30 -10
- package/src/MediaStreamTrackEvent.ts +2 -2
- package/src/MessageEvent.ts +1 -1
- package/src/RTCCertificate.ts +24 -0
- package/src/RTCDataChannel.ts +49 -14
- package/src/RTCDataChannelEvent.ts +2 -2
- package/src/RTCErrorEvent.ts +1 -1
- package/src/RTCIceCandidateEvent.ts +2 -2
- package/src/RTCPeerConnection.ts +138 -24
- package/src/RTCRtpEncodingParameters.ts +20 -0
- package/src/RTCTrackEvent.ts +1 -1
- package/src/getDisplayMedia.ts +9 -2
- package/src/index.ts +9 -2
- package/src/vendor/event-target-shim/LICENSE +22 -0
- package/src/vendor/event-target-shim/index.d.ts +411 -0
- package/src/vendor/event-target-shim/index.js +1186 -0
|
@@ -1,15 +1,17 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
2
|
export default class RTCRtpEncodingParameters {
|
|
3
3
|
constructor(init) {
|
|
4
|
-
var _init$rid, _init$maxBitrate, _init$maxFramerate, _init$scaleResolution;
|
|
4
|
+
var _init$rid, _init$maxBitrate, _init$minBitrate, _init$maxFramerate, _init$scaleResolution;
|
|
5
5
|
_defineProperty(this, "active", void 0);
|
|
6
6
|
_defineProperty(this, "_rid", void 0);
|
|
7
7
|
_defineProperty(this, "_maxFramerate", void 0);
|
|
8
8
|
_defineProperty(this, "_maxBitrate", void 0);
|
|
9
|
+
_defineProperty(this, "_minBitrate", void 0);
|
|
9
10
|
_defineProperty(this, "_scaleResolutionDownBy", void 0);
|
|
10
11
|
this.active = init.active;
|
|
11
12
|
this._rid = (_init$rid = init.rid) !== null && _init$rid !== void 0 ? _init$rid : null;
|
|
12
13
|
this._maxBitrate = (_init$maxBitrate = init.maxBitrate) !== null && _init$maxBitrate !== void 0 ? _init$maxBitrate : null;
|
|
14
|
+
this._minBitrate = (_init$minBitrate = init.minBitrate) !== null && _init$minBitrate !== void 0 ? _init$minBitrate : null;
|
|
13
15
|
this._maxFramerate = (_init$maxFramerate = init.maxFramerate) !== null && _init$maxFramerate !== void 0 ? _init$maxFramerate : null;
|
|
14
16
|
this._scaleResolutionDownBy = (_init$scaleResolution = init.scaleResolutionDownBy) !== null && _init$scaleResolution !== void 0 ? _init$scaleResolution : null;
|
|
15
17
|
}
|
|
@@ -38,6 +40,17 @@ export default class RTCRtpEncodingParameters {
|
|
|
38
40
|
this._maxBitrate = null;
|
|
39
41
|
}
|
|
40
42
|
}
|
|
43
|
+
get minBitrate() {
|
|
44
|
+
return this._minBitrate;
|
|
45
|
+
}
|
|
46
|
+
set minBitrate(bitrate) {
|
|
47
|
+
// eslint-disable-next-line eqeqeq
|
|
48
|
+
if (bitrate != null && bitrate >= 0) {
|
|
49
|
+
this._minBitrate = bitrate;
|
|
50
|
+
} else {
|
|
51
|
+
this._minBitrate = null;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
41
54
|
get scaleResolutionDownBy() {
|
|
42
55
|
return this._scaleResolutionDownBy;
|
|
43
56
|
}
|
|
@@ -59,6 +72,9 @@ export default class RTCRtpEncodingParameters {
|
|
|
59
72
|
if (this._maxBitrate !== null) {
|
|
60
73
|
obj['maxBitrate'] = this._maxBitrate;
|
|
61
74
|
}
|
|
75
|
+
if (this._minBitrate !== null) {
|
|
76
|
+
obj['minBitrate'] = this._minBitrate;
|
|
77
|
+
}
|
|
62
78
|
if (this._maxFramerate !== null) {
|
|
63
79
|
obj['maxFramerate'] = this._maxFramerate;
|
|
64
80
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["RTCRtpEncodingParameters","constructor","init","_init$rid","_init$maxBitrate","_init$maxFramerate","_init$scaleResolution","_defineProperty","active","_rid","rid","_maxBitrate","maxBitrate","_maxFramerate","maxFramerate","_scaleResolutionDownBy","scaleResolutionDownBy","framerate","bitrate","resolutionScale","toJSON","obj","Boolean"],"sources":["RTCRtpEncodingParameters.ts"],"sourcesContent":["export interface RTCRtpEncodingParametersInit {\n active: boolean,\n rid?: string;\n maxFramerate?: number;\n maxBitrate?: number;\n scaleResolutionDownBy?: number;\n}\n\nexport default class RTCRtpEncodingParameters {\n active: boolean;\n _rid: string | null;\n _maxFramerate: number | null;\n _maxBitrate: number | null;\n _scaleResolutionDownBy: number | null;\n\n constructor(init: RTCRtpEncodingParametersInit) {\n this.active = init.active;\n this._rid = init.rid ?? null;\n this._maxBitrate = init.maxBitrate ?? null;\n this._maxFramerate = init.maxFramerate ?? null;\n this._scaleResolutionDownBy = init.scaleResolutionDownBy ?? null;\n }\n\n get rid() {\n return this._rid;\n }\n\n get maxFramerate() {\n return this._maxFramerate;\n }\n\n set maxFramerate(framerate) {\n // eslint-disable-next-line eqeqeq\n if (framerate != null && framerate > 0) {\n this._maxFramerate = framerate;\n } else {\n this._maxFramerate = null;\n }\n }\n\n get maxBitrate() {\n return this._maxBitrate;\n }\n\n set maxBitrate(bitrate) {\n // eslint-disable-next-line eqeqeq\n if (bitrate != null && bitrate >= 0) {\n this._maxBitrate = bitrate;\n } else {\n this._maxBitrate = null;\n }\n }\n\n get scaleResolutionDownBy() {\n return this._scaleResolutionDownBy;\n }\n\n set scaleResolutionDownBy(resolutionScale) {\n // eslint-disable-next-line eqeqeq\n if (resolutionScale != null && resolutionScale >= 1) {\n this._scaleResolutionDownBy = resolutionScale;\n } else {\n this._scaleResolutionDownBy = null;\n }\n }\n\n toJSON(): RTCRtpEncodingParametersInit {\n const obj = {\n active: Boolean(this.active),\n };\n\n if (this._rid !== null) {\n obj['rid'] = this._rid;\n }\n\n if (this._maxBitrate !== null) {\n obj['maxBitrate'] = this._maxBitrate;\n }\n\n if (this._maxFramerate !== null) {\n obj['maxFramerate'] = this._maxFramerate;\n }\n\n if (this._scaleResolutionDownBy !== null) {\n obj['scaleResolutionDownBy'] = this._scaleResolutionDownBy;\n }\n\n return obj;\n }\n}\n"],"mappings":";
|
|
1
|
+
{"version":3,"names":["RTCRtpEncodingParameters","constructor","init","_init$rid","_init$maxBitrate","_init$minBitrate","_init$maxFramerate","_init$scaleResolution","_defineProperty","active","_rid","rid","_maxBitrate","maxBitrate","_minBitrate","minBitrate","_maxFramerate","maxFramerate","_scaleResolutionDownBy","scaleResolutionDownBy","framerate","bitrate","resolutionScale","toJSON","obj","Boolean"],"sources":["RTCRtpEncodingParameters.ts"],"sourcesContent":["export interface RTCRtpEncodingParametersInit {\n active: boolean,\n rid?: string;\n maxFramerate?: number;\n maxBitrate?: number;\n minBitrate?: number;\n scaleResolutionDownBy?: number;\n}\n\nexport default class RTCRtpEncodingParameters {\n active: boolean;\n _rid: string | null;\n _maxFramerate: number | null;\n _maxBitrate: number | null;\n _minBitrate: number | null;\n _scaleResolutionDownBy: number | null;\n\n constructor(init: RTCRtpEncodingParametersInit) {\n this.active = init.active;\n this._rid = init.rid ?? null;\n this._maxBitrate = init.maxBitrate ?? null;\n this._minBitrate = init.minBitrate ?? null;\n this._maxFramerate = init.maxFramerate ?? null;\n this._scaleResolutionDownBy = init.scaleResolutionDownBy ?? null;\n }\n\n get rid() {\n return this._rid;\n }\n\n get maxFramerate() {\n return this._maxFramerate;\n }\n\n set maxFramerate(framerate) {\n // eslint-disable-next-line eqeqeq\n if (framerate != null && framerate > 0) {\n this._maxFramerate = framerate;\n } else {\n this._maxFramerate = null;\n }\n }\n\n get maxBitrate() {\n return this._maxBitrate;\n }\n\n set maxBitrate(bitrate) {\n // eslint-disable-next-line eqeqeq\n if (bitrate != null && bitrate >= 0) {\n this._maxBitrate = bitrate;\n } else {\n this._maxBitrate = null;\n }\n }\n\n get minBitrate() {\n return this._minBitrate;\n }\n\n set minBitrate(bitrate) {\n // eslint-disable-next-line eqeqeq\n if (bitrate != null && bitrate >= 0) {\n this._minBitrate = bitrate;\n } else {\n this._minBitrate = null;\n }\n }\n\n get scaleResolutionDownBy() {\n return this._scaleResolutionDownBy;\n }\n\n set scaleResolutionDownBy(resolutionScale) {\n // eslint-disable-next-line eqeqeq\n if (resolutionScale != null && resolutionScale >= 1) {\n this._scaleResolutionDownBy = resolutionScale;\n } else {\n this._scaleResolutionDownBy = null;\n }\n }\n\n toJSON(): RTCRtpEncodingParametersInit {\n const obj = {\n active: Boolean(this.active),\n };\n\n if (this._rid !== null) {\n obj['rid'] = this._rid;\n }\n\n if (this._maxBitrate !== null) {\n obj['maxBitrate'] = this._maxBitrate;\n }\n\n if (this._minBitrate !== null) {\n obj['minBitrate'] = this._minBitrate;\n }\n\n if (this._maxFramerate !== null) {\n obj['maxFramerate'] = this._maxFramerate;\n }\n\n if (this._scaleResolutionDownBy !== null) {\n obj['scaleResolutionDownBy'] = this._scaleResolutionDownBy;\n }\n\n return obj;\n }\n}\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
2
|
-
import { Event } from 'event-target-shim
|
|
2
|
+
import { Event } from './vendor/event-target-shim';
|
|
3
3
|
/**
|
|
4
4
|
* @eventClass
|
|
5
5
|
* This event is fired whenever the Track is changed in PeerConnection.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["Event","RTCTrackEvent","constructor","type","eventInitDict","_defineProperty","streams","transceiver","receiver","track"],"sources":["RTCTrackEvent.ts"],"sourcesContent":["
|
|
1
|
+
{"version":3,"names":["Event","RTCTrackEvent","constructor","type","eventInitDict","_defineProperty","streams","transceiver","receiver","track"],"sources":["RTCTrackEvent.ts"],"sourcesContent":["\nimport MediaStream from './MediaStream';\nimport type MediaStreamTrack from './MediaStreamTrack';\nimport RTCRtpReceiver from './RTCRtpReceiver';\nimport RTCRtpTransceiver from './RTCRtpTransceiver';\nimport { Event } from './vendor/event-target-shim';\n\ntype TRACK_EVENTS = 'track'\n\ninterface IRTCTrackEventInitDict extends Event.EventInit {\n streams: MediaStream[]\n transceiver: RTCRtpTransceiver\n}\n\n/**\n * @eventClass\n * This event is fired whenever the Track is changed in PeerConnection.\n * @param {TRACK_EVENTS} type - The type of event.\n * @param {IRTCTrackEventInitDict} eventInitDict - The event init properties.\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/RTCPeerConnection/track_event MDN} for details.\n */\nexport default class RTCTrackEvent<TEventType extends TRACK_EVENTS> extends Event<TEventType> {\n /** @eventProperty */\n readonly streams: MediaStream[] = [];\n\n /** @eventProperty */\n readonly transceiver: RTCRtpTransceiver;\n\n /** @eventProperty */\n readonly receiver: RTCRtpReceiver | null;\n\n /** @eventProperty */\n readonly track: MediaStreamTrack | null;\n\n constructor(type: TEventType, eventInitDict: IRTCTrackEventInitDict) {\n super(type, eventInitDict);\n this.streams = eventInitDict.streams;\n this.transceiver = eventInitDict.transceiver;\n this.receiver = eventInitDict.transceiver.receiver;\n this.track = eventInitDict.transceiver.receiver ? eventInitDict.transceiver.receiver.track : null;\n }\n}\n"],"mappings":";AAKA,SAASA,KAAK,QAAQ,4BAA4B;AASlD;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,MAAMC,aAAa,SAA0CD,KAAK,CAAa;EAC1F;;EAGA;;EAGA;;EAGA;;EAGAE,WAAWA,CAACC,IAAgB,EAAEC,aAAqC,EAAE;IACjE,KAAK,CAACD,IAAI,EAAEC,aAAa,CAAC;IAACC,eAAA,kBAZG,EAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAahC,IAAI,CAACC,OAAO,GAAGF,aAAa,CAACE,OAAO;IACpC,IAAI,CAACC,WAAW,GAAGH,aAAa,CAACG,WAAW;IAC5C,IAAI,CAACC,QAAQ,GAAGJ,aAAa,CAACG,WAAW,CAACC,QAAQ;IAClD,IAAI,CAACC,KAAK,GAAGL,aAAa,CAACG,WAAW,CAACC,QAAQ,GAAGJ,aAAa,CAACG,WAAW,CAACC,QAAQ,CAACC,KAAK,GAAG,IAAI;EACrG;AACJ"}
|
|
@@ -5,8 +5,9 @@ const {
|
|
|
5
5
|
WebRTCModule
|
|
6
6
|
} = NativeModules;
|
|
7
7
|
export default function getDisplayMedia() {
|
|
8
|
+
let constraints = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
9
|
return new Promise((resolve, reject) => {
|
|
9
|
-
WebRTCModule.getDisplayMedia().then(data => {
|
|
10
|
+
WebRTCModule.getDisplayMedia(constraints).then(data => {
|
|
10
11
|
const {
|
|
11
12
|
streamId,
|
|
12
13
|
track
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","MediaStream","MediaStreamError","WebRTCModule","getDisplayMedia","Promise","resolve","reject","then","data","streamId","track","info","streamReactTag","tracks","stream","error"],"sources":["getDisplayMedia.ts"],"sourcesContent":["\nimport { NativeModules } from 'react-native';\n\nimport MediaStream from './MediaStream';\nimport MediaStreamError from './MediaStreamError';\n\nconst { WebRTCModule } = NativeModules;\n\nexport default function getDisplayMedia(): Promise<MediaStream> {\n return new Promise((resolve, reject) => {\n WebRTCModule.getDisplayMedia().then(\n data => {\n const { streamId, track } = data;\n\n const info = {\n streamId: streamId,\n streamReactTag: streamId,\n tracks: [ track ]\n };\n\n const stream = new MediaStream(info);\n\n resolve(stream);\n },\n error => {\n reject(new MediaStreamError(error));\n }\n );\n });\n}\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,cAAc;AAE5C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,MAAM;EAAEC;AAAa,CAAC,GAAGH,aAAa;
|
|
1
|
+
{"version":3,"names":["NativeModules","MediaStream","MediaStreamError","WebRTCModule","getDisplayMedia","constraints","arguments","length","undefined","Promise","resolve","reject","then","data","streamId","track","info","streamReactTag","tracks","stream","error"],"sources":["getDisplayMedia.ts"],"sourcesContent":["\nimport { NativeModules } from 'react-native';\n\nimport MediaStream from './MediaStream';\nimport MediaStreamError from './MediaStreamError';\n\nconst { WebRTCModule } = NativeModules;\n\nexport interface Constraints {\n android?: {\n createConfigForDefaultDisplay?: boolean;\n resolutionScale?: number;\n }\n}\n\nexport default function getDisplayMedia(constraints: Constraints = {}): Promise<MediaStream> {\n return new Promise((resolve, reject) => {\n WebRTCModule.getDisplayMedia(constraints).then(\n data => {\n const { streamId, track } = data;\n\n const info = {\n streamId: streamId,\n streamReactTag: streamId,\n tracks: [ track ]\n };\n\n const stream = new MediaStream(info);\n\n resolve(stream);\n },\n error => {\n reject(new MediaStreamError(error));\n }\n );\n });\n}\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,cAAc;AAE5C,OAAOC,WAAW,MAAM,eAAe;AACvC,OAAOC,gBAAgB,MAAM,oBAAoB;AAEjD,MAAM;EAAEC;AAAa,CAAC,GAAGH,aAAa;AAStC,eAAe,SAASI,eAAeA,CAAA,EAAsD;EAAA,IAArDC,WAAwB,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,CAAC,CAAC;EACjE,OAAO,IAAIG,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACpCR,YAAY,CAACC,eAAe,CAACC,WAAW,CAAC,CAACO,IAAI,CAC1CC,IAAI,IAAI;MACJ,MAAM;QAAEC,QAAQ;QAAEC;MAAM,CAAC,GAAGF,IAAI;MAEhC,MAAMG,IAAI,GAAG;QACTF,QAAQ,EAAEA,QAAQ;QAClBG,cAAc,EAAEH,QAAQ;QACxBI,MAAM,EAAE,CAAEH,KAAK;MACnB,CAAC;MAED,MAAMI,MAAM,GAAG,IAAIlB,WAAW,CAACe,IAAI,CAAC;MAEpCN,OAAO,CAACS,MAAM,CAAC;IACnB,CAAC,EACDC,KAAK,IAAI;MACLT,MAAM,CAAC,IAAIT,gBAAgB,CAACkB,KAAK,CAAC,CAAC;IACvC,CACJ,CAAC;EACL,CAAC,CAAC;AACN"}
|
package/lib/module/index.js
CHANGED
|
@@ -13,11 +13,14 @@ import MediaStreamTrack from './MediaStreamTrack';
|
|
|
13
13
|
import MediaStreamTrackEvent from './MediaStreamTrackEvent';
|
|
14
14
|
import permissions from './Permissions';
|
|
15
15
|
import RTCAudioSession from './RTCAudioSession';
|
|
16
|
+
import RTCCertificate from './RTCCertificate';
|
|
16
17
|
import RTCErrorEvent from './RTCErrorEvent';
|
|
17
18
|
import RTCIceCandidate from './RTCIceCandidate';
|
|
18
19
|
import RTCPIPView, { startIOSPIP, stopIOSPIP } from './RTCPIPView';
|
|
19
20
|
import RTCPeerConnection from './RTCPeerConnection';
|
|
21
|
+
import RTCRtpEncodingParameters from './RTCRtpEncodingParameters';
|
|
20
22
|
import RTCRtpReceiver from './RTCRtpReceiver';
|
|
23
|
+
import RTCRtpSendParameters from './RTCRtpSendParameters';
|
|
21
24
|
import RTCRtpSender from './RTCRtpSender';
|
|
22
25
|
import RTCRtpTransceiver from './RTCRtpTransceiver';
|
|
23
26
|
import RTCSessionDescription from './RTCSessionDescription';
|
|
@@ -27,7 +30,7 @@ Logger.enable(`${Logger.ROOT_PREFIX}:*`);
|
|
|
27
30
|
|
|
28
31
|
// Add listeners for the native events early, since they are added asynchronously.
|
|
29
32
|
setupNativeEvents();
|
|
30
|
-
export { RTCIceCandidate, RTCPeerConnection, RTCSessionDescription, RTCView, RTCPIPView, ScreenCapturePickerView, RTCRtpTransceiver, RTCRtpReceiver, RTCRtpSender, RTCErrorEvent, RTCAudioSession, MediaStream, MediaStreamTrack, mediaDevices, permissions, registerGlobals, startIOSPIP, stopIOSPIP };
|
|
33
|
+
export { RTCIceCandidate, RTCPeerConnection, RTCSessionDescription, RTCCertificate, RTCView, RTCPIPView, ScreenCapturePickerView, RTCRtpEncodingParameters, RTCRtpTransceiver, RTCRtpReceiver, RTCRtpSender, RTCRtpSendParameters, RTCErrorEvent, RTCAudioSession, MediaStream, MediaStreamTrack, mediaDevices, permissions, registerGlobals, startIOSPIP, stopIOSPIP };
|
|
31
34
|
function registerGlobals() {
|
|
32
35
|
// Should not happen. React Native has a global navigator object.
|
|
33
36
|
if (typeof global.navigator !== 'object') {
|
|
@@ -40,9 +43,8 @@ function registerGlobals() {
|
|
|
40
43
|
global.navigator.mediaDevices.getDisplayMedia = mediaDevices.getDisplayMedia.bind(mediaDevices);
|
|
41
44
|
global.navigator.mediaDevices.enumerateDevices = mediaDevices.enumerateDevices.bind(mediaDevices);
|
|
42
45
|
global.RTCIceCandidate = RTCIceCandidate;
|
|
46
|
+
global.RTCCertificate = RTCCertificate;
|
|
43
47
|
global.RTCPeerConnection = RTCPeerConnection;
|
|
44
|
-
global.RTCRtpReceiver = RTCRtpReceiver;
|
|
45
|
-
global.RTCRtpSender = RTCRtpReceiver;
|
|
46
48
|
global.RTCSessionDescription = RTCSessionDescription;
|
|
47
49
|
global.MediaStream = MediaStream;
|
|
48
50
|
global.MediaStreamTrack = MediaStreamTrack;
|
package/lib/module/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["NativeModules","Platform","WebRTCModule","Error","OS","setupNativeEvents","Logger","mediaDevices","MediaStream","MediaStreamTrack","MediaStreamTrackEvent","permissions","RTCAudioSession","RTCErrorEvent","RTCIceCandidate","RTCPIPView","startIOSPIP","stopIOSPIP","RTCPeerConnection","RTCRtpReceiver","RTCRtpSender","RTCRtpTransceiver","RTCSessionDescription","RTCView","ScreenCapturePickerView","enable","ROOT_PREFIX","registerGlobals","global","navigator","getUserMedia","bind","getDisplayMedia","enumerateDevices"],"sources":["index.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nconst { WebRTCModule } = NativeModules;\n\nif (WebRTCModule === null) {\n throw new Error(`WebRTC native module not found.\\n${Platform.OS === 'ios' ?\n 'Try executing the \"pod install\" command inside your projects ios folder.' :\n 'Try executing the \"npm install\" command inside your projects folder.'\n }`);\n}\n\nimport { setupNativeEvents } from './EventEmitter';\nimport Logger from './Logger';\nimport mediaDevices from './MediaDevices';\nimport MediaStream from './MediaStream';\nimport MediaStreamTrack, { type MediaTrackSettings } from './MediaStreamTrack';\nimport MediaStreamTrackEvent from './MediaStreamTrackEvent';\nimport permissions from './Permissions';\nimport RTCAudioSession from './RTCAudioSession';\nimport RTCErrorEvent from './RTCErrorEvent';\nimport RTCIceCandidate from './RTCIceCandidate';\nimport RTCPIPView, { startIOSPIP, stopIOSPIP } from './RTCPIPView';\nimport RTCPeerConnection from './RTCPeerConnection';\nimport RTCRtpReceiver from './RTCRtpReceiver';\nimport RTCRtpSender from './RTCRtpSender';\nimport RTCRtpTransceiver from './RTCRtpTransceiver';\nimport RTCSessionDescription from './RTCSessionDescription';\nimport RTCView, { type RTCVideoViewProps, type RTCIOSPIPOptions } from './RTCView';\nimport ScreenCapturePickerView from './ScreenCapturePickerView';\n\nLogger.enable(`${Logger.ROOT_PREFIX}:*`);\n\n// Add listeners for the native events early, since they are added asynchronously.\nsetupNativeEvents();\n\nexport {\n RTCIceCandidate,\n RTCPeerConnection,\n RTCSessionDescription,\n RTCView,\n RTCPIPView,\n ScreenCapturePickerView,\n RTCRtpTransceiver,\n RTCRtpReceiver,\n RTCRtpSender,\n RTCErrorEvent,\n RTCAudioSession,\n MediaStream,\n MediaStreamTrack,\n type MediaTrackSettings,\n type RTCVideoViewProps,\n type RTCIOSPIPOptions,\n mediaDevices,\n permissions,\n registerGlobals,\n startIOSPIP,\n stopIOSPIP,\n};\n\ndeclare const global: any;\n\nfunction registerGlobals(): void {\n // Should not happen. React Native has a global navigator object.\n if (typeof global.navigator !== 'object') {\n throw new Error('navigator is not an object');\n }\n\n if (!global.navigator.mediaDevices) {\n global.navigator.mediaDevices = {};\n }\n\n global.navigator.mediaDevices.getUserMedia = mediaDevices.getUserMedia.bind(mediaDevices);\n global.navigator.mediaDevices.getDisplayMedia = mediaDevices.getDisplayMedia.bind(mediaDevices);\n global.navigator.mediaDevices.enumerateDevices = mediaDevices.enumerateDevices.bind(mediaDevices);\n\n global.RTCIceCandidate = RTCIceCandidate;\n global.
|
|
1
|
+
{"version":3,"names":["NativeModules","Platform","WebRTCModule","Error","OS","setupNativeEvents","Logger","mediaDevices","MediaStream","MediaStreamTrack","MediaStreamTrackEvent","permissions","RTCAudioSession","RTCCertificate","RTCErrorEvent","RTCIceCandidate","RTCPIPView","startIOSPIP","stopIOSPIP","RTCPeerConnection","RTCRtpEncodingParameters","RTCRtpReceiver","RTCRtpSendParameters","RTCRtpSender","RTCRtpTransceiver","RTCSessionDescription","RTCView","ScreenCapturePickerView","enable","ROOT_PREFIX","registerGlobals","global","navigator","getUserMedia","bind","getDisplayMedia","enumerateDevices"],"sources":["index.ts"],"sourcesContent":["import { NativeModules, Platform } from 'react-native';\nconst { WebRTCModule } = NativeModules;\n\nif (WebRTCModule === null) {\n throw new Error(`WebRTC native module not found.\\n${Platform.OS === 'ios' ?\n 'Try executing the \"pod install\" command inside your projects ios folder.' :\n 'Try executing the \"npm install\" command inside your projects folder.'\n }`);\n}\n\nimport { setupNativeEvents } from './EventEmitter';\nimport Logger from './Logger';\nimport mediaDevices from './MediaDevices';\nimport MediaStream from './MediaStream';\nimport MediaStreamTrack, { type MediaTrackSettings } from './MediaStreamTrack';\nimport MediaStreamTrackEvent from './MediaStreamTrackEvent';\nimport permissions from './Permissions';\nimport RTCAudioSession from './RTCAudioSession';\nimport RTCCertificate from './RTCCertificate';\nimport RTCErrorEvent from './RTCErrorEvent';\nimport RTCIceCandidate from './RTCIceCandidate';\nimport RTCPIPView, { startIOSPIP, stopIOSPIP } from './RTCPIPView';\nimport RTCPeerConnection from './RTCPeerConnection';\nimport RTCRtpEncodingParameters, { type RTCRtpEncodingParametersInit } from './RTCRtpEncodingParameters';\nimport RTCRtpReceiver from './RTCRtpReceiver';\nimport RTCRtpSendParameters, { type RTCRtpSendParametersInit } from './RTCRtpSendParameters';\nimport RTCRtpSender from './RTCRtpSender';\nimport RTCRtpTransceiver from './RTCRtpTransceiver';\nimport RTCSessionDescription from './RTCSessionDescription';\nimport RTCView, { type RTCVideoViewProps, type RTCIOSPIPOptions } from './RTCView';\nimport ScreenCapturePickerView from './ScreenCapturePickerView';\n\nLogger.enable(`${Logger.ROOT_PREFIX}:*`);\n\n// Add listeners for the native events early, since they are added asynchronously.\nsetupNativeEvents();\n\nexport {\n RTCIceCandidate,\n RTCPeerConnection,\n RTCSessionDescription,\n RTCCertificate,\n RTCView,\n RTCPIPView,\n ScreenCapturePickerView,\n RTCRtpEncodingParameters,\n RTCRtpTransceiver,\n RTCRtpReceiver,\n RTCRtpSender,\n RTCRtpSendParameters,\n RTCErrorEvent,\n RTCAudioSession,\n MediaStream,\n MediaStreamTrack,\n type MediaTrackSettings,\n type RTCRtpEncodingParametersInit,\n type RTCRtpSendParametersInit,\n type RTCVideoViewProps,\n type RTCIOSPIPOptions,\n mediaDevices,\n permissions,\n registerGlobals,\n startIOSPIP,\n stopIOSPIP,\n};\n\ndeclare const global: any;\n\nfunction registerGlobals(): void {\n // Should not happen. React Native has a global navigator object.\n if (typeof global.navigator !== 'object') {\n throw new Error('navigator is not an object');\n }\n\n if (!global.navigator.mediaDevices) {\n global.navigator.mediaDevices = {};\n }\n\n global.navigator.mediaDevices.getUserMedia = mediaDevices.getUserMedia.bind(mediaDevices);\n global.navigator.mediaDevices.getDisplayMedia = mediaDevices.getDisplayMedia.bind(mediaDevices);\n global.navigator.mediaDevices.enumerateDevices = mediaDevices.enumerateDevices.bind(mediaDevices);\n\n global.RTCIceCandidate = RTCIceCandidate;\n global.RTCCertificate = RTCCertificate;\n global.RTCPeerConnection = RTCPeerConnection;\n global.RTCSessionDescription = RTCSessionDescription;\n global.MediaStream = MediaStream;\n global.MediaStreamTrack = MediaStreamTrack;\n global.MediaStreamTrackEvent = MediaStreamTrackEvent;\n global.RTCRtpTransceiver = RTCRtpTransceiver;\n global.RTCRtpReceiver = RTCRtpReceiver;\n global.RTCRtpSender = RTCRtpSender;\n global.RTCErrorEvent = RTCErrorEvent;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2015 Toru Nagashima
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
22
|
+
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
// Generated by dts-bundle-generator v5.5.0
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Set the error handler.
|
|
5
|
+
* @param value The error handler to set.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* An implementation of the `EventTarget` interface.
|
|
10
|
+
* @see https://dom.spec.whatwg.org/#eventtarget
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* An implementation of `Event` interface, that wraps a given event object.
|
|
15
|
+
* `EventTarget` shim can control the internal state of this `Event` objects.
|
|
16
|
+
* @see https://dom.spec.whatwg.org/#event
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Get the current value of a given event attribute.
|
|
21
|
+
* @param target The `EventTarget` object to get.
|
|
22
|
+
* @param type The event type.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Set an event listener to a given event attribute.
|
|
27
|
+
* @param target The `EventTarget` object to set.
|
|
28
|
+
* @param type The event type.
|
|
29
|
+
* @param callback The event listener.
|
|
30
|
+
*/
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Define an `EventTarget` class that has event attibutes.
|
|
34
|
+
* @param types The types to define event attributes.
|
|
35
|
+
* @deprecated Use `getEventAttributeValue`/`setEventAttributeValue` pair on your derived class instead because of static analysis friendly.
|
|
36
|
+
*/
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Define an event attribute.
|
|
40
|
+
* @param target The `EventTarget` object to define an event attribute.
|
|
41
|
+
* @param type The event type to define.
|
|
42
|
+
* @param _eventClass Unused, but to infer `Event` class type.
|
|
43
|
+
* @deprecated Use `getEventAttributeValue`/`setEventAttributeValue` pair on your derived class instead because of static analysis friendly.
|
|
44
|
+
*/
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Set the warning handler.
|
|
48
|
+
* @param value The warning handler to set.
|
|
49
|
+
*/
|
|
50
|
+
|
|
51
|
+
export {};
|
|
52
|
+
//# sourceMappingURL=index.d.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":[],"sources":["index.d.ts"],"sourcesContent":["// Generated by dts-bundle-generator v5.5.0\n\n/**\n * Set the error handler.\n * @param value The error handler to set.\n */\nexport declare function setErrorHandler(value: setErrorHandler.ErrorHandler | undefined): void;\nexport declare namespace setErrorHandler {\n\t/**\n\t * The error handler.\n\t * @param error The thrown error object.\n\t */\n\ttype ErrorHandler = (error: Error) => void;\n}\n/**\n * An implementation of the `EventTarget` interface.\n * @see https://dom.spec.whatwg.org/#eventtarget\n */\nexport declare class EventTarget<TEventMap extends Record<string, Event> = Record<string, Event>, TMode extends \"standard\" | \"strict\" = \"standard\"> {\n\t/**\n\t * Initialize this instance.\n\t */\n\tconstructor();\n\t/**\n\t * Add an event listener.\n\t * @param type The event type.\n\t * @param callback The event listener.\n\t * @param options Options.\n\t */\n\taddEventListener<T extends string & keyof TEventMap>(type: T, callback?: EventTarget.EventListener<this, TEventMap[T]> | null, options?: EventTarget.AddOptions): void;\n\t/**\n\t * Add an event listener.\n\t * @param type The event type.\n\t * @param callback The event listener.\n\t * @param options Options.\n\t */\n\taddEventListener(type: string, callback?: EventTarget.FallbackEventListener<this, TMode>, options?: EventTarget.AddOptions): void;\n\t/**\n\t * Add an event listener.\n\t * @param type The event type.\n\t * @param callback The event listener.\n\t * @param capture The capture flag.\n\t * @deprecated Use `{capture: boolean}` object instead of a boolean value.\n\t */\n\taddEventListener<T extends string & keyof TEventMap>(type: T, callback: EventTarget.EventListener<this, TEventMap[T]> | null | undefined, capture: boolean): void;\n\t/**\n\t * Add an event listener.\n\t * @param type The event type.\n\t * @param callback The event listener.\n\t * @param capture The capture flag.\n\t * @deprecated Use `{capture: boolean}` object instead of a boolean value.\n\t */\n\taddEventListener(type: string, callback: EventTarget.FallbackEventListener<this, TMode>, capture: boolean): void;\n\t/**\n\t * Remove an added event listener.\n\t * @param type The event type.\n\t * @param callback The event listener.\n\t * @param options Options.\n\t */\n\tremoveEventListener<T extends string & keyof TEventMap>(type: T, callback?: EventTarget.EventListener<this, TEventMap[T]> | null, options?: EventTarget.Options): void;\n\t/**\n\t * Remove an added event listener.\n\t * @param type The event type.\n\t * @param callback The event listener.\n\t * @param options Options.\n\t */\n\tremoveEventListener(type: string, callback?: EventTarget.FallbackEventListener<this, TMode>, options?: EventTarget.Options): void;\n\t/**\n\t * Remove an added event listener.\n\t * @param type The event type.\n\t * @param callback The event listener.\n\t * @param capture The capture flag.\n\t * @deprecated Use `{capture: boolean}` object instead of a boolean value.\n\t */\n\tremoveEventListener<T extends string & keyof TEventMap>(type: T, callback: EventTarget.EventListener<this, TEventMap[T]> | null | undefined, capture: boolean): void;\n\t/**\n\t * Remove an added event listener.\n\t * @param type The event type.\n\t * @param callback The event listener.\n\t * @param capture The capture flag.\n\t * @deprecated Use `{capture: boolean}` object instead of a boolean value.\n\t */\n\tremoveEventListener(type: string, callback: EventTarget.FallbackEventListener<this, TMode>, capture: boolean): void;\n\t/**\n\t * Dispatch an event.\n\t * @param event The `Event` object to dispatch.\n\t */\n\tdispatchEvent<T extends string & keyof TEventMap>(event: EventTarget.EventData<TEventMap, TMode, T>): boolean;\n\t/**\n\t * Dispatch an event.\n\t * @param event The `Event` object to dispatch.\n\t */\n\tdispatchEvent(event: EventTarget.FallbackEvent<TMode>): boolean;\n}\nexport declare namespace EventTarget {\n\t/**\n\t * The event listener.\n\t */\n\ttype EventListener<TEventTarget extends EventTarget<any, any>, TEvent extends Event> = CallbackFunction<TEventTarget, TEvent> | CallbackObject<TEvent>;\n\t/**\n\t * The event listener function.\n\t */\n\tinterface CallbackFunction<TEventTarget extends EventTarget<any, any>, TEvent extends Event> {\n\t\t(this: TEventTarget, event: TEvent): void;\n\t}\n\t/**\n\t * The event listener object.\n\t * @see https://dom.spec.whatwg.org/#callbackdef-eventlistener\n\t */\n\tinterface CallbackObject<TEvent extends Event> {\n\t\thandleEvent(event: TEvent): void;\n\t}\n\t/**\n\t * The common options for both `addEventListener` and `removeEventListener` methods.\n\t * @see https://dom.spec.whatwg.org/#dictdef-eventlisteneroptions\n\t */\n\tinterface Options {\n\t\tcapture?: boolean;\n\t}\n\t/**\n\t * The options for the `addEventListener` methods.\n\t * @see https://dom.spec.whatwg.org/#dictdef-addeventlisteneroptions\n\t */\n\tinterface AddOptions extends Options {\n\t\tpassive?: boolean;\n\t\tonce?: boolean;\n\t\tsignal?: AbortSignal | null | undefined;\n\t}\n\t/**\n\t * The abort signal.\n\t * @see https://dom.spec.whatwg.org/#abortsignal\n\t */\n\tinterface AbortSignal extends EventTarget<{\n\t\tabort: Event;\n\t}> {\n\t\treadonly aborted: boolean;\n\t\tonabort: CallbackFunction<this, Event> | null;\n\t}\n\t/**\n\t * The event data to dispatch in strict mode.\n\t */\n\ttype EventData<TEventMap extends Record<string, Event>, TMode extends \"standard\" | \"strict\", TEventType extends string> = TMode extends \"strict\" ? IsValidEventMap<TEventMap> extends true ? ExplicitType<TEventType> & Omit<TEventMap[TEventType], keyof Event> & Partial<Omit<Event, \"type\">> : never : never;\n\t/**\n\t * Define explicit `type` property if `T` is a string literal.\n\t * Otherwise, never.\n\t */\n\ttype ExplicitType<T extends string> = string extends T ? never : {\n\t\treadonly type: T;\n\t};\n\t/**\n\t * The event listener type in standard mode.\n\t * Otherwise, never.\n\t */\n\ttype FallbackEventListener<TEventTarget extends EventTarget<any, any>, TMode extends \"standard\" | \"strict\"> = TMode extends \"standard\" ? EventListener<TEventTarget, Event> | null | undefined : never;\n\t/**\n\t * The event type in standard mode.\n\t * Otherwise, never.\n\t */\n\ttype FallbackEvent<TMode extends \"standard\" | \"strict\"> = TMode extends \"standard\" ? Event : never;\n\t/**\n\t * Check if given event map is valid.\n\t * It's valid if the keys of the event map are narrower than `string`.\n\t */\n\ttype IsValidEventMap<T> = string extends keyof T ? false : true;\n}\n/**\n * An implementation of `Event` interface, that wraps a given event object.\n * `EventTarget` shim can control the internal state of this `Event` objects.\n * @see https://dom.spec.whatwg.org/#event\n */\nexport declare class Event<TEventType extends string = string> {\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-none\n\t */\n\tstatic get NONE(): number;\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-capturing_phase\n\t */\n\tstatic get CAPTURING_PHASE(): number;\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-at_target\n\t */\n\tstatic get AT_TARGET(): number;\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-bubbling_phase\n\t */\n\tstatic get BUBBLING_PHASE(): number;\n\t/**\n\t * Initialize this event instance.\n\t * @param type The type of this event.\n\t * @param eventInitDict Options to initialize.\n\t * @see https://dom.spec.whatwg.org/#dom-event-event\n\t */\n\tconstructor(type: TEventType, eventInitDict?: Event.EventInit);\n\t/**\n\t * The type of this event.\n\t * @see https://dom.spec.whatwg.org/#dom-event-type\n\t */\n\tget type(): TEventType;\n\t/**\n\t * The event target of the current dispatching.\n\t * @see https://dom.spec.whatwg.org/#dom-event-target\n\t */\n\tget target(): EventTarget | null;\n\t/**\n\t * The event target of the current dispatching.\n\t * @deprecated Use the `target` property instead.\n\t * @see https://dom.spec.whatwg.org/#dom-event-srcelement\n\t */\n\tget srcElement(): EventTarget | null;\n\t/**\n\t * The event target of the current dispatching.\n\t * @see https://dom.spec.whatwg.org/#dom-event-currenttarget\n\t */\n\tget currentTarget(): EventTarget | null;\n\t/**\n\t * The event target of the current dispatching.\n\t * This doesn't support node tree.\n\t * @see https://dom.spec.whatwg.org/#dom-event-composedpath\n\t */\n\tcomposedPath(): EventTarget[];\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-none\n\t */\n\tget NONE(): number;\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-capturing_phase\n\t */\n\tget CAPTURING_PHASE(): number;\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-at_target\n\t */\n\tget AT_TARGET(): number;\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-bubbling_phase\n\t */\n\tget BUBBLING_PHASE(): number;\n\t/**\n\t * The current event phase.\n\t * @see https://dom.spec.whatwg.org/#dom-event-eventphase\n\t */\n\tget eventPhase(): number;\n\t/**\n\t * Stop event bubbling.\n\t * Because this shim doesn't support node tree, this merely changes the `cancelBubble` property value.\n\t * @see https://dom.spec.whatwg.org/#dom-event-stoppropagation\n\t */\n\tstopPropagation(): void;\n\t/**\n\t * `true` if event bubbling was stopped.\n\t * @deprecated\n\t * @see https://dom.spec.whatwg.org/#dom-event-cancelbubble\n\t */\n\tget cancelBubble(): boolean;\n\t/**\n\t * Stop event bubbling if `true` is set.\n\t * @deprecated Use the `stopPropagation()` method instead.\n\t * @see https://dom.spec.whatwg.org/#dom-event-cancelbubble\n\t */\n\tset cancelBubble(value: boolean);\n\t/**\n\t * Stop event bubbling and subsequent event listener callings.\n\t * @see https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation\n\t */\n\tstopImmediatePropagation(): void;\n\t/**\n\t * `true` if this event will bubble.\n\t * @see https://dom.spec.whatwg.org/#dom-event-bubbles\n\t */\n\tget bubbles(): boolean;\n\t/**\n\t * `true` if this event can be canceled by the `preventDefault()` method.\n\t * @see https://dom.spec.whatwg.org/#dom-event-cancelable\n\t */\n\tget cancelable(): boolean;\n\t/**\n\t * `true` if the default behavior will act.\n\t * @deprecated Use the `defaultPrevented` proeprty instead.\n\t * @see https://dom.spec.whatwg.org/#dom-event-returnvalue\n\t */\n\tget returnValue(): boolean;\n\t/**\n\t * Cancel the default behavior if `false` is set.\n\t * @deprecated Use the `preventDefault()` method instead.\n\t * @see https://dom.spec.whatwg.org/#dom-event-returnvalue\n\t */\n\tset returnValue(value: boolean);\n\t/**\n\t * Cancel the default behavior.\n\t * @see https://dom.spec.whatwg.org/#dom-event-preventdefault\n\t */\n\tpreventDefault(): void;\n\t/**\n\t * `true` if the default behavior was canceled.\n\t * @see https://dom.spec.whatwg.org/#dom-event-defaultprevented\n\t */\n\tget defaultPrevented(): boolean;\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-composed\n\t */\n\tget composed(): boolean;\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-istrusted\n\t */\n\tget isTrusted(): boolean;\n\t/**\n\t * @see https://dom.spec.whatwg.org/#dom-event-timestamp\n\t */\n\tget timeStamp(): number;\n\t/**\n\t * @deprecated Don't use this method. The constructor did initialization.\n\t */\n\tinitEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;\n}\nexport declare namespace Event {\n\t/**\n\t * The options of the `Event` constructor.\n\t * @see https://dom.spec.whatwg.org/#dictdef-eventinit\n\t */\n\tinterface EventInit {\n\t\tbubbles?: boolean;\n\t\tcancelable?: boolean;\n\t\tcomposed?: boolean;\n\t}\n}\n/**\n * Get the current value of a given event attribute.\n * @param target The `EventTarget` object to get.\n * @param type The event type.\n */\nexport declare function getEventAttributeValue<TEventTarget extends EventTarget<any, any>, TEvent extends Event>(target: TEventTarget, type: string): EventTarget.CallbackFunction<TEventTarget, TEvent> | null;\n/**\n * Set an event listener to a given event attribute.\n * @param target The `EventTarget` object to set.\n * @param type The event type.\n * @param callback The event listener.\n */\nexport declare function setEventAttributeValue(target: EventTarget<any, any>, type: string, callback: EventTarget.CallbackFunction<any, any> | null): void;\n/**\n * Define an `EventTarget` class that has event attibutes.\n * @param types The types to define event attributes.\n * @deprecated Use `getEventAttributeValue`/`setEventAttributeValue` pair on your derived class instead because of static analysis friendly.\n */\nexport declare function defineCustomEventTarget<TEventMap extends Record<string, Event>, TMode extends \"standard\" | \"strict\" = \"standard\">(...types: (string & keyof TEventMap)[]): defineCustomEventTarget.CustomEventTargetConstructor<TEventMap, TMode>;\nexport declare namespace defineCustomEventTarget {\n\t/**\n\t * The interface of CustomEventTarget constructor.\n\t */\n\ttype CustomEventTargetConstructor<TEventMap extends Record<string, Event>, TMode extends \"standard\" | \"strict\"> = {\n\t\t/**\n\t\t * Create a new instance.\n\t\t */\n\t\tnew (): CustomEventTarget<TEventMap, TMode>;\n\t\t/**\n\t\t * prototype object.\n\t\t */\n\t\tprototype: CustomEventTarget<TEventMap, TMode>;\n\t};\n\t/**\n\t * The interface of CustomEventTarget.\n\t */\n\ttype CustomEventTarget<TEventMap extends Record<string, Event>, TMode extends \"standard\" | \"strict\"> = EventTarget<TEventMap, TMode> & defineEventAttribute.EventAttributes<any, TEventMap>;\n}\n/**\n * Define an event attribute.\n * @param target The `EventTarget` object to define an event attribute.\n * @param type The event type to define.\n * @param _eventClass Unused, but to infer `Event` class type.\n * @deprecated Use `getEventAttributeValue`/`setEventAttributeValue` pair on your derived class instead because of static analysis friendly.\n */\nexport declare function defineEventAttribute<TEventTarget extends EventTarget, TEventType extends string, TEventConstrucor extends typeof Event>(target: TEventTarget, type: TEventType, _eventClass?: TEventConstrucor): asserts target is TEventTarget & defineEventAttribute.EventAttributes<TEventTarget, Record<TEventType, InstanceType<TEventConstrucor>>>;\nexport declare namespace defineEventAttribute {\n\t/**\n\t * Definition of event attributes.\n\t */\n\ttype EventAttributes<TEventTarget extends EventTarget<any, any>, TEventMap extends Record<string, Event>> = {\n\t\t[P in string & keyof TEventMap as `on${P}`]: EventTarget.CallbackFunction<TEventTarget, TEventMap[P]> | null;\n\t};\n}\n/**\n * Set the warning handler.\n * @param value The warning handler to set.\n */\nexport declare function setWarningHandler(value: setWarningHandler.WarningHandler | undefined): void;\nexport declare namespace setWarningHandler {\n\t/**\n\t * The warning information.\n\t */\n\tinterface Warning {\n\t\t/**\n\t\t * The code of this warning.\n\t\t */\n\t\tcode: string;\n\t\t/**\n\t\t * The message in English.\n\t\t */\n\t\tmessage: string;\n\t\t/**\n\t\t * The arguments for replacing placeholders in the text.\n\t\t */\n\t\targs: any[];\n\t}\n\t/**\n\t * The warning handler.\n\t * @param warning The warning.\n\t */\n\ttype WarningHandler = (warning: Warning) => void;\n}\nexport default EventTarget;\n\nexport {};\n"],"mappings":"AAAA;;AAEA;AACA;AACA;AACA;;AASA;AACA;AACA;AACA;;AAoJA;AACA;AACA;AACA;AACA;;AA4JA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAqBA;AACA;AACA;AACA;AACA;AACA;AACA;;AAUA;AACA;AACA;AACA;;AA4BA"}
|