react-native-webrtc 124.0.8 → 155.0.0

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 (102) hide show
  1. package/README.md +1 -1
  2. package/android/build.gradle +1 -1
  3. package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +17 -0
  4. package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +4 -1
  5. package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoEffectProcessor.java +3 -3
  6. package/ios/RCTWebRTC/RCTConvert+WebRTC.m +2 -0
  7. package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +4 -1
  8. package/lib/commonjs/Constraints.js.map +1 -1
  9. package/lib/commonjs/EventEmitter.js.map +1 -1
  10. package/lib/commonjs/Logger.js.map +1 -1
  11. package/lib/commonjs/MediaDevices.js +1 -2
  12. package/lib/commonjs/MediaDevices.js.map +1 -1
  13. package/lib/commonjs/MediaStream.js.map +1 -1
  14. package/lib/commonjs/MediaStreamError.js.map +1 -1
  15. package/lib/commonjs/MediaStreamErrorEvent.js.map +1 -1
  16. package/lib/commonjs/MediaStreamTrack.js.map +1 -1
  17. package/lib/commonjs/MediaStreamTrackEvent.js.map +1 -1
  18. package/lib/commonjs/MessageEvent.js.map +1 -1
  19. package/lib/commonjs/Permissions.js +1 -2
  20. package/lib/commonjs/Permissions.js.map +1 -1
  21. package/lib/commonjs/RTCAudioSession.js.map +1 -1
  22. package/lib/commonjs/RTCCertificate.js.map +1 -1
  23. package/lib/commonjs/RTCDataChannel.js.map +1 -1
  24. package/lib/commonjs/RTCDataChannelEvent.js.map +1 -1
  25. package/lib/commonjs/RTCErrorEvent.js.map +1 -1
  26. package/lib/commonjs/RTCIceCandidate.js.map +1 -1
  27. package/lib/commonjs/RTCIceCandidateEvent.js.map +1 -1
  28. package/lib/commonjs/RTCPIPView.js +1 -2
  29. package/lib/commonjs/RTCPIPView.js.map +1 -1
  30. package/lib/commonjs/RTCPeerConnection.js.map +1 -1
  31. package/lib/commonjs/RTCRtcpParameters.js.map +1 -1
  32. package/lib/commonjs/RTCRtpCapabilities.js.map +1 -1
  33. package/lib/commonjs/RTCRtpCodecCapability.js.map +1 -1
  34. package/lib/commonjs/RTCRtpCodecParameters.js.map +1 -1
  35. package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -1
  36. package/lib/commonjs/RTCRtpHeaderExtension.js.map +1 -1
  37. package/lib/commonjs/RTCRtpParameters.js.map +1 -1
  38. package/lib/commonjs/RTCRtpReceiveParameters.js.map +1 -1
  39. package/lib/commonjs/RTCRtpReceiver.js.map +1 -1
  40. package/lib/commonjs/RTCRtpSendParameters.js.map +1 -1
  41. package/lib/commonjs/RTCRtpSender.js.map +1 -1
  42. package/lib/commonjs/RTCRtpTransceiver.js.map +1 -1
  43. package/lib/commonjs/RTCSessionDescription.js.map +1 -1
  44. package/lib/commonjs/RTCTrackEvent.js.map +1 -1
  45. package/lib/commonjs/RTCUtil.js.map +1 -1
  46. package/lib/commonjs/RTCView.js +1 -2
  47. package/lib/commonjs/RTCView.js.map +1 -1
  48. package/lib/commonjs/ScreenCapturePickerView.js +1 -2
  49. package/lib/commonjs/ScreenCapturePickerView.js.map +1 -1
  50. package/lib/commonjs/getDisplayMedia.js.map +1 -1
  51. package/lib/commonjs/getUserMedia.js.map +1 -1
  52. package/lib/commonjs/index.js.map +1 -1
  53. package/lib/commonjs/vendor/event-target-shim/index.js.map +1 -1
  54. package/lib/module/Constraints.js.map +1 -1
  55. package/lib/module/EventEmitter.js.map +1 -1
  56. package/lib/module/Logger.js.map +1 -1
  57. package/lib/module/MediaDevices.js.map +1 -1
  58. package/lib/module/MediaStream.js.map +1 -1
  59. package/lib/module/MediaStreamError.js.map +1 -1
  60. package/lib/module/MediaStreamErrorEvent.js.map +1 -1
  61. package/lib/module/MediaStreamTrack.js.map +1 -1
  62. package/lib/module/MediaStreamTrackEvent.js.map +1 -1
  63. package/lib/module/MessageEvent.js.map +1 -1
  64. package/lib/module/Permissions.js.map +1 -1
  65. package/lib/module/RTCAudioSession.js.map +1 -1
  66. package/lib/module/RTCCertificate.js.map +1 -1
  67. package/lib/module/RTCDataChannel.js.map +1 -1
  68. package/lib/module/RTCDataChannelEvent.js.map +1 -1
  69. package/lib/module/RTCErrorEvent.js.map +1 -1
  70. package/lib/module/RTCIceCandidate.js.map +1 -1
  71. package/lib/module/RTCIceCandidateEvent.js.map +1 -1
  72. package/lib/module/RTCPIPView.js.map +1 -1
  73. package/lib/module/RTCPeerConnection.js.map +1 -1
  74. package/lib/module/RTCRtcpParameters.js.map +1 -1
  75. package/lib/module/RTCRtpCapabilities.js.map +1 -1
  76. package/lib/module/RTCRtpCodecCapability.js.map +1 -1
  77. package/lib/module/RTCRtpCodecParameters.js.map +1 -1
  78. package/lib/module/RTCRtpEncodingParameters.js.map +1 -1
  79. package/lib/module/RTCRtpHeaderExtension.js.map +1 -1
  80. package/lib/module/RTCRtpParameters.js.map +1 -1
  81. package/lib/module/RTCRtpReceiveParameters.js.map +1 -1
  82. package/lib/module/RTCRtpReceiver.js.map +1 -1
  83. package/lib/module/RTCRtpSendParameters.js.map +1 -1
  84. package/lib/module/RTCRtpSender.js.map +1 -1
  85. package/lib/module/RTCRtpTransceiver.js.map +1 -1
  86. package/lib/module/RTCSessionDescription.js.map +1 -1
  87. package/lib/module/RTCTrackEvent.js.map +1 -1
  88. package/lib/module/RTCUtil.js.map +1 -1
  89. package/lib/module/RTCView.js.map +1 -1
  90. package/lib/module/ScreenCapturePickerView.js.map +1 -1
  91. package/lib/module/getDisplayMedia.js.map +1 -1
  92. package/lib/module/getUserMedia.js.map +1 -1
  93. package/lib/module/index.js.map +1 -1
  94. package/lib/module/vendor/event-target-shim/index.js.map +1 -1
  95. package/lib/typescript/vendor/event-target-shim/index.d.ts +411 -0
  96. package/package.json +2 -2
  97. package/react-native-webrtc.podspec +2 -2
  98. package/tools/postbuild.mjs +67 -0
  99. package/lib/commonjs/vendor/event-target-shim/index.d.js +0 -6
  100. package/lib/commonjs/vendor/event-target-shim/index.d.js.map +0 -1
  101. package/lib/module/vendor/event-target-shim/index.d.js +0 -52
  102. package/lib/module/vendor/event-target-shim/index.d.js.map +0 -1
