react-native-webrtc 124.0.6 → 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.
Files changed (134) hide show
  1. package/.claude/settings.local.json +9 -0
  2. package/.eslintignore +1 -0
  3. package/CLAUDE.md +714 -0
  4. package/android/src/main/java/com/oney/WebRTCModule/AbstractVideoCaptureController.java +5 -3
  5. package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +74 -8
  6. package/android/src/main/java/com/oney/WebRTCModule/MediaProjectionService.java +24 -3
  7. package/android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java +4 -4
  8. package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +8 -0
  9. package/android/src/main/java/com/oney/WebRTCModule/ThreadUtils.java +8 -0
  10. package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +112 -26
  11. package/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java +56 -28
  12. package/ios/RCTWebRTC/RCTConvert+WebRTC.m +19 -0
  13. package/ios/RCTWebRTC/ScreenCapturePickerViewManager.m +22 -23
  14. package/ios/RCTWebRTC/SerializeUtils.m +6 -0
  15. package/ios/RCTWebRTC/VideoCaptureController.m +40 -1
  16. package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m +23 -9
  17. package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.h +2 -0
  18. package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +95 -0
  19. package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +1 -0
  20. package/lib/commonjs/MediaDevices.js +12 -10
  21. package/lib/commonjs/MediaDevices.js.map +1 -1
  22. package/lib/commonjs/MediaStream.js +14 -9
  23. package/lib/commonjs/MediaStream.js.map +1 -1
  24. package/lib/commonjs/MediaStreamTrack.js +28 -12
  25. package/lib/commonjs/MediaStreamTrack.js.map +1 -1
  26. package/lib/commonjs/MediaStreamTrackEvent.js +2 -2
  27. package/lib/commonjs/MediaStreamTrackEvent.js.map +1 -1
  28. package/lib/commonjs/MessageEvent.js +2 -2
  29. package/lib/commonjs/MessageEvent.js.map +1 -1
  30. package/lib/commonjs/Permissions.js +3 -3
  31. package/lib/commonjs/Permissions.js.map +1 -1
  32. package/lib/commonjs/RTCCertificate.js +25 -0
  33. package/lib/commonjs/RTCCertificate.js.map +1 -0
  34. package/lib/commonjs/RTCDataChannel.js +38 -13
  35. package/lib/commonjs/RTCDataChannel.js.map +1 -1
  36. package/lib/commonjs/RTCDataChannelEvent.js +2 -2
  37. package/lib/commonjs/RTCDataChannelEvent.js.map +1 -1
  38. package/lib/commonjs/RTCErrorEvent.js +2 -2
  39. package/lib/commonjs/RTCErrorEvent.js.map +1 -1
  40. package/lib/commonjs/RTCIceCandidateEvent.js +2 -2
  41. package/lib/commonjs/RTCIceCandidateEvent.js.map +1 -1
  42. package/lib/commonjs/RTCPeerConnection.js +109 -27
  43. package/lib/commonjs/RTCPeerConnection.js.map +1 -1
  44. package/lib/commonjs/RTCRtpEncodingParameters.js +17 -1
  45. package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -1
  46. package/lib/commonjs/RTCTrackEvent.js +2 -2
  47. package/lib/commonjs/RTCTrackEvent.js.map +1 -1
  48. package/lib/commonjs/RTCUtil.js +1 -1
  49. package/lib/commonjs/RTCUtil.js.map +1 -1
  50. package/lib/commonjs/getDisplayMedia.js +2 -1
  51. package/lib/commonjs/getDisplayMedia.js.map +1 -1
  52. package/lib/commonjs/index.js +22 -2
  53. package/lib/commonjs/index.js.map +1 -1
  54. package/lib/commonjs/vendor/event-target-shim/LICENSE +22 -0
  55. package/lib/commonjs/vendor/event-target-shim/index.d.js +6 -0
  56. package/lib/commonjs/vendor/event-target-shim/index.d.js.map +1 -0
  57. package/lib/commonjs/vendor/event-target-shim/index.js +1221 -0
  58. package/lib/commonjs/vendor/event-target-shim/index.js.map +1 -0
  59. package/lib/module/MediaDevices.js +11 -9
  60. package/lib/module/MediaDevices.js.map +1 -1
  61. package/lib/module/MediaStream.js +13 -8
  62. package/lib/module/MediaStream.js.map +1 -1
  63. package/lib/module/MediaStreamTrack.js +25 -9
  64. package/lib/module/MediaStreamTrack.js.map +1 -1
  65. package/lib/module/MediaStreamTrackEvent.js +1 -1
  66. package/lib/module/MediaStreamTrackEvent.js.map +1 -1
  67. package/lib/module/MessageEvent.js +1 -1
  68. package/lib/module/MessageEvent.js.map +1 -1
  69. package/lib/module/Permissions.js +3 -3
  70. package/lib/module/Permissions.js.map +1 -1
  71. package/lib/module/RTCCertificate.js +18 -0
  72. package/lib/module/RTCCertificate.js.map +1 -0
  73. package/lib/module/RTCDataChannel.js +37 -12
  74. package/lib/module/RTCDataChannel.js.map +1 -1
  75. package/lib/module/RTCDataChannelEvent.js +1 -1
  76. package/lib/module/RTCDataChannelEvent.js.map +1 -1
  77. package/lib/module/RTCErrorEvent.js +1 -1
  78. package/lib/module/RTCErrorEvent.js.map +1 -1
  79. package/lib/module/RTCIceCandidateEvent.js +1 -1
  80. package/lib/module/RTCIceCandidateEvent.js.map +1 -1
  81. package/lib/module/RTCPeerConnection.js +103 -21
  82. package/lib/module/RTCPeerConnection.js.map +1 -1
  83. package/lib/module/RTCRtpEncodingParameters.js +17 -1
  84. package/lib/module/RTCRtpEncodingParameters.js.map +1 -1
  85. package/lib/module/RTCTrackEvent.js +1 -1
  86. package/lib/module/RTCTrackEvent.js.map +1 -1
  87. package/lib/module/RTCUtil.js +1 -1
  88. package/lib/module/RTCUtil.js.map +1 -1
  89. package/lib/module/getDisplayMedia.js +2 -1
  90. package/lib/module/getDisplayMedia.js.map +1 -1
  91. package/lib/module/index.js +5 -3
  92. package/lib/module/index.js.map +1 -1
  93. package/lib/module/vendor/event-target-shim/LICENSE +22 -0
  94. package/lib/module/vendor/event-target-shim/index.d.js +52 -0
  95. package/lib/module/vendor/event-target-shim/index.d.js.map +1 -0
  96. package/lib/module/vendor/event-target-shim/index.js +1221 -0
  97. package/lib/module/vendor/event-target-shim/index.js.map +1 -0
  98. package/lib/typescript/MediaDevices.d.ts +8 -4
  99. package/lib/typescript/MediaStream.d.ts +5 -1
  100. package/lib/typescript/MediaStreamTrack.d.ts +7 -1
  101. package/lib/typescript/MediaStreamTrackEvent.d.ts +1 -1
  102. package/lib/typescript/MessageEvent.d.ts +1 -1
  103. package/lib/typescript/Permissions.d.ts +1 -1
  104. package/lib/typescript/RTCCertificate.d.ts +16 -0
  105. package/lib/typescript/RTCDataChannel.d.ts +13 -1
  106. package/lib/typescript/RTCDataChannelEvent.d.ts +1 -1
  107. package/lib/typescript/RTCErrorEvent.d.ts +1 -1
  108. package/lib/typescript/RTCIceCandidateEvent.d.ts +1 -1
  109. package/lib/typescript/RTCPeerConnection.d.ts +30 -1
  110. package/lib/typescript/RTCRtpEncodingParameters.d.ts +4 -0
  111. package/lib/typescript/RTCTrackEvent.d.ts +1 -1
  112. package/lib/typescript/getDisplayMedia.d.ts +7 -1
  113. package/lib/typescript/index.d.ts +4 -1
  114. package/package.json +2 -3
  115. package/src/MediaDevices.ts +15 -14
  116. package/src/MediaStream.ts +17 -9
  117. package/src/MediaStreamTrack.ts +30 -10
  118. package/src/MediaStreamTrackEvent.ts +2 -2
  119. package/src/MessageEvent.ts +1 -1
  120. package/src/Permissions.ts +3 -3
  121. package/src/RTCCertificate.ts +24 -0
  122. package/src/RTCDataChannel.ts +49 -14
  123. package/src/RTCDataChannelEvent.ts +2 -2
  124. package/src/RTCErrorEvent.ts +1 -1
  125. package/src/RTCIceCandidateEvent.ts +2 -2
  126. package/src/RTCPeerConnection.ts +138 -24
  127. package/src/RTCRtpEncodingParameters.ts +20 -0
  128. package/src/RTCTrackEvent.ts +1 -1
  129. package/src/RTCUtil.ts +1 -1
  130. package/src/getDisplayMedia.ts +9 -2
  131. package/src/index.ts +9 -2
  132. package/src/vendor/event-target-shim/LICENSE +22 -0
  133. package/src/vendor/event-target-shim/index.d.ts +411 -0
  134. package/src/vendor/event-target-shim/index.js +1186 -0
