react-native-webrtc 124.0.7 → 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.
- package/.claude/settings.local.json +9 -0
- package/.eslintignore +1 -0
- package/CLAUDE.md +714 -0
- package/README.md +1 -1
- package/android/build.gradle +1 -1
- package/android/src/main/java/com/oney/WebRTCModule/AbstractVideoCaptureController.java +5 -3
- package/android/src/main/java/com/oney/WebRTCModule/GetUserMediaImpl.java +84 -7
- package/android/src/main/java/com/oney/WebRTCModule/MediaProjectionService.java +24 -3
- package/android/src/main/java/com/oney/WebRTCModule/ScreenCaptureController.java +4 -4
- package/android/src/main/java/com/oney/WebRTCModule/SerializeUtils.java +8 -0
- package/android/src/main/java/com/oney/WebRTCModule/ThreadUtils.java +8 -0
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCModule.java +116 -27
- package/android/src/main/java/com/oney/WebRTCModule/WebRTCView.java +56 -28
- package/android/src/main/java/com/oney/WebRTCModule/videoEffects/VideoEffectProcessor.java +3 -3
- package/ios/RCTWebRTC/RCTConvert+WebRTC.m +21 -0
- package/ios/RCTWebRTC/ScreenCapturePickerViewManager.m +22 -23
- package/ios/RCTWebRTC/SerializeUtils.m +6 -0
- package/ios/RCTWebRTC/VideoCaptureController.m +40 -1
- package/ios/RCTWebRTC/WebRTCModule+RTCMediaStream.m +16 -9
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.h +2 -0
- package/ios/RCTWebRTC/WebRTCModule+RTCPeerConnection.m +95 -0
- package/ios/RCTWebRTC/WebRTCModule+Transceivers.m +5 -1
- package/lib/commonjs/Constraints.js.map +1 -1
- package/lib/commonjs/EventEmitter.js.map +1 -1
- package/lib/commonjs/Logger.js.map +1 -1
- package/lib/commonjs/MediaDevices.js +13 -12
- package/lib/commonjs/MediaDevices.js.map +1 -1
- package/lib/commonjs/MediaStream.js +14 -9
- package/lib/commonjs/MediaStream.js.map +1 -1
- package/lib/commonjs/MediaStreamError.js.map +1 -1
- package/lib/commonjs/MediaStreamErrorEvent.js.map +1 -1
- package/lib/commonjs/MediaStreamTrack.js +28 -12
- package/lib/commonjs/MediaStreamTrack.js.map +1 -1
- package/lib/commonjs/MediaStreamTrackEvent.js +2 -2
- package/lib/commonjs/MediaStreamTrackEvent.js.map +1 -1
- package/lib/commonjs/MessageEvent.js +2 -2
- package/lib/commonjs/MessageEvent.js.map +1 -1
- package/lib/commonjs/Permissions.js +1 -2
- package/lib/commonjs/Permissions.js.map +1 -1
- package/lib/commonjs/RTCAudioSession.js.map +1 -1
- package/lib/commonjs/RTCCertificate.js +25 -0
- package/lib/commonjs/RTCCertificate.js.map +1 -0
- package/lib/commonjs/RTCDataChannel.js +38 -13
- package/lib/commonjs/RTCDataChannel.js.map +1 -1
- package/lib/commonjs/RTCDataChannelEvent.js +2 -2
- package/lib/commonjs/RTCDataChannelEvent.js.map +1 -1
- package/lib/commonjs/RTCErrorEvent.js +2 -2
- package/lib/commonjs/RTCErrorEvent.js.map +1 -1
- package/lib/commonjs/RTCIceCandidate.js.map +1 -1
- package/lib/commonjs/RTCIceCandidateEvent.js +2 -2
- package/lib/commonjs/RTCIceCandidateEvent.js.map +1 -1
- package/lib/commonjs/RTCPIPView.js +1 -2
- package/lib/commonjs/RTCPIPView.js.map +1 -1
- package/lib/commonjs/RTCPeerConnection.js +109 -27
- package/lib/commonjs/RTCPeerConnection.js.map +1 -1
- package/lib/commonjs/RTCRtcpParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpCapabilities.js.map +1 -1
- package/lib/commonjs/RTCRtpCodecCapability.js.map +1 -1
- package/lib/commonjs/RTCRtpCodecParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpEncodingParameters.js +17 -1
- package/lib/commonjs/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpHeaderExtension.js.map +1 -1
- package/lib/commonjs/RTCRtpParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpReceiveParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpReceiver.js.map +1 -1
- package/lib/commonjs/RTCRtpSendParameters.js.map +1 -1
- package/lib/commonjs/RTCRtpSender.js.map +1 -1
- package/lib/commonjs/RTCRtpTransceiver.js.map +1 -1
- package/lib/commonjs/RTCSessionDescription.js.map +1 -1
- package/lib/commonjs/RTCTrackEvent.js +2 -2
- package/lib/commonjs/RTCTrackEvent.js.map +1 -1
- package/lib/commonjs/RTCUtil.js.map +1 -1
- package/lib/commonjs/RTCView.js +1 -2
- package/lib/commonjs/RTCView.js.map +1 -1
- package/lib/commonjs/ScreenCapturePickerView.js +1 -2
- package/lib/commonjs/ScreenCapturePickerView.js.map +1 -1
- package/lib/commonjs/getDisplayMedia.js +2 -1
- package/lib/commonjs/getDisplayMedia.js.map +1 -1
- package/lib/commonjs/getUserMedia.js.map +1 -1
- package/lib/commonjs/index.js +22 -2
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/vendor/event-target-shim/LICENSE +22 -0
- package/lib/commonjs/vendor/event-target-shim/index.js +1221 -0
- package/lib/commonjs/vendor/event-target-shim/index.js.map +1 -0
- package/lib/module/Constraints.js.map +1 -1
- package/lib/module/EventEmitter.js.map +1 -1
- package/lib/module/Logger.js.map +1 -1
- package/lib/module/MediaDevices.js +11 -9
- package/lib/module/MediaDevices.js.map +1 -1
- package/lib/module/MediaStream.js +13 -8
- package/lib/module/MediaStream.js.map +1 -1
- package/lib/module/MediaStreamError.js.map +1 -1
- package/lib/module/MediaStreamErrorEvent.js.map +1 -1
- package/lib/module/MediaStreamTrack.js +25 -9
- package/lib/module/MediaStreamTrack.js.map +1 -1
- package/lib/module/MediaStreamTrackEvent.js +1 -1
- package/lib/module/MediaStreamTrackEvent.js.map +1 -1
- package/lib/module/MessageEvent.js +1 -1
- package/lib/module/MessageEvent.js.map +1 -1
- package/lib/module/Permissions.js.map +1 -1
- package/lib/module/RTCAudioSession.js.map +1 -1
- package/lib/module/RTCCertificate.js +18 -0
- package/lib/module/RTCCertificate.js.map +1 -0
- package/lib/module/RTCDataChannel.js +37 -12
- package/lib/module/RTCDataChannel.js.map +1 -1
- package/lib/module/RTCDataChannelEvent.js +1 -1
- package/lib/module/RTCDataChannelEvent.js.map +1 -1
- package/lib/module/RTCErrorEvent.js +1 -1
- package/lib/module/RTCErrorEvent.js.map +1 -1
- package/lib/module/RTCIceCandidate.js.map +1 -1
- package/lib/module/RTCIceCandidateEvent.js +1 -1
- package/lib/module/RTCIceCandidateEvent.js.map +1 -1
- package/lib/module/RTCPIPView.js.map +1 -1
- package/lib/module/RTCPeerConnection.js +103 -21
- package/lib/module/RTCPeerConnection.js.map +1 -1
- package/lib/module/RTCRtcpParameters.js.map +1 -1
- package/lib/module/RTCRtpCapabilities.js.map +1 -1
- package/lib/module/RTCRtpCodecCapability.js.map +1 -1
- package/lib/module/RTCRtpCodecParameters.js.map +1 -1
- package/lib/module/RTCRtpEncodingParameters.js +17 -1
- package/lib/module/RTCRtpEncodingParameters.js.map +1 -1
- package/lib/module/RTCRtpHeaderExtension.js.map +1 -1
- package/lib/module/RTCRtpParameters.js.map +1 -1
- package/lib/module/RTCRtpReceiveParameters.js.map +1 -1
- package/lib/module/RTCRtpReceiver.js.map +1 -1
- package/lib/module/RTCRtpSendParameters.js.map +1 -1
- package/lib/module/RTCRtpSender.js.map +1 -1
- package/lib/module/RTCRtpTransceiver.js.map +1 -1
- package/lib/module/RTCSessionDescription.js.map +1 -1
- package/lib/module/RTCTrackEvent.js +1 -1
- package/lib/module/RTCTrackEvent.js.map +1 -1
- package/lib/module/RTCUtil.js.map +1 -1
- package/lib/module/RTCView.js.map +1 -1
- package/lib/module/ScreenCapturePickerView.js.map +1 -1
- package/lib/module/getDisplayMedia.js +2 -1
- package/lib/module/getDisplayMedia.js.map +1 -1
- package/lib/module/getUserMedia.js.map +1 -1
- package/lib/module/index.js +5 -3
- package/lib/module/index.js.map +1 -1
- package/lib/module/vendor/event-target-shim/LICENSE +22 -0
- package/lib/module/vendor/event-target-shim/index.js +1221 -0
- package/lib/module/vendor/event-target-shim/index.js.map +1 -0
- package/lib/typescript/MediaDevices.d.ts +8 -4
- package/lib/typescript/MediaStream.d.ts +5 -1
- package/lib/typescript/MediaStreamTrack.d.ts +7 -1
- package/lib/typescript/MediaStreamTrackEvent.d.ts +1 -1
- package/lib/typescript/MessageEvent.d.ts +1 -1
- package/lib/typescript/RTCCertificate.d.ts +16 -0
- package/lib/typescript/RTCDataChannel.d.ts +13 -1
- package/lib/typescript/RTCDataChannelEvent.d.ts +1 -1
- package/lib/typescript/RTCErrorEvent.d.ts +1 -1
- package/lib/typescript/RTCIceCandidateEvent.d.ts +1 -1
- package/lib/typescript/RTCPeerConnection.d.ts +30 -1
- package/lib/typescript/RTCRtpEncodingParameters.d.ts +4 -0
- package/lib/typescript/RTCTrackEvent.d.ts +1 -1
- package/lib/typescript/getDisplayMedia.d.ts +7 -1
- package/lib/typescript/index.d.ts +4 -1
- package/lib/typescript/vendor/event-target-shim/index.d.ts +411 -0
- package/package.json +3 -4
- package/react-native-webrtc.podspec +2 -2
- package/src/MediaDevices.ts +15 -14
- package/src/MediaStream.ts +17 -9
- package/src/MediaStreamTrack.ts +30 -10
- package/src/MediaStreamTrackEvent.ts +2 -2
- package/src/MessageEvent.ts +1 -1
- package/src/RTCCertificate.ts +24 -0
- package/src/RTCDataChannel.ts +49 -14
- package/src/RTCDataChannelEvent.ts +2 -2
- package/src/RTCErrorEvent.ts +1 -1
- package/src/RTCIceCandidateEvent.ts +2 -2
- package/src/RTCPeerConnection.ts +138 -24
- package/src/RTCRtpEncodingParameters.ts +20 -0
- package/src/RTCTrackEvent.ts +1 -1
- package/src/getDisplayMedia.ts +9 -2
- package/src/index.ts +9 -2
- package/src/vendor/event-target-shim/LICENSE +22 -0
- package/src/vendor/event-target-shim/index.d.ts +411 -0
- package/src/vendor/event-target-shim/index.js +1186 -0
- package/tools/postbuild.mjs +67 -0
|
@@ -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 {};
|