@@ -0,0 +1,411 @@
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
+ export declare function setErrorHandler(value: setErrorHandler.ErrorHandler | undefined): void;
8
+ export declare namespace setErrorHandler {
9
+ /**
10
+ * The error handler.
11
+ * @param error The thrown error object.
12
+ */
13
+ type ErrorHandler = (error: Error) => void;
14
+ }
15
+ /**
16
+ * An implementation of the `EventTarget` interface.
17
+ * @see https://dom.spec.whatwg.org/#eventtarget
18
+ */
19
+ export declare class EventTarget<TEventMap extends Record<string, Event> = Record<string, Event>, TMode extends "standard" | "strict" = "standard"> {
20
+ /**
21
+ * Initialize this instance.
22
+ */
23
+ constructor();
24
+ /**
25
+ * Add an event listener.
26
+ * @param type The event type.
27
+ * @param callback The event listener.
28
+ * @param options Options.
29
+ */
30
+ addEventListener<T extends string & keyof TEventMap>(type: T, callback?: EventTarget.EventListener<this, TEventMap[T]> | null, options?: EventTarget.AddOptions): void;
31
+ /**
32
+ * Add an event listener.
33
+ * @param type The event type.
34
+ * @param callback The event listener.
35
+ * @param options Options.
36
+ */
37
+ addEventListener(type: string, callback?: EventTarget.FallbackEventListener<this, TMode>, options?: EventTarget.AddOptions): void;
38
+ /**
39
+ * Add an event listener.
40
+ * @param type The event type.
41
+ * @param callback The event listener.
42
+ * @param capture The capture flag.
43
+ * @deprecated Use `{capture: boolean}` object instead of a boolean value.
44
+ */
45
+ addEventListener<T extends string & keyof TEventMap>(type: T, callback: EventTarget.EventListener<this, TEventMap[T]> | null | undefined, capture: boolean): void;
46
+ /**
47
+ * Add an event listener.
48
+ * @param type The event type.
49
+ * @param callback The event listener.
50
+ * @param capture The capture flag.
51
+ * @deprecated Use `{capture: boolean}` object instead of a boolean value.
52
+ */
53
+ addEventListener(type: string, callback: EventTarget.FallbackEventListener<this, TMode>, capture: boolean): void;
54
+ /**
55
+ * Remove an added event listener.
56
+ * @param type The event type.
57
+ * @param callback The event listener.
58
+ * @param options Options.
59
+ */
60
+ removeEventListener<T extends string & keyof TEventMap>(type: T, callback?: EventTarget.EventListener<this, TEventMap[T]> | null, options?: EventTarget.Options): void;
61
+ /**
62
+ * Remove an added event listener.
63
+ * @param type The event type.
64
+ * @param callback The event listener.
65
+ * @param options Options.
66
+ */
67
+ removeEventListener(type: string, callback?: EventTarget.FallbackEventListener<this, TMode>, options?: EventTarget.Options): void;
68
+ /**
69
+ * Remove an added event listener.
70
+ * @param type The event type.
71
+ * @param callback The event listener.
72
+ * @param capture The capture flag.
73
+ * @deprecated Use `{capture: boolean}` object instead of a boolean value.
74
+ */
75
+ removeEventListener<T extends string & keyof TEventMap>(type: T, callback: EventTarget.EventListener<this, TEventMap[T]> | null | undefined, capture: boolean): void;
76
+ /**
77
+ * Remove an added event listener.
78
+ * @param type The event type.
79
+ * @param callback The event listener.
80
+ * @param capture The capture flag.
81
+ * @deprecated Use `{capture: boolean}` object instead of a boolean value.
82
+ */
83
+ removeEventListener(type: string, callback: EventTarget.FallbackEventListener<this, TMode>, capture: boolean): void;
84
+ /**
85
+ * Dispatch an event.
86
+ * @param event The `Event` object to dispatch.
87
+ */
88
+ dispatchEvent<T extends string & keyof TEventMap>(event: EventTarget.EventData<TEventMap, TMode, T>): boolean;
89
+ /**
90
+ * Dispatch an event.
91
+ * @param event The `Event` object to dispatch.
92
+ */
93
+ dispatchEvent(event: EventTarget.FallbackEvent<TMode>): boolean;
94
+ }
95
+ export declare namespace EventTarget {
96
+ /**
97
+ * The event listener.
98
+ */
99
+ type EventListener<TEventTarget extends EventTarget<any, any>, TEvent extends Event> = CallbackFunction<TEventTarget, TEvent> | CallbackObject<TEvent>;
100
+ /**
101
+ * The event listener function.
102
+ */
103
+ interface CallbackFunction<TEventTarget extends EventTarget<any, any>, TEvent extends Event> {
104
+ (this: TEventTarget, event: TEvent): void;
105
+ }
106
+ /**
107
+ * The event listener object.
108
+ * @see https://dom.spec.whatwg.org/#callbackdef-eventlistener
109
+ */
110
+ interface CallbackObject<TEvent extends Event> {
111
+ handleEvent(event: TEvent): void;
112
+ }
113
+ /**
114
+ * The common options for both `addEventListener` and `removeEventListener` methods.
115
+ * @see https://dom.spec.whatwg.org/#dictdef-eventlisteneroptions
116
+ */
117
+ interface Options {
118
+ capture?: boolean;
119
+ }
120
+ /**
121
+ * The options for the `addEventListener` methods.
122
+ * @see https://dom.spec.whatwg.org/#dictdef-addeventlisteneroptions
123
+ */
124
+ interface AddOptions extends Options {
125
+ passive?: boolean;
126
+ once?: boolean;
127
+ signal?: AbortSignal | null | undefined;
128
+ }
129
+ /**
130
+ * The abort signal.
131
+ * @see https://dom.spec.whatwg.org/#abortsignal
132
+ */
133
+ interface AbortSignal extends EventTarget<{
134
+ abort: Event;
135
+ }> {
136
+ readonly aborted: boolean;
137
+ onabort: CallbackFunction<this, Event> | null;
138
+ }
139
+ /**
140
+ * The event data to dispatch in strict mode.
141
+ */
142
+ type 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;
143
+ /**
144
+ * Define explicit `type` property if `T` is a string literal.
145
+ * Otherwise, never.
146
+ */
147
+ type ExplicitType<T extends string> = string extends T ? never : {
148
+ readonly type: T;
149
+ };
150
+ /**
151
+ * The event listener type in standard mode.
152
+ * Otherwise, never.
153
+ */
154
+ type FallbackEventListener<TEventTarget extends EventTarget<any, any>, TMode extends "standard" | "strict"> = TMode extends "standard" ? EventListener<TEventTarget, Event> | null | undefined : never;
155
+ /**
156
+ * The event type in standard mode.
157
+ * Otherwise, never.
158
+ */
159
+ type FallbackEvent<TMode extends "standard" | "strict"> = TMode extends "standard" ? Event : never;
160
+ /**
161
+ * Check if given event map is valid.
162
+ * It's valid if the keys of the event map are narrower than `string`.
163
+ */
164
+ type IsValidEventMap<T> = string extends keyof T ? false : true;
165
+ }
166
+ /**
167
+ * An implementation of `Event` interface, that wraps a given event object.
168
+ * `EventTarget` shim can control the internal state of this `Event` objects.
169
+ * @see https://dom.spec.whatwg.org/#event
170
+ */
171
+ export declare class Event<TEventType extends string = string> {
172
+ /**
173
+ * @see https://dom.spec.whatwg.org/#dom-event-none
174
+ */
175
+ static get NONE(): number;
176
+ /**
177
+ * @see https://dom.spec.whatwg.org/#dom-event-capturing_phase
178
+ */
179
+ static get CAPTURING_PHASE(): number;
180
+ /**
181
+ * @see https://dom.spec.whatwg.org/#dom-event-at_target
182
+ */
183
+ static get AT_TARGET(): number;
184
+ /**
185
+ * @see https://dom.spec.whatwg.org/#dom-event-bubbling_phase
186
+ */
187
+ static get BUBBLING_PHASE(): number;
188
+ /**
189
+ * Initialize this event instance.
190
+ * @param type The type of this event.
191
+ * @param eventInitDict Options to initialize.
192
+ * @see https://dom.spec.whatwg.org/#dom-event-event
193
+ */
194
+ constructor(type: TEventType, eventInitDict?: Event.EventInit);
195
+ /**
196
+ * The type of this event.
197
+ * @see https://dom.spec.whatwg.org/#dom-event-type
198
+ */
199
+ get type(): TEventType;
200
+ /**
201
+ * The event target of the current dispatching.
202
+ * @see https://dom.spec.whatwg.org/#dom-event-target
203
+ */
204
+ get target(): EventTarget | null;
205
+ /**
206
+ * The event target of the current dispatching.
207
+ * @deprecated Use the `target` property instead.
208
+ * @see https://dom.spec.whatwg.org/#dom-event-srcelement
209
+ */
210
+ get srcElement(): EventTarget | null;
211
+ /**
212
+ * The event target of the current dispatching.
213
+ * @see https://dom.spec.whatwg.org/#dom-event-currenttarget
214
+ */
215
+ get currentTarget(): EventTarget | null;
216
+ /**
217
+ * The event target of the current dispatching.
218
+ * This doesn't support node tree.
219
+ * @see https://dom.spec.whatwg.org/#dom-event-composedpath
220
+ */
221
+ composedPath(): EventTarget[];
222
+ /**
223
+ * @see https://dom.spec.whatwg.org/#dom-event-none
224
+ */
225
+ get NONE(): number;
226
+ /**
227
+ * @see https://dom.spec.whatwg.org/#dom-event-capturing_phase
228
+ */
229
+ get CAPTURING_PHASE(): number;
230
+ /**
231
+ * @see https://dom.spec.whatwg.org/#dom-event-at_target
232
+ */
233
+ get AT_TARGET(): number;
234
+ /**
235
+ * @see https://dom.spec.whatwg.org/#dom-event-bubbling_phase
236
+ */
237
+ get BUBBLING_PHASE(): number;
238
+ /**
239
+ * The current event phase.
240
+ * @see https://dom.spec.whatwg.org/#dom-event-eventphase
241
+ */
242
+ get eventPhase(): number;
243
+ /**
244
+ * Stop event bubbling.
245
+ * Because this shim doesn't support node tree, this merely changes the `cancelBubble` property value.
246
+ * @see https://dom.spec.whatwg.org/#dom-event-stoppropagation
247
+ */
248
+ stopPropagation(): void;
249
+ /**
250
+ * `true` if event bubbling was stopped.
251
+ * @deprecated
252
+ * @see https://dom.spec.whatwg.org/#dom-event-cancelbubble
253
+ */
254
+ get cancelBubble(): boolean;
255
+ /**
256
+ * Stop event bubbling if `true` is set.
257
+ * @deprecated Use the `stopPropagation()` method instead.
258
+ * @see https://dom.spec.whatwg.org/#dom-event-cancelbubble
259
+ */
260
+ set cancelBubble(value: boolean);
261
+ /**
262
+ * Stop event bubbling and subsequent event listener callings.
263
+ * @see https://dom.spec.whatwg.org/#dom-event-stopimmediatepropagation
264
+ */
265
+ stopImmediatePropagation(): void;
266
+ /**
267
+ * `true` if this event will bubble.
268
+ * @see https://dom.spec.whatwg.org/#dom-event-bubbles
269
+ */
270
+ get bubbles(): boolean;
271
+ /**
272
+ * `true` if this event can be canceled by the `preventDefault()` method.
273
+ * @see https://dom.spec.whatwg.org/#dom-event-cancelable
274
+ */
275
+ get cancelable(): boolean;
276
+ /**
277
+ * `true` if the default behavior will act.
278
+ * @deprecated Use the `defaultPrevented` proeprty instead.
279
+ * @see https://dom.spec.whatwg.org/#dom-event-returnvalue
280
+ */
281
+ get returnValue(): boolean;
282
+ /**
283
+ * Cancel the default behavior if `false` is set.
284
+ * @deprecated Use the `preventDefault()` method instead.
285
+ * @see https://dom.spec.whatwg.org/#dom-event-returnvalue
286
+ */
287
+ set returnValue(value: boolean);
288
+ /**
289
+ * Cancel the default behavior.
290
+ * @see https://dom.spec.whatwg.org/#dom-event-preventdefault
291
+ */
292
+ preventDefault(): void;
293
+ /**
294
+ * `true` if the default behavior was canceled.
295
+ * @see https://dom.spec.whatwg.org/#dom-event-defaultprevented
296
+ */
297
+ get defaultPrevented(): boolean;
298
+ /**
299
+ * @see https://dom.spec.whatwg.org/#dom-event-composed
300
+ */
301
+ get composed(): boolean;
302
+ /**
303
+ * @see https://dom.spec.whatwg.org/#dom-event-istrusted
304
+ */
305
+ get isTrusted(): boolean;
306
+ /**
307
+ * @see https://dom.spec.whatwg.org/#dom-event-timestamp
308
+ */
309
+ get timeStamp(): number;
310
+ /**
311
+ * @deprecated Don't use this method. The constructor did initialization.
312
+ */
313
+ initEvent(type: string, bubbles?: boolean, cancelable?: boolean): void;
314
+ }
315
+ export declare namespace Event {
316
+ /**
317
+ * The options of the `Event` constructor.
318
+ * @see https://dom.spec.whatwg.org/#dictdef-eventinit
319
+ */
320
+ interface EventInit {
321
+ bubbles?: boolean;
322
+ cancelable?: boolean;
323
+ composed?: boolean;
324
+ }
325
+ }
326
+ /**
327
+ * Get the current value of a given event attribute.
328
+ * @param target The `EventTarget` object to get.
329
+ * @param type The event type.
330
+ */
331
+ export declare function getEventAttributeValue<TEventTarget extends EventTarget<any, any>, TEvent extends Event>(target: TEventTarget, type: string): EventTarget.CallbackFunction<TEventTarget, TEvent> | null;
332
+ /**
333
+ * Set an event listener to a given event attribute.
334
+ * @param target The `EventTarget` object to set.
335
+ * @param type The event type.
336
+ * @param callback The event listener.
337
+ */
338
+ export declare function setEventAttributeValue(target: EventTarget<any, any>, type: string, callback: EventTarget.CallbackFunction<any, any> | null): void;
339
+ /**
340
+ * Define an `EventTarget` class that has event attibutes.
341
+ * @param types The types to define event attributes.
342
+ * @deprecated Use `getEventAttributeValue`/`setEventAttributeValue` pair on your derived class instead because of static analysis friendly.
343
+ */
344
+ export declare function defineCustomEventTarget<TEventMap extends Record<string, Event>, TMode extends "standard" | "strict" = "standard">(...types: (string & keyof TEventMap)[]): defineCustomEventTarget.CustomEventTargetConstructor<TEventMap, TMode>;
345
+ export declare namespace defineCustomEventTarget {
346
+ /**
347
+ * The interface of CustomEventTarget constructor.
348
+ */
349
+ type CustomEventTargetConstructor<TEventMap extends Record<string, Event>, TMode extends "standard" | "strict"> = {
350
+ /**
351
+ * Create a new instance.
352
+ */
353
+ new (): CustomEventTarget<TEventMap, TMode>;
354
+ /**
355
+ * prototype object.
356
+ */
357
+ prototype: CustomEventTarget<TEventMap, TMode>;
358
+ };
359
+ /**
360
+ * The interface of CustomEventTarget.
361
+ */
362
+ type CustomEventTarget<TEventMap extends Record<string, Event>, TMode extends "standard" | "strict"> = EventTarget<TEventMap, TMode> & defineEventAttribute.EventAttributes<any, TEventMap>;
363
+ }
364
+ /**
365
+ * Define an event attribute.
366
+ * @param target The `EventTarget` object to define an event attribute.
367
+ * @param type The event type to define.
368
+ * @param _eventClass Unused, but to infer `Event` class type.
369
+ * @deprecated Use `getEventAttributeValue`/`setEventAttributeValue` pair on your derived class instead because of static analysis friendly.
370
+ */
371
+ export 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>>>;
372
+ export declare namespace defineEventAttribute {
373
+ /**
374
+ * Definition of event attributes.
375
+ */
376
+ type EventAttributes<TEventTarget extends EventTarget<any, any>, TEventMap extends Record<string, Event>> = {
377
+ [P in string & keyof TEventMap as `on${P}`]: EventTarget.CallbackFunction<TEventTarget, TEventMap[P]> | null;
378
+ };
379
+ }
380
+ /**
381
+ * Set the warning handler.
382
+ * @param value The warning handler to set.
383
+ */
384
+ export declare function setWarningHandler(value: setWarningHandler.WarningHandler | undefined): void;
385
+ export declare namespace setWarningHandler {
386
+ /**
387
+ * The warning information.
388
+ */
389
+ interface Warning {
390
+ /**
391
+ * The code of this warning.
392
+ */
393
+ code: string;
394
+ /**
395
+ * The message in English.
396
+ */
397
+ message: string;
398
+ /**
399
+ * The arguments for replacing placeholders in the text.
400
+ */
401
+ args: any[];
402
+ }
403
+ /**
404
+ * The warning handler.
405
+ * @param warning The warning.
406
+ */
407
+ type WarningHandler = (warning: Warning) => void;
408
+ }
409
+ export default EventTarget;
410
+
411
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-webrtc",
3
- "version": "124.0.8",
3
+ "version": "155.0.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/react-native-webrtc/react-native-webrtc.git"
@@ -29,7 +29,7 @@
29
29
  "scripts": {
30
30
  "lint": "eslint --max-warnings 0 . && tsc --noEmit",
31
31
  "lintfix": "eslint --max-warnings 0 --fix . && tsc --noEmit",
32
- "prepare": "husky install && bob build",
32
+ "prepare": "husky install && bob build && node tools/postbuild.mjs",
33
33
  "format": "tools/format.sh"
34
34
  },