@@ -1 +1 @@
1
- {"version":3,"names":["_index","require","_defineProperty","obj","key","value","Object","defineProperty","enumerable","configurable","writable","RTCTrackEvent","Event","constructor","type","eventInitDict","streams","transceiver","receiver","track","exports","default"],"sources":["RTCTrackEvent.ts"],"sourcesContent":["import { Event } from 'event-target-shim/index';\n\nimport MediaStream from './MediaStream';\nimport type MediaStreamTrack from './MediaStreamTrack';\nimport RTCRtpReceiver from './RTCRtpReceiver';\nimport RTCRtpTransceiver from './RTCRtpTransceiver';\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":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAAgD,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,QAAAD,GAAA,IAAAD,GAAA,IAAAG,MAAA,CAAAC,cAAA,CAAAJ,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAG,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAP,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AAchD;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMQ,aAAa,SAA0CC,YAAK,CAAa;EAC1F;;EAGA;;EAGA;;EAGA;;EAGAC,WAAWA,CAACC,IAAgB,EAAEC,aAAqC,EAAE;IACjE,KAAK,CAACD,IAAI,EAAEC,aAAa,CAAC;IAACb,eAAA,kBAZG,EAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAahC,IAAI,CAACc,OAAO,GAAGD,aAAa,CAACC,OAAO;IACpC,IAAI,CAACC,WAAW,GAAGF,aAAa,CAACE,WAAW;IAC5C,IAAI,CAACC,QAAQ,GAAGH,aAAa,CAACE,WAAW,CAACC,QAAQ;IAClD,IAAI,CAACC,KAAK,GAAGJ,aAAa,CAACE,WAAW,CAACC,QAAQ,GAAGH,aAAa,CAACE,WAAW,CAACC,QAAQ,CAACC,KAAK,GAAG,IAAI;EACrG;AACJ;AAACC,OAAA,CAAAC,OAAA,GAAAV,aAAA"}
1
+ {"version":3,"names":["_eventTargetShim","require","_defineProperty","obj","key","value","Object","defineProperty","enumerable","configurable","writable","RTCTrackEvent","Event","constructor","type","eventInitDict","streams","transceiver","receiver","track","exports","default"],"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,IAAAA,gBAAA,GAAAC,OAAA;AAAmD,SAAAC,gBAAAC,GAAA,EAAAC,GAAA,EAAAC,KAAA,QAAAD,GAAA,IAAAD,GAAA,IAAAG,MAAA,CAAAC,cAAA,CAAAJ,GAAA,EAAAC,GAAA,IAAAC,KAAA,EAAAA,KAAA,EAAAG,UAAA,QAAAC,YAAA,QAAAC,QAAA,oBAAAP,GAAA,CAAAC,GAAA,IAAAC,KAAA,WAAAF,GAAA;AASnD;AACA;AACA;AACA;AACA;AACA;AACA;AACe,MAAMQ,aAAa,SAA0CC,sBAAK,CAAa;EAC1F;;EAGA;;EAGA;;EAGA;;EAGAC,WAAWA,CAACC,IAAgB,EAAEC,aAAqC,EAAE;IACjE,KAAK,CAACD,IAAI,EAAEC,aAAa,CAAC;IAACb,eAAA,kBAZG,EAAE;IAAAA,eAAA;IAAAA,eAAA;IAAAA,eAAA;IAahC,IAAI,CAACc,OAAO,GAAGD,aAAa,CAACC,OAAO;IACpC,IAAI,CAACC,WAAW,GAAGF,aAAa,CAACE,WAAW;IAC5C,IAAI,CAACC,QAAQ,GAAGH,aAAa,CAACE,WAAW,CAACC,QAAQ;IAClD,IAAI,CAACC,KAAK,GAAGJ,aAAa,CAACE,WAAW,CAACC,QAAQ,GAAGH,aAAa,CAACE,WAAW,CAACC,QAAQ,CAACC,KAAK,GAAG,IAAI;EACrG;AACJ;AAACC,OAAA,CAAAC,OAAA,GAAAV,aAAA"}
@@ -146,7 +146,7 @@ function isSdpTypeValid(type) {
146
146
  */
147
147
  function normalizeOfferOptions(options) {
148
148
  const newOptions = {};
149
- if (typeof options !== 'object') {
149
+ if (!options || typeof options !== 'object') {
150
150
  return newOptions;
151
151
  }
152
152
 
@@ -1 +1 @@
1
- {"version":3,"names":["DEFAULT_AUDIO_CONSTRAINTS","DEFAULT_VIDEO_CONSTRAINTS","facingMode","frameRate","height","width","FACING_MODES","ASPECT_RATIO","STANDARD_OFFER_OPTIONS","icerestart","offertoreceiveaudio","offertoreceivevideo","voiceactivitydetection","SDP_TYPES","getDefaultMediaConstraints","mediaType","TypeError","extractString","constraints","prop","value","type","v","extractNumber","Number","parseInt","normalizeMediaConstraints","c","deviceId","includes","Math","round","chr4","random","toString","slice","uniqueID","deepClone","obj","JSON","parse","stringify","isSdpTypeValid","normalizeOfferOptions","options","newOptions","key","Object","entries","newKey","toLowerCase","String","Boolean","normalizeConstraints","mediaTypeConstraints","typeofMediaTypeConstraints"],"sources":["RTCUtil.ts"],"sourcesContent":["\nconst DEFAULT_AUDIO_CONSTRAINTS = {};\n\nconst DEFAULT_VIDEO_CONSTRAINTS = {\n facingMode: 'user',\n frameRate: 30,\n height: 720,\n width: 1280\n};\n\nconst FACING_MODES = [ 'user', 'environment' ];\n\nconst ASPECT_RATIO = 16 / 9;\n\nexport type RTCOfferOptions = {\n iceRestart?:boolean;\n offerToReceiveAudio?: boolean;\n offerToReceiveVideo?: boolean;\n voiceActivityDetection?:boolean\n};\n\nconst STANDARD_OFFER_OPTIONS = {\n icerestart: 'IceRestart',\n offertoreceiveaudio: 'OfferToReceiveAudio',\n offertoreceivevideo: 'OfferToReceiveVideo',\n voiceactivitydetection: 'VoiceActivityDetection'\n};\n\nconst SDP_TYPES = [\n 'offer',\n 'pranswer',\n 'answer',\n 'rollback'\n];\n\nfunction getDefaultMediaConstraints(mediaType) {\n switch (mediaType) {\n case 'audio':\n return DEFAULT_AUDIO_CONSTRAINTS;\n case 'video':\n return DEFAULT_VIDEO_CONSTRAINTS;\n default:\n throw new TypeError(`Invalid media type: ${mediaType}`);\n }\n}\n\nfunction extractString(constraints, prop) {\n const value = constraints[prop];\n const type = typeof value;\n\n if (type === 'object') {\n for (const v of [ 'exact', 'ideal' ]) {\n if (value[v]) {\n return value[v];\n }\n }\n } else if (type === 'string') {\n return value;\n }\n}\n\nfunction extractNumber(constraints, prop) {\n const value = constraints[prop];\n const type = typeof value;\n\n if (type === 'number') {\n return Number.parseInt(value);\n } else if (type === 'object') {\n for (const v of [ 'exact', 'ideal', 'max', 'min' ]) {\n if (value[v]) {\n return Number.parseInt(value[v]);\n }\n }\n }\n}\n\nfunction normalizeMediaConstraints(constraints, mediaType) {\n switch (mediaType) {\n case 'audio':\n return constraints;\n\n case 'video': {\n const c = {\n deviceId: extractString(constraints, 'deviceId'),\n facingMode: extractString(constraints, 'facingMode'),\n frameRate: extractNumber(constraints, 'frameRate'),\n height: extractNumber(constraints, 'height'),\n width: extractNumber(constraints, 'width')\n };\n\n if (!c.deviceId) {\n delete c.deviceId;\n }\n\n if (!FACING_MODES.includes(c.facingMode)) {\n c.facingMode = DEFAULT_VIDEO_CONSTRAINTS.facingMode;\n }\n\n if (!c.frameRate) {\n c.frameRate = DEFAULT_VIDEO_CONSTRAINTS.frameRate;\n }\n\n if (!c.height && !c.width) {\n c.height = DEFAULT_VIDEO_CONSTRAINTS.height;\n c.width = DEFAULT_VIDEO_CONSTRAINTS.width;\n } else if (!c.height && c.width) {\n c.height = Math.round(c.width / ASPECT_RATIO);\n } else if (!c.width && c.height) {\n c.width = Math.round(c.height * ASPECT_RATIO);\n }\n\n return c;\n }\n\n default:\n throw new TypeError(`Invalid media type: ${mediaType}`);\n }\n}\n\n/**\n * Utility for creating short random strings from float point values.\n * We take 4 characters from the end after converting to a string.\n * Conversion to string gives us some letters as we don't want just numbers.\n * Should be suitable to pass for enough randomness.\n *\n * @return {String} 4 random characters\n */\nfunction chr4() {\n return Math.random().toString(16).slice(-4);\n}\n\n/**\n * Put together a random string in UUIDv4 format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\n *\n * @return {String} uuidv4\n */\nexport function uniqueID(): string {\n return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\n}\n\n/**\n * Utility for deep cloning an object. Object.assign() only does a shallow copy.\n *\n * @param {Object} obj - object to be cloned\n * @return {Object} cloned obj\n */\nexport function deepClone<T>(obj: T): T {\n return JSON.parse(JSON.stringify(obj));\n}\n\n/**\n * Checks whether an SDP type is valid or not.\n *\n * @param type SDP type to check.\n * @returns Whether the SDP type is valid or not.\n */\nexport function isSdpTypeValid(type: string): boolean {\n return SDP_TYPES.includes(type);\n}\n\n/**\n * Normalize options passed to createOffer().\n *\n * @param options - user supplied options\n * @return Normalized options\n */\nexport function normalizeOfferOptions(options?: RTCOfferOptions) {\n const newOptions: Record<string,string> = {};\n\n if (typeof options !== 'object') {\n return newOptions;\n }\n\n // Convert standard options into WebRTC internal constant names.\n // See: https://github.com/jitsi/webrtc/blob/0cd6ce4de669bed94ba47b88cb71b9be0341bb81/sdk/media_constraints.cc#L113\n for (const [ key, value ] of Object.entries(options)) {\n const newKey = STANDARD_OFFER_OPTIONS[key.toLowerCase()];\n\n if (newKey) {\n newOptions[newKey] = String(Boolean(value));\n }\n }\n\n return newOptions;\n}\n\n/**\n * Normalize the given constraints in something we can work with.\n */\nexport function normalizeConstraints(constraints) {\n const c = deepClone(constraints);\n\n for (const mediaType of [ 'audio', 'video' ]) {\n const mediaTypeConstraints = c[mediaType];\n const typeofMediaTypeConstraints = typeof mediaTypeConstraints;\n\n if (typeofMediaTypeConstraints !== 'undefined') {\n if (typeofMediaTypeConstraints === 'boolean') {\n if (mediaTypeConstraints) {\n c[mediaType] = getDefaultMediaConstraints(mediaType);\n }\n } else if (typeofMediaTypeConstraints === 'object') {\n c[mediaType] = normalizeMediaConstraints(mediaTypeConstraints, mediaType);\n } else {\n throw new TypeError(`constraints.${mediaType} is neither a boolean nor a dictionary`);\n }\n }\n }\n\n return c;\n}\n"],"mappings":";;;;;;;;;;AACA,MAAMA,yBAAyB,GAAG,CAAC,CAAC;AAEpC,MAAMC,yBAAyB,GAAG;EAC9BC,UAAU,EAAE,MAAM;EAClBC,SAAS,EAAE,EAAE;EACbC,MAAM,EAAE,GAAG;EACXC,KAAK,EAAE;AACX,CAAC;AAED,MAAMC,YAAY,GAAG,CAAE,MAAM,EAAE,aAAa,CAAE;AAE9C,MAAMC,YAAY,GAAG,EAAE,GAAG,CAAC;AAS3B,MAAMC,sBAAsB,GAAG;EAC3BC,UAAU,EAAE,YAAY;EACxBC,mBAAmB,EAAE,qBAAqB;EAC1CC,mBAAmB,EAAE,qBAAqB;EAC1CC,sBAAsB,EAAE;AAC5B,CAAC;AAED,MAAMC,SAAS,GAAG,CACd,OAAO,EACP,UAAU,EACV,QAAQ,EACR,UAAU,CACb;AAED,SAASC,0BAA0BA,CAACC,SAAS,EAAE;EAC3C,QAAQA,SAAS;IACb,KAAK,OAAO;MACR,OAAOf,yBAAyB;IACpC,KAAK,OAAO;MACR,OAAOC,yBAAyB;IACpC;MACI,MAAM,IAAIe,SAAS,CAAE,uBAAsBD,SAAU,EAAC,CAAC;EAC/D;AACJ;AAEA,SAASE,aAAaA,CAACC,WAAW,EAAEC,IAAI,EAAE;EACtC,MAAMC,KAAK,GAAGF,WAAW,CAACC,IAAI,CAAC;EAC/B,MAAME,IAAI,GAAG,OAAOD,KAAK;EAEzB,IAAIC,IAAI,KAAK,QAAQ,EAAE;IACnB,KAAK,MAAMC,CAAC,IAAI,CAAE,OAAO,EAAE,OAAO,CAAE,EAAE;MAClC,IAAIF,KAAK,CAACE,CAAC,CAAC,EAAE;QACV,OAAOF,KAAK,CAACE,CAAC,CAAC;MACnB;IACJ;EACJ,CAAC,M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UACtB3B,CAAC,CAACZ,SAAS,CAAC,GAAGD,0BAA0B,CAACC,SAAS,CAAC;QACxD;MACJ,CAAC,MAAM,IAAIwC,0BAA0B,KAAK,QAAQ,EAAE;QAChD5B,CAAC,CAACZ,SAAS,CAAC,GAAGW,yBAAyB,CAAC4B,oBAAoB,EAAEvC,SAAS,CAAC;MAC7E,CAAC,MAAM;QACH,MAAM,IAAIC,SAAS,CAAE,eAAcD,SAAU,wCAAuC,CAAC;MACzF;IACJ;EACJ;EAEA,OAAOY,CAAC;AACZ"}
1
+ {"version":3,"names":["DEFAULT_AUDIO_CONSTRAINTS","DEFAULT_VIDEO_CONSTRAINTS","facingMode","frameRate","height","width","FACING_MODES","ASPECT_RATIO","STANDARD_OFFER_OPTIONS","icerestart","offertoreceiveaudio","offertoreceivevideo","voiceactivitydetection","SDP_TYPES","getDefaultMediaConstraints","mediaType","TypeError","extractString","constraints","prop","value","type","v","extractNumber","Number","parseInt","normalizeMediaConstraints","c","deviceId","includes","Math","round","chr4","random","toString","slice","uniqueID","deepClone","obj","JSON","parse","stringify","isSdpTypeValid","normalizeOfferOptions","options","newOptions","key","Object","entries","newKey","toLowerCase","String","Boolean","normalizeConstraints","mediaTypeConstraints","typeofMediaTypeConstraints"],"sources":["RTCUtil.ts"],"sourcesContent":["\nconst DEFAULT_AUDIO_CONSTRAINTS = {};\n\nconst DEFAULT_VIDEO_CONSTRAINTS = {\n facingMode: 'user',\n frameRate: 30,\n height: 720,\n width: 1280\n};\n\nconst FACING_MODES = [ 'user', 'environment' ];\n\nconst ASPECT_RATIO = 16 / 9;\n\nexport type RTCOfferOptions = {\n iceRestart?:boolean;\n offerToReceiveAudio?: boolean;\n offerToReceiveVideo?: boolean;\n voiceActivityDetection?:boolean\n};\n\nconst STANDARD_OFFER_OPTIONS = {\n icerestart: 'IceRestart',\n offertoreceiveaudio: 'OfferToReceiveAudio',\n offertoreceivevideo: 'OfferToReceiveVideo',\n voiceactivitydetection: 'VoiceActivityDetection'\n};\n\nconst SDP_TYPES = [\n 'offer',\n 'pranswer',\n 'answer',\n 'rollback'\n];\n\nfunction getDefaultMediaConstraints(mediaType) {\n switch (mediaType) {\n case 'audio':\n return DEFAULT_AUDIO_CONSTRAINTS;\n case 'video':\n return DEFAULT_VIDEO_CONSTRAINTS;\n default:\n throw new TypeError(`Invalid media type: ${mediaType}`);\n }\n}\n\nfunction extractString(constraints, prop) {\n const value = constraints[prop];\n const type = typeof value;\n\n if (type === 'object') {\n for (const v of [ 'exact', 'ideal' ]) {\n if (value[v]) {\n return value[v];\n }\n }\n } else if (type === 'string') {\n return value;\n }\n}\n\nfunction extractNumber(constraints, prop) {\n const value = constraints[prop];\n const type = typeof value;\n\n if (type === 'number') {\n return Number.parseInt(value);\n } else if (type === 'object') {\n for (const v of [ 'exact', 'ideal', 'max', 'min' ]) {\n if (value[v]) {\n return Number.parseInt(value[v]);\n }\n }\n }\n}\n\nfunction normalizeMediaConstraints(constraints, mediaType) {\n switch (mediaType) {\n case 'audio':\n return constraints;\n\n case 'video': {\n const c = {\n deviceId: extractString(constraints, 'deviceId'),\n facingMode: extractString(constraints, 'facingMode'),\n frameRate: extractNumber(constraints, 'frameRate'),\n height: extractNumber(constraints, 'height'),\n width: extractNumber(constraints, 'width')\n };\n\n if (!c.deviceId) {\n delete c.deviceId;\n }\n\n if (!FACING_MODES.includes(c.facingMode)) {\n c.facingMode = DEFAULT_VIDEO_CONSTRAINTS.facingMode;\n }\n\n if (!c.frameRate) {\n c.frameRate = DEFAULT_VIDEO_CONSTRAINTS.frameRate;\n }\n\n if (!c.height && !c.width) {\n c.height = DEFAULT_VIDEO_CONSTRAINTS.height;\n c.width = DEFAULT_VIDEO_CONSTRAINTS.width;\n } else if (!c.height && c.width) {\n c.height = Math.round(c.width / ASPECT_RATIO);\n } else if (!c.width && c.height) {\n c.width = Math.round(c.height * ASPECT_RATIO);\n }\n\n return c;\n }\n\n default:\n throw new TypeError(`Invalid media type: ${mediaType}`);\n }\n}\n\n/**\n * Utility for creating short random strings from float point values.\n * We take 4 characters from the end after converting to a string.\n * Conversion to string gives us some letters as we don't want just numbers.\n * Should be suitable to pass for enough randomness.\n *\n * @return {String} 4 random characters\n */\nfunction chr4() {\n return Math.random().toString(16).slice(-4);\n}\n\n/**\n * Put together a random string in UUIDv4 format {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}\n *\n * @return {String} uuidv4\n */\nexport function uniqueID(): string {\n return `${chr4()}${chr4()}-${chr4()}-${chr4()}-${chr4()}-${chr4()}${chr4()}${chr4()}`;\n}\n\n/**\n * Utility for deep cloning an object. Object.assign() only does a shallow copy.\n *\n * @param {Object} obj - object to be cloned\n * @return {Object} cloned obj\n */\nexport function deepClone<T>(obj: T): T {\n return JSON.parse(JSON.stringify(obj));\n}\n\n/**\n * Checks whether an SDP type is valid or not.\n *\n * @param type SDP type to check.\n * @returns Whether the SDP type is valid or not.\n */\nexport function isSdpTypeValid(type: string): boolean {\n return SDP_TYPES.includes(type);\n}\n\n/**\n * Normalize options passed to createOffer().\n *\n * @param options - user supplied options\n * @return Normalized options\n */\nexport function normalizeOfferOptions(options?: RTCOfferOptions) {\n const newOptions: Record<string,string> = {};\n\n if (!options || typeof options !== 'object') {\n return newOptions;\n }\n\n // Convert standard options into WebRTC internal constant names.\n // See: https://github.com/jitsi/webrtc/blob/0cd6ce4de669bed94ba47b88cb71b9be0341bb81/sdk/media_constraints.cc#L113\n for (const [ key, value ] of Object.entries(options)) {\n const newKey = STANDARD_OFFER_OPTIONS[key.toLowerCase()];\n\n if (newKey) {\n newOptions[newKey] = String(Boolean(value));\n }\n }\n\n return newOptions;\n}\n\n/**\n * Normalize the given constraints in something we can work with.\n */\nexport function normalizeConstraints(constraints) {\n const c = deepClone(constraints);\n\n for (const mediaType of [ 'audio', 'video' ]) {\n const mediaTypeConstraints = c[mediaType];\n const typeofMediaTypeConstraints = typeof mediaTypeConstraints;\n\n if (typeofMediaTypeConstraints !== 'undefined') {\n if (typeofMediaTypeConstraints === 'boolean') {\n if (mediaTypeConstraints) {\n c[mediaType] = getDefaultMediaConstraints(mediaType);\n }\n } else if (typeofMediaTypeConstraints === 'object') {\n c[mediaType] = normalizeMediaConstraints(mediaTypeConstraints, mediaType);\n } else {\n throw new TypeError(`constraints.${mediaType} is neither a boolean nor a dictionary`);\n }\n }\n }\n\n return c;\n}\n"],"mappings":";;;;;;;;;;AACA,MAAMA,yBAAyB,GAAG,CAAC,CAAC;AAEpC,MAAMC,yBAAyB,GAAG;EAC9BC,UAAU,EAAE,MAAM;EAClBC,SAAS,EAAE,EAAE;EACbC,MAAM,EAAE,GAAG;EACXC,KAAK,EAAE;AACX,CAAC;AAED,MAAMC,YAAY,GAAG,CAAE,MAAM,EAAE,aAAa,CAAE;AAE9C,MAAMC,YAAY,GAAG,EAAE,GAAG,CAAC;AAS3B,MAAMC,sBAAsB,GAAG;EAC3BC,UAAU,EAAE,YAAY;EACxBC,mBAAmB,EAAE,qBAAqB;EAC1CC,mBAAmB,EAAE,qBAAqB;EAC1CC,sBAAsB,EAAE;AAC5B,CAAC;AAED,MAAMC,SAAS,GAAG,CACd,OAAO,EACP,UAAU,EACV,QAAQ,EACR,UAAU,CACb;AAED,SAASC,0BAA0BA,CAACC,SAAS,EAAE;EAC3C,QAAQA,SAAS;IACb,KAAK,OAAO;MACR,OAAOf,yBAAyB;IACpC,KAAK,OAAO;MACR,OAAOC,yBAAyB;IACpC;MACI,MAAM,IAAIe,SAAS,CAAE,uBAAsBD,SAAU,EAAC,CAAC;EAC/D;AACJ;AAEA,SAASE,aAAaA,CAACC,WAAW,EAAEC,IAAI,EAAE;EACtC,MAAMC,KAAK,GAAGF,WAAW,CAACC,IAAI,CAAC;EAC/B,MAAME,IAAI,GAAG,OAAOD,KAAK;EAEzB,IAAIC,IAAI,KAAK,QAAQ,EAAE;IACnB,KAAK,MAAMC,CAAC,IAAI,CAAE,OAAO,EAAE,OAAO,CAAE,EAAE;MAClC,IAAIF,KAAK,CAACE,CAAC,CAAC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AAK,WAAW,EAAE;MAC5C,IAAIA,0BAA0B,KAAK,SAAS,EAAE;QAC1C,IAAID,oBAAoB,EAAE;UACtB3B,CAAC,CAACZ,SAAS,CAAC,GAAGD,0BAA0B,CAACC,SAAS,CAAC;QACxD;MACJ,CAAC,MAAM,IAAIwC,0BAA0B,KAAK,QAAQ,EAAE;QAChD5B,CAAC,CAACZ,SAAS,CAAC,GAAGW,yBAAyB,CAAC4B,oBAAoB,EAAEvC,SAAS,CAAC;MAC7E,CAAC,MAAM;QACH,MAAM,IAAIC,SAAS,CAAE,eAAcD,SAAU,wCAAuC,CAAC;MACzF;IACJ;EACJ;EAEA,OAAOY,CAAC;AACZ"}
@@ -12,8 +12,9 @@ const {
12
12
  WebRTCModule
13
13
  } = _reactNative.NativeModules;
14
14
  function getDisplayMedia() {
15
+ let constraints = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
15
16
  return new Promise((resolve, reject) => {
16
- WebRTCModule.getDisplayMedia().then(data => {
17
+ WebRTCModule.getDisplayMedia(constraints).then(data => {
17
18
  const {
18
19
  streamId,
19
20
  track
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_MediaStream","_interopRequireDefault","_MediaStreamError","obj","__esModule","default","WebRTCModule","NativeModules","getDisplayMedia","Promise","resolve","reject","then","data","streamId","track","info","streamReactTag","tracks","stream","MediaStream","error","MediaStreamError"],"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,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAkD,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAElD,MAAM;EAAEG;AAAa,CAAC,GAAGC,0BAAa;AAEvB,SAASC,eAAeA,CAAA,EAAyB;EAC5D,OAAO,IAAIC,OAAO,CAAC,CAACC,OAAO,EAAEC,MAAM,KAAK;IACpCL,YAAY,CAACE,eAAe,CAAC,CAAC,CAACI,IAAI,CAC/BC,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,IAAIC,oBAAW,CAACJ,IAAI,CAAC;MAEpCN,OAAO,CAACS,MAAM,CAAC;IACnB,CAAC,EACDE,KAAK,IAAI;MACLV,MAAM,CAAC,IAAIW,yBAAgB,CAACD,KAAK,CAAC,CAAC;IACvC,CACJ,CAAC;EACL,CAAC,CAAC;AACN"}
1
+ {"version":3,"names":["_reactNative","require","_MediaStream","_interopRequireDefault","_MediaStreamError","obj","__esModule","default","WebRTCModule","NativeModules","getDisplayMedia","constraints","arguments","length","undefined","Promise","resolve","reject","then","data","streamId","track","info","streamReactTag","tracks","stream","MediaStream","error","MediaStreamError"],"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,IAAAA,YAAA,GAAAC,OAAA;AAEA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAD,sBAAA,CAAAF,OAAA;AAAkD,SAAAE,uBAAAE,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;AAElD,MAAM;EAAEG;AAAa,CAAC,GAAGC,0BAAa;AASvB,SAASC,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;IACpCT,YAAY,CAACE,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,IAAIC,oBAAW,CAACJ,IAAI,CAAC;MAEpCN,OAAO,CAACS,MAAM,CAAC;IACnB,CAAC,EACDE,KAAK,IAAI;MACLV,MAAM,CAAC,IAAIW,yBAAgB,CAACD,KAAK,CAAC,CAAC;IACvC,CACJ,CAAC;EACL,CAAC,CAAC;AACN"}
@@ -21,6 +21,12 @@ Object.defineProperty(exports, "RTCAudioSession", {
21
21
  return _RTCAudioSession.default;
22
22
  }
23
23
  });
24
+ Object.defineProperty(exports, "RTCCertificate", {
25
+ enumerable: true,
26
+ get: function () {
27
+ return _RTCCertificate.default;
28
+ }
29
+ });
24
30
  Object.defineProperty(exports, "RTCErrorEvent", {
25
31
  enumerable: true,
26
32
  get: function () {
@@ -45,12 +51,24 @@ Object.defineProperty(exports, "RTCPeerConnection", {
45
51
  return _RTCPeerConnection.default;
46
52
  }
47
53
  });
54
+ Object.defineProperty(exports, "RTCRtpEncodingParameters", {
55
+ enumerable: true,
56
+ get: function () {
57
+ return _RTCRtpEncodingParameters.default;
58
+ }
59
+ });
48
60
  Object.defineProperty(exports, "RTCRtpReceiver", {
49
61
  enumerable: true,
50
62
  get: function () {
51
63
  return _RTCRtpReceiver.default;
52
64
  }
53
65
  });
66
+ Object.defineProperty(exports, "RTCRtpSendParameters", {
67
+ enumerable: true,
68
+ get: function () {
69
+ return _RTCRtpSendParameters.default;
70
+ }
71
+ });
54
72
  Object.defineProperty(exports, "RTCRtpSender", {
55
73
  enumerable: true,
56
74
  get: function () {
@@ -115,11 +133,14 @@ var _MediaStreamTrack = _interopRequireDefault(require("./MediaStreamTrack"));
115
133
  var _MediaStreamTrackEvent = _interopRequireDefault(require("./MediaStreamTrackEvent"));
116
134
  var _Permissions = _interopRequireDefault(require("./Permissions"));
117
135
  var _RTCAudioSession = _interopRequireDefault(require("./RTCAudioSession"));
136
+ var _RTCCertificate = _interopRequireDefault(require("./RTCCertificate"));
118
137
  var _RTCErrorEvent = _interopRequireDefault(require("./RTCErrorEvent"));
119
138
  var _RTCIceCandidate = _interopRequireDefault(require("./RTCIceCandidate"));
120
139
  var _RTCPIPView = _interopRequireWildcard(require("./RTCPIPView"));
121
140
  var _RTCPeerConnection = _interopRequireDefault(require("./RTCPeerConnection"));
141
+ var _RTCRtpEncodingParameters = _interopRequireDefault(require("./RTCRtpEncodingParameters"));
122
142
  var _RTCRtpReceiver = _interopRequireDefault(require("./RTCRtpReceiver"));
143
+ var _RTCRtpSendParameters = _interopRequireDefault(require("./RTCRtpSendParameters"));
123
144
  var _RTCRtpSender = _interopRequireDefault(require("./RTCRtpSender"));
124
145
  var _RTCRtpTransceiver = _interopRequireDefault(require("./RTCRtpTransceiver"));
125
146
  var _RTCSessionDescription = _interopRequireDefault(require("./RTCSessionDescription"));
@@ -150,9 +171,8 @@ function registerGlobals() {
150
171
  global.navigator.mediaDevices.getDisplayMedia = _MediaDevices.default.getDisplayMedia.bind(_MediaDevices.default);
151
172
  global.navigator.mediaDevices.enumerateDevices = _MediaDevices.default.enumerateDevices.bind(_MediaDevices.default);
152
173
  global.RTCIceCandidate = _RTCIceCandidate.default;
174
+ global.RTCCertificate = _RTCCertificate.default;
153
175
  global.RTCPeerConnection = _RTCPeerConnection.default;
154
- global.RTCRtpReceiver = _RTCRtpReceiver.default;
155
- global.RTCRtpSender = _RTCRtpReceiver.default;
156
176
  global.RTCSessionDescription = _RTCSessionDescription.default;
157
177
  global.MediaStream = _MediaStream.default;
158
178
  global.MediaStreamTrack = _MediaStreamTrack.default;
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_EventEmitter","_Logger","_interopRequireDefault","_MediaDevices","_MediaStream","_MediaStreamTrack","_MediaStreamTrackEvent","_Permissions","_RTCAudioSession","_RTCErrorEvent","_RTCIceCandidate","_RTCPIPView","_interopRequireWildcard","_RTCPeerConnection","_RTCRtpReceiver","_RTCRtpSender","_RTCRtpTransceiver","_RTCSessionDescription","_RTCView","_ScreenCapturePickerView","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","WebRTCModule","NativeModules","Error","Platform","OS","Logger","enable","ROOT_PREFIX","setupNativeEvents","registerGlobals","global","navigator","mediaDevices","getUserMedia","bind","getDisplayMedia","enumerateDevices","RTCIceCandidate","RTCPeerConnection","RTCRtpReceiver","RTCRtpSender","RTCSessionDescription","MediaStream","MediaStreamTrack","MediaStreamTrackEvent","RTCRtpTransceiver","RTCErrorEvent"],"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.RTCPeerConnection = RTCPeerConnection;\n global.RTCRtpReceiver = RTCRtpReceiver;\n global.RTCRtpSender = RTCRtpReceiver;\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAUA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,aAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,YAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,iBAAA,GAAAH,sBAAA,CAAAH,OAAA;AACA,IAAAO,sBAAA,GAAAJ,sBAAA,CAAAH,OAAA;AACA,IAAAQ,YAAA,GAAAL,sBAAA,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eAAe,GAAGH,qBAAY,CAACG,eAAe,CAACD,IAAI,CAACF,qBAAY,CAAC;EAC/FF,MAAM,CAACC,SAAS,CAACC,YAAY,CAACI,gBAAgB,GAAGJ,qBAAY,CAACI,gBAAgB,CAACF,IAAI,CAACF,qBAAY,CAAC;EAEjGF,MAAM,CAACO,eAAe,GAAGA,wBAAe;EACxCP,MAAM,CAACQ,iBAAiB,GAAGA,0BAAiB;EAC5CR,MAAM,CAACS,cAAc,GAAGA,uBAAc;EACtCT,MAAM,CAACU,YAAY,GAAGD,uBAAc;EACpCT,MAAM,CAACW,qBAAqB,GAAGA,8BAAqB;EACpDX,MAAM,CAACY,WAAW,GAAGA,oBAAW;EAChCZ,MAAM,CAACa,gBAAgB,GAAGA,yBAAgB;EAC1Cb,MAAM,CAACc,qBAAqB,GAAGA,8BAAqB;EACpDd,MAAM,CAACe,iBAAiB,GAAGA,0BAAiB;EAC5Cf,MAAM,CAACS,cAAc,GAAGA,uBAAc;EACtCT,MAAM,CAACU,YAAY,GAAGA,qBAAY;EAClCV,MAAM,CAACgB,aAAa,GAAGA,sBAAa;AACxC"}
1
+ {"version":3,"names":["_reactNative","require","_EventEmitter","_Logger","_interopRequireDefault","_MediaDevices","_MediaStream","_MediaStreamTrack","_MediaStreamTrackEvent","_Permissions","_RTCAudioSession","_RTCCertificate","_RTCErrorEvent","_RTCIceCandidate","_RTCPIPView","_interopRequireWildcard","_RTCPeerConnection","_RTCRtpEncodingParameters","_RTCRtpReceiver","_RTCRtpSendParameters","_RTCRtpSender","_RTCRtpTransceiver","_RTCSessionDescription","_RTCView","_ScreenCapturePickerView","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","WebRTCModule","NativeModules","Error","Platform","OS","Logger","enable","ROOT_PREFIX","setupNativeEvents","registerGlobals","global","navigator","mediaDevices","getUserMedia","bind","getDisplayMedia","enumerateDevices","RTCIceCandidate","RTCCertificate","RTCPeerConnection","RTCSessionDescription","MediaStream","MediaStreamTrack","MediaStreamTrackEvent","RTCRtpTransceiver","RTCRtpReceiver","RTCRtpSender","RTCErrorEvent"],"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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,YAAA,GAAAC,OAAA;AAUA,IAAAC,aAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAC,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AAS;EAC7B;EACA,IAAI,OAAOC,MAAM,CAACC,SAAS,KAAK,QAAQ,EAAE;IACtC,MAAM,IAAIT,KAAK,CAAC,4BAA4B,CAAC;EACjD;EAEA,IAAI,CAACQ,MAAM,CAACC,SAAS,CAACC,YAAY,EAAE;IAChCF,MAAM,CAACC,SAAS,CAACC,YAAY,GAAG,CAAC,CAAC;EACtC;EAEAF,MAAM,CAACC,SAAS,CAACC,YAAY,CAACC,YAAY,GAAGD,qBAAY,CAACC,YAAY,CAACC,IAAI,CAACF,qBAAY,CAAC;EACzFF,MAAM,CAACC,SAAS,CAACC,YAAY,CAACG,eAAe,GAAGH,qBAAY,CAACG,eAAe,CAACD,IAAI,CAACF,qBAAY,CAAC;EAC/FF,MAAM,CAACC,SAAS,CAACC,YAAY,CAACI,gBAAgB,GAAGJ,qBAAY,CAACI,gBAAgB,CAACF,IAAI,CAACF,qBAAY,CAAC;EAEjGF,MAAM,CAACO,eAAe,GAAGA,wBAAe;EACxCP,MAAM,CAACQ,cAAc,GAAGA,uBAAc;EACtCR,MAAM,CAACS,iBAAiB,GAAGA,0BAAiB;EAC5CT,MAAM,CAACU,qBAAqB,GAAGA,8BAAqB;EACpDV,MAAM,CAACW,WAAW,GAAGA,oBAAW;EAChCX,MAAM,CAACY,gBAAgB,GAAGA,yBAAgB;EAC1CZ,MAAM,CAACa,qBAAqB,GAAGA,8BAAqB;EACpDb,MAAM,CAACc,iBAAiB,GAAGA,0BAAiB;EAC5Cd,MAAM,CAACe,cAAc,GAAGA,uBAAc;EACtCf,MAAM,CAACgB,YAAY,GAAGA,qBAAY;EAClChB,MAAM,CAACiB,aAAa,GAAGA,sBAAa;AACxC"}
@@ -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,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# 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":""}