@doubao-dev/framework 0.0.38-canary-1b929937-20260722020207

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.
@@ -0,0 +1,4504 @@
1
+ import type { BaseEvent } from '@lynx-js/types';
2
+ import type { BaseGesture } from '@byted-lynx/gesture-runtime';
3
+ import { ContentSizeChangedEvent } from '@lynx-js/types';
4
+ import type { CSSProperties } from '@lynx-js/types';
5
+ import type { CSSProperties as CSSProperties_2 } from '@byted-lynx/type-lynx';
6
+ import type { ErrorEvent as ErrorEvent_2 } from '@lynx-js/types';
7
+ import type { ForwardedRef } from '@byted-lynx/react';
8
+ import type { ForwardRefExoticComponent } from 'react';
9
+ import type { InputBlurEvent } from '@lynx-js/types';
10
+ import type { InputConfirmEvent } from '@lynx-js/types';
11
+ import type { InputFocusEvent } from '@lynx-js/types';
12
+ import type { InputInputEvent } from '@lynx-js/types';
13
+ import type { InputSelectionEvent } from '@lynx-js/types';
14
+ import type { LayoutChangeEvent } from '@lynx-js/types';
15
+ import type { LayoutEvent } from '@lynx-js/types';
16
+ import { ListAttachedCell } from '@lynx-js/types';
17
+ import { ListItemInfo } from '@lynx-js/types';
18
+ import type { ListItemSnapAlignment } from '@lynx-js/types';
19
+ import { ListLayoutCompleteEvent } from '@lynx-js/types';
20
+ import { ListLayoutCompleteInfo } from '@lynx-js/types';
21
+ import { ListScrollEvent } from '@lynx-js/types';
22
+ import { ListScrollInfo } from '@lynx-js/types';
23
+ import { ListScrollState } from '@lynx-js/types';
24
+ import { ListScrollStateChangeEvent } from '@lynx-js/types';
25
+ import { ListScrollStateInfo } from '@lynx-js/types';
26
+ import { ListScrollToLowerEvent } from '@lynx-js/types';
27
+ import { ListScrollToUpperEvent } from '@lynx-js/types';
28
+ import { ListSnapEvent } from '@lynx-js/types';
29
+ import { ListSnapInfo } from '@lynx-js/types';
30
+ import type { LoadEvent } from '@lynx-js/types';
31
+ import type { NodesRef } from '@lynx-js/types';
32
+ import type { ReactElement } from '@byted-lynx/react';
33
+ import type { ReactElement as ReactElement_2 } from 'react';
34
+ import type { ReactNode } from 'react';
35
+ import type { Ref } from 'react';
36
+ import type { RefAttributes } from 'react';
37
+ import { ScrollEndEvent } from '@lynx-js/types';
38
+ import { ScrollEvent } from '@lynx-js/types';
39
+ import { ScrollToLowerEvent } from '@lynx-js/types';
40
+ import { ScrollToUpperEvent } from '@lynx-js/types';
41
+ import type { SelectionChangeEvent } from '@lynx-js/types';
42
+ import type { TextAreaBlurEvent } from '@lynx-js/types';
43
+ import type { TextAreaConfirmEvent } from '@lynx-js/types';
44
+ import type { TextAreaFocusEvent } from '@lynx-js/types';
45
+ import type { TextAreaInputEvent } from '@lynx-js/types';
46
+ import type { TextAreaSelectionChangeEvent } from '@lynx-js/types';
47
+ import type { TouchEvent as TouchEvent_2 } from '@lynx-js/types';
48
+ import type { UIAppearanceEvent } from '@lynx-js/types';
49
+ import type { XOverlayNGProps } from '@byted-lynx/type-lynx';
50
+
51
+ export declare interface AgreePrivacyResult {
52
+ /** Whether the save was successful */
53
+ result: boolean;
54
+ }
55
+
56
+ export declare interface Arc {
57
+ /**
58
+ * 弧线 id。
59
+ */
60
+ id: string;
61
+ /**
62
+ * 弧线起始点。
63
+ */
64
+ start: LatLng;
65
+ /**
66
+ * 弧线中间点(用于控制弧度)。
67
+ */
68
+ middle: LatLng;
69
+ /**
70
+ * 弧线终点。
71
+ */
72
+ end: LatLng;
73
+ /**
74
+ * 弧线宽度。
75
+ */
76
+ width?: number;
77
+ /**
78
+ * 弧线颜色,支持 HEX, RGBA, 颜色别名。
79
+ * @defaultValue "#0066ff"
80
+ */
81
+ color?: string;
82
+ /**
83
+ * 设置弧线 Z 轴数值。
84
+ * @defaultValue 0
85
+ */
86
+ zIndex?: number;
87
+ }
88
+
89
+ declare interface BounceConfig {
90
+ /**
91
+ * 是否启用回弹效果,当 loop 为 true 时忽略此设置
92
+ * @defaultValue false
93
+ */
94
+ enable?: boolean;
95
+ /**
96
+ * 左侧回弹项(水平方向时)
97
+ */
98
+ startBounceItem?: ReactElement_2;
99
+ /**
100
+ * 右侧回弹项(水平方向时)
101
+ */
102
+ endBounceItem?: ReactElement_2;
103
+ /**
104
+ * 当 startBounceItem 处于回弹状态时,释放手指将调用此函数
105
+ */
106
+ onStartBounceItemBounce?: (bounceParams: onBounceParams) => void;
107
+ /**
108
+ * 当 endBounceItem 处于回弹状态时,释放手指将调用此函数
109
+ */
110
+ onEndBounceItemBounce?: (bounceParams: onBounceParams) => void;
111
+ /**
112
+ * 回弹项的宽度
113
+ * @defaultValue 100
114
+ */
115
+ startBounceItemWidth?: number;
116
+ /**
117
+ * 回弹项的宽度
118
+ * @defaultValue 100
119
+ */
120
+ endBounceItemWidth?: number;
121
+ }
122
+
123
+ /**
124
+ * 按钮组件。
125
+ *
126
+ * ## CSS 继承原则
127
+ *
128
+ * 由于 Lynx 组件不开启 CSS 继承,Button 的文本样式不会自动应用到 children。
129
+ * 因此提供了以下明确的 API 用法:
130
+ *
131
+ * - `text` prop:传入字符串,按钮会应用默认文本样式
132
+ * - `icon` + `text` prop:组合使用,显示图标和文字
133
+ * - `children`:完全自定义内容,**不会**应用按钮的默认文本样式
134
+ *
135
+ *
136
+ * ## 使用建议
137
+ *
138
+ * ```tsx
139
+ * // 简单文字:用 text prop(推荐)
140
+ * <Button text="确定" />
141
+ *
142
+ * // 图标+文字:用 icon + text
143
+ * <Button icon={<Icon />} text="提交" />
144
+ *
145
+ * // 完全自定义:用 children(无默认样式)
146
+ * <Button>
147
+ * <text style={{ color: 'red' }}>自定义</text>
148
+ * </Button>
149
+ * ```
150
+ */
151
+ export declare interface ButtonProps {
152
+ /**
153
+ * 组件样式
154
+ */
155
+ style?: CSSProperties;
156
+ /**
157
+ * 组件类名
158
+ */
159
+ className?: string;
160
+ /**
161
+ * React key 属性
162
+ */
163
+ key?: string | number | null | undefined;
164
+ /**
165
+ * 按钮文字
166
+ */
167
+ text?: string;
168
+ /**
169
+ * 按钮尺寸
170
+ * @defaultValue 'default'
171
+ */
172
+ size?: ButtonSize;
173
+ /**
174
+ * 按钮样式类型
175
+ * @defaultValue 'primary'
176
+ */
177
+ type?: ButtonType;
178
+ /**
179
+ * 是否禁用
180
+ * @defaultValue false
181
+ */
182
+ disabled?: boolean;
183
+ /**
184
+ * 是否展示组件内置的禁用态样式
185
+ * @defaultValue true
186
+ */
187
+ showDisabledStyle?: boolean;
188
+ /**
189
+ * 是否显示加载状态
190
+ * @defaultValue false
191
+ */
192
+ loading?: boolean;
193
+ /**
194
+ * 图标,显示在文字前面
195
+ */
196
+ icon?: ReactNode;
197
+ /**
198
+ * 子元素,用于自定义内容。当同时提供 icon/text 和 children 时,children 优先。
199
+ */
200
+ children?: ReactNode;
201
+ /**
202
+ * onClick 的节流时间,单位为毫秒
203
+ * @defaultValue 500
204
+ */
205
+ throttle?: number;
206
+ /**
207
+ * 开放能力类型
208
+ */
209
+ openType?: 'getPhoneNumber' | 'agreePrivacyAuthorization' | 'agreePrivacyAuthorization|getPhoneNumber';
210
+ /**
211
+ * 点击回调函数
212
+ * @eventProperty
213
+ */
214
+ onClick?: (event?: TouchEvent_2) => void;
215
+ /**
216
+ * 禁用状态下的点击回调函数
217
+ * @eventProperty
218
+ */
219
+ onDisabledClick?: (event?: TouchEvent_2) => void;
220
+ /**
221
+ * 获取用户手机号回调,只在 openType="getPhoneNumber" 时有效
222
+ * @eventProperty
223
+ */
224
+ onGetPhoneNumber?: (result?: GetPhoneNumberResult) => void;
225
+ /**
226
+ * 授权隐私协议回调,只在 openType="agreePrivacyAuthorization" 时有效
227
+ * @eventProperty
228
+ */
229
+ onAgreePrivacyAuthorization?: (result?: AgreePrivacyResult) => void;
230
+ }
231
+
232
+ declare type ButtonSize = 'default' | 'medium' | 'mini';
233
+
234
+ declare type ButtonType = 'primary' | 'default' | 'plain';
235
+
236
+ declare interface Canvas2DContext extends CanvasRenderingContext2D {
237
+ drawImage(image: DrawImageSource, dx: number, dy: number): void;
238
+ drawImage(image: DrawImageSource, dx: number, dy: number, dw: number, dh: number): void;
239
+ drawImage(image: DrawImageSource, sx: number, sy: number, sw: number, sh: number, dx: number, dy: number, dw: number, dh: number): void;
240
+ }
241
+
242
+ export declare interface CanvasElement {
243
+ width: number;
244
+ height: number;
245
+ getContext: ((ctx: '2d') => CanvasRenderingContext2D | null) & ((ctx: 'webgl', contextAttributes?: Record<string, unknown>) => WebGLRenderingContext | null) & ((ctx: 'webgl2', contextAttributes?: Record<string, unknown>) => WebGL2RenderingContext | null);
246
+ toDataURL: (type?: string, encoderOptions?: number) => string;
247
+ attachToCanvasView: (name: string) => boolean;
248
+ detachFromCanvasView: () => void;
249
+ addEventListener: (event: 'resize', listener: (event: CanvasResizeEvent) => void, options?: AddEventListenerOptions | boolean) => void;
250
+ removeEventListener: (event: 'resize', listener: (event: CanvasResizeEvent) => void, options?: EventListenerOptions | boolean) => void;
251
+ }
252
+
253
+ declare interface CanvasImage {
254
+ src: string;
255
+ readonly width: number;
256
+ readonly height: number;
257
+ readonly complete: boolean;
258
+ onload: (() => void) | null;
259
+ onerror: ((error: unknown) => void) | null;
260
+ addEventListener: (event: 'load' | 'error', listener: (event: unknown) => void, options?: AddEventListenerOptions | boolean) => void;
261
+ removeEventListener: (event: 'load' | 'error', listener: (event: unknown) => void, options?: EventListenerOptions | boolean) => void;
262
+ }
263
+
264
+ /**
265
+ * 画布组件,提供 2D/WebGL 绘图上下文,用于图形绘制、动画渲染等场景。
266
+ */
267
+ export declare interface CanvasProps {
268
+ /**
269
+ * Canvas 实例引用,用于获取绘图上下文。
270
+ */
271
+ ref?: Ref<CanvasRef>;
272
+ /**
273
+ * 有手势事件绑定时,禁止屏幕滚动及下拉刷新
274
+ * @defaultValue false
275
+ */
276
+ disableScroll?: boolean;
277
+ /**
278
+ * 组件样式
279
+ */
280
+ style?: CSSProperties;
281
+ /**
282
+ * 组件类名
283
+ */
284
+ className?: string;
285
+ /**
286
+ * 元素的唯一标识
287
+ */
288
+ id?: string;
289
+ /**
290
+ * 手指触摸动作开始
291
+ * @eventProperty
292
+ */
293
+ onTouchStart?: (event: TouchEvent_2) => void;
294
+ /**
295
+ * @deprecated 请使用 onTouchStart 替代
296
+ */
297
+ bindtouchstart?: (event: TouchEvent_2) => void;
298
+ /**
299
+ * 手指触摸后移动
300
+ * @eventProperty
301
+ */
302
+ onTouchMove?: (event: TouchEvent_2) => void;
303
+ /**
304
+ * @deprecated 请使用 onTouchMove 替代
305
+ */
306
+ bindtouchmove?: (event: TouchEvent_2) => void;
307
+ /**
308
+ * 手指触摸动作结束
309
+ * @eventProperty
310
+ */
311
+ onTouchEnd?: (event: TouchEvent_2) => void;
312
+ /**
313
+ * @deprecated 请使用 onTouchEnd 替代
314
+ */
315
+ bindtouchend?: (event: TouchEvent_2) => void;
316
+ /**
317
+ * 手指触摸动作被打断,如来电提醒,弹窗
318
+ * @eventProperty
319
+ */
320
+ onTouchCancel?: (event: TouchEvent_2) => void;
321
+ /**
322
+ * @deprecated 请使用 onTouchCancel 替代
323
+ */
324
+ bindtouchcancel?: (event: TouchEvent_2) => void;
325
+ /**
326
+ * 手指长按 500ms 之后触发,触发了长按事件后进行移动不会触发屏幕的滚动
327
+ * @eventProperty
328
+ */
329
+ onLongPress?: (event: TouchEvent_2) => void;
330
+ /**
331
+ * @deprecated 请使用 onLongPress 替代
332
+ */
333
+ bindlongpress?: (event: TouchEvent_2) => void;
334
+ /**
335
+ * 当发生错误时触发 error 事件,detail = {errMsg}
336
+ * @eventProperty
337
+ */
338
+ onError?: (event: {
339
+ detail: {
340
+ errMsg: string;
341
+ };
342
+ }) => void;
343
+ /**
344
+ * @deprecated 请使用 onError 替代
345
+ */
346
+ binderror?: (event: {
347
+ detail: {
348
+ errMsg: string;
349
+ };
350
+ }) => void;
351
+ }
352
+
353
+ export declare interface CanvasRef {
354
+ /**
355
+ * 同步获取绘图上下文
356
+ */
357
+ getContext: {
358
+ (contextType: '2d'): Canvas2DContext | null;
359
+ (contextType: 'webgl', contextAttributes?: WebGLContextAttributes_2): WebGLRenderingContext | null;
360
+ (contextType: 'webgl2', contextAttributes?: WebGLContextAttributes_2): WebGL2RenderingContext | null;
361
+ };
362
+ /**
363
+ * 创建图片对象,用于加载图片后绘制到画布
364
+ */
365
+ createImage: () => CanvasImage | undefined;
366
+ /**
367
+ * 导出画布内容为 data URI
368
+ */
369
+ toDataURL: (type?: string, encoderOptions?: number) => Promise<string>;
370
+ /**
371
+ * 在下次重绘之前调用指定的回调函数
372
+ */
373
+ requestAnimationFrame: (callback: FrameRequestCallback) => number;
374
+ /**
375
+ * 取消由 requestAnimationFrame 添加的动画帧请求
376
+ */
377
+ cancelAnimationFrame: (id: number) => void;
378
+ /**
379
+ * 创建与画布同尺寸的空白 ImageData 对象,仅支持 2D 上下文
380
+ */
381
+ createImageData: () => Promise<ImageData>;
382
+ /**
383
+ * 画布宽度(buffer 像素数),写入时会清空画布内容
384
+ */
385
+ width: number;
386
+ /**
387
+ * 画布高度(buffer 像素数),写入时会清空画布内容
388
+ */
389
+ height: number;
390
+ }
391
+
392
+ export declare interface CanvasResizeEvent {
393
+ width: number;
394
+ height: number;
395
+ }
396
+
397
+ export declare interface Circle {
398
+ id: string;
399
+ center: LatLng;
400
+ /**
401
+ * 圆半径。
402
+ */
403
+ radius: number;
404
+ /**
405
+ * 圆环宽度。
406
+ */
407
+ strokeWidth?: number;
408
+ /**
409
+ * 圆环颜色。
410
+ */
411
+ strokeColor?: string;
412
+ /**
413
+ * 圆形填充色。
414
+ */
415
+ fillColor?: string;
416
+ /**
417
+ * 设置圆 Z 轴数值。
418
+ * @defaultValue 0
419
+ */
420
+ zIndex?: number;
421
+ }
422
+
423
+ export { ContentSizeChangedEvent }
424
+
425
+ export declare const DoubaoPaymentButton: typeof DoubaoPaymentButton_2;
426
+
427
+ declare const DoubaoPaymentButton_2: DoubaoPaymentButton_3;
428
+
429
+ declare type DoubaoPaymentButton_3 = ForwardRefExoticComponent<DoubaoPaymentButtonProps_2 & RefAttributes<NodesRef>>;
430
+
431
+ /**
432
+ * 支付按钮组件。
433
+ *
434
+ * 根据订单是否支持免密支付,自动渲染普通支付或免密支付单按钮。
435
+ * 其中免密支付按钮文案来自平台接口返回的 signInfo。
436
+ */
437
+ export declare interface DoubaoPaymentButtonProps {
438
+ /**
439
+ * 动态获取订单 ID。
440
+ *
441
+ * 点击支付按钮后调用,可在回调内创建订单并返回订单 ID。
442
+ */
443
+ getOrderId: GetDoubaoPaymentOrderId;
444
+ /**
445
+ * 支付金额,单位为分。
446
+ */
447
+ amount: number;
448
+ /**
449
+ * 按钮样式。
450
+ */
451
+ style?: CSSProperties;
452
+ /**
453
+ * 按钮类名。
454
+ */
455
+ className?: string;
456
+ /**
457
+ * 是否禁用支付按钮。
458
+ * @defaultValue false
459
+ */
460
+ disabled?: boolean;
461
+ /**
462
+ * 是否显示加载态。
463
+ * @defaultValue false
464
+ */
465
+ loading?: boolean;
466
+ /**
467
+ * 是否展示内置禁用态样式。
468
+ * @defaultValue true
469
+ */
470
+ showDisabledStyle?: boolean;
471
+ /**
472
+ * 禁用态点击回调。
473
+ */
474
+ onDisabledClick?: (event?: TouchEvent_2) => void;
475
+ /**
476
+ * 点击节流时间,单位为毫秒。
477
+ * @defaultValue 500
478
+ */
479
+ throttle?: number;
480
+ /**
481
+ * 支付完成后的统一回调。
482
+ * 成功时返回 result,失败时返回 error。
483
+ */
484
+ onPaymentResult?: (payload: DoubaoPaymentResultPayload_2) => void;
485
+ }
486
+
487
+ /**
488
+ * 支付按钮组件。
489
+ *
490
+ * 根据订单是否支持免密支付,自动渲染普通支付或免密支付单按钮。
491
+ * 其中免密支付按钮文案来自平台接口返回的 signInfo。
492
+ */
493
+ declare interface DoubaoPaymentButtonProps_2 {
494
+ /**
495
+ * 动态获取订单 ID。
496
+ *
497
+ * 点击支付按钮后调用,可在回调内创建订单并返回订单 ID。
498
+ */
499
+ getOrderId: GetDoubaoPaymentOrderId_2;
500
+ /**
501
+ * 支付金额,单位为分。
502
+ */
503
+ amount: number;
504
+ /**
505
+ * 按钮样式。
506
+ */
507
+ style?: CSSProperties;
508
+ /**
509
+ * 按钮类名。
510
+ */
511
+ className?: string;
512
+ /**
513
+ * 是否禁用支付按钮。
514
+ * @defaultValue false
515
+ */
516
+ disabled?: boolean;
517
+ /**
518
+ * 是否显示加载态。
519
+ * @defaultValue false
520
+ */
521
+ loading?: boolean;
522
+ /**
523
+ * 是否展示内置禁用态样式。
524
+ * @defaultValue true
525
+ */
526
+ showDisabledStyle?: boolean;
527
+ /**
528
+ * 禁用态点击回调。
529
+ */
530
+ onDisabledClick?: (event?: TouchEvent_2) => void;
531
+ /**
532
+ * 点击节流时间,单位为毫秒。
533
+ * @defaultValue 500
534
+ */
535
+ throttle?: number;
536
+ /**
537
+ * 支付完成后的统一回调。
538
+ * 成功时返回 result,失败时返回 error。
539
+ */
540
+ onPaymentResult?: (payload: DoubaoPaymentResultPayload) => void;
541
+ }
542
+
543
+ declare type DoubaoPaymentMode = 'normal' | 'password-free';
544
+
545
+ declare type DoubaoPaymentMode_2 = 'normal' | 'password-free';
546
+
547
+ declare interface DoubaoPaymentResult {
548
+ orderId: string;
549
+ logId: string;
550
+ }
551
+
552
+ declare interface DoubaoPaymentResult_2 {
553
+ orderId: string;
554
+ logId: string;
555
+ }
556
+
557
+ declare interface DoubaoPaymentResultPayload {
558
+ mode: DoubaoPaymentMode;
559
+ result?: DoubaoPaymentResult;
560
+ error?: unknown;
561
+ }
562
+
563
+ declare interface DoubaoPaymentResultPayload_2 {
564
+ mode: DoubaoPaymentMode_2;
565
+ result?: DoubaoPaymentResult_2;
566
+ error?: unknown;
567
+ }
568
+
569
+ declare type DrawImageSource = CanvasImageSource | CanvasImage | OffscreenCanvas_2;
570
+
571
+ export declare type GetDoubaoPaymentOrderId = (mode?: DoubaoPaymentMode_2) => string | Promise<string>;
572
+
573
+ declare type GetDoubaoPaymentOrderId_2 = (mode?: DoubaoPaymentMode) => string | Promise<string>;
574
+
575
+ export declare interface GetPhoneNumberResult {
576
+ code?: string;
577
+ message?: string;
578
+ }
579
+
580
+ declare interface HeightPercent {
581
+ /**
582
+ * The init offset percentage or absolute value (e.g. "200px") that the popup, base line is maxHeight
583
+ * @zh 弹窗的初始偏移百分比或绝对值(例如 "200px"),基准线是 maxHeight * @defaultValue 60
584
+ * @Android
585
+ * @iOS
586
+ * @Harmony
587
+ */
588
+ init: number | `${number}px` | `${number}%` | `${number}rpx`;
589
+ /**
590
+ * The maximum offset percentage or absolute value (e.g. "400px") that the popup can drag, base line is maxHeight
591
+ * @zh 弹窗可拖动的最大偏移百分比或绝对值(例如 "400px"),基准线是 maxHeight
592
+ * @defaultValue 100
593
+ * @Android
594
+ * @iOS
595
+ * @Harmony
596
+ */
597
+ top: number | `${number}px` | `${number}%` | `${number}rpx`;
598
+ /**
599
+ * The minimum offset percentage or absolute value (e.g. "0px") that the popup can drag, base line is maxHeight
600
+ * @zh 弹窗可拖动的最小偏移百分比或绝对值(例如 "0px"),基准线是 maxHeight
601
+ * @defaultValue 0
602
+ * @Android
603
+ * @iOS
604
+ * @Harmony
605
+ */
606
+ bottom?: number | `${number}px` | `${number}%` | `${number}rpx`;
607
+ /**
608
+ * The boundary offset percentage or absolute value (e.g., "20px") for the popup's non-inertial slide release rebound. When the non-inertial slide release rebound area is within position - boundaryArea to + boundaryArea, it will trigger a rebound back to the current position; otherwise, it will move to the next position. The baseline is maxHeight.
609
+ * @zh 弹窗无惯性滑动的松手回弹的边界偏移百分比或绝对值(例如 "20px"),当无惯性滑动松手回弹的区域在position - boundaryArea / + boundaryArea 之间时,会触发回弹到当前的position为止,否则会进入下一个位置,基准线是 maxHeight
610
+ * @defaultValue 10
611
+ * @Android
612
+ * @iOS
613
+ * @Harmony
614
+ */
615
+ boundaryArea?: number | `${number}px` | `${number}%` | `${number}rpx`;
616
+ /**
617
+ * The speed threshold for inertial sliding rebound. When the release speed is greater than this value, it will slide to the next position; when less than this value, it will rebound to the current position
618
+ * @zh 惯性滑动回弹阈值:弹窗有惯性滑动时的速度阈值,当松手大于该速度时会滑动到下一个position,当小于该速度时会回弹至当前的position
619
+ * @defaultValue 5(px/s)
620
+ * @Android
621
+ * @iOS
622
+ * @Harmony
623
+ */
624
+ flingThreshold?: number;
625
+ }
626
+
627
+ /**
628
+ * 图片展示组件,支持加载本地或网络图片资源,提供多种裁剪和缩放模式。
629
+ */
630
+ export declare interface ImageProps {
631
+ /**
632
+ * 组件样式
633
+ */
634
+ style?: CSSProperties;
635
+ /**
636
+ * 组件类名
637
+ */
638
+ className?: string;
639
+ /**
640
+ * 元素的唯一标识
641
+ */
642
+ id?: string;
643
+ /**
644
+ * React key 属性
645
+ */
646
+ key?: string | number | null | undefined;
647
+ /**
648
+ * 用于获取组件实例的 ref
649
+ */
650
+ ref?: Ref<NodesRef>;
651
+ /**
652
+ * 图片资源地址,支持 http/https/base64
653
+ */
654
+ src: string;
655
+ /**
656
+ * 图片裁剪、缩放模式
657
+ * @defaultValue 'scaleToFill'
658
+ */
659
+ mode?: 'scaleToFill' | 'aspectFit' | 'aspectFill' | 'center';
660
+ /**
661
+ * 占位图地址,用法同 src
662
+ */
663
+ placeholder?: string;
664
+ /**
665
+ * 是否在加载成功后自动调整图片尺寸为原图大小
666
+ * @defaultValue false
667
+ */
668
+ autoSize?: boolean;
669
+ /**
670
+ * 是否扁平化元素,避免创建真实渲染对象以提升性能。
671
+ *
672
+ * Android 上默认图片链路会受到 Fresco / OpenGL 纹理尺寸限制影响,
673
+ * 超过限制的图片可能按分辨率逐轮除 2 降采样。设置 `flatten={false}`
674
+ * 会走 Lynx 自定义解码链路,将默认限制替换为约 3379 x 3379
675
+ * (厂商未修改时),能在一定程度上缓解大图被过度降采样的问题。
676
+ * @defaultValue true
677
+ */
678
+ flatten?: boolean;
679
+ /**
680
+ * 是否启用降采样。
681
+ *
682
+ * 仅建议在确认图片分辨率可控时设置 `subsample={false}`。
683
+ * `flatten={false} & subsample={false}` 会关闭尺寸限制和降采样逻辑,
684
+ * 可能显著增加解码内存峰值,超大图片存在 OOM 风险。
685
+ * @defaultValue true
686
+ */
687
+ subsample?: boolean;
688
+ /**
689
+ * 图片加载成功时触发,事件对象中包含图片宽高信息
690
+ * @eventProperty
691
+ */
692
+ onLoad?: (event: LoadEvent) => void;
693
+ /**
694
+ * @deprecated 请使用 onLoad 替代
695
+ */
696
+ bindload?: (event: LoadEvent) => void;
697
+ /**
698
+ * 图片加载失败时触发,事件对象中包含错误信息
699
+ * @eventProperty
700
+ */
701
+ onError?: (event: ErrorEvent_2) => void;
702
+ /**
703
+ * @deprecated 请使用 onError 替代
704
+ */
705
+ binderror?: (event: ErrorEvent_2) => void;
706
+ /**
707
+ * 点击时的回调函数
708
+ * @eventProperty
709
+ */
710
+ onClick?: (event: TouchEvent_2) => void;
711
+ /**
712
+ * @deprecated 请使用 onClick 替代
713
+ */
714
+ bindtap?: (event: TouchEvent_2) => void;
715
+ /**
716
+ * 点击时的回调函数(阻止事件冒泡)
717
+ * @eventProperty
718
+ */
719
+ onCatchTap?: (event: TouchEvent_2) => void;
720
+ /**
721
+ * @deprecated 请使用 onCatchTap 替代
722
+ */
723
+ catchtap?: (event: TouchEvent_2) => void;
724
+ /**
725
+ * 长按时的回调函数
726
+ * @eventProperty
727
+ */
728
+ onLongPress?: (event: TouchEvent_2) => void;
729
+ /**
730
+ * @deprecated 请使用 onLongPress 替代
731
+ */
732
+ bindlongpress?: (event: TouchEvent_2) => void;
733
+ /**
734
+ * 触摸开始时的回调函数
735
+ * @eventProperty
736
+ */
737
+ onTouchStart?: (event: TouchEvent_2) => void;
738
+ /**
739
+ * @deprecated 请使用 onTouchStart 替代
740
+ */
741
+ bindtouchstart?: (event: TouchEvent_2) => void;
742
+ /**
743
+ * 触摸结束时的回调函数
744
+ * @eventProperty
745
+ */
746
+ onTouchEnd?: (event: TouchEvent_2) => void;
747
+ /**
748
+ * @deprecated 请使用 onTouchEnd 替代
749
+ */
750
+ bindtouchend?: (event: TouchEvent_2) => void;
751
+ /**
752
+ * 触摸移动时的回调函数
753
+ * @eventProperty
754
+ */
755
+ onTouchMove?: (event: TouchEvent_2) => void;
756
+ /**
757
+ * @deprecated 请使用 onTouchMove 替代
758
+ */
759
+ bindtouchmove?: (event: TouchEvent_2) => void;
760
+ /**
761
+ * 元素曝光时的回调函数(进入可视区域)
762
+ * @eventProperty
763
+ */
764
+ onAppear?: (event: UIAppearanceEvent) => void;
765
+ /**
766
+ * @deprecated 请使用 onAppear 替代
767
+ */
768
+ binduiappear?: (event: UIAppearanceEvent) => void;
769
+ /**
770
+ * 元素消失时的回调函数(离开可视区域)
771
+ * @eventProperty
772
+ */
773
+ onDisappear?: (event: UIAppearanceEvent) => void;
774
+ /**
775
+ * @deprecated 请使用 onDisappear 替代
776
+ */
777
+ binduidisappear?: (event: UIAppearanceEvent) => void;
778
+ /**
779
+ * 布局变化时的回调函数
780
+ * @eventProperty
781
+ */
782
+ onLayoutChange?: (event: LayoutChangeEvent) => void;
783
+ /**
784
+ * @deprecated 请使用 onLayoutChange 替代
785
+ */
786
+ bindlayoutchange?: (event: LayoutChangeEvent) => void;
787
+ }
788
+
789
+ /**
790
+ * 单行文本输入组件,支持多种输入类型(文本、数字、密码等)及受控/非受控模式。
791
+ */
792
+ export declare interface InputProps {
793
+ /**
794
+ * 组件样式
795
+ */
796
+ style?: CSSProperties;
797
+ /**
798
+ * 组件类名
799
+ */
800
+ className?: string;
801
+ /**
802
+ * 元素的唯一标识
803
+ */
804
+ id?: string;
805
+ /**
806
+ * React key 属性
807
+ */
808
+ key?: string | number | null | undefined;
809
+ /**
810
+ * 用于获取组件实例的 ref
811
+ */
812
+ ref?: Ref<InputRef>;
813
+ /**
814
+ * 占位符文本
815
+ */
816
+ placeholder?: string;
817
+ /**
818
+ * 输入类型
819
+ * @defaultValue 'text'
820
+ */
821
+ type?: 'text' | 'number' | 'digit' | 'password' | 'tel' | 'email';
822
+ /**
823
+ * 最大输入长度
824
+ * @defaultValue 140
825
+ */
826
+ maxlength?: number;
827
+ /**
828
+ * 是否禁用
829
+ * @defaultValue false
830
+ */
831
+ disabled?: boolean;
832
+ /**
833
+ * 是否只读
834
+ * @defaultValue false
835
+ */
836
+ readonly?: boolean;
837
+ /**
838
+ * 输入框的当前值,用于受控组件
839
+ */
840
+ value?: string;
841
+ /**
842
+ * 输入框的默认值,用于非受控组件
843
+ */
844
+ defaultValue?: string;
845
+ /**
846
+ * 键盘右下角确认按钮的类型
847
+ * @defaultValue 'send'
848
+ */
849
+ confirmType?: 'send' | 'search' | 'go' | 'done' | 'next';
850
+ /**
851
+ * 聚焦时是否显示软键盘
852
+ * @defaultValue true
853
+ */
854
+ showSoftInputOnFocus?: boolean;
855
+ /**
856
+ * 输入内容变化时触发
857
+ * @eventProperty
858
+ */
859
+ onInput?: (event: BaseEvent<'bindinput', InputInputEvent>) => void;
860
+ /**
861
+ * @deprecated 请使用 onInput 替代
862
+ */
863
+ bindinput?: (event: BaseEvent<'bindinput', InputInputEvent>) => void;
864
+ /**
865
+ * 聚焦时触发
866
+ * @eventProperty
867
+ */
868
+ onFocus?: (event: BaseEvent<'bindfocus', InputFocusEvent>) => void;
869
+ /**
870
+ * @deprecated 请使用 onFocus 替代
871
+ */
872
+ bindfocus?: (event: BaseEvent<'bindfocus', InputFocusEvent>) => void;
873
+ /**
874
+ * 失焦时触发
875
+ * @eventProperty
876
+ */
877
+ onBlur?: (event: BaseEvent<'bindblur', InputBlurEvent>) => void;
878
+ /**
879
+ * @deprecated 请使用 onBlur 替代
880
+ */
881
+ bindblur?: (event: BaseEvent<'bindblur', InputBlurEvent>) => void;
882
+ /**
883
+ * 点击键盘确认按钮时触发
884
+ * @eventProperty
885
+ */
886
+ onConfirm?: (event: BaseEvent<'bindconfirm', InputConfirmEvent>) => void;
887
+ /**
888
+ * @deprecated 请使用 onConfirm 替代
889
+ */
890
+ bindconfirm?: (event: BaseEvent<'bindconfirm', InputConfirmEvent>) => void;
891
+ /**
892
+ * 选择区域变化时触发
893
+ * @eventProperty
894
+ */
895
+ onSelectionChange?: (event: BaseEvent<'bindselection', InputSelectionEvent>) => void;
896
+ /**
897
+ * @deprecated 请使用 onSelectionChange 替代
898
+ */
899
+ bindselection?: (event: BaseEvent<'bindselection', InputSelectionEvent>) => void;
900
+ }
901
+
902
+ /**
903
+ * Input 组件暴露的方法
904
+ */
905
+ export declare interface InputRef {
906
+ /**
907
+ * 设置输入框的值
908
+ */
909
+ setValue: (value: string) => Promise<void>;
910
+ /**
911
+ * 获取输入框的值和选择区域
912
+ */
913
+ getValue: () => Promise<{
914
+ value: string;
915
+ selectionStart: number;
916
+ selectionEnd: number;
917
+ }>;
918
+ /**
919
+ * 聚焦输入框
920
+ */
921
+ focus: () => Promise<void>;
922
+ /**
923
+ * 失焦输入框
924
+ */
925
+ blur: () => Promise<void>;
926
+ /**
927
+ * 设置选择区域
928
+ */
929
+ setSelectionRange: (selectionStart: number, selectionEnd: number) => Promise<void>;
930
+ }
931
+
932
+ export declare type LatLng = {
933
+ latitude: number;
934
+ longitude: number;
935
+ };
936
+
937
+ export { ListAttachedCell }
938
+
939
+ export { ListItemInfo }
940
+
941
+ export { ListLayoutCompleteEvent }
942
+
943
+ export { ListLayoutCompleteInfo }
944
+
945
+ /**
946
+ * 高性能列表组件,适用于渲染大量数据,支持垂直滚动和按需渲染。
947
+ */
948
+ export declare interface ListProps {
949
+ /**
950
+ * 子元素
951
+ */
952
+ children?: ReactNode;
953
+ /**
954
+ * 组件样式
955
+ */
956
+ style?: CSSProperties;
957
+ /**
958
+ * 组件类名
959
+ */
960
+ className?: string;
961
+ /**
962
+ * 元素的唯一标识
963
+ */
964
+ id?: string;
965
+ /**
966
+ * React key 属性
967
+ */
968
+ key?: string | number | null | undefined;
969
+ /**
970
+ * 用于获取组件实例的 ref
971
+ */
972
+ ref?: Ref<NodesRef>;
973
+ /**
974
+ * 滚动方向和布局方向
975
+ * @defaultValue 'vertical'
976
+ */
977
+ scrollOrientation?: 'vertical' | 'horizontal';
978
+ /**
979
+ * 列表的列数或行数,仅当 listType 为 'flow' 或 'waterfall' 时有效
980
+ * @defaultValue 1
981
+ */
982
+ spanCount?: number;
983
+ /**
984
+ * 列表的布局类型
985
+ * @defaultValue 'single'
986
+ */
987
+ listType?: 'single' | 'flow' | 'waterfall';
988
+ /**
989
+ * 是否允许滚动
990
+ * @defaultValue true
991
+ */
992
+ enableScroll?: boolean;
993
+ /**
994
+ * 是否支持嵌套滚动
995
+ * @defaultValue false
996
+ */
997
+ enableNestedScroll?: boolean;
998
+ /**
999
+ * 是否允许列表整体吸顶或吸底
1000
+ * @defaultValue false
1001
+ */
1002
+ sticky?: boolean;
1003
+ /**
1004
+ * 吸顶或吸底时的偏移距离(px)
1005
+ * @defaultValue 0
1006
+ */
1007
+ stickyOffset?: number;
1008
+ /**
1009
+ * 是否启用弹性效果(iOS 回弹效果)
1010
+ * @defaultValue true
1011
+ */
1012
+ bounces?: boolean;
1013
+ /**
1014
+ * 列表渲染后自动滚动到的节点位置
1015
+ * @defaultValue 0
1016
+ */
1017
+ initialScrollIndex?: number;
1018
+ /**
1019
+ * 是否在滚动事件回调参数中包含当前渲染节点的位置信息
1020
+ * @defaultValue false
1021
+ */
1022
+ needVisibleItemInfo?: boolean;
1023
+ /**
1024
+ * 触发滚动到底部的剩余子节点数量阈值
1025
+ * @defaultValue 0
1026
+ */
1027
+ lowerThresholdItemCount?: number;
1028
+ /**
1029
+ * 触发滚动到顶部的剩余子节点数量阈值
1030
+ * @defaultValue 0
1031
+ */
1032
+ upperThresholdItemCount?: number;
1033
+ /**
1034
+ * 滚动事件的回调频率(ms)
1035
+ * @defaultValue 200
1036
+ */
1037
+ scrollEventThrottle?: number;
1038
+ /**
1039
+ * 启用分页效果
1040
+ */
1041
+ itemSnap?: ListItemSnapAlignment;
1042
+ /**
1043
+ * layoutcomplete 事件是否包含布局信息
1044
+ * @defaultValue false
1045
+ */
1046
+ needLayoutCompleteInfo?: boolean;
1047
+ /**
1048
+ * 数据源更新的唯一标识,会在 layoutcomplete 事件中返回
1049
+ * @defaultValue -1
1050
+ */
1051
+ layoutId?: number;
1052
+ /**
1053
+ * 列表外预加载的节点数量
1054
+ * @defaultValue 0
1055
+ */
1056
+ preloadBufferCount?: number;
1057
+ /**
1058
+ * 是否显示滚动条
1059
+ */
1060
+ scrollBarEnable?: boolean;
1061
+ /**
1062
+ * 是否回收吸顶元素
1063
+ */
1064
+ experimentalRecycleStickyItem?: boolean;
1065
+ /**
1066
+ * 滚动事件
1067
+ * @eventProperty
1068
+ */
1069
+ onScroll?: (event: ListScrollEvent) => void;
1070
+ /**
1071
+ * 滚动到顶部时触发
1072
+ * @eventProperty
1073
+ */
1074
+ onScrollToUpper?: (event: ListScrollToUpperEvent) => void;
1075
+ /**
1076
+ * 滚动到底部时触发
1077
+ * @eventProperty
1078
+ */
1079
+ onScrollToLower?: (event: ListScrollToLowerEvent) => void;
1080
+ /**
1081
+ * 滚动状态变化时触发
1082
+ * @eventProperty
1083
+ */
1084
+ onScrollStateChange?: (event: ListScrollStateChangeEvent) => void;
1085
+ /**
1086
+ * 首屏渲染完成时触发
1087
+ * @eventProperty
1088
+ */
1089
+ onLayoutComplete?: (event: ListLayoutCompleteEvent) => void;
1090
+ /**
1091
+ * 分页滚动回调
1092
+ * @eventProperty
1093
+ */
1094
+ onSnap?: (event: ListSnapEvent) => void;
1095
+ }
1096
+
1097
+ export { ListScrollEvent }
1098
+
1099
+ export { ListScrollInfo }
1100
+
1101
+ export { ListScrollState }
1102
+
1103
+ export { ListScrollStateChangeEvent }
1104
+
1105
+ export { ListScrollStateInfo }
1106
+
1107
+ export { ListScrollToLowerEvent }
1108
+
1109
+ export { ListScrollToUpperEvent }
1110
+
1111
+ export { ListSnapEvent }
1112
+
1113
+ export { ListSnapInfo }
1114
+
1115
+ export declare type LongImageActiveRange = {
1116
+ /**
1117
+ * 当前激活解码窗口起始分段索引(含)。
1118
+ */
1119
+ start: number;
1120
+ /**
1121
+ * 当前激活解码窗口结束分段索引(含)。
1122
+ */
1123
+ end: number;
1124
+ };
1125
+
1126
+ export declare type LongImageMetrics = {
1127
+ /**
1128
+ * 容器实际渲染宽度(px)。
1129
+ */
1130
+ displayWidth: number;
1131
+ /**
1132
+ * 原图宽度(px)。
1133
+ */
1134
+ imageWidth: number;
1135
+ /**
1136
+ * 原图高度(px)。
1137
+ */
1138
+ imageHeight: number;
1139
+ /**
1140
+ * 单个分段在原图坐标系中的解码高度(px)。
1141
+ */
1142
+ segmentSrcHeight: number;
1143
+ /**
1144
+ * 总分段数量。
1145
+ */
1146
+ segmentCount: number;
1147
+ /**
1148
+ * 当前激活解码窗口起始分段索引(含)。
1149
+ * 空窗口时固定为 0。
1150
+ */
1151
+ activeStartIndex: number;
1152
+ /**
1153
+ * 当前激活解码窗口结束分段索引(含)。
1154
+ * 空窗口时固定为 -1。
1155
+ */
1156
+ activeEndIndex: number;
1157
+ /**
1158
+ * 当前激活解码窗口内分段数量。
1159
+ */
1160
+ activeSegmentCount: number;
1161
+ };
1162
+
1163
+ export declare type LongImagePhase = 'idle' | 'measuring' | 'loading-meta' | 'ready' | 'error';
1164
+
1165
+ /**
1166
+ * 长图加载与展示组件,支持分段懒加载,适用于超长图片的高性能渲染。
1167
+ */
1168
+ export declare interface LongImageProps {
1169
+ /**
1170
+ * 图片资源地址。
1171
+ */
1172
+ src: string;
1173
+ /**
1174
+ * 元素唯一标识。未传时内部自动生成。
1175
+ */
1176
+ id?: string;
1177
+ /**
1178
+ * 手动重建分段与解码窗口的触发令牌。值变化时会重新初始化。
1179
+ * @defaultValue 0
1180
+ */
1181
+ reloadToken?: number;
1182
+ /**
1183
+ * 单段在展示坐标系下的目标高度(px)。
1184
+ * 值越大,单次解码像素越大;值越小,分段数量越多。
1185
+ * @defaultValue 600
1186
+ */
1187
+ segmentDisplayHeight?: number;
1188
+ /**
1189
+ * 解码窗口的预加载屏数,基于当前可视区域高度计算。
1190
+ * @defaultValue 1
1191
+ */
1192
+ decodeOverscanScreens?: number;
1193
+ /**
1194
+ * 解码窗口允许同时激活的最大分段数。
1195
+ * 用于控制单次内存峰值。
1196
+ * @defaultValue 8
1197
+ */
1198
+ maxActiveSegments?: number;
1199
+ /**
1200
+ * 滚动事件回调节流时间(ms)。
1201
+ * @defaultValue 60
1202
+ */
1203
+ scrollEventThrottle?: number;
1204
+ /**
1205
+ * 非激活分段占位背景色。
1206
+ * @defaultValue 'transparent'
1207
+ */
1208
+ placeholderColor?: string;
1209
+ /**
1210
+ * 组件样式。
1211
+ * - `style.height`:建议显式指定;未指定时默认使用 `100vh`。
1212
+ * - `style.width`:未指定时默认使用 `100%`。
1213
+ */
1214
+ style?: CSSProperties;
1215
+ /**
1216
+ * 组件类名。
1217
+ */
1218
+ className?: string;
1219
+ /**
1220
+ * 指标回调,输出尺寸和当前激活窗口信息。
1221
+ */
1222
+ onMetricsChange?: (metrics: LongImageMetrics) => void;
1223
+ /**
1224
+ * 状态回调,输出阶段与错误信息。
1225
+ */
1226
+ onStateChange?: (state: LongImageState) => void;
1227
+ }
1228
+
1229
+ export declare type LongImageScrollEventLike = {
1230
+ detail?: {
1231
+ scrollTop?: number;
1232
+ listHeight?: number;
1233
+ };
1234
+ scrollTop?: number;
1235
+ listHeight?: number;
1236
+ };
1237
+
1238
+ export declare type LongImageSegmentData = {
1239
+ /**
1240
+ * 分段唯一标识。
1241
+ */
1242
+ id: string;
1243
+ /**
1244
+ * 分段索引(0-based)。
1245
+ */
1246
+ index: number;
1247
+ /**
1248
+ * 分段在原图中的起始 y 坐标(px)。
1249
+ */
1250
+ y: number;
1251
+ /**
1252
+ * 分段在原图中的解码高度(px)。
1253
+ */
1254
+ height: number;
1255
+ /**
1256
+ * 分段在展示坐标系中的高度(px)。
1257
+ */
1258
+ displayHeight: number;
1259
+ /**
1260
+ * 分段在展示坐标系中的顶部位置(px)。
1261
+ */
1262
+ displayTop: number;
1263
+ /**
1264
+ * 分段在展示坐标系中的底部位置(px)。
1265
+ */
1266
+ displayBottom: number;
1267
+ };
1268
+
1269
+ /**
1270
+ * 长图的单个渲染分段,配合 LongImage 使用。
1271
+ */
1272
+ export declare interface LongImageSegmentProps {
1273
+ /**
1274
+ * 图片资源地址。
1275
+ */
1276
+ src: string;
1277
+ /**
1278
+ * 分段数据。
1279
+ */
1280
+ segment: LongImageSegmentData;
1281
+ /**
1282
+ * 原图宽度(px)。
1283
+ */
1284
+ imageWidth: number;
1285
+ /**
1286
+ * 当前分段是否处于激活解码窗口内。
1287
+ * 非激活分段只渲染占位节点,不触发区域解码。
1288
+ * @defaultValue true
1289
+ */
1290
+ active?: boolean;
1291
+ /**
1292
+ * 非激活分段占位背景色。
1293
+ * @defaultValue 'transparent'
1294
+ */
1295
+ placeholderColor?: string;
1296
+ /**
1297
+ * 分段样式。未指定时默认铺满父容器。
1298
+ */
1299
+ style?: CSSProperties;
1300
+ /**
1301
+ * 分段类名。
1302
+ */
1303
+ className?: string;
1304
+ }
1305
+
1306
+ export declare type LongImageState = {
1307
+ /**
1308
+ * 当前状态阶段。
1309
+ */
1310
+ phase: 'idle' | 'measuring' | 'loading-meta' | 'ready';
1311
+ /**
1312
+ * 当前阶段对应的提示文案。
1313
+ */
1314
+ message: string;
1315
+ /**
1316
+ * 分段总数。
1317
+ */
1318
+ totalSegments: number;
1319
+ /**
1320
+ * 当前激活解码窗口起始分段索引(含)。
1321
+ */
1322
+ activeStartIndex: number;
1323
+ /**
1324
+ * 当前激活解码窗口结束分段索引(含)。
1325
+ */
1326
+ activeEndIndex: number;
1327
+ /**
1328
+ * 非错误阶段不返回 error 字段。
1329
+ */
1330
+ error?: never;
1331
+ } | {
1332
+ /**
1333
+ * 当前状态阶段。
1334
+ */
1335
+ phase: 'error';
1336
+ /**
1337
+ * 当前阶段对应的提示文案。
1338
+ */
1339
+ message: string;
1340
+ /**
1341
+ * 错误摘要。
1342
+ */
1343
+ error: string;
1344
+ /**
1345
+ * 分段总数。
1346
+ */
1347
+ totalSegments: number;
1348
+ /**
1349
+ * 当前激活解码窗口起始分段索引(含)。
1350
+ */
1351
+ activeStartIndex: number;
1352
+ /**
1353
+ * 当前激活解码窗口结束分段索引(含)。
1354
+ */
1355
+ activeEndIndex: number;
1356
+ };
1357
+
1358
+ declare type Map_2 = ForwardRefExoticComponent<MapProps & RefAttributes<MapRef>>;
1359
+ export { Map_2 as Map }
1360
+
1361
+ export declare type MapMarker = ForwardRefExoticComponent<MapMarkerProps & RefAttributes<MapMarkerRef>>;
1362
+
1363
+ export declare interface MapMarkerAnimate {
1364
+ /**
1365
+ * 缩放动画。from / to 为缩放倍率,1 表示原始大小。
1366
+ */
1367
+ scale?: MapMarkerAnimationConfig;
1368
+ /**
1369
+ * 透明度动画。from / to 范围为 0-1。
1370
+ */
1371
+ alpha?: MapMarkerAnimationConfig;
1372
+ }
1373
+
1374
+ export declare interface MapMarkerAnimationConfig {
1375
+ /**
1376
+ * 动画起始值。
1377
+ * @defaultValue 1.0
1378
+ */
1379
+ from?: number;
1380
+ /**
1381
+ * 动画结束值。
1382
+ * @defaultValue 1.0
1383
+ */
1384
+ to?: number;
1385
+ /**
1386
+ * 动画时长,单位 ms。
1387
+ * @defaultValue 250
1388
+ */
1389
+ duration?: number;
1390
+ /**
1391
+ * 重复次数。0 表示不重复,-1 表示无限循环。
1392
+ * @defaultValue 0
1393
+ */
1394
+ repeatCount?: number;
1395
+ }
1396
+
1397
+ /**
1398
+ * 地图标记点组件,作为 Map 的子组件使用,支持自定义图标和动画。
1399
+ */
1400
+ export declare interface MapMarkerProps {
1401
+ ref?: Ref<MapMarkerRef>;
1402
+ /**
1403
+ * React key 属性
1404
+ */
1405
+ key?: string | number | null | undefined;
1406
+ /**
1407
+ * 组件的样式。
1408
+ */
1409
+ style?: CSSProperties;
1410
+ /**
1411
+ * 标记点坐标。
1412
+ */
1413
+ position: LatLng;
1414
+ /**
1415
+ * 经纬度在标注图标的锚点。
1416
+ */
1417
+ anchor?: [number, number];
1418
+ /**
1419
+ * 标记点透明度。
1420
+ */
1421
+ alpha?: number;
1422
+ /**
1423
+ * 标记点旋转角度。
1424
+ */
1425
+ rotation?: number;
1426
+ /**
1427
+ * 标记点动画配置。多个动画属性会并行执行。
1428
+ */
1429
+ animate?: MapMarkerAnimate;
1430
+ /**
1431
+ * 标记点在自定义布局中的容器位置。
1432
+ */
1433
+ containerPosition?: {
1434
+ x: number;
1435
+ y: number;
1436
+ };
1437
+ /**
1438
+ * 点击事件处理函数。
1439
+ */
1440
+ onClick?: () => void;
1441
+ /**
1442
+ * 标记点是否可点击,设为 false 时,点击标记点会触发地图的 onClick 事件。
1443
+ * @defaultValue true
1444
+ */
1445
+ clickable?: boolean;
1446
+ /**
1447
+ * 标记点是否可拖拽。
1448
+ * @defaultValue false
1449
+ */
1450
+ draggable?: boolean;
1451
+ /**
1452
+ * 标记点是否参与 POI 碰撞避让。
1453
+ * @defaultValue false
1454
+ */
1455
+ enableCollideWithPoi?: boolean;
1456
+ /**
1457
+ * 标记点的自定义 UI 内容。**必填 - 必须提供自定义标记点 UI**
1458
+ */
1459
+ children: ReactNode;
1460
+ }
1461
+
1462
+ export declare type MapMarkerRef = {
1463
+ /**
1464
+ * 刷新标记点样式。当自定义内容(children)样式变化时调用此方法更新。
1465
+ */
1466
+ refreshMarker: () => void;
1467
+ };
1468
+
1469
+ /**
1470
+ * 地图展示组件,支持标记点、路线、多边形等覆盖物,以及平移、缩放等交互。
1471
+ */
1472
+ export declare interface MapProps {
1473
+ ref?: Ref<MapRef>;
1474
+ /**
1475
+ * 组件的样式。
1476
+ */
1477
+ style?: CSSProperties;
1478
+ /**
1479
+ * 组件的类名。
1480
+ */
1481
+ className?: string;
1482
+ /**
1483
+ * 子元素。一般与 `<MapMarker />` 搭配使用。
1484
+ */
1485
+ children?: ReactNode;
1486
+ /**
1487
+ * 地图主题样式。
1488
+ * @defaultValue "normal-light"
1489
+ */
1490
+ mapStyle?: 'normal-light' | 'normal-dark' | 'simple-light' | 'simple-dark';
1491
+ /**
1492
+ * 地图中心位置。
1493
+ */
1494
+ center?: LatLng;
1495
+ /**
1496
+ * 缩放级别,取值范围为 3-20。
1497
+ * @defaultValue 16
1498
+ */
1499
+ scale?: number;
1500
+ /**
1501
+ * 最小缩放级别,取值范围为 3-20。
1502
+ * @defaultValue 3
1503
+ */
1504
+ minScale?: number;
1505
+ /**
1506
+ * 最大缩放级别,取值范围为 3-20。
1507
+ * @defaultValue 20
1508
+ */
1509
+ maxScale?: number;
1510
+ /**
1511
+ * 路线数组。
1512
+ */
1513
+ polyline?: Polyline[];
1514
+ /**
1515
+ * 路线标签数组。
1516
+ */
1517
+ routeLabel?: RouteLabel[];
1518
+ /**
1519
+ * 多边形数组。
1520
+ */
1521
+ polygons?: Polygon[];
1522
+ /**
1523
+ * 圆数组。
1524
+ */
1525
+ circles?: Circle[];
1526
+ /**
1527
+ * 弧线数组。
1528
+ */
1529
+ arcs?: Arc[];
1530
+ /**
1531
+ * 旋转角度。
1532
+ * @defaultValue 0
1533
+ */
1534
+ rotate?: number;
1535
+ /**
1536
+ * 显示比例尺。
1537
+ * @defaultValue false
1538
+ */
1539
+ showScale?: boolean;
1540
+ /**
1541
+ * 是否显示当前位置标记。开启后会调用定位 API 获取并监听当前位置变化,使用内置 marker 图标展示。
1542
+ * @defaultValue false
1543
+ */
1544
+ showLocation?: boolean;
1545
+ /**
1546
+ * 地图logo位置。
1547
+ * @defaultValue 'bottom-left'
1548
+ */
1549
+ logoPosition?: 'bottom-left' | 'bottom-center' | 'bottom-right' | 'top-left' | 'top-center' | 'top-right';
1550
+ /**
1551
+ * 是否允许缩放。
1552
+ * @defaultValue true
1553
+ */
1554
+ enableScale?: boolean;
1555
+ /**
1556
+ * 是否允许拖动。
1557
+ * @defaultValue true
1558
+ */
1559
+ enableDrag?: boolean;
1560
+ /**
1561
+ * 是否允许旋转。
1562
+ * @defaultValue false
1563
+ */
1564
+ enableRotate?: boolean;
1565
+ /**
1566
+ * 是否允许倾斜。
1567
+ * @defaultValue false
1568
+ */
1569
+ enableTilt?: boolean;
1570
+ /**
1571
+ * 是否允许原生交互。控制平台层触摸事件的处理,影响平台层手势。
1572
+ * @defaultValue true
1573
+ */
1574
+ enableNativeInteraction?: boolean;
1575
+ /**
1576
+ * 点击地图时触发。
1577
+ */
1578
+ onClick?: (event: {
1579
+ point: LatLng;
1580
+ }) => void;
1581
+ /**
1582
+ * 地图加载完成时触发。
1583
+ */
1584
+ onMapLoaded?: () => void;
1585
+ /**
1586
+ * 视野发生变化时触发。
1587
+ */
1588
+ onRegionChange?: (event: {
1589
+ type: 'begin' | 'end';
1590
+ rotate?: number;
1591
+ scale?: number;
1592
+ center?: LatLng;
1593
+ region?: {
1594
+ northeast: LatLng;
1595
+ southwest: LatLng;
1596
+ };
1597
+ causedBy?: 'drag' | 'scale';
1598
+ triggeredBy?: 'user' | 'api';
1599
+ }) => void;
1600
+ /**
1601
+ * 点击路线时触发。
1602
+ */
1603
+ onPolylineClick?: (event: {
1604
+ id: string;
1605
+ }) => void;
1606
+ }
1607
+
1608
+ export declare interface MapRef {
1609
+ /**
1610
+ * 设置地图中心点。
1611
+ */
1612
+ setCenter: (center: LatLng, scale?: number, animationOptions?: MapViewportAnimationOptions) => void;
1613
+ /**
1614
+ * 获取当前地图中心位置。
1615
+ */
1616
+ getCenter: () => Promise<LatLng>;
1617
+ /**
1618
+ * 获取当前缩放级别。
1619
+ */
1620
+ getScale: () => Promise<number>;
1621
+ /**
1622
+ * 设置缩放级别。
1623
+ */
1624
+ setScale: (scale: number, animationOptions?: MapViewportAnimationOptions) => void;
1625
+ /**
1626
+ * 获取当前地图边界。
1627
+ */
1628
+ getBound: () => Promise<{
1629
+ southwest: LatLng;
1630
+ northeast: LatLng;
1631
+ }>;
1632
+ /**
1633
+ * 设置地图边界。
1634
+ */
1635
+ setBound: (bounds: {
1636
+ northeast: LatLng;
1637
+ southwest: LatLng;
1638
+ }, animationOptions?: MapViewportAnimationOptions) => void;
1639
+ /**
1640
+ * 使地图视图适合给定的点。
1641
+ * @param points - 要适配的点数组
1642
+ * @param padding - 点周围的内边距, 分别为左、右、上、下的内边距(像素,默认:[0, 0, 0, 0])
1643
+ * @param animationOptions - 地图视野变化动画配置
1644
+ */
1645
+ fitPoints: (points: LatLng[], padding?: number[], animationOptions?: MapViewportAnimationOptions) => void;
1646
+ /**
1647
+ * 设置地图锚点(地图坐标对齐的屏幕像素位置)。
1648
+ * 默认情况下,setCenter() 将坐标对齐到视口中心。
1649
+ * 调用 setAnchor(x, y) 后,setCenter() 会将坐标对齐到屏幕的 (x, y) 像素位置。
1650
+ * @param position.x - 屏幕 x 坐标像素(0 = 左边缘)
1651
+ * @param position.y - 屏幕 y 坐标像素(0 = 上边缘)
1652
+ * @example
1653
+ * // 将地图中心对齐到屏幕左上角
1654
+ * setAnchor({ x: 0, y: 0 })
1655
+ * // 将地图中心对齐到指定像素位置 (100, 100)
1656
+ * setAnchor({ x: 100, y: 100 })
1657
+ * // 重置为视口中心(假设地图为 500x500)
1658
+ * setAnchor({ x: 250, y: 250 })
1659
+ */
1660
+ setAnchor: (position: {
1661
+ x: number;
1662
+ y: number;
1663
+ }) => void;
1664
+ /**
1665
+ * 将地图经纬度转换为屏幕像素坐标。
1666
+ */
1667
+ latLngToPx: (latLng: LatLng) => Promise<{
1668
+ x: number;
1669
+ y: number;
1670
+ }>;
1671
+ /**
1672
+ * 将屏幕像素坐标转换为地图经纬度。
1673
+ */
1674
+ pxToLatLng: (point: {
1675
+ x: number;
1676
+ y: number;
1677
+ }) => Promise<LatLng>;
1678
+ }
1679
+
1680
+ export declare interface MapViewportAnimationOptions {
1681
+ /**
1682
+ * 是否开启地图视野变化动画。
1683
+ * @defaultValue true
1684
+ */
1685
+ animated?: boolean;
1686
+ /**
1687
+ * 动画时长,单位 ms。
1688
+ * 仅支持 Android 平台。
1689
+ * @defaultValue 250
1690
+ */
1691
+ duration?: number;
1692
+ }
1693
+
1694
+ export declare interface MarkdownAnimationStepEvent {
1695
+ animationStep: number;
1696
+ maxAnimationStep: number;
1697
+ }
1698
+
1699
+ export declare interface MarkdownAnimationStepResult {
1700
+ animationStep: number;
1701
+ }
1702
+
1703
+ export declare interface MarkdownBoundingRect {
1704
+ left: number;
1705
+ top: number;
1706
+ right: number;
1707
+ bottom: number;
1708
+ width: number;
1709
+ height: number;
1710
+ }
1711
+
1712
+ export declare interface MarkdownContentRangeOptions {
1713
+ /**
1714
+ * 起始索引
1715
+ * @defaultValue 0
1716
+ */
1717
+ start?: number;
1718
+ /**
1719
+ * 结束索引
1720
+ * @defaultValue int32_max
1721
+ */
1722
+ end?: number;
1723
+ }
1724
+
1725
+ export declare interface MarkdownContentResult {
1726
+ content: string;
1727
+ }
1728
+
1729
+ export declare type MarkdownEffect = Record<string, unknown>;
1730
+
1731
+ export declare type MarkdownEvent<EventType extends string = string, Detail = unknown> = BaseEvent<EventType, Detail>;
1732
+
1733
+ export declare interface MarkdownImagesResult {
1734
+ images: string[];
1735
+ }
1736
+
1737
+ export declare interface MarkdownImageTapEvent {
1738
+ url: string;
1739
+ }
1740
+
1741
+ export declare interface MarkdownLineStyle {
1742
+ lineType: 'solid' | 'dashed';
1743
+ color: string;
1744
+ width: number;
1745
+ elementSize?: number;
1746
+ emptySize?: number;
1747
+ }
1748
+
1749
+ export declare interface MarkdownLinkEvent {
1750
+ url: string;
1751
+ content: string;
1752
+ }
1753
+
1754
+ export declare interface MarkdownMarkAttachment {
1755
+ startIndex: number;
1756
+ endIndex: number;
1757
+ indexType: 'char' | 'source';
1758
+ clickable?: boolean;
1759
+ id?: string;
1760
+ layer?: 'background' | 'foreground';
1761
+ style: MarkdownMarkStyle;
1762
+ }
1763
+
1764
+ export declare interface MarkdownMarkStyle {
1765
+ radius?: number;
1766
+ left?: number;
1767
+ right?: number;
1768
+ top?: number;
1769
+ bottom?: number;
1770
+ color?: string;
1771
+ borderLeft?: MarkdownLineStyle;
1772
+ borderTop?: MarkdownLineStyle;
1773
+ borderRight?: MarkdownLineStyle;
1774
+ borderBottom?: MarkdownLineStyle;
1775
+ }
1776
+
1777
+ export declare interface MarkdownMethodFailResult {
1778
+ code: number;
1779
+ data: string;
1780
+ }
1781
+
1782
+ export declare interface MarkdownOverflowEvent {
1783
+ type: 'ellipsis' | 'clip';
1784
+ }
1785
+
1786
+ export declare interface MarkdownParseEndEvent {
1787
+ id: string;
1788
+ }
1789
+
1790
+ export declare interface MarkdownParseResult {
1791
+ result: Map<string, MarkdownSourceRange[]>;
1792
+ }
1793
+
1794
+ export declare interface MarkdownParseResultOptions {
1795
+ /**
1796
+ * 需要获取源码区间的标签名
1797
+ */
1798
+ tags: string[];
1799
+ }
1800
+
1801
+ /**
1802
+ * Markdown 渲染组件,基于 Lynx `x-markdown` 渲染 Markdown 内容。
1803
+ */
1804
+ export declare interface MarkdownProps {
1805
+ /**
1806
+ * 组件样式
1807
+ */
1808
+ style?: CSSProperties;
1809
+ /**
1810
+ * 组件类名
1811
+ */
1812
+ className?: string;
1813
+ /**
1814
+ * 元素的唯一标识
1815
+ */
1816
+ id?: string;
1817
+ /**
1818
+ * React key 属性
1819
+ */
1820
+ key?: string | number | null | undefined;
1821
+ /**
1822
+ * 用于获取组件实例的 ref
1823
+ */
1824
+ ref?: Ref<MarkdownRef>;
1825
+ /**
1826
+ * Markdown 源内容
1827
+ */
1828
+ content: string;
1829
+ /**
1830
+ * 内容标识,会在事件和 UI 方法中回传
1831
+ */
1832
+ contentId?: string;
1833
+ /**
1834
+ * Markdown 内部元素样式表。该对象会直接透传给 Lynx 原生 `x-markdown` 的 `markdown-style`,
1835
+ * 不是普通 CSS style;颜色使用不带 `#` 的十六进制字符串(如 `'151515'`),尺寸使用 number
1836
+ *(如 `fontSize: 15`、`lineHeight: 22`),不要传 `var(--color)`、`'#151515'` 或 `'15px'`。
1837
+ * @defaultValue {}
1838
+ */
1839
+ markdownStyle?: MarkdownStyle;
1840
+ /**
1841
+ * 动画类型
1842
+ * @defaultValue 'none'
1843
+ */
1844
+ animationType?: 'none' | 'typewriter';
1845
+ /**
1846
+ * 动画速度。打字机模式下表示每秒输出字符数
1847
+ * @defaultValue 1
1848
+ */
1849
+ animationVelocity?: number;
1850
+ /**
1851
+ * 最大文本行数,表格行也会计为一行
1852
+ */
1853
+ textMaxline?: number;
1854
+ /**
1855
+ * 动画起始步数
1856
+ * @defaultValue 0
1857
+ */
1858
+ initialAnimationStep?: number;
1859
+ /**
1860
+ * 打字机动画完成后是否隐藏光标并触发绘制完成事件
1861
+ * @defaultValue true
1862
+ */
1863
+ contentComplete?: boolean;
1864
+ /**
1865
+ * 打字机模式下高度是否跟随已输出内容变化
1866
+ * @defaultValue false
1867
+ */
1868
+ typewriterDynamicHeight?: boolean;
1869
+ /**
1870
+ * 是否支持文本选择
1871
+ * @defaultValue false
1872
+ */
1873
+ textSelection?: boolean;
1874
+ /**
1875
+ * 文本高亮、下划线等标注配置
1876
+ * @defaultValue []
1877
+ */
1878
+ textMarkAttachments?: MarkdownMarkAttachment[];
1879
+ /**
1880
+ * 需要解析的内容区间
1881
+ * @defaultValue [0, int32_max]
1882
+ */
1883
+ contentRange?: number[];
1884
+ /**
1885
+ * 额外 Markdown 效果配置
1886
+ * @defaultValue {}
1887
+ */
1888
+ markdownEffect?: MarkdownEffect;
1889
+ /**
1890
+ * 打字机动画扩展高度时的过渡时长
1891
+ * @defaultValue 0
1892
+ */
1893
+ typewriterHeightTransitionDuration?: number;
1894
+ /**
1895
+ * 是否启用 GIF 动画
1896
+ * @defaultValue false
1897
+ */
1898
+ enableGif?: boolean;
1899
+ /**
1900
+ * 开始绘制时触发
1901
+ * @eventProperty
1902
+ */
1903
+ onDrawStart?: (event: MarkdownEvent<'binddrawStart'>) => void;
1904
+ /**
1905
+ * 绘制完成时触发
1906
+ * @eventProperty
1907
+ */
1908
+ onDrawEnd?: (event: MarkdownEvent<'binddrawEnd'>) => void;
1909
+ /**
1910
+ * 动画每步结束时触发
1911
+ * @eventProperty
1912
+ */
1913
+ onAnimationStep?: (event: MarkdownEvent<'bindanimationStep', MarkdownAnimationStepEvent>) => void;
1914
+ /**
1915
+ * 文本溢出时触发
1916
+ * @eventProperty
1917
+ */
1918
+ onOverflow?: (event: MarkdownEvent<'bindoverflow', MarkdownOverflowEvent>) => void;
1919
+ /**
1920
+ * 点击链接时触发
1921
+ * @eventProperty
1922
+ */
1923
+ onLink?: (event: MarkdownEvent<'bindlink', MarkdownLinkEvent>) => void;
1924
+ /**
1925
+ * 文本选择变化时触发
1926
+ * @eventProperty
1927
+ */
1928
+ onSelectionChange?: (event: MarkdownEvent<'bindselectionchange', MarkdownSelectionChangeEvent>) => void;
1929
+ /**
1930
+ * 点击图片时触发
1931
+ * @eventProperty
1932
+ */
1933
+ onImageTap?: (event: MarkdownEvent<'bindimageTap', MarkdownImageTapEvent>) => void;
1934
+ /**
1935
+ * 解析完成时触发
1936
+ * @eventProperty
1937
+ */
1938
+ onParseEnd?: (event: MarkdownEvent<'bindparseEnd', MarkdownParseEndEvent>) => void;
1939
+ /**
1940
+ * 点击 textMarkAttachments 中的可点击标注时触发
1941
+ * @eventProperty
1942
+ */
1943
+ onTextClick?: (event: MarkdownEvent<'bindtextClick', MarkdownTextClickEvent>) => void;
1944
+ }
1945
+
1946
+ /**
1947
+ * Markdown 组件暴露的方法
1948
+ */
1949
+ export declare interface MarkdownRef {
1950
+ /**
1951
+ * 暂停打字机动画
1952
+ */
1953
+ pauseAnimation: () => Promise<MarkdownAnimationStepResult>;
1954
+ /**
1955
+ * 继续打字机动画
1956
+ */
1957
+ resumeAnimation: (options?: MarkdownResumeAnimationOptions) => Promise<void>;
1958
+ /**
1959
+ * 获取指定区间的已解析内容
1960
+ */
1961
+ getContent: (options?: MarkdownContentRangeOptions) => Promise<MarkdownContentResult>;
1962
+ /**
1963
+ * 获取当前选中的文本
1964
+ */
1965
+ getSelectedText: () => Promise<MarkdownSelectedTextResult>;
1966
+ /**
1967
+ * 通过坐标设置文本选区
1968
+ */
1969
+ setTextSelection: (options: MarkdownTextSelectionOptions) => Promise<MarkdownTextSelectionResult>;
1970
+ /**
1971
+ * 获取指定文本区间的布局包围盒
1972
+ */
1973
+ getTextBoundingRect: (options?: MarkdownTextBoundingRectOptions) => Promise<MarkdownTextBoundingRectResult>;
1974
+ /**
1975
+ * 获取 Markdown 中的所有图片地址
1976
+ */
1977
+ getImages: () => Promise<MarkdownImagesResult>;
1978
+ /**
1979
+ * 获取指定标签对应的源码区间
1980
+ */
1981
+ getParseResult: (options: MarkdownParseResultOptions) => Promise<MarkdownParseResult>;
1982
+ }
1983
+
1984
+ export declare interface MarkdownResumeAnimationOptions {
1985
+ /**
1986
+ * 动画从指定步数继续
1987
+ */
1988
+ animationStep?: number;
1989
+ }
1990
+
1991
+ export declare interface MarkdownSelectedTextResult {
1992
+ selectedText: string;
1993
+ }
1994
+
1995
+ export declare interface MarkdownSelectionChangeEvent {
1996
+ start: number;
1997
+ end: number;
1998
+ direction: 'forward' | 'backward';
1999
+ }
2000
+
2001
+ export declare interface MarkdownSelectionHandle {
2002
+ x: number;
2003
+ y: number;
2004
+ radius: number;
2005
+ }
2006
+
2007
+ export declare interface MarkdownSourceRange {
2008
+ start: number;
2009
+ end: number;
2010
+ }
2011
+
2012
+ export declare type MarkdownStyle = Record<string, unknown>;
2013
+
2014
+ export declare interface MarkdownTextBoundingRectOptions extends MarkdownContentRangeOptions {
2015
+ /**
2016
+ * start/end 的索引类型
2017
+ * @defaultValue 'char'
2018
+ */
2019
+ indexType?: 'source' | 'char';
2020
+ }
2021
+
2022
+ export declare interface MarkdownTextBoundingRectResult {
2023
+ boundingRect: MarkdownBoundingRect;
2024
+ boxes: MarkdownBoundingRect[];
2025
+ }
2026
+
2027
+ export declare interface MarkdownTextClickEvent {
2028
+ id: string;
2029
+ }
2030
+
2031
+ export declare interface MarkdownTextSelectionOptions {
2032
+ /**
2033
+ * 选区起点相对组件的 x 坐标
2034
+ */
2035
+ startX: number;
2036
+ /**
2037
+ * 选区起点相对组件的 y 坐标
2038
+ */
2039
+ startY: number;
2040
+ /**
2041
+ * 选区终点相对组件的 x 坐标
2042
+ */
2043
+ endX: number;
2044
+ /**
2045
+ * 选区终点相对组件的 y 坐标
2046
+ */
2047
+ endY: number;
2048
+ }
2049
+
2050
+ export declare interface MarkdownTextSelectionResult {
2051
+ boundingRect: MarkdownBoundingRect;
2052
+ boxes: MarkdownBoundingRect[];
2053
+ handles: {
2054
+ start: MarkdownSelectionHandle;
2055
+ end: MarkdownSelectionHandle;
2056
+ }[];
2057
+ }
2058
+
2059
+ /**
2060
+ * 可移动区域组件,定义子视图可拖拽移动的范围边界。
2061
+ */
2062
+ export declare interface MovableAreaProps {
2063
+ /**
2064
+ * 组件样式
2065
+ */
2066
+ style?: CSSProperties;
2067
+ /**
2068
+ * 组件类名
2069
+ */
2070
+ className?: string;
2071
+ /**
2072
+ * 子组件
2073
+ */
2074
+ children?: ReactNode;
2075
+ }
2076
+
2077
+ /**
2078
+ * 可移动视图组件,支持拖拽移动、双指缩放、惯性滑动、越界回弹等交互。
2079
+ */
2080
+ export declare interface MovableViewProps {
2081
+ /**
2082
+ * 组件样式
2083
+ */
2084
+ style?: CSSProperties;
2085
+ /**
2086
+ * 组件类名
2087
+ */
2088
+ className?: string;
2089
+ /**
2090
+ * 移动方向
2091
+ * - 'all':允许所有方向移动
2092
+ * - 'vertical':只允许垂直移动
2093
+ * - 'horizontal':只允许水平移动
2094
+ * - 'none':不允许移动
2095
+ *
2096
+ * @defaultValue 'none'
2097
+ */
2098
+ direction?: 'all' | 'vertical' | 'horizontal' | 'none';
2099
+ /**
2100
+ * 是否禁用移动
2101
+ * @defaultValue false
2102
+ */
2103
+ disabled?: boolean;
2104
+ /**
2105
+ * 是否允许缩放
2106
+ * @defaultValue false
2107
+ */
2108
+ scale?: boolean;
2109
+ /**
2110
+ * 是否启用惯性滑动
2111
+ * @defaultValue false
2112
+ */
2113
+ inertia?: boolean;
2114
+ /**
2115
+ * 是否启用动画
2116
+ * @defaultValue true
2117
+ */
2118
+ animation?: boolean;
2119
+ /**
2120
+ * 阻尼系数,用于控制 x/y 改变时的动画和越界回弹动画。值越大越快。
2121
+ * @defaultValue 20
2122
+ */
2123
+ damping?: number;
2124
+ /**
2125
+ * 摩擦系数,用于控制惯性滑动衰减。值越大摩擦越大,越快停止;必须 > 0。
2126
+ * @defaultValue 2
2127
+ */
2128
+ friction?: number;
2129
+ /**
2130
+ * 最小缩放比例
2131
+ * @defaultValue 0.5
2132
+ */
2133
+ scaleMin?: number;
2134
+ /**
2135
+ * 最大缩放比例
2136
+ * @defaultValue 10
2137
+ */
2138
+ scaleMax?: number;
2139
+ /**
2140
+ * 是否允许超出可移动区域
2141
+ * @defaultValue false
2142
+ */
2143
+ outOfBounds?: boolean;
2144
+ /**
2145
+ * 初始 X 轴偏移
2146
+ * @defaultValue 0
2147
+ */
2148
+ x?: number;
2149
+ /**
2150
+ * 初始 Y 轴偏移
2151
+ * @defaultValue 0
2152
+ */
2153
+ y?: number;
2154
+ /**
2155
+ * 初始缩放值
2156
+ * @defaultValue 1
2157
+ */
2158
+ scaleValue?: number;
2159
+ /**
2160
+ * 拖拽移动时触发
2161
+ */
2162
+ onDrag?: (x: number, y: number) => void;
2163
+ /**
2164
+ * 双指缩放时触发
2165
+ */
2166
+ onScale?: (scale: number) => void;
2167
+ /**
2168
+ * 子组件
2169
+ */
2170
+ children?: ReactNode;
2171
+ }
2172
+
2173
+ declare interface OffscreenCanvas_2 {
2174
+ /**
2175
+ * 画布宽度(buffer 像素数)
2176
+ */
2177
+ width: number;
2178
+ /**
2179
+ * 画布高度(buffer 像素数)
2180
+ */
2181
+ height: number;
2182
+ /**
2183
+ * 获取绘图上下文
2184
+ */
2185
+ getContext: {
2186
+ (contextType: '2d'): Canvas2DContext | null;
2187
+ (contextType: 'webgl', contextAttributes?: WebGLContextAttributes_2): WebGLRenderingContext | null;
2188
+ (contextType: 'webgl2', contextAttributes?: WebGLContextAttributes_2): WebGL2RenderingContext | null;
2189
+ };
2190
+ /**
2191
+ * 创建图片对象
2192
+ */
2193
+ createImage: () => CanvasImage | undefined;
2194
+ }
2195
+
2196
+ declare interface onBounceParams {
2197
+ type: 'start' | 'end';
2198
+ offset: number;
2199
+ }
2200
+
2201
+ declare interface OnDragCallback {
2202
+ /**
2203
+ * 0 - begin 1 - drag 2 - end
2204
+ * @zh 0 - 开始 1 - 拖动 2 - 结束
2205
+ */
2206
+ state: number;
2207
+ /**
2208
+ * x and y coordinate
2209
+ * @zh x 和 y 坐标
2210
+ */
2211
+ touchEvent: TouchEvent_3;
2212
+ /**
2213
+ * The top of popup
2214
+ * @zh 弹窗的顶部位置
2215
+ */
2216
+ top: number;
2217
+ }
2218
+
2219
+ /**
2220
+ * PickerColumn 单个选项的数据结构
2221
+ */
2222
+ export declare interface PickerColumnOption {
2223
+ /**
2224
+ * 选项显示的文本
2225
+ */
2226
+ label: string;
2227
+ /**
2228
+ * 选项的值
2229
+ */
2230
+ value: string | number;
2231
+ /**
2232
+ * 是否禁用
2233
+ */
2234
+ disabled?: boolean;
2235
+ }
2236
+
2237
+ /**
2238
+ * 滚轮选择列,单列数据选择,通常作为 PickerView 的子组件使用。
2239
+ */
2240
+ export declare interface PickerColumnProps {
2241
+ /**
2242
+ * 组件样式
2243
+ */
2244
+ style?: CSSProperties;
2245
+ /**
2246
+ * 组件类名
2247
+ */
2248
+ className?: string;
2249
+ /**
2250
+ * 列数据
2251
+ */
2252
+ options: PickerColumnOption[];
2253
+ /**
2254
+ * 当前选中的值
2255
+ */
2256
+ value?: string | number;
2257
+ /**
2258
+ * 默认选中的值,用于非受控模式
2259
+ */
2260
+ defaultValue?: string | number;
2261
+ /**
2262
+ * 选项变化时触发
2263
+ */
2264
+ onChange?: (value: string | number, option: PickerColumnOption) => void;
2265
+ }
2266
+
2267
+ export declare interface PickerColumnRef {
2268
+ getValue: () => {
2269
+ value: string | number;
2270
+ option: PickerColumnOption;
2271
+ };
2272
+ setValue: (value: string | number) => void;
2273
+ }
2274
+
2275
+ /**
2276
+ * 滚轮选择器分隔线组件,用于在 PickerColumn 之间展示文字或自定义内容。
2277
+ */
2278
+ export declare interface PickerDividerProps {
2279
+ /**
2280
+ * 展示文本。
2281
+ */
2282
+ text?: string;
2283
+ /**
2284
+ * 自定义内容,优先级高于 text。
2285
+ */
2286
+ children?: ReactNode;
2287
+ /**
2288
+ * 组件类名。
2289
+ */
2290
+ className?: string;
2291
+ /**
2292
+ * 组件样式。
2293
+ */
2294
+ style?: CSSProperties;
2295
+ }
2296
+
2297
+ /**
2298
+ * 滚轮选择器容器,支持多列组合选择。
2299
+ */
2300
+ export declare interface PickerViewProps {
2301
+ /**
2302
+ * 组件样式
2303
+ */
2304
+ style?: CSSProperties;
2305
+ /**
2306
+ * 组件类名
2307
+ */
2308
+ className?: string;
2309
+ /**
2310
+ * 组件主题。未传时跟随宿主应用主题;传入后固定使用指定主题。
2311
+ */
2312
+ theme?: Theme;
2313
+ /**
2314
+ * 单个选项高度,单位 px。PickerView 会用它同步 indicator 高度和滚动居中计算。
2315
+ */
2316
+ itemHeight?: number;
2317
+ /**
2318
+ * 子元素,通常是 PickerColumn
2319
+ */
2320
+ children?: ReactNode;
2321
+ /**
2322
+ * 选项变化时触发
2323
+ */
2324
+ onChange?: (values: (string | number)[], options: PickerColumnOption[]) => void;
2325
+ }
2326
+
2327
+ export declare interface PickerViewRef {
2328
+ getValues: () => (string | number)[];
2329
+ getOptions: () => PickerColumnOption[];
2330
+ setValues: (values: (string | number)[]) => void;
2331
+ }
2332
+
2333
+ export declare interface Polygon {
2334
+ id: string;
2335
+ /**
2336
+ * 多边形顶点经纬度数组,顺时针方向。
2337
+ */
2338
+ points: LatLng[];
2339
+ /**
2340
+ * 是否虚线。
2341
+ */
2342
+ dottedLine?: boolean;
2343
+ /**
2344
+ * 描边的宽度。
2345
+ * @defaultValue 1
2346
+ */
2347
+ strokeWidth?: number;
2348
+ /**
2349
+ * 描边的颜色。
2350
+ * @defaultValue "#52afff99"
2351
+ */
2352
+ strokeColor?: string;
2353
+ /**
2354
+ * 填充颜色。
2355
+ * @defaultValue "#52afff33"
2356
+ */
2357
+ fillColor?: string;
2358
+ /**
2359
+ * 设置多边形 Z 轴数值。
2360
+ * @defaultValue 0
2361
+ */
2362
+ zIndex?: number;
2363
+ }
2364
+
2365
+ export declare interface Polyline {
2366
+ id: string;
2367
+ /**
2368
+ * 路线点数组。
2369
+ */
2370
+ points: LatLng[];
2371
+ /**
2372
+ * 路线各段边缘颜色数组。
2373
+ */
2374
+ edgeColor?: string[];
2375
+ /**
2376
+ * 路线各段纹理 ID 数组,ID 必须在 edgeTextureAssets 中定义。
2377
+ */
2378
+ edgeTexture?: string[];
2379
+ /**
2380
+ * 路线纹理资源数组。
2381
+ */
2382
+ edgeTextureAssets?: PolylineEdgeTexture[];
2383
+ /**
2384
+ * 路线上叠加展示的方向箭头。
2385
+ *
2386
+ * 箭头会作为独立纹理层渲染在当前路线上方,不会占用 edgeTexture 和
2387
+ * edgeTextureAssets 配置。
2388
+ */
2389
+ arrow?: PolylineArrow;
2390
+ /**
2391
+ * 路线宽度,单位 px。
2392
+ */
2393
+ width?: number;
2394
+ /**
2395
+ * 是否虚线。
2396
+ */
2397
+ dottedLine?: boolean;
2398
+ /**
2399
+ * 线帽样式(端点样式)。注意:客户端仅支持在构造时设置,若需更新请手动更换 id 或重新构造整条折线。
2400
+ * @defaultValue "line_cap_butt"
2401
+ */
2402
+ lineCapType?: 'line_cap_butt' | 'line_cap_round';
2403
+ /**
2404
+ * 线连接样式(拐角样式)。注意:客户端仅支持在构造时设置,若需更新请手动更换 id 或重新构造整条折线。
2405
+ * @defaultValue "line_join_bevel"
2406
+ */
2407
+ lineJoinType?: 'line_join_miter' | 'line_join_round' | 'line_join_bevel';
2408
+ /**
2409
+ * 设置折线 Z 轴数值。
2410
+ * @defaultValue 0
2411
+ */
2412
+ zIndex?: number;
2413
+ }
2414
+
2415
+ export declare interface PolylineArrow {
2416
+ /**
2417
+ * 箭头纹理图片 URL,支持网络图片和 base64 字符串。
2418
+ */
2419
+ iconPath: string;
2420
+ }
2421
+
2422
+ export declare interface PolylineEdgeTexture {
2423
+ /**
2424
+ * 纹理 ID。
2425
+ */
2426
+ id: string;
2427
+ /**
2428
+ * 纹理图片 URL,支持网络图片和 base64 字符串。
2429
+ */
2430
+ url: string;
2431
+ }
2432
+
2433
+ export declare interface PopupProps {
2434
+ ref?: ForwardedRef<PopupRef>;
2435
+ /**
2436
+ * The id of root scroll container(required)
2437
+ * @zh 根节点滚动容器的 ID(必需)
2438
+ * @Android
2439
+ * @iOS
2440
+ * @Harmony
2441
+ */
2442
+ scrollContainerId: string;
2443
+ /**
2444
+ * children of popup.
2445
+ * @zh 弹窗的子元素
2446
+ * @Android
2447
+ * @iOS
2448
+ * @Harmony
2449
+ */
2450
+ children: (prop: RenderFunction) => ReactElement;
2451
+ /**
2452
+ * The ID of the popup content, which needs to be set when autoHeight is true, to get the content height
2453
+ * @zh 弹窗内容的 ID, 在 autoHeight 为 true 时需要设置,用于获取内容高度
2454
+ * @Android
2455
+ * @iOS
2456
+ * @Harmony
2457
+ */
2458
+ contentId?: string;
2459
+ /**
2460
+ * Auto height of popup, when set to true, you need to specified contentId prop, the height of popup will be the height of content, The drag area is between bottom and the current height, initHeight and maxHeight are no longer valid
2461
+ * @zh 自动弹窗高度,设置为 true 时,需要指定 contentId 属性,弹窗高度会根据内容高度动态变化,拖动区域在底部和当前高度之间,initHeight 和 maxHeight 不再有效
2462
+ * @Android
2463
+ * @iOS
2464
+ * @Harmony
2465
+ */
2466
+ autoHeight?: boolean;
2467
+ /**
2468
+ * Style for mask
2469
+ * @zh 遮罩的样式
2470
+ * @Android
2471
+ * @iOS
2472
+ * @Harmony
2473
+ */
2474
+ maskStyle?: CSSProperties_2;
2475
+ /**
2476
+ * Style for popup content
2477
+ * @zh 弹窗内容的样式
2478
+ * @Android
2479
+ * @iOS
2480
+ * @Harmony
2481
+ */
2482
+ contentStyle?: CSSProperties_2;
2483
+ /**
2484
+ * Preload when popup is create, it will speed up shown when visible is true
2485
+ * @zh 弹窗创建时预加载,这样在 visible 为 true 时会加快显示速度
2486
+ * @defaultValue true
2487
+ * @Android
2488
+ * @iOS
2489
+ * @Harmony
2490
+ */
2491
+ preload?: boolean;
2492
+ /**
2493
+ * When set to true, click mask will dismiss popup.
2494
+ * @zh 设置为 true 时,点击遮罩会关闭弹窗
2495
+ * @defaultValue true
2496
+ * @Android
2497
+ * @iOS
2498
+ * @Harmony
2499
+ */
2500
+ closeOnMaskClick?: boolean;
2501
+ /**
2502
+ * When set to true, mask event will through to children
2503
+ * @zh 当设置为true的时候,遮罩事件会传递到子元素
2504
+ * @defaultValue false
2505
+ * @Android
2506
+ * @iOS
2507
+ * @Harmony
2508
+ */
2509
+ maskEventThrough?: boolean;
2510
+ /**
2511
+ * if enable drag or not
2512
+ * @zh 是否启用拖动
2513
+ * @defaultValue true
2514
+ * @Android
2515
+ * @iOS
2516
+ * @Harmony
2517
+ */
2518
+ enableDrag?: boolean;
2519
+ /**
2520
+ * if enable bounces or not when touch up
2521
+ * @zh 是否需要松手回弹
2522
+ * @defaultValue true
2523
+ * @Android
2524
+ * @iOS
2525
+ * @Harmony
2526
+ */
2527
+ enableBounces?: boolean;
2528
+ /**
2529
+ * If true, allows the component to overflow the bottom boundary when dragged.
2530
+ * @zh 如果为 true,则允许组件在拖动时超出底部边界。
2531
+ * @defaultValue false
2532
+ * @Android
2533
+ * @iOS
2534
+ * @Harmony
2535
+ */
2536
+ allowDragBeyondBottom?: boolean;
2537
+ /**
2538
+ * Stops the propagation of gesture events when the scroll container is at the top.
2539
+ * @zh 当滚动容器滚动到顶部时,停止滚动容器的手势事件传播。
2540
+ * @defaultValue false
2541
+ * @Android
2542
+ * @iOS
2543
+ * @Harmony
2544
+ */
2545
+ stopGesturePropagationWhenScrollAtTop?: boolean;
2546
+ /**
2547
+ * Dynamically adjusts the exit animation based on the content height. When enabled, the on-screen animation duration remains constant. As a result, the greater the content height, the faster the exit velocity to ensure the animation completes within the fixed time
2548
+ * @zh 根据内容高度动态调整退出动画。启用后,屏幕上的动画持续时间保持不变。因此,内容高度越大,退出速度越快,以确保动画在固定时间内完成。
2549
+ * @defaultValue false
2550
+ * @Android
2551
+ * @iOS
2552
+ * @Harmony
2553
+ */
2554
+ adjustExitTransitionByContentHeight?: boolean;
2555
+ /**
2556
+ * Theoretically, this is the maximum height that can be dragged to. When using overlayMode, the screen height needs to be passed in. When not using overlayMode, the height of the current LynxView needs to be passed in.
2557
+ * @zh 理论上能拖拽到的最大高度,当使用overlayMode时需要传入屏幕高度,当不使用overlayMode时,需要传入当前LynxView的高度
2558
+ * @defaultValue screenHeight
2559
+ * @Android
2560
+ * @iOS
2561
+ * @Harmony
2562
+ */
2563
+ maxHeight: number;
2564
+ /**
2565
+ * Nodes fixed at the bottom of the popup will not be affected by dragging
2566
+ * @zh 固定在弹窗底部的节点,不会受到拖动影响
2567
+ * @Android
2568
+ * @iOS
2569
+ * @Harmony
2570
+ */
2571
+ bottomNode?: ReactElement;
2572
+ /**
2573
+ * Whether to allow dragging the Popup when touching the internal scroll container area
2574
+ * @zh 是否允许触摸在内部滚动容器区域时可拖拽Popup
2575
+ * @defaultValue true
2576
+ * @Android
2577
+ * @iOS
2578
+ * @Harmony
2579
+ */
2580
+ enableScrollContainerDraggable?: boolean;
2581
+ /**
2582
+ * It is recommended to use a full-screen transparent container for the popup, as it offers better performance. Alternatively, you can also choose to use the popup through an overlay
2583
+ * @zh 建议为弹窗使用全屏透明容器,因为这样性能更好。或者,你也可以选择通过overlay使用弹窗,请参考overlay-ng mode官网描述
2584
+ * @Android
2585
+ * @iOS
2586
+ * @Harmony
2587
+ * @docTypeFallback 'spark' | 'bullet' | 'bulletPopup' | (string & {})
2588
+ */
2589
+ bytedanceOverlayMode?: 'spark' | 'bullet' | 'bulletPopup' | (string & {});
2590
+ /**
2591
+ * Whether to enable the debug log
2592
+ * @zh 是否启用调试日志
2593
+ * @defaultValue false
2594
+ * @Android
2595
+ * @iOS
2596
+ * @Harmony
2597
+ */
2598
+ internalDebugLog?: boolean;
2599
+ /**
2600
+ * show animation transition
2601
+ * @zh 显示动画过渡效果
2602
+ * @defaultValue 'all ease-out'
2603
+ * @Android
2604
+ * @iOS
2605
+ * @Harmony
2606
+ */
2607
+ enterEasingFunction?: string;
2608
+ /**
2609
+ * hide animation transition
2610
+ * @zh 隐藏动画过渡效果
2611
+ * @defaultValue 'all ease-out'
2612
+ * @Android
2613
+ * @iOS
2614
+ * @Harmony
2615
+ */
2616
+ exitEasingFunction?: string;
2617
+ /**
2618
+ * enter animation duration(ms)
2619
+ * @zh 进入动画持续时间(毫秒)
2620
+ * @defaultValue 300
2621
+ * @Android
2622
+ * @iOS
2623
+ * @Harmony
2624
+ */
2625
+ enterDuration?: number;
2626
+ /**
2627
+ * exit animation duration(ms)
2628
+ * @zh 退出动画持续时间(毫秒)
2629
+ * @defaultValue 300
2630
+ * @Android
2631
+ * @iOS
2632
+ * @Harmony
2633
+ */
2634
+ exitDuration?: number;
2635
+ /**
2636
+ * If you want to use gesture, pass it here.
2637
+ * @zh 如果你想使用手势,请使用这个属性
2638
+ * @Android
2639
+ * @iOS
2640
+ * @Harmony
2641
+ */
2642
+ 'main-thread:gesture'?: BaseGesture;
2643
+ /**
2644
+ * height percentage of Popup
2645
+ * @zh 弹窗的高度百分比
2646
+ * @Android
2647
+ * @iOS
2648
+ * @Harmony
2649
+ */
2650
+ heightPercent?: HeightPercent;
2651
+ /**
2652
+ * bounces transition
2653
+ * @zh 松手回弹效果动画
2654
+ * @defaultValue 'all 0.1s ease-out'
2655
+ * @Android
2656
+ * @iOS
2657
+ * @Harmony
2658
+ */
2659
+ bouncesTransition?: string;
2660
+ /**
2661
+ * mask transition timing function, e.g. cubic-bezier(0.25, 0.1, 0.25, 1)
2662
+ * @zh 遮罩的过渡动画时间函数,例如 cubic-bezier(0.25, 0.1, 0.25, 1)
2663
+ * @Android
2664
+ * @iOS
2665
+ * @Harmony
2666
+ */
2667
+ maskTransitionTimingFunction?: string;
2668
+ /**
2669
+ * x-overlay-ng props for the popup
2670
+ * @zh 在弹窗的overlay id, 用于在设置bytedanceOverlayMode下指定弹窗的overlay props
2671
+ * @defaultValue {}
2672
+ * @Android
2673
+ * @iOS
2674
+ * @Harmony
2675
+ */
2676
+ overlayProps?: Partial<XOverlayNGProps>;
2677
+ /**
2678
+ * drag callback
2679
+ * @zh 拖动回调
2680
+ * @Android
2681
+ * @iOS
2682
+ * @Harmony
2683
+ */
2684
+ onDrag?: (eventParam: OnDragCallback) => void;
2685
+ /**
2686
+ * popup position callback
2687
+ * @zh 弹窗位置回调
2688
+ * @Android
2689
+ * @iOS
2690
+ * @Harmony
2691
+ */
2692
+ onPopupPositionChange?: (
2693
+ /**
2694
+ * 0(center) 1(top) -1(bottom) 4(close)
2695
+ * @zh 0(中间) 1(顶部) -1(底部) 4(关闭)
2696
+ * @Android
2697
+ * @iOS
2698
+ * @Harmony
2699
+ */
2700
+ position: number) => void;
2701
+ /**
2702
+ * 弹窗高度变化回调
2703
+ * @param height 弹窗的高度
2704
+ * @returns
2705
+ */
2706
+ onPopupTopChange?: (height: number) => void;
2707
+ /**
2708
+ * clicking the back button or sliding back
2709
+ * @zh 是否左滑或者点击返回键
2710
+ * @Android
2711
+ */
2712
+ onRequestClose?: () => void;
2713
+ }
2714
+
2715
+ export declare interface PopupRef {
2716
+ /**
2717
+ * Open the popup. Popup position: 0 (center), 1 (top), -1 (bottom). Default is center.
2718
+ * @zh 打开弹窗, 弹窗位置 0(中心)1(顶部)-1(底部),默认是中心
2719
+ * @defaultValue 0
2720
+ * @Android
2721
+ * @iOS
2722
+ * @Harmony
2723
+ */
2724
+ open: (position?: PopupStatus) => void;
2725
+ /**
2726
+ * Close popup
2727
+ * @zh 关闭弹窗
2728
+ * @Android
2729
+ * @iOS
2730
+ * @Harmony
2731
+ */
2732
+ close: () => void;
2733
+ /**
2734
+ * Translate popup to specified position, 0(center) 1(top) -1(bottom) | "px" | "%" | "rpx"
2735
+ * @zh 移动弹窗到指定位置,0(中心)1(顶部)-1(底部)
2736
+ * @Android
2737
+ * @iOS
2738
+ * @Harmony
2739
+ */
2740
+ translateTo: (position: PopupStatus | string) => void;
2741
+ }
2742
+
2743
+ declare const enum PopupStatus {
2744
+ AT_BOTTOM = -1,
2745
+ AT_CENTER = 0,
2746
+ AT_TOP = 1,
2747
+ TOP_TO_CENTER = 2,
2748
+ CENTER_TO_TOP = 3,
2749
+ AT_CLOSE = 4
2750
+ }
2751
+
2752
+ /**
2753
+ * 单选按钮组,管理一组互斥的 Radio 选项,提供统一的值控制。
2754
+ */
2755
+ export declare interface RadioGroupProps {
2756
+ /**
2757
+ * 子元素
2758
+ */
2759
+ children?: ReactNode;
2760
+ /**
2761
+ * 组件样式
2762
+ */
2763
+ style?: CSSProperties;
2764
+ /**
2765
+ * 组件类名
2766
+ */
2767
+ className?: string;
2768
+ /**
2769
+ * 当前选中的值(受控模式)
2770
+ */
2771
+ value?: string;
2772
+ /**
2773
+ * 默认选中的值(非受控模式)
2774
+ */
2775
+ defaultValue?: string;
2776
+ /**
2777
+ * 是否禁用整组
2778
+ * @defaultValue false
2779
+ */
2780
+ disabled?: boolean;
2781
+ /**
2782
+ * 选中值变化时的回调
2783
+ */
2784
+ onValueChange?: (value: string) => void;
2785
+ }
2786
+
2787
+ /**
2788
+ * 单选按钮,需配合 RadioGroup 使用。
2789
+ */
2790
+ export declare interface RadioProps {
2791
+ /**
2792
+ * Radio 的值
2793
+ */
2794
+ value: string;
2795
+ /**
2796
+ * 组件样式
2797
+ */
2798
+ style?: CSSProperties;
2799
+ /**
2800
+ * 组件类名
2801
+ */
2802
+ className?: string;
2803
+ /**
2804
+ * React key 属性
2805
+ */
2806
+ key?: string | number | null | undefined;
2807
+ /**
2808
+ * 是否禁用
2809
+ * @defaultValue false
2810
+ */
2811
+ disabled?: boolean;
2812
+ }
2813
+
2814
+ declare interface RenderFunction {
2815
+ /**
2816
+ * The gesture that needs to be bound to the scroll container inside the popup. After binding, the scroll container inside the popup follows the rule that when it is not at the top, it will drag the popup first, and when it is at the top, it can scroll the inner scroll container.
2817
+ * @zh Popup内滚动容器需要绑定的手势,绑定后弹窗内的滚动容器遵循未到达顶部时,优先拖拽Popup,到达顶部后可以滚动内部滚动容器
2818
+ * @Android
2819
+ * @iOS
2820
+ * @Harmony
2821
+ */
2822
+ 'main-thread:gesture': BaseGesture;
2823
+ /**
2824
+ * The gesture that needs to be bound to the non-scrollable container inside the popup. After binding, the non-scrollable container inside the popup will only respond to dragging.
2825
+ * @zh Popup内非滚动容器当需要拖拽时需要绑定的手势,绑定后该节点仅响应拖拽
2826
+ * @Android
2827
+ * @iOS
2828
+ * @Harmony
2829
+ */
2830
+ 'draggableGesture': BaseGesture;
2831
+ }
2832
+
2833
+ declare interface RenderFunctionProps<T> {
2834
+ item: T;
2835
+ index: number;
2836
+ realIndex: number;
2837
+ }
2838
+
2839
+ export declare interface RenderLongImageSegmentsOptions {
2840
+ /**
2841
+ * 渲染模式:
2842
+ * - `view`:返回一组 `<view>` 包裹的分段节点,适合放在 `scroll-view` / 普通容器中。
2843
+ * - `list`:返回一组 `<list-item>` 包裹的分段节点,适合直接放在 `list` 中。
2844
+ * @defaultValue 'view'
2845
+ */
2846
+ mode?: 'view' | 'list';
2847
+ /**
2848
+ * 非激活分段占位背景色。
2849
+ * @defaultValue 'transparent'
2850
+ */
2851
+ placeholderColor?: string;
2852
+ /**
2853
+ * 传给 `LongImageSegment` 的样式。
2854
+ */
2855
+ segmentStyle?: CSSProperties;
2856
+ /**
2857
+ * 传给 `LongImageSegment` 的类名。
2858
+ */
2859
+ segmentClassName?: string;
2860
+ /**
2861
+ * 外层包装节点的样式。
2862
+ */
2863
+ wrapperStyle?: CSSProperties;
2864
+ /**
2865
+ * 外层包装节点的类名。
2866
+ */
2867
+ wrapperClassName?: string;
2868
+ /**
2869
+ * `mode='list'` 时的 `reuse-identifier` 前缀。
2870
+ * @defaultValue 'item_'
2871
+ */
2872
+ listItemReuseIdentifierPrefix?: string;
2873
+ }
2874
+
2875
+ export declare interface RouteLabel {
2876
+ /**
2877
+ * 标签 ID。
2878
+ */
2879
+ id: string;
2880
+ /**
2881
+ * 标签沿线点数组。
2882
+ */
2883
+ points: LatLng[];
2884
+ /**
2885
+ * 标签文案。
2886
+ */
2887
+ text: string;
2888
+ /**
2889
+ * 标签文字颜色。
2890
+ * @defaultValue "#000000"
2891
+ */
2892
+ textColor?: string;
2893
+ /**
2894
+ * 标签字体大小,单位为 px。
2895
+ * @defaultValue 12
2896
+ */
2897
+ fontSize?: number;
2898
+ /**
2899
+ * 标签边框颜色。
2900
+ * @defaultValue "#cccccc"
2901
+ */
2902
+ borderColor?: string;
2903
+ /**
2904
+ * 路名文字描边宽度,单位 px。
2905
+ * @defaultValue 0
2906
+ */
2907
+ borderWidth?: number;
2908
+ /**
2909
+ * 标签 Z 轴数值。
2910
+ * @defaultValue 0
2911
+ */
2912
+ zIndex?: number;
2913
+ }
2914
+
2915
+ export { ScrollEndEvent }
2916
+
2917
+ export { ScrollEvent }
2918
+
2919
+ export { ScrollToLowerEvent }
2920
+
2921
+ export { ScrollToUpperEvent }
2922
+
2923
+ /**
2924
+ * 可滚动容器,支持垂直和水平方向内容滚动,适用于内容超出可视区域的场景。
2925
+ */
2926
+ export declare interface ScrollViewProps {
2927
+ /**
2928
+ * 子元素
2929
+ */
2930
+ children?: ReactNode;
2931
+ /**
2932
+ * 组件样式
2933
+ */
2934
+ style?: CSSProperties;
2935
+ /**
2936
+ * 组件类名
2937
+ */
2938
+ className?: string;
2939
+ /**
2940
+ * 元素的唯一标识
2941
+ */
2942
+ id?: string;
2943
+ /**
2944
+ * React key 属性
2945
+ */
2946
+ key?: string | number | null | undefined;
2947
+ /**
2948
+ * 用于获取组件实例的 ref
2949
+ */
2950
+ ref?: Ref<NodesRef>;
2951
+ /**
2952
+ * 滚动方向
2953
+ * @defaultValue 'vertical'
2954
+ */
2955
+ scrollOrientation?: 'vertical' | 'horizontal';
2956
+ /**
2957
+ * 是否启用弹性效果(iOS 回弹效果)
2958
+ * @defaultValue true
2959
+ */
2960
+ bounces?: boolean;
2961
+ /**
2962
+ * 是否允许滚动
2963
+ * @defaultValue true
2964
+ */
2965
+ enableScroll?: boolean;
2966
+ /**
2967
+ * 是否显示滚动条
2968
+ * @defaultValue true
2969
+ */
2970
+ scrollBarEnable?: boolean;
2971
+ /**
2972
+ * 触发滚动到顶部/左侧的距离阈值(px)
2973
+ * @defaultValue 0
2974
+ */
2975
+ upperThreshold?: number;
2976
+ /**
2977
+ * 触发滚动到底部/右侧的距离阈值(px)
2978
+ * @defaultValue 0
2979
+ */
2980
+ lowerThreshold?: number;
2981
+ /**
2982
+ * 初始滚动偏移量(px),仅首屏有效
2983
+ * @defaultValue 0
2984
+ */
2985
+ initialScrollOffset?: number;
2986
+ /**
2987
+ * 初始滚动到指定子节点的索引,仅首屏有效。所有直接子节点必须设置 flatten=false
2988
+ * @defaultValue 0
2989
+ */
2990
+ initialScrollToIndex?: number;
2991
+ /**
2992
+ * 滚动到顶部/左侧时触发
2993
+ * @eventProperty
2994
+ */
2995
+ onScrollToUpper?: (event: ScrollToUpperEvent) => void;
2996
+ /**
2997
+ * @deprecated 请使用 onScrollToUpper 替代
2998
+ */
2999
+ bindscrolltoupper?: (event: ScrollToUpperEvent) => void;
3000
+ /**
3001
+ * 滚动到底部/右侧时触发
3002
+ * @eventProperty
3003
+ */
3004
+ onScrollToLower?: (event: ScrollToLowerEvent) => void;
3005
+ /**
3006
+ * @deprecated 请使用 onScrollToLower 替代
3007
+ */
3008
+ bindscrolltolower?: (event: ScrollToLowerEvent) => void;
3009
+ /**
3010
+ * 滚动过程中触发
3011
+ * @eventProperty
3012
+ */
3013
+ onScroll?: (event: ScrollEvent) => void;
3014
+ /**
3015
+ * @deprecated 请使用 onScroll 替代
3016
+ */
3017
+ bindscroll?: (event: ScrollEvent) => void;
3018
+ /**
3019
+ * 滚动结束时触发
3020
+ * @eventProperty
3021
+ */
3022
+ onScrollEnd?: (event: ScrollEndEvent) => void;
3023
+ /**
3024
+ * @deprecated 请使用 onScrollEnd 替代
3025
+ */
3026
+ bindscrollend?: (event: ScrollEndEvent) => void;
3027
+ /**
3028
+ * 内容尺寸变化时触发
3029
+ * @eventProperty
3030
+ */
3031
+ onContentSizeChanged?: (event: ContentSizeChangedEvent) => void;
3032
+ /**
3033
+ * @deprecated 请使用 onContentSizeChanged 替代
3034
+ */
3035
+ bindcontentsizechanged?: (event: ContentSizeChangedEvent) => void;
3036
+ }
3037
+
3038
+ /**
3039
+ * 滑块组件,支持在指定范围内选择连续或离散数值。
3040
+ */
3041
+ export declare interface SliderProps {
3042
+ /**
3043
+ * 组件样式。
3044
+ */
3045
+ style?: CSSProperties;
3046
+ /**
3047
+ * 组件类名。
3048
+ */
3049
+ className?: string;
3050
+ /**
3051
+ * React key 属性
3052
+ */
3053
+ key?: string | number | null | undefined;
3054
+ /**
3055
+ * 当前数值 (必填,只支持受控用法)
3056
+ */
3057
+ value: number;
3058
+ /**
3059
+ * 最小值
3060
+ * @defaultValue 0
3061
+ */
3062
+ min?: number;
3063
+ /**
3064
+ * 最大值
3065
+ * @defaultValue 100
3066
+ */
3067
+ max?: number;
3068
+ /**
3069
+ * 是否展示数值
3070
+ * @defaultValue true
3071
+ */
3072
+ showValue?: boolean;
3073
+ /**
3074
+ * 是否禁用
3075
+ * @defaultValue false
3076
+ */
3077
+ disabled?: boolean;
3078
+ /**
3079
+ * 数值变化的回调
3080
+ */
3081
+ onChange?: (value: number) => void;
3082
+ }
3083
+
3084
+ /**
3085
+ * SVG 图形渲染组件,支持内联展示 SVG 格式图片。
3086
+ */
3087
+ export declare interface SvgProps {
3088
+ /**
3089
+ * 组件样式
3090
+ */
3091
+ style?: CSSProperties;
3092
+ /**
3093
+ * 组件类名
3094
+ */
3095
+ className?: string;
3096
+ /**
3097
+ * 元素的唯一标识
3098
+ */
3099
+ id?: string;
3100
+ /**
3101
+ * React key 属性
3102
+ */
3103
+ key?: string | number | null | undefined;
3104
+ /**
3105
+ * 用于获取组件实例的 ref
3106
+ */
3107
+ ref?: Ref<NodesRef>;
3108
+ /**
3109
+ * SVG 资源地址,支持 http/https/base64
3110
+ */
3111
+ src?: string;
3112
+ /**
3113
+ * SVG 内容字符串,直接传入 SVG XML 内容
3114
+ */
3115
+ content?: string;
3116
+ /**
3117
+ * 点击时的回调函数
3118
+ * @eventProperty
3119
+ */
3120
+ onClick?: (event: TouchEvent_2) => void;
3121
+ /**
3122
+ * @deprecated 请使用 onClick 替代
3123
+ */
3124
+ bindtap?: (event: TouchEvent_2) => void;
3125
+ }
3126
+
3127
+ /**
3128
+ * 轮播项组件,用于包裹单个轮播内容,必须作为 Swiper 的直接子组件使用。
3129
+ */
3130
+ export declare interface SwiperItemProps {
3131
+ /**
3132
+ * 当前 SwiperItem 的索引,基于 Swiper 的数据
3133
+ */
3134
+ index: number;
3135
+ /**
3136
+ * 子元素
3137
+ */
3138
+ children: ReactElement_2 | ReactElement_2[];
3139
+ /**
3140
+ * 样式
3141
+ */
3142
+ style?: CSSProperties;
3143
+ /**
3144
+ * 类名
3145
+ */
3146
+ className?: string;
3147
+ /**
3148
+ * 当前 SwiperItem 的真实索引,基于 Swiper 的数据
3149
+ * 与 `index` 相同,但在 loop 模式下会不同
3150
+ */
3151
+ realIndex?: number;
3152
+ /**
3153
+ * 传递给 SwiperItem 直接子元素的 `overlap` 属性
3154
+ * 仅在透明度有问题时使用
3155
+ */
3156
+ overlap?: boolean;
3157
+ }
3158
+
3159
+ /**
3160
+ * 轮播容器组件,支持自动播放、循环、自定义动画等功能。子节点须为 SwiperItem 组件。
3161
+ */
3162
+ export declare type SwiperProps<T = any> = SwiperPropsNormal<T> | SwiperPropsCustom<T>;
3163
+
3164
+ declare interface SwiperProps_2<T> {
3165
+ /**
3166
+ * 组件类名
3167
+ */
3168
+ className?: string;
3169
+ /**
3170
+ * 轮播图数据集合
3171
+ */
3172
+ data: T[];
3173
+ /**
3174
+ * 轮播项宽度
3175
+ */
3176
+ itemWidth: number;
3177
+ /**
3178
+ * 轮播项高度
3179
+ */
3180
+ itemHeight?: number | 'auto';
3181
+ /**
3182
+ * 子元素,应该是一个函数,返回 SwiperItem
3183
+ * @example
3184
+ * ```tsx
3185
+ * <Swiper
3186
+ * data={items}
3187
+ * itemWidth={350}
3188
+ * >
3189
+ * {({ index, item }) => (
3190
+ * <SwiperItem index={index} key={index}>
3191
+ * <image class="image" src={`${item}`}></image>
3192
+ * <text class="image-text">Number.{index}</text>
3193
+ * </SwiperItem>
3194
+ * )}
3195
+ * </Swiper>
3196
+ * ```
3197
+ */
3198
+ children: (prop: RenderFunctionProps<T>) => ReactElement_2;
3199
+ /**
3200
+ * 容器宽度
3201
+ * @defaultValue screenWidth
3202
+ */
3203
+ containerWidth?: number;
3204
+ /**
3205
+ * 初始索引,仅在首屏时使用,后续更新将被忽略
3206
+ * @defaultValue 0
3207
+ */
3208
+ initialIndex?: number;
3209
+ /**
3210
+ * 是否开启循环轮播
3211
+ * @defaultValue false
3212
+ */
3213
+ loop?: boolean;
3214
+ /**
3215
+ * 当 loop 为 true 时,Swiper 会复制前 2 个和后 2 个项目来创建循环效果。
3216
+ * 此属性可用于自定义复制第一个和最后一个项目的数量
3217
+ * @defaultValue 2
3218
+ */
3219
+ loopDuplicateCount?: number;
3220
+ /**
3221
+ * 翻页或滑动动画的持续时间
3222
+ * @defaultValue 500
3223
+ */
3224
+ duration?: number;
3225
+ /**
3226
+ * 当前索引改变时的回调函数
3227
+ */
3228
+ onChange?: (current: number) => void;
3229
+ /**
3230
+ * 开始滑动时的回调函数,可与 onSwipeStop 配合使用,用于在滑动时禁用点击事件
3231
+ */
3232
+ onSwipeStart?: (current: number) => void;
3233
+ /**
3234
+ * 停止滑动时的回调函数,可与 onSwipeStart 配合使用
3235
+ */
3236
+ onSwipeStop?: (current: number) => void;
3237
+ /**
3238
+ * Swiper 偏移量改变时的回调函数,应该是一个主线程函数
3239
+ */
3240
+ 'main-thread:onOffsetChange'?: (offset: number) => void;
3241
+ /**
3242
+ * 自定义翻页效果的缓动函数
3243
+ */
3244
+ 'main-thread:easing'?: (progress: number) => number;
3245
+ /**
3246
+ * 自定义动画效果,应该是一个主线程函数
3247
+ */
3248
+ 'main-thread:customAnimation'?: (value: number, index: number) => CSSProperties;
3249
+ /**
3250
+ * 在 JS 中使用的自定义动画效果,应该是一个 JS 函数。
3251
+ * customAnimationFirstScreen 应该是与 'main-thread:customAnimation' 内容相同的函数,但不带 'main thread' 注解。
3252
+ * 这是对 MainThreadScript 不支持首屏的临时解决方案
3253
+ */
3254
+ customAnimationFirstScreen?: (value: number, index: number) => CSSProperties;
3255
+ /**
3256
+ * 是否启用自动播放
3257
+ * @defaultValue false
3258
+ */
3259
+ autoPlay?: boolean;
3260
+ /**
3261
+ * 自动播放间隔
3262
+ * @defaultValue 2000
3263
+ */
3264
+ autoPlayInterval?: number;
3265
+ /**
3266
+ * 用于限制或扩展 Swiper 的偏移量范围,可用于限制偏移量以避免过度滚动
3267
+ */
3268
+ offsetLimit?: [number, number];
3269
+ /**
3270
+ * 回弹参数配置
3271
+ */
3272
+ bounceConfig?: BounceConfig;
3273
+ /**
3274
+ * Swiper 组件的 key,更改此值将重置 Swiper 的进度和状态
3275
+ */
3276
+ swiperKey?: unknown;
3277
+ /**
3278
+ * 在重用 Swiper 组件时是否重置 Swiper 的进度和状态
3279
+ * @defaultValue false
3280
+ */
3281
+ resetOnReuse?: boolean;
3282
+ /**
3283
+ * 根元素样式,控制包含轮播图的可见视口/框架
3284
+ */
3285
+ style?: CSSProperties;
3286
+ /**
3287
+ * 内部滑动轨道的样式,这是实际移动/滑动的元素
3288
+ */
3289
+ trackStyle?: CSSProperties;
3290
+ /**
3291
+ * 决定 Swiper 如何响应不同角度的触摸
3292
+ * @defaultValue [[-180, -135], [-45, 45], [135, 180]]
3293
+ */
3294
+ consumeSlideEvent?: [number, number][];
3295
+ /**
3296
+ * 是否阻止原生事件
3297
+ * @defaultValue false
3298
+ */
3299
+ blockNativeEvent?: boolean;
3300
+ /**
3301
+ * 是否启用 RTL 模式
3302
+ * @defaultValue false
3303
+ */
3304
+ RTL?: boolean | 'lynx-rtl';
3305
+ }
3306
+
3307
+ /**
3308
+ * @hidden
3309
+ */
3310
+ declare interface SwiperPropsCustom<T> extends SwiperProps_2<T> {
3311
+ /**
3312
+ * Swiper 的模式。普通模式会使 SwiperItem 依次排列。
3313
+ * 自定义模式会使 SwiperItem 以绝对定位方式放置在最左侧
3314
+ * @defaultValue normal
3315
+ */
3316
+ mode?: 'custom';
3317
+ /**
3318
+ * 模式的额外配置
3319
+ */
3320
+ modeConfig?: Record<string, unknown>;
3321
+ }
3322
+
3323
+ /**
3324
+ * @hidden
3325
+ */
3326
+ declare interface SwiperPropsNormal<T> extends SwiperProps_2<T> {
3327
+ /**
3328
+ * Swiper 的模式。普通模式会使 SwiperItem 依次排列。
3329
+ * 自定义模式会使 SwiperItem 以绝对定位方式放置在最左侧
3330
+ * @defaultValue normal
3331
+ */
3332
+ mode?: 'normal';
3333
+ /**
3334
+ * 模式的额外配置
3335
+ */
3336
+ modeConfig?: {
3337
+ /**
3338
+ * SwiperItem 的对齐方式
3339
+ * @defaultValue start
3340
+ */
3341
+ align?: 'start' | 'center' | 'end';
3342
+ /**
3343
+ * SwiperItem 之间的间距
3344
+ * @defaultValue 0
3345
+ */
3346
+ spaceBetween?: number;
3347
+ };
3348
+ }
3349
+
3350
+ export declare interface SwiperRef {
3351
+ /**
3352
+ * 滑动到指定索引的项目
3353
+ */
3354
+ swipeTo: (index: number, options?: SwipeToOptions) => void;
3355
+ /**
3356
+ * 滑动到下一个项目
3357
+ */
3358
+ swipeNext: () => void;
3359
+ /**
3360
+ * 滑动到上一个项目
3361
+ */
3362
+ swipePrev: () => void;
3363
+ /**
3364
+ * 取消当前正在运行的动画。谨慎使用,可能会破坏内部状态
3365
+ * @experimental
3366
+ */
3367
+ cancelAnimation: () => void;
3368
+ }
3369
+
3370
+ declare interface SwipeToOptions {
3371
+ animate?: boolean;
3372
+ onFinished?: () => void;
3373
+ }
3374
+
3375
+ /**
3376
+ * 开关切换组件,用于二元状态(开/关)的交互控制。
3377
+ */
3378
+ export declare interface SwitchProps {
3379
+ /**
3380
+ * 组件样式
3381
+ */
3382
+ style?: CSSProperties;
3383
+ /**
3384
+ * 组件类名
3385
+ */
3386
+ className?: string;
3387
+ /**
3388
+ * React key 属性
3389
+ */
3390
+ key?: string | number | null | undefined;
3391
+ /**
3392
+ * 尺寸
3393
+ * @defaultValue 'large'
3394
+ */
3395
+ size?: SwitchSize;
3396
+ /**
3397
+ * 是否选中。如果设置了 `checked`,则 Switch 将处于受控模式,此时 `defaultChecked` 将被忽略。
3398
+ */
3399
+ checked?: boolean;
3400
+ /**
3401
+ * 默认选中状态,仅在非受控模式下生效
3402
+ * @defaultValue false
3403
+ */
3404
+ defaultChecked?: boolean;
3405
+ /**
3406
+ * 是否禁用。当为 `true` 时用户无法操作
3407
+ * @defaultValue false
3408
+ */
3409
+ disabled?: boolean;
3410
+ /**
3411
+ * 状态变化时的回调函数
3412
+ * @param checked - 最新的选中状态
3413
+ */
3414
+ onChange?: (checked: boolean) => void;
3415
+ }
3416
+
3417
+ /** Switch 尺寸变体 */
3418
+ declare type SwitchSize = 'default' | 'large';
3419
+
3420
+ /**
3421
+ * 多行文本输入组件,支持自动高度、字数限制等功能。
3422
+ */
3423
+ export declare interface TextAreaProps {
3424
+ /**
3425
+ * 组件样式
3426
+ */
3427
+ style?: CSSProperties;
3428
+ /**
3429
+ * 组件类名
3430
+ */
3431
+ className?: string;
3432
+ /**
3433
+ * 元素的唯一标识
3434
+ */
3435
+ id?: string;
3436
+ /**
3437
+ * React key 属性
3438
+ */
3439
+ key?: string | number | null | undefined;
3440
+ /**
3441
+ * 用于获取组件实例的 ref
3442
+ */
3443
+ ref?: Ref<NodesRef>;
3444
+ /**
3445
+ * 占位符文本
3446
+ */
3447
+ placeholder?: string;
3448
+ /**
3449
+ * 最大输入长度
3450
+ * @defaultValue 140
3451
+ */
3452
+ maxlength?: number;
3453
+ /**
3454
+ * 最大行数
3455
+ */
3456
+ maxlines?: number;
3457
+ /**
3458
+ * 行间距
3459
+ */
3460
+ lineSpacing?: number | `${number}px` | `${number}rpx`;
3461
+ /**
3462
+ * 是否禁用
3463
+ * @defaultValue false
3464
+ */
3465
+ disabled?: boolean;
3466
+ /**
3467
+ * 是否只读
3468
+ * @defaultValue false
3469
+ */
3470
+ readonly?: boolean;
3471
+ /**
3472
+ * 键盘右下角确认按钮的类型
3473
+ * @defaultValue 'done'
3474
+ */
3475
+ confirmType?: 'send' | 'search' | 'go' | 'done' | 'next';
3476
+ /**
3477
+ * 聚焦时是否显示软键盘
3478
+ * @defaultValue true
3479
+ */
3480
+ showSoftInputOnFocus?: boolean;
3481
+ /**
3482
+ * iOS 弹性效果
3483
+ * @defaultValue true
3484
+ */
3485
+ bounces?: boolean;
3486
+ /**
3487
+ * 输入内容变化时触发
3488
+ * @eventProperty
3489
+ */
3490
+ onInput?: (event: BaseEvent<'bindinput', TextAreaInputEvent>) => void;
3491
+ /**
3492
+ * @deprecated 请使用 onInput 替代
3493
+ */
3494
+ bindinput?: (event: BaseEvent<'bindinput', TextAreaInputEvent>) => void;
3495
+ /**
3496
+ * 聚焦时触发
3497
+ * @eventProperty
3498
+ */
3499
+ onFocus?: (event: BaseEvent<'bindfocus', TextAreaFocusEvent>) => void;
3500
+ /**
3501
+ * @deprecated 请使用 onFocus 替代
3502
+ */
3503
+ bindfocus?: (event: BaseEvent<'bindfocus', TextAreaFocusEvent>) => void;
3504
+ /**
3505
+ * 失焦时触发
3506
+ * @eventProperty
3507
+ */
3508
+ onBlur?: (event: BaseEvent<'bindblur', TextAreaBlurEvent>) => void;
3509
+ /**
3510
+ * @deprecated 请使用 onBlur 替代
3511
+ */
3512
+ bindblur?: (event: BaseEvent<'bindblur', TextAreaBlurEvent>) => void;
3513
+ /**
3514
+ * 点击键盘确认按钮时触发
3515
+ * @eventProperty
3516
+ */
3517
+ onConfirm?: (event: BaseEvent<'bindconfirm', TextAreaConfirmEvent>) => void;
3518
+ /**
3519
+ * @deprecated 请使用 onConfirm 替代
3520
+ */
3521
+ bindconfirm?: (event: BaseEvent<'bindconfirm', TextAreaConfirmEvent>) => void;
3522
+ /**
3523
+ * 选择区域变化时触发
3524
+ * @eventProperty
3525
+ */
3526
+ onSelectionChange?: (event: BaseEvent<'bindselection', TextAreaSelectionChangeEvent>) => void;
3527
+ /**
3528
+ * @deprecated 请使用 onSelectionChange 替代
3529
+ */
3530
+ bindselection?: (event: BaseEvent<'bindselection', TextAreaSelectionChangeEvent>) => void;
3531
+ }
3532
+
3533
+ /**
3534
+ * 文本渲染组件,是展示文字内容的基础元件,支持文字样式配置。
3535
+ */
3536
+ export declare interface TextProps {
3537
+ /**
3538
+ * 子元素
3539
+ */
3540
+ children?: ReactNode;
3541
+ /**
3542
+ * 组件样式
3543
+ */
3544
+ style?: CSSProperties;
3545
+ /**
3546
+ * 组件类名
3547
+ */
3548
+ className?: string;
3549
+ /**
3550
+ * 元素的唯一标识
3551
+ */
3552
+ id?: string;
3553
+ /**
3554
+ * React key 属性
3555
+ */
3556
+ key?: string | number | null | undefined;
3557
+ /**
3558
+ * 用于获取组件实例的 ref
3559
+ */
3560
+ ref?: Ref<NodesRef>;
3561
+ /**
3562
+ * 文本显示的最大行数,超出将显示省略号
3563
+ */
3564
+ textMaxline?: string;
3565
+ /**
3566
+ * 文本截断时,省略号颜色是否使用外层 text 标签样式(默认使用最近 inline-text 样式)
3567
+ * @defaultValue false
3568
+ */
3569
+ tailColorConvert?: boolean;
3570
+ /**
3571
+ * 单行纯文本在行内垂直居中/对齐方式,inline 文本不支持
3572
+ * @defaultValue 'normal'
3573
+ */
3574
+ textSingleLineVerticalAlign?: 'normal' | 'bottom' | 'center' | 'top';
3575
+ /**
3576
+ * 是否开启文本选择功能,开启时需同时设置 `flatten={false}`
3577
+ * @defaultValue false
3578
+ */
3579
+ textSelection?: boolean;
3580
+ /**
3581
+ * 是否将节点扁平化以加速渲染,开启文本选择等需要真实节点的能力时需设为 false
3582
+ * @defaultValue true
3583
+ */
3584
+ flatten?: boolean;
3585
+ /**
3586
+ * 开启文本选择后,是否使用自定义弹窗菜单
3587
+ * @defaultValue false
3588
+ */
3589
+ customContextMenu?: boolean;
3590
+ /**
3591
+ * 文本布局完成时触发,事件对象包含文本布局信息
3592
+ * @eventProperty
3593
+ */
3594
+ onLayout?: (event: LayoutEvent) => void;
3595
+ /**
3596
+ * @deprecated 请使用 onLayout 替代
3597
+ */
3598
+ bindlayout?: (event: LayoutEvent) => void;
3599
+ /**
3600
+ * 文本选择变化时触发(需开启 text-selection)
3601
+ * @eventProperty
3602
+ */
3603
+ onSelectionChange?: (event: SelectionChangeEvent) => void;
3604
+ /**
3605
+ * @deprecated 请使用 onSelectionChange 替代
3606
+ */
3607
+ bindselectionchange?: (event: SelectionChangeEvent) => void;
3608
+ /**
3609
+ * 点击时的回调函数
3610
+ * @eventProperty
3611
+ */
3612
+ onClick?: (event: TouchEvent_2) => void;
3613
+ /**
3614
+ * @deprecated 请使用 onClick 替代
3615
+ */
3616
+ bindtap?: (event: TouchEvent_2) => void;
3617
+ }
3618
+
3619
+ export declare type Theme = 'light' | 'dark';
3620
+
3621
+ /**
3622
+ * 主题配置组件,为其包裹的子组件统一设置主题样式(颜色、圆角等 CSS 变量)。
3623
+ */
3624
+ export declare interface ThemeProviderProps {
3625
+ /**
3626
+ * Theme for the provider subtree. Defaults to the nearest provider theme or host app theme.
3627
+ */
3628
+ theme?: Theme;
3629
+ /**
3630
+ * Child nodes that should inherit Doubao theme CSS variables.
3631
+ */
3632
+ children?: ReactNode;
3633
+ /**
3634
+ * Container style.
3635
+ */
3636
+ style?: CSSProperties;
3637
+ /**
3638
+ * Container class name.
3639
+ */
3640
+ className?: string;
3641
+ /**
3642
+ * Container id.
3643
+ */
3644
+ id?: string;
3645
+ /**
3646
+ * Whether to flatten the provider view. Defaults to false because the view is used as a CSS variable scope.
3647
+ *
3648
+ * @defaultValue false
3649
+ */
3650
+ flatten?: boolean;
3651
+ }
3652
+
3653
+ declare interface TouchEvent_3 {
3654
+ detail: {
3655
+ /**
3656
+ * x coordinate of touch event
3657
+ * @zh 触摸事件的 x 坐标
3658
+ */
3659
+ y: number;
3660
+ /**
3661
+ * y coordinate of touch event
3662
+ * @zh 触摸事件的 y 坐标
3663
+ */
3664
+ x: number;
3665
+ };
3666
+ }
3667
+
3668
+ /**
3669
+ * 内容更新状态组件,在内容更新时展示渐变过渡效果。
3670
+ */
3671
+ export declare interface UpdatedStateProps {
3672
+ className?: string;
3673
+ style?: CSSProperties;
3674
+ }
3675
+
3676
+ export declare interface UseLongImageOptions {
3677
+ /**
3678
+ * 图片资源地址。
3679
+ */
3680
+ src: string;
3681
+ /**
3682
+ * 滚动容器唯一标识。未传时内部自动生成。
3683
+ */
3684
+ containerId?: string;
3685
+ /**
3686
+ * 手动重建分段与解码窗口的触发令牌。值变化时会重新初始化。
3687
+ * @defaultValue 0
3688
+ */
3689
+ reloadToken?: number;
3690
+ /**
3691
+ * 单段在展示坐标系下的目标高度(px)。
3692
+ * 值越大,单次解码像素越大;值越小,分段数量越多。
3693
+ * @defaultValue 600
3694
+ */
3695
+ segmentDisplayHeight?: number;
3696
+ /**
3697
+ * 解码窗口的预加载屏数,基于当前可视区域高度计算。
3698
+ * @defaultValue 1
3699
+ */
3700
+ decodeOverscanScreens?: number;
3701
+ /**
3702
+ * 解码窗口允许同时激活的最大分段数。
3703
+ * 用于控制单次内存峰值。
3704
+ * @defaultValue 8
3705
+ */
3706
+ maxActiveSegments?: number;
3707
+ /**
3708
+ * 指标回调,输出尺寸和当前激活窗口信息。
3709
+ */
3710
+ onMetricsChange?: (metrics: LongImageMetrics) => void;
3711
+ /**
3712
+ * 状态回调,输出阶段与错误信息。
3713
+ */
3714
+ onStateChange?: (state: LongImageState) => void;
3715
+ }
3716
+
3717
+ export declare interface UseLongImageResult {
3718
+ /**
3719
+ * 图片资源地址。
3720
+ */
3721
+ src: string;
3722
+ /**
3723
+ * 需要绑定到外部滚动容器测量节点上的 id。
3724
+ */
3725
+ containerId: string;
3726
+ /**
3727
+ * 原图宽度(px)。
3728
+ */
3729
+ imageWidth: number;
3730
+ /**
3731
+ * 原图高度(px)。
3732
+ */
3733
+ imageHeight: number;
3734
+ /**
3735
+ * 容器实际渲染宽度(px)。
3736
+ */
3737
+ displayWidth: number;
3738
+ /**
3739
+ * 分段数据。
3740
+ */
3741
+ segments: LongImageSegmentData[];
3742
+ /**
3743
+ * 当前激活窗口。
3744
+ */
3745
+ activeRange: LongImageActiveRange;
3746
+ /**
3747
+ * 当前指标快照。
3748
+ */
3749
+ metrics: LongImageMetrics;
3750
+ /**
3751
+ * 当前状态快照。
3752
+ */
3753
+ state: LongImageState;
3754
+ /**
3755
+ * 外部容器布局变化时触发,内部会重新测量容器宽高。
3756
+ */
3757
+ handleContainerLayoutChange: () => void;
3758
+ /**
3759
+ * 外部滚动事件处理器。
3760
+ */
3761
+ handleScroll: (event: LongImageScrollEventLike) => void;
3762
+ /**
3763
+ * 判断指定索引的分段当前是否处于激活解码窗口内。
3764
+ */
3765
+ isSegmentActive: (index: number) => boolean;
3766
+ }
3767
+
3768
+ declare enum VideoEngineOption {
3769
+ PLAYER_OPTION_ENABLE_DASH = "17"
3770
+ }
3771
+
3772
+ declare type VideoEnginePlaybackCallback = (success: boolean, errCode?: number, errMsg?: string) => void;
3773
+
3774
+ export declare interface VideoProps {
3775
+ ref?: ForwardedRef<VideoRef>;
3776
+ /**
3777
+ * Style for wrapper, especially for border-radius
3778
+ * @zh 包装器的样式,特别用于设置圆角
3779
+ * @defaultValue undefined
3780
+ * @Android
3781
+ * @iOS
3782
+ * @Harmony
3783
+ */
3784
+ style?: CSSProperties_2;
3785
+ /**
3786
+ * Be used to select the `x-video-engine`. Please ensure that it is unique throughout the page.
3787
+ * @zh 用于选择 `x-video-engine`。请确保在整个页面中唯一。
3788
+ * @defaultValue 'videoengine'
3789
+ * @Android
3790
+ * @iOS
3791
+ * @Harmony
3792
+ */
3793
+ videoEngineId?: string;
3794
+ /**
3795
+ * Be used to mark the exposure timing. Please ensure that it is unique throughout the page.
3796
+ * @zh 用于标记曝光时间点。请确保在整个页面中唯一。
3797
+ * @defaultValue 'videoengine'
3798
+ * @Android
3799
+ * @iOS
3800
+ * @Harmony
3801
+ */
3802
+ scene?: string;
3803
+ /**
3804
+ * The specified video playback source uses the videoModel data structure recommended by the company to play the resource and is expressed by JSONString.
3805
+ * @zh 指定视频播放源,使用公司推荐的视频模型数据结构播放资源,表现为 JSON 字符串。
3806
+ * @defaultValue undefined
3807
+ * @Android
3808
+ * @iOS
3809
+ */
3810
+ videoModel?: string;
3811
+ /**
3812
+ * Use vid to specify the video playback source. Most hosts use vid to play. You need to pass in token and domain at the same time. Toutiao can support only passing in vid.
3813
+ * @zh 使用 vid 指定视频播放源。大多数主机会使用 vid 来播放。你需要同时传入 token 和 domain。头条支持仅传入 vid。
3814
+ * @defaultValue undefined
3815
+ * @Android
3816
+ * @iOS
3817
+ */
3818
+ videoId?: string;
3819
+ /**
3820
+ * To play with vid, you need to pass in both token and domain. Toutiao can support passing in only vid
3821
+ * @zh 使用 vid 播放视频需要同时传入 token 和 domain。头条支持仅传入 vid。
3822
+ * @defaultValue undefined
3823
+ * @Android
3824
+ * @iOS
3825
+ */
3826
+ token?: string;
3827
+ /**
3828
+ * To play with vid, you need to pass in both token and domain. Toutiao can support passing in only vid. {@link https://lynx.bytedance.net/docs/frontend/components/x-video-engine | see more}.
3829
+ * @zh 使用 vid 播放视频需要同时传入 token 和 domain。头条支持仅传入 vid。{@link https://lynx.bytedance.net/docs/frontend/components/x-video-engine | 查看更多}.
3830
+ * @defaultValue undefined
3831
+ * @Android
3832
+ * @iOS
3833
+ */
3834
+ domain?: string;
3835
+ /**
3836
+ * For the specified video playback source, once play-url is set, the player will try to load the resource asynchronously. Before bindredirect, all playback control logic will not take effect.
3837
+ * @zh 指定视频播放源,一旦设置 play-url,播放器将尝试异步加载资源。在绑定重定向之前,所有播放控制逻辑将无效。
3838
+ * @defaultValue undefined
3839
+ * @Android
3840
+ * @iOS
3841
+ * @Harmony
3842
+ */
3843
+ playUrl?: string;
3844
+ /**
3845
+ * Poster. Will be dismissed after playing.
3846
+ * @zh 海报。播放后将被取消显示。
3847
+ * @defaultValue undefined
3848
+ * @Android
3849
+ * @iOS
3850
+ * @Harmony
3851
+ */
3852
+ poster?: string;
3853
+ /**
3854
+ * Play automatically after stream data changes.
3855
+ * @zh 流数据变化后自动播放。
3856
+ * @defaultValue false
3857
+ * @Android
3858
+ * @iOS
3859
+ * @Harmony
3860
+ */
3861
+ autoPlay?: boolean;
3862
+ /**
3863
+ * Specifies the video cropping/scaling mode.
3864
+ * @zh 指定视频裁剪/缩放模式。
3865
+ * @defaultValue 'aspectFit'
3866
+ * @Android
3867
+ * @iOS
3868
+ * @Harmony
3869
+ */
3870
+ objectfit?: 'aspectFit' | 'aspectFill' | 'scaleToFill';
3871
+ /**
3872
+ * Rotate or not in full-screen mode
3873
+ * @zh 全屏模式下是否旋转
3874
+ * @defaultValue 'landscape'
3875
+ * @Android
3876
+ * @iOS
3877
+ * @since 2.18
3878
+ */
3879
+ fullscreenMode?: 'landscape' | 'portrait';
3880
+ /**
3881
+ * Live player should muted.
3882
+ * @zh 是否静音实时播放器。
3883
+ * @defaultValue true
3884
+ * @Android
3885
+ * @iOS
3886
+ * @Harmony
3887
+ */
3888
+ mute?: boolean;
3889
+ /**
3890
+ * Loop play. After the video starts playing, loop changes will not change the current play/pause status of the video.
3891
+ * @zh 循环播放。视频开始播放后,循环状态变化不会改变视频的当前播放/暂停状态。
3892
+ * @defaultValue false
3893
+ * @Android
3894
+ * @iOS
3895
+ * @Harmony
3896
+ */
3897
+ loop?: boolean;
3898
+ /**
3899
+ * Automatically pre-render the player (showing the first frame) after resource preparation is completed
3900
+ * @zh 在资源准备完成后自动预渲染播放器(显示首帧)
3901
+ * @defaultValue true
3902
+ * @Android
3903
+ * @iOS
3904
+ * @Harmony
3905
+ */
3906
+ autoPrepare?: boolean;
3907
+ /**
3908
+ * Automatically pre-render the player (showing the first frame) after resource preparation is completed
3909
+ * @zh 在资源准备完成后自动预渲染播放器(显示首帧)
3910
+ * @defaultValue false
3911
+ * @Android
3912
+ * @iOS
3913
+ * @Harmony
3914
+ */
3915
+ initTime?: number;
3916
+ /**
3917
+ * @defaultValue undefined
3918
+ * @Android
3919
+ * @iOS
3920
+ */
3921
+ preloadKey?: string;
3922
+ /**
3923
+ * @defaultValue undefined
3924
+ * @Android
3925
+ * @iOS
3926
+ */
3927
+ cacheSize?: number;
3928
+ /**
3929
+ * For player monitoring.
3930
+ * @zh 用于播放器监控。
3931
+ * @defaultValue undefined
3932
+ * @Android
3933
+ * @iOS
3934
+ * @Harmony
3935
+ */
3936
+ tag?: string;
3937
+ /**
3938
+ * For player monitoring.
3939
+ * @zh 用于播放器监控。
3940
+ * @defaultValue undefined
3941
+ * @Android
3942
+ * @iOS
3943
+ */
3944
+ subTag?: string;
3945
+ /**
3946
+ * Specify whether to pause the video when the LynxView exits the background or moves out of the screen to prevent sound leakage
3947
+ * @zh 指定当 LynxView 退出背景或移出屏幕后是否暂停视频,以防止声音泄漏
3948
+ * @defaultValue false
3949
+ * @Android
3950
+ * @iOS
3951
+ */
3952
+ pauseOnHide?: boolean;
3953
+ /**
3954
+ * To customize engine parameters, you need to refer to TTVideoEngine key definition and pass in the correct value type. The client needs to pay attention to it.
3955
+ * @zh 要自定义引擎参数,需要参考 TTVideoEngine 键定义并传入正确的值类型。客户端需要注意。
3956
+ * @defaultValue undefined
3957
+ * @Android
3958
+ * @iOS
3959
+ */
3960
+ playerOption?: Record<VideoEngineOption, `@encode(${string | number | boolean}, ${'[c]' | 'i' | 'l' | 'f' | 'd' | 'b'})`>;
3961
+ /**
3962
+ * Specify the playback speed.
3963
+ * @zh 指定播放速度
3964
+ * @defaultValue 1.0
3965
+ * @Android
3966
+ * @iOS
3967
+ */
3968
+ playbackSpeed?: number;
3969
+ /**
3970
+ * Specify the volume, range: [0.0, 1.0]
3971
+ * @zh 指定音量,范围:[0.0, 1.0]
3972
+ * @defaultValue 1.0
3973
+ * @Android
3974
+ * @iOS
3975
+ * @Harmony
3976
+ */
3977
+ volume?: number;
3978
+ /**
3979
+ * Whether to use the default resource loader (Forest、Gecko) to download resources
3980
+ * @zh 是否使用默认资源加载器(Forest、Gecko)下载资源
3981
+ * @defaultValue true
3982
+ * @Android
3983
+ * @iOS
3984
+ */
3985
+ skipRedirection?: boolean;
3986
+ /**
3987
+ * Execute pending ops automatically
3988
+ * @zh 自动执行待处理的操作
3989
+ * @defaultValue true
3990
+ * @Android
3991
+ * @iOS
3992
+ * @Harmony
3993
+ */
3994
+ cachingPendingOps?: boolean;
3995
+ /**
3996
+ * Custom player backend. The host can inject its own player. `preloadKey` is not supported for playerType === 'light'.
3997
+ * @zh 自定义播放器后端。宿主可注入其自己的播放器。playerType === 'light' 不支持 `preloadKey`。
3998
+ * @defaultValue 'default'
3999
+ * @Android
4000
+ * @iOS
4001
+ * @docTypeFallback 'default' | 'light' | (string & {})
4002
+ */
4003
+ playerType?: 'default' | 'light' | (string & {});
4004
+ /**
4005
+ * Whether to load player instances on demand for performance optimization, commonly used in list scenarios, no need to set in other cases
4006
+ * @zh 是否按需加载播放器实例,用于性能优化,常用于列表场景,其他情况无需设置
4007
+ * @Android
4008
+ * @iOS
4009
+ * @Harmony
4010
+ */
4011
+ attached?: boolean;
4012
+ /**
4013
+ * Specify the playback resolution.
4014
+ * @zh 指定播放分辨率。
4015
+ * @defaultValue 'auto'
4016
+ * @Android
4017
+ * @iOS
4018
+ * @since 3.3
4019
+ */
4020
+ resolution?: 'auto' | '240p' | '360p' | '480p' | '540p' | '720p' | '1080p' | '4k' | 'hdr' | '2k' | '1080p 50fps' | '2k 50fps' | '4k 50fps' | '1080p 60fps' | '2k 60fps' | '4k 60fps' | '1080p 120fps' | '2k 120fps' | '4k 120fps';
4021
+ /**
4022
+ * The type of the media
4023
+ * @zh 媒体的类型
4024
+ * @defaultValue 'Video'
4025
+ * @Android
4026
+ * @iOS
4027
+ * @Harmony
4028
+ */
4029
+ as?: 'Video' | 'Audio';
4030
+ /**
4031
+ * The player starts playing.
4032
+ * @zh 播放器开始播放。
4033
+ * @defaultValue undefined
4034
+ * @eventProperty
4035
+ * @Android
4036
+ * @iOS
4037
+ * @Harmony
4038
+ */
4039
+ onPlay?: () => void;
4040
+ /**
4041
+ * The player is paused.
4042
+ * @zh 播放器暂停。
4043
+ * @defaultValue undefined
4044
+ * @eventProperty
4045
+ * @Android
4046
+ * @iOS
4047
+ * @Harmony
4048
+ */
4049
+ onPause?: () => void;
4050
+ /**
4051
+ * The player is stopped.
4052
+ * @zh 播放器停止。
4053
+ * @defaultValue undefined
4054
+ * @eventProperty
4055
+ * @Android
4056
+ * @iOS
4057
+ * @Harmony
4058
+ */
4059
+ onStop?: () => void;
4060
+ /**
4061
+ * The player is seek.
4062
+ * @zh 播放器搜索。
4063
+ * @defaultValue undefined
4064
+ * @eventProperty
4065
+ * @Android
4066
+ * @iOS
4067
+ */
4068
+ onSeek?: (willPlay: boolean) => void;
4069
+ /**
4070
+ * The player finish playing.
4071
+ * @zh 播放器播放结束。
4072
+ * @defaultValue undefined
4073
+ * @eventProperty
4074
+ * @Android
4075
+ * @iOS
4076
+ * @Harmony
4077
+ */
4078
+ onEnded?: () => void;
4079
+ /**
4080
+ * The src is changed
4081
+ * @zh 源文件发生变化
4082
+ * @defaultValue undefined
4083
+ * @eventProperty
4084
+ * @Android
4085
+ * @iOS
4086
+ * @Harmony
4087
+ */
4088
+ onSrcChanged?: () => void;
4089
+ /**
4090
+ * The player receives an error.
4091
+ * @zh 播放器接收到错误信息。
4092
+ * @defaultValue undefined
4093
+ * @eventProperty
4094
+ * @Android
4095
+ * @iOS
4096
+ * @Harmony
4097
+ */
4098
+ onError?: (e: {
4099
+ errorCode: number;
4100
+ errorMsg: string;
4101
+ }) => void;
4102
+ /**
4103
+ * The player's progress is updated
4104
+ * @zh 播放器进度更新
4105
+ * @defaultValue undefined
4106
+ * @eventProperty
4107
+ * @Android
4108
+ * @iOS
4109
+ * @Harmony
4110
+ */
4111
+ onTimeUpdate?: (e: {
4112
+ detail: {
4113
+ current: number;
4114
+ total: number;
4115
+ };
4116
+ }) => void;
4117
+ /**
4118
+ * If you access gecko resources, the loading is asynchronous
4119
+ * @zh 如果访问 gecko 资源,加载是异步的
4120
+ * @defaultValue undefined
4121
+ * @eventProperty
4122
+ * @Android
4123
+ * @iOS
4124
+ */
4125
+ onRedirected?: () => void;
4126
+ /**
4127
+ * Triggered when the video starts rendering the first frame
4128
+ * @zh 视频开始渲染首帧时触发
4129
+ * @defaultValue undefined
4130
+ * @eventProperty
4131
+ * @Android
4132
+ * @iOS
4133
+ * @Harmony
4134
+ */
4135
+ onFirstFrame?: () => void;
4136
+ /**
4137
+ * The player is ready to play.
4138
+ * @zh 播放器准备好播放。
4139
+ * @defaultValue undefined
4140
+ * @eventProperty
4141
+ * @Android
4142
+ * @iOS
4143
+ */
4144
+ onPrepared?: () => void;
4145
+ /**
4146
+ * The player is visible. `scene` and `videoengineId` should be specified.
4147
+ * @zh 播放器可见。应该指定 `scene` 和 `videoengineId`。
4148
+ * @defaultValue undefined
4149
+ * @eventProperty
4150
+ * @Android
4151
+ * @iOS
4152
+ */
4153
+ onAppear?: () => void;
4154
+ /**
4155
+ * The player is invisible. `scene` and `videoengineId` should be specified.
4156
+ * @zh 播放器不可见。应该指定 `scene` 和 `videoengineId`。
4157
+ * @defaultValue undefined
4158
+ * @eventProperty
4159
+ * @Android
4160
+ * @iOS
4161
+ */
4162
+ onDisappear?: () => void;
4163
+ }
4164
+
4165
+ export declare interface VideoRef {
4166
+ /**
4167
+ * Start playing. You should start play after resource redirect (after `onRedirected`)
4168
+ * @zh 开始播放。你应该在资源重定向后(`onRedirected`)开始播放
4169
+ * @remarks When this operation is successful, it only means that the operation was successfully submitted to the player, and does not mean that the player status has changed.
4170
+ * @Android
4171
+ * @iOS
4172
+ * @Harmony
4173
+ */
4174
+ play: (
4175
+ /**
4176
+ * Invocation callback,errCode refer to {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4177
+ * @zh 调用回调,errCode 参考 {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4178
+ * @Android
4179
+ * @iOS
4180
+ * @Harmony
4181
+ */
4182
+ callback?: VideoEnginePlaybackCallback) => void;
4183
+ /**
4184
+ * Pause playing
4185
+ * @zh 暂停播放
4186
+ * @remarks When this operation is successful, it only means that the operation was successfully submitted to the player, and does not mean that the player status has changed.
4187
+ * @Android
4188
+ * @iOS
4189
+ * @Harmony
4190
+ */
4191
+ pause: (
4192
+ /**
4193
+ * Invocation callback,errCode refer to {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4194
+ * @zh 调用回调,errCode 参考 {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4195
+ * @Android
4196
+ * @iOS
4197
+ */
4198
+ callback?: VideoEnginePlaybackCallback) => void;
4199
+ /**
4200
+ * Stop playing
4201
+ * @zh 停止播放
4202
+ * @remarks When this operation is successful, it only means that the operation was successfully submitted to the player, and does not mean that the player status has changed.
4203
+ * @Android
4204
+ * @iOS
4205
+ * @Harmony
4206
+ */
4207
+ stop: (
4208
+ /**
4209
+ * Invocation callback,errCode refer to {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4210
+ * @zh 调用回调,errCode 参考 {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4211
+ * @Android
4212
+ * @iOS
4213
+ */
4214
+ callback?: VideoEnginePlaybackCallback) => void;
4215
+ /**
4216
+ * Seek
4217
+ * @zh 定位播放位置
4218
+ * @remarks When this operation is successful, it only means that the operation was successfully submitted to the player, and does not mean that the player status has changed.
4219
+ * @Android
4220
+ * @iOS
4221
+ */
4222
+ seek: (position: number, play: boolean,
4223
+ /**
4224
+ * Invocation callback,errCode refer to {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4225
+ * @zh 调用回调,errCode 参考 {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4226
+ * @Android
4227
+ * @iOS
4228
+ */
4229
+ callback?: VideoEnginePlaybackCallback) => void;
4230
+ /**
4231
+ * Replay, it is recommended to call it after the playback ends.
4232
+ * @zh 重新播放,建议在播放结束后调用
4233
+ * @remarks When this operation is successful, it only means that the operation was successfully submitted to the player, and does not mean that the player status has changed.
4234
+ * @Android
4235
+ * @iOS
4236
+ */
4237
+ replay: (
4238
+ /**
4239
+ * Whether to play after replay. If not, it will be stopped at the first frame.
4240
+ * @zh 是否在重新播放后开始播放。如果为 false,则会在第一帧停止。
4241
+ * @Android
4242
+ * @iOS
4243
+ */
4244
+ play: boolean,
4245
+ /**
4246
+ * Invocation callback,errCode refer to {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4247
+ * @zh 调用回调,errCode 参考 {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4248
+ * @Android
4249
+ * @iOS
4250
+ */
4251
+ callback?: VideoEnginePlaybackCallback) => void;
4252
+ /**
4253
+ * Prepare manually.
4254
+ * @zh 手动准备。
4255
+ * @Android
4256
+ * @iOS
4257
+ * @Harmony
4258
+ */
4259
+ prepare: (
4260
+ /**
4261
+ * Invocation callback,errCode refer to {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4262
+ * @zh 调用回调,errCode 参考 {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4263
+ * @Android
4264
+ * @iOS
4265
+ */
4266
+ callback?: VideoEnginePlaybackCallback) => void;
4267
+ /**
4268
+ * Get playback duration.
4269
+ * @zh 获取播放时长。
4270
+ * @Android
4271
+ * @iOS
4272
+ * @Harmony
4273
+ */
4274
+ getDuration: (
4275
+ /**
4276
+ * Invocation callback,errCode refer to {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4277
+ * @zh 调用回调,errCode 参考 {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4278
+ * @Android
4279
+ * @iOS
4280
+ */
4281
+ callback?: (success: boolean,
4282
+ /**
4283
+ * Duration, in ms.
4284
+ * @zh 时长,以毫秒为单位
4285
+ * @Android
4286
+ * @iOS
4287
+ */
4288
+ duration: number, errCode?: number, errMsg?: string) => void) => void;
4289
+ /**
4290
+ * Enter full screen. It need client impl, {@link https://lynx.bytedance.net/docs/frontend/components/x-video-engine | see more}.
4291
+ * @zh 进入全屏。需要客户端实现,{@link https://lynx.bytedance.net/docs/frontend/components/x-video-engine | 了解更多}.
4292
+ * @Android
4293
+ * @iOS
4294
+ */
4295
+ enterFullScreen: (
4296
+ /**
4297
+ * Invocation callback,errCode refer to {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4298
+ * @zh 调用回调,errCode 参考 {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4299
+ * @Android
4300
+ * @iOS
4301
+ */
4302
+ callback?: VideoEnginePlaybackCallback) => void;
4303
+ /**
4304
+ * Exit full screen. It need client impl, {@link https://lynx.bytedance.net/docs/frontend/components/x-video-engine | see more}.
4305
+ * @zh 退出全屏。需要客户端实现,{@link https://lynx.bytedance.net/docs/frontend/components/x-video-engine | 了解更多}.
4306
+ * @Android
4307
+ * @iOS
4308
+ */
4309
+ exitFullScreen: (
4310
+ /**
4311
+ * Invocation callback,errCode refer to {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4312
+ * @zh 调用回调,errCode 参考 {@link https://lynx.bytedance.net/docs/frontend/lynx-api/selector-query/selector-query | SelectorQuery}
4313
+ * @Android
4314
+ * @iOS
4315
+ */
4316
+ callback?: VideoEnginePlaybackCallback) => void;
4317
+ /**
4318
+ * Reset the Video. It is required to reset the Video if it is reused. Will be deprecated after being refactored by MTS.
4319
+ * @zh 重置视频。如果要重复使用视频,则需要重置视频。重构后将弃用。
4320
+ * @Android
4321
+ * @iOS
4322
+ * @Harmony
4323
+ */
4324
+ reset: () => void;
4325
+ /**
4326
+ * Handle the poster manually
4327
+ * @zh 手动处理海报
4328
+ * @Android
4329
+ * @iOS
4330
+ * @Harmony
4331
+ */
4332
+ operatePoster: (display: boolean) => void;
4333
+ }
4334
+
4335
+ /**
4336
+ * 基础布局容器,用于组织和嵌套其他组件,支持 Flexbox 布局。
4337
+ */
4338
+ export declare interface ViewProps {
4339
+ /**
4340
+ * 子元素
4341
+ */
4342
+ children?: ReactNode;
4343
+ /**
4344
+ * 组件样式
4345
+ */
4346
+ style?: CSSProperties;
4347
+ /**
4348
+ * 组件类名
4349
+ */
4350
+ className?: string;
4351
+ /**
4352
+ * 元素的唯一标识
4353
+ */
4354
+ id?: string;
4355
+ /**
4356
+ * React key 属性
4357
+ */
4358
+ key?: string | number | null | undefined;
4359
+ /**
4360
+ * 用于获取组件实例的 ref
4361
+ */
4362
+ ref?: Ref<NodesRef>;
4363
+ /**
4364
+ * 是否扁平化元素,避免创建真实渲染对象以提升性能
4365
+ * @defaultValue true
4366
+ */
4367
+ flatten?: boolean;
4368
+ /**
4369
+ * 点击时的回调函数
4370
+ * @eventProperty
4371
+ */
4372
+ onClick?: (event: TouchEvent_2) => void;
4373
+ /**
4374
+ * @deprecated 请使用 onClick 替代
4375
+ */
4376
+ bindtap?: (event: TouchEvent_2) => void;
4377
+ /**
4378
+ * 点击时的回调函数(阻止事件冒泡)
4379
+ * @eventProperty
4380
+ */
4381
+ onCatchTap?: (event: TouchEvent_2) => void;
4382
+ /**
4383
+ * @deprecated 请使用 onCatchTap 替代
4384
+ */
4385
+ catchtap?: (event: TouchEvent_2) => void;
4386
+ /**
4387
+ * 长按时的回调函数
4388
+ * @eventProperty
4389
+ */
4390
+ onLongPress?: (event: TouchEvent_2) => void;
4391
+ /**
4392
+ * @deprecated 请使用 onLongPress 替代
4393
+ */
4394
+ bindlongpress?: (event: TouchEvent_2) => void;
4395
+ /**
4396
+ * 触摸开始时的回调函数
4397
+ * @eventProperty
4398
+ */
4399
+ onTouchStart?: (event: TouchEvent_2) => void;
4400
+ /**
4401
+ * @deprecated 请使用 onTouchStart 替代
4402
+ */
4403
+ bindtouchstart?: (event: TouchEvent_2) => void;
4404
+ /**
4405
+ * 触摸结束时的回调函数
4406
+ * @eventProperty
4407
+ */
4408
+ onTouchEnd?: (event: TouchEvent_2) => void;
4409
+ /**
4410
+ * @deprecated 请使用 onTouchEnd 替代
4411
+ */
4412
+ bindtouchend?: (event: TouchEvent_2) => void;
4413
+ /**
4414
+ * 触摸移动时的回调函数
4415
+ * @eventProperty
4416
+ */
4417
+ onTouchMove?: (event: TouchEvent_2) => void;
4418
+ /**
4419
+ * @deprecated 请使用 onTouchMove 替代
4420
+ */
4421
+ bindtouchmove?: (event: TouchEvent_2) => void;
4422
+ /**
4423
+ * 元素曝光时的回调函数(进入可视区域)
4424
+ * @eventProperty
4425
+ */
4426
+ onAppear?: (event: UIAppearanceEvent) => void;
4427
+ /**
4428
+ * @deprecated 请使用 onAppear 替代
4429
+ */
4430
+ binduiappear?: (event: UIAppearanceEvent) => void;
4431
+ /**
4432
+ * 元素消失时的回调函数(离开可视区域)
4433
+ * @eventProperty
4434
+ */
4435
+ onDisappear?: (event: UIAppearanceEvent) => void;
4436
+ /**
4437
+ * @deprecated 请使用 onDisappear 替代
4438
+ */
4439
+ binduidisappear?: (event: UIAppearanceEvent) => void;
4440
+ /**
4441
+ * 布局变化时的回调函数
4442
+ * @eventProperty
4443
+ */
4444
+ onLayoutChange?: (event: LayoutChangeEvent) => void;
4445
+ /**
4446
+ * @deprecated 请使用 onLayoutChange 替代
4447
+ */
4448
+ bindlayoutchange?: (event: LayoutChangeEvent) => void;
4449
+ }
4450
+
4451
+ declare interface WebGLContextAttributes_2 {
4452
+ /**
4453
+ * 是否开启透明通道,开启后画布背景透明可与下层内容叠加显示
4454
+ * @defaultValue false
4455
+ */
4456
+ alpha?: boolean;
4457
+ /**
4458
+ * 是否保留绘图缓冲区,开启后 toDataURL/readPixels 可在绘制后正常读取
4459
+ * @defaultValue false
4460
+ */
4461
+ preserveDrawingBuffer?: boolean;
4462
+ /**
4463
+ * 是否开启抗锯齿
4464
+ * @defaultValue false
4465
+ */
4466
+ antialias?: boolean;
4467
+ }
4468
+
4469
+ export declare interface WebViewProps {
4470
+ /**
4471
+ * 用于获取 WebView 实例方法
4472
+ */
4473
+ ref?: Ref<WebViewRef>;
4474
+ /**
4475
+ * 网页资源地址
4476
+ */
4477
+ src?: string;
4478
+ /**
4479
+ * 网页加载成功时触发
4480
+ */
4481
+ onLoad?: (event: {
4482
+ src: string;
4483
+ }) => void;
4484
+ /**
4485
+ * 网页加载错误时触发
4486
+ */
4487
+ onError?: (event: {
4488
+ errorMsg: string;
4489
+ errorCode: number;
4490
+ url: string;
4491
+ }) => void;
4492
+ /**
4493
+ * 网页向应用 postMessage 时触发
4494
+ */
4495
+ onMessage?: (event: {
4496
+ data: unknown;
4497
+ }) => void;
4498
+ }
4499
+
4500
+ export declare interface WebViewRef {
4501
+ postMessage(data: unknown): void;
4502
+ }
4503
+
4504
+ export { }