35
35
  "bugs": {
@@ -12,12 +12,12 @@ Pod::Spec.new do |s|
12
12
  s.source = { :git => 'git@github.com:react-native-webrtc/react-native-webrtc.git', :tag => 'release #{s.version}' }
13
13
  s.requires_arc = true
14
14
 
15
- s.platforms = { :ios => '12.0', :osx => '10.13', :tvos => '16.0' }
15
+ s.platforms = { :ios => '14.0', :osx => '10.13', :tvos => '16.0' }
16
16
 
17
17
  s.preserve_paths = 'ios/**/*'
18
18
  s.source_files = 'ios/**/*.{h,m}'
19
19
  s.libraries = 'c', 'sqlite3', 'stdc++'
20
20
  s.framework = 'AudioToolbox','AVFoundation', 'CoreAudio', 'CoreGraphics', 'CoreVideo', 'GLKit', 'VideoToolbox'
21
21
  s.dependency 'React-Core'
22
- s.dependency 'JitsiWebRTC', '~> 124.0.0'
22
+ s.dependency 'JitsiWebRTC', '~> 155.0.0'
23
23
  end
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Fixes up the bob build output for the declaration files which are shipped as-is
5
+ * (currently the ones for the vendored event-target-shim). bob mishandles them in
6
+ * both directions, so for every .d.ts file in src/ we:
7
+ *
8
+ * - Copy it into the typescript output. That target builds with
9
+ * `tsc --emitDeclarationOnly`, and tsc never emits output for .d.ts inputs, so the
10
+ * relative imports pointing at them fail to resolve for consumers using the
11
+ * declaration files, which silently strips the EventTarget members off our classes.
12
+ *
13
+ * - Delete the empty module babel emitted for it in the commonjs and module outputs.
14
+ * Those targets compile every source file and rewrite the extension to .js, turning
15
+ * index.d.ts into an index.d.js which holds no code and which nothing imports.
16
+ */
17
+
18
+ import fs from 'node:fs';
19
+ import path from 'node:path';
20
+ import process from 'node:process';
21
+
22
+ const root = path.resolve(import.meta.dirname, '..');
23
+ const source = path.join(root, 'src');
24
+ const output = path.join(root, 'lib');
25
+ const declarationsOutput = path.join(output, 'typescript');
26
+ const compiledOutputs = [ path.join(output, 'commonjs'), path.join(output, 'module') ];
27
+
28
+ /**
29
+ * Finds every declaration file below the given directory, as paths relative to it.
30
+ */
31
+ function findDeclarations(directory, prefix = '') {
32
+ return fs.readdirSync(directory, { withFileTypes: true }).flatMap(entry => {
33
+ const entryPath = path.join(prefix, entry.name);
34
+
35
+ if (entry.isDirectory()) {
36
+ return findDeclarations(path.join(directory, entry.name), entryPath);
37
+ }
38
+
39
+ return entry.name.endsWith('.d.ts') ? [ entryPath ] : [];
40
+ });
41
+ }
42
+
43
+ if (!fs.existsSync(output)) {
44
+ console.error(`${path.relative(root, output)} not found, run "bob build" first.`);
45
+ process.exit(1);
46
+ }
47
+
48
+ for (const declaration of findDeclarations(source)) {
49
+ const target = path.join(declarationsOutput, declaration);
50
+
51
+ fs.mkdirSync(path.dirname(target), { recursive: true });
52
+ fs.copyFileSync(path.join(source, declaration), target);
53
+
54
+ console.info(`Copied src/${declaration} -> ${path.relative(root, target)}`);
55
+
56
+ for (const compiledOutput of compiledOutputs) {
57
+ const compiled = path.join(compiledOutput, declaration.replace(/\.ts$/, '.js'));
58
+
59
+ for (const artifact of [ compiled, `${compiled}.map` ]) {
60
+ if (fs.existsSync(artifact)) {
61
+ fs.rmSync(artifact);
62
+
63
+ console.info(`Removed ${path.relative(root, artifact)}`);
64
+ }
65
+ }
66
+ }
67
+ }
@@ -1,6 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- //# sourceMappingURL=index.d.js.map
@@ -1 +0,0 @@
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":""}
@@ -1,52 +0,0 @@
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
@@ -1 +0,0 @@
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"}