@lynx-js/types 3.3.1 → 3.3.2
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/CHANGELOG.md +54 -1
- package/package.json +5 -1
- package/types/background-thread/fetch.d.ts +15 -0
- package/types/background-thread/index.d.ts +1 -0
- package/types/background-thread/lynx-performance-entry.d.ts +53 -0
- package/types/background-thread/lynx.d.ts +11 -1
- package/types/background-thread/nodes-ref.d.ts +2 -0
- package/types/background-thread/text-encoder-decoder.d.ts +15 -21
- package/types/common/csstype.d.ts +103 -213
- package/types/common/element/element.d.ts +11 -1
- package/types/common/element/image.d.ts +82 -65
- package/types/common/element/index.d.ts +2 -0
- package/types/common/element/input.d.ts +386 -0
- package/types/common/element/list.d.ts +45 -3
- package/types/common/element/methods.d.ts +2 -2
- package/types/common/element/scroll-view.d.ts +92 -137
- package/types/common/element/text.d.ts +174 -11
- package/types/common/element/textarea.d.ts +411 -0
- package/types/common/events.d.ts +155 -15
- package/types/common/global.d.ts +4 -2
- package/types/common/lynx.d.ts +60 -0
- package/types/common/performance.d.ts +10 -1
- package/types/main-thread/element.d.ts +0 -20
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
import { BaseEvent, BaseMethod, Callback } from '../events';
|
|
2
|
+
import { StandardProps } from '../props';
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
export interface TextAreaInputEvent {
|
|
6
|
+
/**
|
|
7
|
+
* Input content
|
|
8
|
+
* @Android
|
|
9
|
+
* @iOS
|
|
10
|
+
* @Harmony
|
|
11
|
+
* @Web
|
|
12
|
+
* @since 3.4
|
|
13
|
+
*/
|
|
14
|
+
value: string;
|
|
15
|
+
/**
|
|
16
|
+
* The start position of the selection
|
|
17
|
+
* @Android
|
|
18
|
+
* @iOS
|
|
19
|
+
* @Harmony
|
|
20
|
+
* @Web
|
|
21
|
+
* @since 3.4
|
|
22
|
+
*/
|
|
23
|
+
selectionStart: number;
|
|
24
|
+
/**
|
|
25
|
+
* The end position of the selection
|
|
26
|
+
* @Android
|
|
27
|
+
* @iOS
|
|
28
|
+
* @Harmony
|
|
29
|
+
* @Web
|
|
30
|
+
* @since 3.4
|
|
31
|
+
*/
|
|
32
|
+
selectionEnd: number;
|
|
33
|
+
/**
|
|
34
|
+
* Is composing or not
|
|
35
|
+
* @iOS
|
|
36
|
+
* @Web
|
|
37
|
+
* @Android
|
|
38
|
+
* @Harmony
|
|
39
|
+
* @since 3.4
|
|
40
|
+
*/
|
|
41
|
+
isComposing?: boolean;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface TextAreaFocusEvent {
|
|
45
|
+
/**
|
|
46
|
+
* Input content
|
|
47
|
+
* @Android
|
|
48
|
+
* @iOS
|
|
49
|
+
* @Harmony
|
|
50
|
+
* @Web
|
|
51
|
+
* @since 3.4
|
|
52
|
+
*/
|
|
53
|
+
value: string;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface TextAreaBlurEvent {
|
|
57
|
+
/**
|
|
58
|
+
* Input content
|
|
59
|
+
* @Android
|
|
60
|
+
* @iOS
|
|
61
|
+
* @Harmony
|
|
62
|
+
* @Web
|
|
63
|
+
* @since 3.4
|
|
64
|
+
*/
|
|
65
|
+
value: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface TextAreaConfirmEvent {
|
|
69
|
+
/**
|
|
70
|
+
* Input content
|
|
71
|
+
* @Android
|
|
72
|
+
* @iOS
|
|
73
|
+
* @Harmony
|
|
74
|
+
* @Web
|
|
75
|
+
* @since 3.4
|
|
76
|
+
*/
|
|
77
|
+
value: string;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export interface TextAreaSelectionChangeEvent {
|
|
81
|
+
/**
|
|
82
|
+
* The start position of the selection
|
|
83
|
+
* @Android
|
|
84
|
+
* @iOS
|
|
85
|
+
* @Harmony
|
|
86
|
+
* @Web
|
|
87
|
+
* @since 3.4
|
|
88
|
+
*/
|
|
89
|
+
selectionStart: number;
|
|
90
|
+
/**
|
|
91
|
+
* The end position of the selection
|
|
92
|
+
* @Android
|
|
93
|
+
* @iOS
|
|
94
|
+
* @Harmony
|
|
95
|
+
* @Web
|
|
96
|
+
* @since 3.4
|
|
97
|
+
*/
|
|
98
|
+
selectionEnd: number;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export interface TextAreaProps extends Omit<StandardProps, 'bindfocus' | 'bindblur'> {
|
|
102
|
+
/**
|
|
103
|
+
* Placeholder
|
|
104
|
+
* @Android
|
|
105
|
+
* @iOS
|
|
106
|
+
* @Harmony
|
|
107
|
+
* @Web
|
|
108
|
+
* @since 3.4
|
|
109
|
+
*/
|
|
110
|
+
placeholder?: string
|
|
111
|
+
/**
|
|
112
|
+
* The type of confirm button
|
|
113
|
+
* @defaultValue 'done'
|
|
114
|
+
* @iOS
|
|
115
|
+
* @Harmony
|
|
116
|
+
* @Web
|
|
117
|
+
* @since 3.4
|
|
118
|
+
*/
|
|
119
|
+
'confirm-type'?: 'send' | 'search' | 'go' | 'done' | 'next';
|
|
120
|
+
/**
|
|
121
|
+
* Max input length
|
|
122
|
+
* @defaultValue 140
|
|
123
|
+
* @Android
|
|
124
|
+
* @iOS
|
|
125
|
+
* @Harmony
|
|
126
|
+
* @Web
|
|
127
|
+
* @since 3.4
|
|
128
|
+
*/
|
|
129
|
+
maxlength?: number;
|
|
130
|
+
/**
|
|
131
|
+
* Max input lines
|
|
132
|
+
* @defaultValue undefined
|
|
133
|
+
* @Android
|
|
134
|
+
* @iOS
|
|
135
|
+
* @Harmony
|
|
136
|
+
* @since 3.4
|
|
137
|
+
*/
|
|
138
|
+
maxlines?: number;
|
|
139
|
+
/**
|
|
140
|
+
* Bounce effect for iOS
|
|
141
|
+
* @defaultValue true
|
|
142
|
+
* @iOS
|
|
143
|
+
* @since 3.4
|
|
144
|
+
*/
|
|
145
|
+
bounces?: boolean;
|
|
146
|
+
/**
|
|
147
|
+
* Line spacing
|
|
148
|
+
* @defaultValue undefined
|
|
149
|
+
* @iOS
|
|
150
|
+
* @Android
|
|
151
|
+
* @since 3.4
|
|
152
|
+
*/
|
|
153
|
+
'line-spacing'?: number | `${number}px` | `${number}rpx`;
|
|
154
|
+
/**
|
|
155
|
+
* Readonly
|
|
156
|
+
* @defaultValue false
|
|
157
|
+
* @Android
|
|
158
|
+
* @iOS
|
|
159
|
+
* @Harmony
|
|
160
|
+
* @Web
|
|
161
|
+
* @since 3.4
|
|
162
|
+
*/
|
|
163
|
+
readonly?: boolean;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Interaction enabled
|
|
167
|
+
* @defaultValue false
|
|
168
|
+
* @Android
|
|
169
|
+
* @iOS
|
|
170
|
+
* @Harmony
|
|
171
|
+
* @since 3.5
|
|
172
|
+
*/
|
|
173
|
+
disabled?: boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Show soft input keyboard while focused
|
|
177
|
+
* @defaultValue true
|
|
178
|
+
* @Android
|
|
179
|
+
* @iOS
|
|
180
|
+
* @since 3.4
|
|
181
|
+
*/
|
|
182
|
+
'show-soft-input-on-focus'?: boolean;
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Filter the input content and process it in the form of regular expressions
|
|
186
|
+
* @defaultValue undefined
|
|
187
|
+
* @Android
|
|
188
|
+
* @iOS
|
|
189
|
+
* @Harmony
|
|
190
|
+
* @Web
|
|
191
|
+
* @since 3.4
|
|
192
|
+
*/
|
|
193
|
+
'input-filter'?: string;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Input content type
|
|
197
|
+
* @defaultValue "text"
|
|
198
|
+
* @Android
|
|
199
|
+
* @iOS
|
|
200
|
+
* @Harmony
|
|
201
|
+
* @Web
|
|
202
|
+
* @since 3.4
|
|
203
|
+
*/
|
|
204
|
+
type?: 'text' | 'number' | 'digit' | 'tel' | 'email';
|
|
205
|
+
|
|
206
|
+
/**
|
|
207
|
+
* Auto correct input content on iOS
|
|
208
|
+
* @defaultValue true
|
|
209
|
+
* @iOS
|
|
210
|
+
* @since 3.4
|
|
211
|
+
*/
|
|
212
|
+
'ios-auto-correct'?: boolean;
|
|
213
|
+
|
|
214
|
+
/**
|
|
215
|
+
* Check spelling issue on iOS
|
|
216
|
+
* @defaultValue true
|
|
217
|
+
* @iOS
|
|
218
|
+
* @Web
|
|
219
|
+
* @since 3.4
|
|
220
|
+
*/
|
|
221
|
+
'ios-spell-check'?: boolean;
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Whether to enter the full-screen input mode when in landscape screen, in which the keyboard and input box will take up the entire screen
|
|
225
|
+
* @defaultValue true
|
|
226
|
+
* @Android
|
|
227
|
+
* @since 3.4
|
|
228
|
+
*/
|
|
229
|
+
'android-fullscreen-mode'?: boolean;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* Focused
|
|
233
|
+
* @Android
|
|
234
|
+
* @iOS
|
|
235
|
+
* @Harmony
|
|
236
|
+
* @Web
|
|
237
|
+
* @since 3.4
|
|
238
|
+
*/
|
|
239
|
+
bindfocus?: (e: BaseEvent<'bindfocus', TextAreaFocusEvent>) => void;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* Blurred
|
|
243
|
+
* @Android
|
|
244
|
+
* @iOS
|
|
245
|
+
* @Harmony
|
|
246
|
+
* @Web
|
|
247
|
+
* @since 3.4
|
|
248
|
+
*/
|
|
249
|
+
bindblur?: (e: BaseEvent<'bindblur', TextAreaBlurEvent>) => void;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Input content changed
|
|
253
|
+
* @Android
|
|
254
|
+
* @iOS
|
|
255
|
+
* @Harmony
|
|
256
|
+
* @Web
|
|
257
|
+
* @since 3.4
|
|
258
|
+
*/
|
|
259
|
+
bindinput?: (e: BaseEvent<'bindinput', TextAreaInputEvent>) => void;
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* Input selection changed
|
|
263
|
+
* @Android
|
|
264
|
+
* @iOS
|
|
265
|
+
* @Harmony
|
|
266
|
+
* @Web
|
|
267
|
+
* @since 3.4
|
|
268
|
+
*/
|
|
269
|
+
bindselection?: (e: BaseEvent<'bindselection', TextAreaSelectionChangeEvent>) => void;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Confirm button clicked, only work when confirm-type is defined
|
|
273
|
+
* @Android
|
|
274
|
+
* @iOS
|
|
275
|
+
* @Harmony
|
|
276
|
+
* @Web
|
|
277
|
+
* @since 3.4
|
|
278
|
+
*/
|
|
279
|
+
bindconfirm?: (e: BaseEvent<'bindconfirm', TextAreaConfirmEvent>) => void;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Require focus
|
|
284
|
+
* @Android
|
|
285
|
+
* @iOS
|
|
286
|
+
* @Harmony
|
|
287
|
+
* @Web
|
|
288
|
+
* @since 3.4
|
|
289
|
+
*/
|
|
290
|
+
export interface TextAreaFocusMethod extends BaseMethod {
|
|
291
|
+
method: 'focus';
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
/**
|
|
295
|
+
* Release focus
|
|
296
|
+
* @Android
|
|
297
|
+
* @iOS
|
|
298
|
+
* @Harmony
|
|
299
|
+
* @Web
|
|
300
|
+
* @since 3.4
|
|
301
|
+
*/
|
|
302
|
+
export interface TextAreaBlurMethod extends BaseMethod {
|
|
303
|
+
method: 'blur';
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* Get input content
|
|
308
|
+
* @Android
|
|
309
|
+
* @iOS
|
|
310
|
+
* @Harmony
|
|
311
|
+
* @Web
|
|
312
|
+
* @since 3.4
|
|
313
|
+
*/
|
|
314
|
+
export interface TextAreaGetValueMethod extends BaseMethod {
|
|
315
|
+
method: 'getValue';
|
|
316
|
+
success?: Callback<{
|
|
317
|
+
/**
|
|
318
|
+
* Input content
|
|
319
|
+
* @Android
|
|
320
|
+
* @iOS
|
|
321
|
+
* @Harmony
|
|
322
|
+
* @Web
|
|
323
|
+
* @since 3.4
|
|
324
|
+
*/
|
|
325
|
+
value: string;
|
|
326
|
+
/**
|
|
327
|
+
* Begin position of the cursor
|
|
328
|
+
* @Android
|
|
329
|
+
* @iOS
|
|
330
|
+
* @Harmony
|
|
331
|
+
* @Web
|
|
332
|
+
* @since 3.4
|
|
333
|
+
*/
|
|
334
|
+
selectionStart: number;
|
|
335
|
+
/**
|
|
336
|
+
* End position of the cursor
|
|
337
|
+
* @Android
|
|
338
|
+
* @iOS
|
|
339
|
+
* @Harmony
|
|
340
|
+
* @Web
|
|
341
|
+
* @since 3.4
|
|
342
|
+
*/
|
|
343
|
+
selectionEnd: number;
|
|
344
|
+
/**
|
|
345
|
+
* Is composing or not, iOS only
|
|
346
|
+
* @iOS
|
|
347
|
+
* @Android
|
|
348
|
+
* @Harmony
|
|
349
|
+
* @Web
|
|
350
|
+
* @since 3.4
|
|
351
|
+
*/
|
|
352
|
+
isComposing: boolean;
|
|
353
|
+
}>;
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/**
|
|
357
|
+
* Set input content
|
|
358
|
+
* @Android
|
|
359
|
+
* @iOS
|
|
360
|
+
* @Harmony
|
|
361
|
+
* @Web
|
|
362
|
+
* @since 3.4
|
|
363
|
+
*/
|
|
364
|
+
export interface TextAreaSetValueMethod extends BaseMethod {
|
|
365
|
+
method: 'setValue';
|
|
366
|
+
params: {
|
|
367
|
+
/**
|
|
368
|
+
* Input content
|
|
369
|
+
* @Android
|
|
370
|
+
* @iOS
|
|
371
|
+
* @Harmony
|
|
372
|
+
* @Web
|
|
373
|
+
* @since 3.4
|
|
374
|
+
*/
|
|
375
|
+
value: string;
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Set selection range
|
|
381
|
+
* @Android
|
|
382
|
+
* @iOS
|
|
383
|
+
* @Harmony
|
|
384
|
+
* @Web
|
|
385
|
+
* @since 3.4
|
|
386
|
+
*/
|
|
387
|
+
export interface TextAreaSetSelectionRangeMethod extends BaseMethod {
|
|
388
|
+
method: 'setSelectionRange';
|
|
389
|
+
params: {
|
|
390
|
+
/**
|
|
391
|
+
* Start position of the selection
|
|
392
|
+
* @Android
|
|
393
|
+
* @iOS
|
|
394
|
+
* @Harmony
|
|
395
|
+
* @Web
|
|
396
|
+
* @since 3.4
|
|
397
|
+
*/
|
|
398
|
+
selectionStart: number;
|
|
399
|
+
/**
|
|
400
|
+
* End position of the selection
|
|
401
|
+
* @Android
|
|
402
|
+
* @iOS
|
|
403
|
+
* @Harmony
|
|
404
|
+
* @Web
|
|
405
|
+
* @since 3.4
|
|
406
|
+
*/
|
|
407
|
+
selectionEnd: number;
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export type TextAreaUIMethods = TextAreaFocusMethod | TextAreaBlurMethod | TextAreaGetValueMethod | TextAreaSetValueMethod | TextAreaSetSelectionRangeMethod;
|
package/types/common/events.d.ts
CHANGED
|
@@ -80,9 +80,9 @@ export interface BaseTouchEvent<T> extends BaseEventOrig<any, T> {
|
|
|
80
80
|
changedTouches: Array<Touch>;
|
|
81
81
|
|
|
82
82
|
detail: {
|
|
83
|
-
/** The current position of the touch point relative to the
|
|
83
|
+
/** The current position of the touch point relative to the page's x-coordinate. */
|
|
84
84
|
x: number;
|
|
85
|
-
/** The current position of the touch point relative to the
|
|
85
|
+
/** The current position of the touch point relative to the page's y-coordinate. */
|
|
86
86
|
y: number;
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -173,33 +173,25 @@ export interface BaseTransitionEvent<T> extends BaseEventOrig<{}, T> {
|
|
|
173
173
|
export interface TransitionEvent extends BaseTransitionEvent<Target> {}
|
|
174
174
|
|
|
175
175
|
export interface BaseImageLoadEvent<T> extends BaseEventOrig<{}, T> {
|
|
176
|
-
detail: {
|
|
177
176
|
width: number;
|
|
178
177
|
height: number;
|
|
179
|
-
};
|
|
180
178
|
}
|
|
181
179
|
|
|
182
180
|
export interface ImageLoadEvent extends BaseImageLoadEvent<Target> {
|
|
183
|
-
detail: {
|
|
184
181
|
width: number;
|
|
185
182
|
height: number;
|
|
186
|
-
};
|
|
187
183
|
}
|
|
188
184
|
|
|
189
185
|
export interface BaseImageErrorEvent<T> extends BaseEventOrig<{}, T> {
|
|
190
|
-
detail: {
|
|
191
186
|
errMsg: string;
|
|
192
187
|
error_code: number;
|
|
193
188
|
lynx_categorized_code: number;
|
|
194
|
-
};
|
|
195
189
|
}
|
|
196
190
|
|
|
197
191
|
export interface ImageErrorEvent extends BaseImageErrorEvent<Target> {
|
|
198
|
-
detail: {
|
|
199
192
|
errMsg: string;
|
|
200
193
|
error_code: number;
|
|
201
194
|
lynx_categorized_code: number;
|
|
202
|
-
};
|
|
203
195
|
}
|
|
204
196
|
|
|
205
197
|
export interface TextLineInfo {
|
|
@@ -217,6 +209,12 @@ export interface TextLayoutEventDetail {
|
|
|
217
209
|
};
|
|
218
210
|
}
|
|
219
211
|
|
|
212
|
+
export interface TextSelectionChangeEventDetail {
|
|
213
|
+
start: number;
|
|
214
|
+
end: number;
|
|
215
|
+
direction: 'forward' | 'backward';
|
|
216
|
+
}
|
|
217
|
+
|
|
220
218
|
export interface AccessibilityActionDetailEvent<T> extends BaseEventOrig<{}, T> {
|
|
221
219
|
detail: {
|
|
222
220
|
/**
|
|
@@ -448,11 +446,83 @@ export interface LynxBindCatchEvent<T = any> {
|
|
|
448
446
|
LongTap?: EventHandler<BaseTouchEvent<T>>;
|
|
449
447
|
}
|
|
450
448
|
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
449
|
+
type PrefixedEvent<E> = {
|
|
450
|
+
bind?: E;
|
|
451
|
+
catch?: E;
|
|
452
|
+
'capture-bind'?: E;
|
|
453
|
+
'capture-catch'?: E;
|
|
454
|
+
'global-bind'?: E;
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
// Helper interfaces for each event, providing explicit properties
|
|
458
|
+
// for bind, catch, capture-bind, capture-catch, and global-bind prefixes.
|
|
459
|
+
interface BGLoadProps<T> { bindbgload?: LynxEvent<T>['BGLoad']; catchbgload?: LynxEvent<T>['BGLoad']; 'capture-bindbgload'?: LynxEvent<T>['BGLoad']; 'capture-catchbgload'?: LynxEvent<T>['BGLoad']; 'global-bindbgload'?: LynxEvent<T>['BGLoad']; }
|
|
460
|
+
interface BGErrorProps<T> { bindbgerror?: LynxEvent<T>['BGError']; catchbgerror?: LynxEvent<T>['BGError']; 'capture-bindbgerror'?: LynxEvent<T>['BGError']; 'capture-catchbgerror'?: LynxEvent<T>['BGError']; 'global-bindbgerror'?: LynxEvent<T>['BGError']; }
|
|
461
|
+
interface TouchStartProps<T> { bindtouchstart?: LynxEvent<T>['TouchStart']; catchtouchstart?: LynxEvent<T>['TouchStart']; 'capture-bindtouchstart'?: LynxEvent<T>['TouchStart']; 'capture-catchtouchstart'?: LynxEvent<T>['TouchStart']; 'global-bindtouchstart'?: LynxEvent<T>['TouchStart']; }
|
|
462
|
+
interface TouchMoveProps<T> { bindtouchmove?: LynxEvent<T>['TouchMove']; catchtouchmove?: LynxEvent<T>['TouchMove']; 'capture-bindtouchmove'?: LynxEvent<T>['TouchMove']; 'capture-catchtouchmove'?: LynxEvent<T>['TouchMove']; 'global-bindtouchmove'?: LynxEvent<T>['TouchMove']; }
|
|
463
|
+
interface TouchCancelProps<T> { bindtouchcancel?: LynxEvent<T>['TouchCancel']; catchtouchcancel?: LynxEvent<T>['TouchCancel']; 'capture-bindtouchcancel'?: LynxEvent<T>['TouchCancel']; 'capture-catchtouchcancel'?: LynxEvent<T>['TouchCancel']; 'global-bindtouchcancel'?: LynxEvent<T>['TouchCancel']; }
|
|
464
|
+
interface TouchEndProps<T> { bindtouchend?: LynxEvent<T>['TouchEnd']; catchtouchend?: LynxEvent<T>['TouchEnd']; 'capture-bindtouchend'?: LynxEvent<T>['TouchEnd']; 'capture-catchtouchend'?: LynxEvent<T>['TouchEnd']; 'global-bindtouchend'?: LynxEvent<T>['TouchEnd']; }
|
|
465
|
+
interface LongPressProps<T> { bindlongpress?: LynxEvent<T>['LongPress']; catchlongpress?: LynxEvent<T>['LongPress']; 'capture-bindlongpress'?: LynxEvent<T>['LongPress']; 'capture-catchlongpress'?: LynxEvent<T>['LongPress']; 'global-bindlongpress'?: LynxEvent<T>['LongPress']; }
|
|
466
|
+
interface TransitionStartProps<T> { bindtransitionstart?: LynxEvent<T>['TransitionStart']; catchtransitionstart?: LynxEvent<T>['TransitionStart']; 'capture-bindtransitionstart'?: LynxEvent<T>['TransitionStart']; 'capture-catchtransitionstart'?: LynxEvent<T>['TransitionStart']; 'global-bindtransitionstart'?: LynxEvent<T>['TransitionStart']; }
|
|
467
|
+
interface TransitionCancelProps<T> { bindtransitioncancel?: LynxEvent<T>['TransitionCancel']; catchtransitioncancel?: LynxEvent<T>['TransitionCancel']; 'capture-bindtransitioncancel'?: LynxEvent<T>['TransitionCancel']; 'capture-catchtransitioncancel'?: LynxEvent<T>['TransitionCancel']; 'global-bindtransitioncancel'?: LynxEvent<T>['TransitionCancel']; }
|
|
468
|
+
interface TransitionEndProps<T> { bindtransitionend?: LynxEvent<T>['TransitionEnd']; catchtransitionend?: LynxEvent<T>['TransitionEnd']; 'capture-bindtransitionend'?: LynxEvent<T>['TransitionEnd']; 'capture-catchtransitionend'?: LynxEvent<T>['TransitionEnd']; 'global-bindtransitionend'?: LynxEvent<T>['TransitionEnd']; }
|
|
469
|
+
interface AnimationStartProps<T> { bindanimationstart?: LynxEvent<T>['AnimationStart']; catchanimationstart?: LynxEvent<T>['AnimationStart']; 'capture-bindanimationstart'?: LynxEvent<T>['AnimationStart']; 'capture-catchanimationstart'?: LynxEvent<T>['AnimationStart']; 'global-bindanimationstart'?: LynxEvent<T>['AnimationStart']; }
|
|
470
|
+
interface AnimationIterationProps<T> { bindanimationiteration?: LynxEvent<T>['AnimationIteration']; catchanimationiteration?: LynxEvent<T>['AnimationIteration']; 'capture-bindanimationiteration'?: LynxEvent<T>['AnimationIteration']; 'capture-catchanimationiteration'?: LynxEvent<T>['AnimationIteration']; 'global-bindanimationiteration'?: LynxEvent<T>['AnimationIteration']; }
|
|
471
|
+
interface AnimationCancelProps<T> { bindanimationcancel?: LynxEvent<T>['AnimationCancel']; catchanimationcancel?: LynxEvent<T>['AnimationCancel']; 'capture-bindanimationcancel'?: LynxEvent<T>['AnimationCancel']; 'capture-catchanimationcancel'?: LynxEvent<T>['AnimationCancel']; 'global-bindanimationcancel'?: LynxEvent<T>['AnimationCancel']; }
|
|
472
|
+
interface AnimationEndProps<T> { bindanimationend?: LynxEvent<T>['AnimationEnd']; catchanimationend?: LynxEvent<T>['AnimationEnd']; 'capture-bindanimationend'?: LynxEvent<T>['AnimationEnd']; 'capture-catchanimationend'?: LynxEvent<T>['AnimationEnd']; 'global-bindanimationend'?: LynxEvent<T>['AnimationEnd']; }
|
|
473
|
+
interface MouseDownProps<T> { bindmousedown?: LynxEvent<T>['MouseDown']; catchmousedown?: LynxEvent<T>['MouseDown']; 'capture-bindmousedown'?: LynxEvent<T>['MouseDown']; 'capture-catchmousedown'?: LynxEvent<T>['MouseDown']; 'global-bindmousedown'?: LynxEvent<T>['MouseDown']; }
|
|
474
|
+
interface MouseUpProps<T> { bindmouseup?: LynxEvent<T>['MouseUp']; catchmouseup?: LynxEvent<T>['MouseUp']; 'capture-bindmouseup'?: LynxEvent<T>['MouseUp']; 'capture-catchmouseup'?: LynxEvent<T>['MouseUp']; 'global-bindmouseup'?: LynxEvent<T>['MouseUp']; }
|
|
475
|
+
interface MouseMoveProps<T> { bindmousemove?: LynxEvent<T>['MouseMove']; catchmousemove?: LynxEvent<T>['MouseMove']; 'capture-bindmousemove'?: LynxEvent<T>['MouseMove']; 'capture-catchmousemove'?: LynxEvent<T>['MouseMove']; 'global-bindmousemove'?: LynxEvent<T>['MouseMove']; }
|
|
476
|
+
interface MouseClickProps<T> { bindmouseclick?: LynxEvent<T>['MouseClick']; catchmouseclick?: LynxEvent<T>['MouseClick']; 'capture-bindmouseclick'?: LynxEvent<T>['MouseClick']; 'capture-catchmouseclick'?: LynxEvent<T>['MouseClick']; 'global-bindmouseclick'?: LynxEvent<T>['MouseClick']; }
|
|
477
|
+
interface MouseDblClickProps<T> { bindmousedblclick?: LynxEvent<T>['MouseDblClick']; catchmousedblclick?: LynxEvent<T>['MouseDblClick']; 'capture-bindmousedblclick'?: LynxEvent<T>['MouseDblClick']; 'capture-catchmousedblclick'?: LynxEvent<T>['MouseDblClick']; 'global-bindmousedblclick'?: LynxEvent<T>['MouseDblClick']; }
|
|
478
|
+
interface MouseLongPressProps<T> { bindmouselongpress?: LynxEvent<T>['MouseLongPress']; catchmouselongpress?: LynxEvent<T>['MouseLongPress']; 'capture-bindmouselongpress'?: LynxEvent<T>['MouseLongPress']; 'capture-catchmouselongpress'?: LynxEvent<T>['MouseLongPress']; 'global-bindmouselongpress'?: LynxEvent<T>['MouseLongPress']; }
|
|
479
|
+
interface WheelProps<T> { bindwheel?: LynxEvent<T>['Wheel']; catchwheel?: LynxEvent<T>['Wheel']; 'capture-bindwheel'?: LynxEvent<T>['Wheel']; 'capture-catchwheel'?: LynxEvent<T>['Wheel']; 'global-bindwheel'?: LynxEvent<T>['Wheel']; }
|
|
480
|
+
interface KeyDownProps<T> { bindkeydown?: LynxEvent<T>['KeyDown']; catchkeydown?: LynxEvent<T>['KeyDown']; 'capture-bindkeydown'?: LynxEvent<T>['KeyDown']; 'capture-catchkeydown'?: LynxEvent<T>['KeyDown']; 'global-bindkeydown'?: LynxEvent<T>['KeyDown']; }
|
|
481
|
+
interface KeyUpProps<T> { bindkeyup?: LynxEvent<T>['KeyUp']; catchkeyup?: LynxEvent<T>['KeyUp']; 'capture-bindkeyup'?: LynxEvent<T>['KeyUp']; 'capture-catchkeyup'?: LynxEvent<T>['KeyUp']; 'global-bindkeyup'?: LynxEvent<T>['KeyUp']; }
|
|
482
|
+
interface FocusProps<T> { bindfocus?: LynxEvent<T>['Focus']; catchfocus?: LynxEvent<T>['Focus']; 'capture-bindfocus'?: LynxEvent<T>['Focus']; 'capture-catchfocus'?: LynxEvent<T>['Focus']; 'global-bindfocus'?: LynxEvent<T>['Focus']; }
|
|
483
|
+
interface BlurProps<T> { bindblur?: LynxEvent<T>['Blur']; catchblur?: LynxEvent<T>['Blur']; 'capture-bindblur'?: LynxEvent<T>['Blur']; 'capture-catchblur'?: LynxEvent<T>['Blur']; 'global-bindblur'?: LynxEvent<T>['Blur']; }
|
|
484
|
+
interface LayoutChangeProps<T> { bindlayoutchange?: LynxEvent<T>['LayoutChange']; catchlayoutchange?: LynxEvent<T>['LayoutChange']; 'capture-bindlayoutchange'?: LynxEvent<T>['LayoutChange']; 'capture-catchlayoutchange'?: LynxEvent<T>['LayoutChange']; 'global-bindlayoutchange'?: LynxEvent<T>['LayoutChange']; }
|
|
485
|
+
interface UIAppearProps<T> { binduiappear?: LynxEvent<T>['UIAppear']; catchuiappear?: LynxEvent<T>['UIAppear']; 'capture-binduiappear'?: LynxEvent<T>['UIAppear']; 'capture-catchuiappear'?: LynxEvent<T>['UIAppear']; 'global-binduiappear'?: LynxEvent<T>['UIAppear']; }
|
|
486
|
+
interface UIDisappearProps<T> { binduidisappear?: LynxEvent<T>['UIDisappear']; catchuidisappear?: LynxEvent<T>['UIDisappear']; 'capture-binduidisappear'?: LynxEvent<T>['UIDisappear']; 'capture-catchuidisappear'?: LynxEvent<T>['UIDisappear']; 'global-binduidisappear'?: LynxEvent<T>['UIDisappear']; }
|
|
487
|
+
interface AccessibilityActionProps<T> { bindaccessibilityaction?: LynxEvent<T>['AccessibilityAction']; catchaccessibilityaction?: LynxEvent<T>['AccessibilityAction']; 'capture-bindaccessibilityaction'?: LynxEvent<T>['AccessibilityAction']; 'capture-catchaccessibilityaction'?: LynxEvent<T>['AccessibilityAction']; 'global-bindaccessibilityaction'?: LynxEvent<T>['AccessibilityAction']; }
|
|
488
|
+
interface TapProps<T> { bindtap?: LynxBindCatchEvent<T>['Tap']; catchtap?: LynxBindCatchEvent<T>['Tap']; 'capture-bindtap'?: LynxBindCatchEvent<T>['Tap']; 'capture-catchtap'?: LynxBindCatchEvent<T>['Tap']; 'global-bindtap'?: LynxBindCatchEvent<T>['Tap']; }
|
|
489
|
+
interface LongTapProps<T> { bindlongtap?: LynxBindCatchEvent<T>['LongTap']; catchlongtap?: LynxBindCatchEvent<T>['LongTap']; 'capture-bindlongtap'?: LynxBindCatchEvent<T>['LongTap']; 'capture-catchlongtap'?: LynxBindCatchEvent<T>['LongTap']; 'global-bindlongtap'?: LynxBindCatchEvent<T>['LongTap']; }
|
|
490
|
+
|
|
491
|
+
/**
|
|
492
|
+
* A combination of all possible event properties, statically defined for IDE-friendliness.
|
|
493
|
+
* This replaces the previous dynamic mapped type.
|
|
494
|
+
*/
|
|
495
|
+
export type LynxEventPropsBase<T> = BGLoadProps<T> &
|
|
496
|
+
BGErrorProps<T> &
|
|
497
|
+
TouchStartProps<T> &
|
|
498
|
+
TouchMoveProps<T> &
|
|
499
|
+
TouchCancelProps<T> &
|
|
500
|
+
TouchEndProps<T> &
|
|
501
|
+
LongPressProps<T> &
|
|
502
|
+
TransitionStartProps<T> &
|
|
503
|
+
TransitionCancelProps<T> &
|
|
504
|
+
TransitionEndProps<T> &
|
|
505
|
+
AnimationStartProps<T> &
|
|
506
|
+
AnimationIterationProps<T> &
|
|
507
|
+
AnimationCancelProps<T> &
|
|
508
|
+
AnimationEndProps<T> &
|
|
509
|
+
MouseDownProps<T> &
|
|
510
|
+
MouseUpProps<T> &
|
|
511
|
+
MouseMoveProps<T> &
|
|
512
|
+
MouseClickProps<T> &
|
|
513
|
+
MouseDblClickProps<T> &
|
|
514
|
+
MouseLongPressProps<T> &
|
|
515
|
+
WheelProps<T> &
|
|
516
|
+
KeyDownProps<T> &
|
|
517
|
+
KeyUpProps<T> &
|
|
518
|
+
FocusProps<T> &
|
|
519
|
+
BlurProps<T> &
|
|
520
|
+
LayoutChangeProps<T> &
|
|
521
|
+
UIAppearProps<T> &
|
|
522
|
+
UIDisappearProps<T> &
|
|
523
|
+
AccessibilityActionProps<T> &
|
|
524
|
+
TapProps<T> &
|
|
525
|
+
LongTapProps<T>;
|
|
456
526
|
|
|
457
527
|
export type LynxEventProps = LynxEventPropsBase<Target>;
|
|
458
528
|
|
|
@@ -460,3 +530,73 @@ export interface ITouchEvent extends BaseTouchEvent<Target> {}
|
|
|
460
530
|
export interface IMouseEvent extends BaseMouseEvent<Target> {}
|
|
461
531
|
export interface IWheelEvent extends BaseWheelEvent<Target> {}
|
|
462
532
|
export interface IKeyEvent extends BaseKeyEvent<Target> {}
|
|
533
|
+
|
|
534
|
+
interface LynxMessageEvents {
|
|
535
|
+
// from native context
|
|
536
|
+
__GlobalEvent: {
|
|
537
|
+
data: [
|
|
538
|
+
// name
|
|
539
|
+
string,
|
|
540
|
+
// params
|
|
541
|
+
any,
|
|
542
|
+
];
|
|
543
|
+
origin: 'NATIVE';
|
|
544
|
+
};
|
|
545
|
+
__DestroyLifetime: {
|
|
546
|
+
data: [
|
|
547
|
+
// appGUID
|
|
548
|
+
number,
|
|
549
|
+
];
|
|
550
|
+
origin: 'NATIVE';
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
// from engine context
|
|
554
|
+
__RenderPage: {
|
|
555
|
+
data: [
|
|
556
|
+
// data
|
|
557
|
+
object,
|
|
558
|
+
// renderOptions
|
|
559
|
+
object,
|
|
560
|
+
];
|
|
561
|
+
origin: 'ENGINE';
|
|
562
|
+
};
|
|
563
|
+
__UpdatePage: {
|
|
564
|
+
data: [
|
|
565
|
+
// data
|
|
566
|
+
object,
|
|
567
|
+
// updateOptions
|
|
568
|
+
object,
|
|
569
|
+
];
|
|
570
|
+
origin: 'ENGINE';
|
|
571
|
+
};
|
|
572
|
+
__UpdateGlobalProps: {
|
|
573
|
+
data: [
|
|
574
|
+
// data
|
|
575
|
+
Object
|
|
576
|
+
];
|
|
577
|
+
origin: 'ENGINE';
|
|
578
|
+
};
|
|
579
|
+
__RemoveComponents: {
|
|
580
|
+
data: [];
|
|
581
|
+
origin: 'ENGINE';
|
|
582
|
+
};
|
|
583
|
+
__SSRHydrate: {
|
|
584
|
+
data: [
|
|
585
|
+
// customHydrateInfo
|
|
586
|
+
string,
|
|
587
|
+
// listIDs
|
|
588
|
+
number[],
|
|
589
|
+
];
|
|
590
|
+
origin: 'ENGINE';
|
|
591
|
+
};
|
|
592
|
+
}
|
|
593
|
+
|
|
594
|
+
type LynxMessageEventType = keyof LynxMessageEvents;
|
|
595
|
+
|
|
596
|
+
type LynxMessageEventsWithType = {
|
|
597
|
+
[k in LynxMessageEventType]: LynxMessageEvents[k] & {
|
|
598
|
+
type: k;
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
|
|
602
|
+
export type LynxMessageEvent = LynxMessageEventsWithType[LynxMessageEventType];
|
package/types/common/global.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// LICENSE file in the root directory of this source tree.
|
|
4
4
|
|
|
5
5
|
import { SystemInfo } from './system-info';
|
|
6
|
-
import { Lynx as BackgroundLynx, NativeModules as INativeModules, GetElementByIdFunc } from '../background-thread';
|
|
6
|
+
import { Lynx as BackgroundLynx, NativeModules as INativeModules, GetElementByIdFunc, ITextCodecHelper } from '../background-thread';
|
|
7
7
|
import { Lynx as MainThreadLynx } from '../main-thread';
|
|
8
8
|
import { CommonLynx } from './lynx';
|
|
9
9
|
|
|
@@ -25,6 +25,7 @@ declare global {
|
|
|
25
25
|
var getElementById: GetElementByIdFunc;
|
|
26
26
|
|
|
27
27
|
var NativeModules: INativeModules;
|
|
28
|
+
var TextCodecHelper: ITextCodecHelper;
|
|
28
29
|
|
|
29
30
|
/**
|
|
30
31
|
* @description requestAnimationFrame
|
|
@@ -38,7 +39,8 @@ declare global {
|
|
|
38
39
|
* @since 3.0
|
|
39
40
|
* below Lynx 3.0, use lynx.cancelAnimationFrame.
|
|
40
41
|
*/
|
|
41
|
-
function cancelAnimationFrame(requestID?: number): void;
|
|
42
|
+
function cancelAnimationFrame(requestID?: number): void;
|
|
43
|
+
|
|
42
44
|
}
|
|
43
45
|
|
|
44
46
|
declare function setTimeout(callback: (...args: unknown[]) => unknown, number: number): number;
|