@doubao-dev/framework 0.9.0 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components-style.css +1 -1
- package/dist/api.d.ts +383 -30
- package/dist/components.d.ts +860 -5
- package/dist/config.d.ts +24 -1
- package/dist/index.d.ts +43 -8
- package/jsx-runtime.d.ts +4 -0
- package/package.json +1 -1
package/dist/components.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ import type { InputConfirmEvent } from '@lynx-js/types';
|
|
|
11
11
|
import type { InputFocusEvent } from '@lynx-js/types';
|
|
12
12
|
import type { InputInputEvent } from '@lynx-js/types';
|
|
13
13
|
import type { InputSelectionEvent } from '@lynx-js/types';
|
|
14
|
+
import { JSX as JSX_2 } from '@lynx-js/react';
|
|
14
15
|
import type { LayoutChangeEvent } from '@lynx-js/types';
|
|
15
16
|
import type { LayoutEvent } from '@lynx-js/types';
|
|
16
17
|
import { ListAttachedCell } from '@lynx-js/types';
|
|
@@ -28,6 +29,7 @@ import { ListScrollToUpperEvent } from '@lynx-js/types';
|
|
|
28
29
|
import { ListSnapEvent } from '@lynx-js/types';
|
|
29
30
|
import { ListSnapInfo } from '@lynx-js/types';
|
|
30
31
|
import type { LoadEvent } from '@lynx-js/types';
|
|
32
|
+
import { MemoExoticComponent } from 'react';
|
|
31
33
|
import type { NodesRef } from '@lynx-js/types';
|
|
32
34
|
import type { OpenAppResult } from '@byted-doubao-apps/bridge-api';
|
|
33
35
|
import { PopupProps } from '@byted-lynx/lynx-ui-popup';
|
|
@@ -35,7 +37,10 @@ import { PopupRef } from '@byted-lynx/lynx-ui-popup';
|
|
|
35
37
|
import type { ReactElement } from 'react';
|
|
36
38
|
import type { ReactNode } from 'react';
|
|
37
39
|
import type { Ref } from 'react';
|
|
38
|
-
import
|
|
40
|
+
import { RefAttributes } from 'react';
|
|
41
|
+
import type { RefreshHeaderOffsetEvent } from '@lynx-js/types';
|
|
42
|
+
import type { RefreshStartRefreshEvent } from '@lynx-js/types';
|
|
43
|
+
import type { RefreshStateChangeEvent } from '@lynx-js/types';
|
|
39
44
|
import { ScrollEndEvent } from '@lynx-js/types';
|
|
40
45
|
import { ScrollEvent } from '@lynx-js/types';
|
|
41
46
|
import { ScrollToLowerEvent } from '@lynx-js/types';
|
|
@@ -58,6 +63,13 @@ export declare interface AgreePrivacyResult {
|
|
|
58
63
|
result: boolean;
|
|
59
64
|
}
|
|
60
65
|
|
|
66
|
+
declare interface AgreePrivacyResult_2 {
|
|
67
|
+
/**
|
|
68
|
+
* 用户是否同意隐私协议授权。
|
|
69
|
+
*/
|
|
70
|
+
result: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
61
73
|
export declare interface Arc {
|
|
62
74
|
/**
|
|
63
75
|
* 弧线 id。
|
|
@@ -130,6 +142,46 @@ declare interface BounceConfig {
|
|
|
130
142
|
endBounceItemWidth?: number;
|
|
131
143
|
}
|
|
132
144
|
|
|
145
|
+
declare interface BounceConfig_2 {
|
|
146
|
+
/**
|
|
147
|
+
* 是否启用回弹效果,当 loop 为 true 时忽略此设置
|
|
148
|
+
* @defaultValue false
|
|
149
|
+
*/
|
|
150
|
+
enable?: boolean;
|
|
151
|
+
/**
|
|
152
|
+
* 左侧回弹项(水平方向时)
|
|
153
|
+
*/
|
|
154
|
+
startBounceItem?: ReactElement;
|
|
155
|
+
/**
|
|
156
|
+
* 右侧回弹项(水平方向时)
|
|
157
|
+
*/
|
|
158
|
+
endBounceItem?: ReactElement;
|
|
159
|
+
/**
|
|
160
|
+
* 当 startBounceItem 处于回弹状态时,释放手指将调用此函数
|
|
161
|
+
*/
|
|
162
|
+
onStartBounceItemBounce?: (bounceParams: onBounceParams_2) => void;
|
|
163
|
+
/**
|
|
164
|
+
* 当 endBounceItem 处于回弹状态时,释放手指将调用此函数
|
|
165
|
+
*/
|
|
166
|
+
onEndBounceItemBounce?: (bounceParams: onBounceParams_2) => void;
|
|
167
|
+
/**
|
|
168
|
+
* 回弹项的宽度
|
|
169
|
+
* @defaultValue 100
|
|
170
|
+
*/
|
|
171
|
+
startBounceItemWidth?: number;
|
|
172
|
+
/**
|
|
173
|
+
* 回弹项的宽度
|
|
174
|
+
* @defaultValue 100
|
|
175
|
+
*/
|
|
176
|
+
endBounceItemWidth?: number;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
export declare const Button: typeof Button_2;
|
|
180
|
+
|
|
181
|
+
declare const Button_2: Button_3;
|
|
182
|
+
|
|
183
|
+
declare type Button_3 = ForwardRefExoticComponent<ButtonProps_2 & RefAttributes<ButtonRef>>;
|
|
184
|
+
|
|
133
185
|
/**
|
|
134
186
|
* 按钮组件。
|
|
135
187
|
*
|
|
@@ -157,6 +209,8 @@ declare interface BounceConfig {
|
|
|
157
209
|
* ```
|
|
158
210
|
*/
|
|
159
211
|
export declare interface ButtonProps {
|
|
212
|
+
/** 节点 ID,可用于选择器查询。 */
|
|
213
|
+
id?: string;
|
|
160
214
|
/**
|
|
161
215
|
* 组件样式
|
|
162
216
|
*/
|
|
@@ -177,12 +231,12 @@ export declare interface ButtonProps {
|
|
|
177
231
|
* 按钮尺寸
|
|
178
232
|
* @defaultValue 'default'
|
|
179
233
|
*/
|
|
180
|
-
size?:
|
|
234
|
+
size?: ButtonSize_2;
|
|
181
235
|
/**
|
|
182
236
|
* 按钮样式类型
|
|
183
237
|
* @defaultValue 'primary'
|
|
184
238
|
*/
|
|
185
|
-
type?:
|
|
239
|
+
type?: ButtonType_2;
|
|
186
240
|
/**
|
|
187
241
|
* 是否禁用
|
|
188
242
|
* @defaultValue false
|
|
@@ -274,10 +328,163 @@ export declare interface ButtonProps {
|
|
|
274
328
|
onLaunchAppError?: (error: unknown) => void;
|
|
275
329
|
}
|
|
276
330
|
|
|
331
|
+
/**
|
|
332
|
+
* 按钮组件。
|
|
333
|
+
*
|
|
334
|
+
* @remarks
|
|
335
|
+
* ## 使用建议
|
|
336
|
+
*
|
|
337
|
+
* 由于组件不开启 CSS 继承,button 的文本样式不会自动应用到 children。
|
|
338
|
+
* 因此提供了以下明确的 API 用法:
|
|
339
|
+
*
|
|
340
|
+
* - `text`:传入字符串,按钮会应用默认文本样式
|
|
341
|
+
* - `icon` + `text`:组合使用,显示图标和文字
|
|
342
|
+
* - `children`:完全自定义内容,**不会**应用按钮的默认文本样式
|
|
343
|
+
*
|
|
344
|
+
* ```tsx
|
|
345
|
+
* // 简单文字:用 text(推荐)
|
|
346
|
+
* <button text="确定" />
|
|
347
|
+
*
|
|
348
|
+
* // 图标+文字:用 icon + text
|
|
349
|
+
* <button icon={<Icon />} text="提交" />
|
|
350
|
+
*
|
|
351
|
+
* // 完全自定义:用 children(无默认样式)
|
|
352
|
+
* <button>
|
|
353
|
+
* <text style={{ color: 'red' }}>自定义</text>
|
|
354
|
+
* </button>
|
|
355
|
+
* ```
|
|
356
|
+
*/
|
|
357
|
+
declare interface ButtonProps_2 {
|
|
358
|
+
/** 节点 ID,可用于选择器查询。 */
|
|
359
|
+
id?: string;
|
|
360
|
+
/**
|
|
361
|
+
* 组件样式
|
|
362
|
+
*/
|
|
363
|
+
style?: CSSProperties;
|
|
364
|
+
/**
|
|
365
|
+
* 组件类名
|
|
366
|
+
*/
|
|
367
|
+
className?: string;
|
|
368
|
+
/**
|
|
369
|
+
* React key 属性
|
|
370
|
+
*/
|
|
371
|
+
key?: string | number | null | undefined;
|
|
372
|
+
/**
|
|
373
|
+
* 按钮文字
|
|
374
|
+
*/
|
|
375
|
+
text?: string;
|
|
376
|
+
/**
|
|
377
|
+
* 按钮尺寸
|
|
378
|
+
* @defaultValue 'default'
|
|
379
|
+
*/
|
|
380
|
+
size?: ButtonSize;
|
|
381
|
+
/**
|
|
382
|
+
* 按钮样式类型
|
|
383
|
+
* @defaultValue 'primary'
|
|
384
|
+
*/
|
|
385
|
+
type?: ButtonType;
|
|
386
|
+
/**
|
|
387
|
+
* 是否禁用
|
|
388
|
+
* @defaultValue false
|
|
389
|
+
*/
|
|
390
|
+
disabled?: boolean;
|
|
391
|
+
/**
|
|
392
|
+
* 是否展示组件内置的禁用态样式
|
|
393
|
+
* @defaultValue true
|
|
394
|
+
*/
|
|
395
|
+
showDisabledStyle?: boolean;
|
|
396
|
+
/**
|
|
397
|
+
* 是否显示加载状态
|
|
398
|
+
* @defaultValue false
|
|
399
|
+
*/
|
|
400
|
+
loading?: boolean;
|
|
401
|
+
/**
|
|
402
|
+
* 图标,显示在文字前面
|
|
403
|
+
*/
|
|
404
|
+
icon?: ReactNode;
|
|
405
|
+
/**
|
|
406
|
+
* 子元素,用于自定义内容。当同时提供 icon/text 和 children 时,children 优先。
|
|
407
|
+
*/
|
|
408
|
+
children?: ReactNode;
|
|
409
|
+
/**
|
|
410
|
+
* onClick 的节流时间,单位为毫秒
|
|
411
|
+
* @defaultValue 500
|
|
412
|
+
*/
|
|
413
|
+
throttle?: number;
|
|
414
|
+
/**
|
|
415
|
+
* 开放能力类型
|
|
416
|
+
*/
|
|
417
|
+
openType?: 'getPhoneNumber' | 'agreePrivacyAuthorization' | 'agreePrivacyAuthorization|getPhoneNumber' | 'openSetting' | 'launchApp';
|
|
418
|
+
/**
|
|
419
|
+
* 跳转外部应用的 deeplink URL,只在 openType="launchApp" 时有效。
|
|
420
|
+
* @since 0.1.1
|
|
421
|
+
*/
|
|
422
|
+
launchAppUrl?: string;
|
|
423
|
+
/**
|
|
424
|
+
* 点击回调函数
|
|
425
|
+
* @eventProperty
|
|
426
|
+
*/
|
|
427
|
+
onClick?: (event?: TouchEvent_2) => void;
|
|
428
|
+
/**
|
|
429
|
+
* 禁用状态下的点击回调函数
|
|
430
|
+
* @eventProperty
|
|
431
|
+
*/
|
|
432
|
+
onDisabledClick?: (event?: TouchEvent_2) => void;
|
|
433
|
+
/**
|
|
434
|
+
* 获取用户手机号回调,只在 openType="getPhoneNumber" 时有效
|
|
435
|
+
* @eventProperty
|
|
436
|
+
*/
|
|
437
|
+
onGetPhoneNumber?: (result?: GetPhoneNumberResult_2) => void;
|
|
438
|
+
/**
|
|
439
|
+
* 授权隐私协议回调,只在 openType="agreePrivacyAuthorization" 时有效
|
|
440
|
+
* @eventProperty
|
|
441
|
+
*/
|
|
442
|
+
onAgreePrivacyAuthorization?: (result?: AgreePrivacyResult_2) => void;
|
|
443
|
+
/**
|
|
444
|
+
* 打开授权设置页回调,只在 openType="openSetting" 时有效
|
|
445
|
+
*
|
|
446
|
+
* 成功时 detail 包含 `errMsg: 'openSetting:ok'` 和最新 `authSetting`;
|
|
447
|
+
* 失败时 detail 仅包含 `openSetting:fail ...`,不会包含 `authSetting` 字段。
|
|
448
|
+
*
|
|
449
|
+
* @example
|
|
450
|
+
* ```tsx
|
|
451
|
+
* <button
|
|
452
|
+
* openType="openSetting"
|
|
453
|
+
* onOpenSetting={({ detail }) => {
|
|
454
|
+
* if (detail.errMsg === 'openSetting:ok') {
|
|
455
|
+
* console.log(detail.authSetting);
|
|
456
|
+
* }
|
|
457
|
+
* }}
|
|
458
|
+
* />
|
|
459
|
+
* ```
|
|
460
|
+
* @eventProperty
|
|
461
|
+
*/
|
|
462
|
+
onOpenSetting?: (event: OpenSettingEvent_2) => void;
|
|
463
|
+
/**
|
|
464
|
+
* 跳转外部应用回调,只在 openType="launchApp" 时有效。
|
|
465
|
+
*
|
|
466
|
+
* 仅在跳转成功时返回跳转结果。
|
|
467
|
+
* @since 0.1.1
|
|
468
|
+
*/
|
|
469
|
+
onLaunchApp?: (result: LaunchAppResult_2) => void;
|
|
470
|
+
/**
|
|
471
|
+
* 跳转外部应用失败回调,只在 openType="launchApp" 时有效。
|
|
472
|
+
* @since 0.1.1
|
|
473
|
+
*/
|
|
474
|
+
onLaunchAppError?: (error: unknown) => void;
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
declare interface ButtonRef extends NodesRef {
|
|
478
|
+
}
|
|
479
|
+
|
|
277
480
|
declare type ButtonSize = 'default' | 'medium' | 'mini';
|
|
278
481
|
|
|
482
|
+
declare type ButtonSize_2 = 'default' | 'medium' | 'mini';
|
|
483
|
+
|
|
279
484
|
declare type ButtonType = 'primary' | 'default' | 'plain';
|
|
280
485
|
|
|
486
|
+
declare type ButtonType_2 = 'primary' | 'default' | 'plain';
|
|
487
|
+
|
|
281
488
|
export { CameraCaptureResult }
|
|
282
489
|
|
|
283
490
|
export { CameraDevicePosition }
|
|
@@ -420,6 +627,7 @@ export declare interface CameraRef {
|
|
|
420
627
|
stopRecord(): Promise<CameraCaptureResult>;
|
|
421
628
|
}
|
|
422
629
|
|
|
630
|
+
/** @public */
|
|
423
631
|
declare interface Canvas2DContext extends CanvasRenderingContext2D {
|
|
424
632
|
drawImage(image: DrawImageSource, dx: number, dy: number): void;
|
|
425
633
|
drawImage(image: DrawImageSource, dx: number, dy: number, dw: number, dh: number): void;
|
|
@@ -437,6 +645,7 @@ export declare interface CanvasElement {
|
|
|
437
645
|
removeEventListener: (event: 'resize', listener: (event: CanvasResizeEvent) => void, options?: EventListenerOptions | boolean) => void;
|
|
438
646
|
}
|
|
439
647
|
|
|
648
|
+
/** @public */
|
|
440
649
|
declare interface CanvasImage {
|
|
441
650
|
/**
|
|
442
651
|
* 图片资源地址。
|
|
@@ -497,6 +706,11 @@ export declare interface CanvasProps {
|
|
|
497
706
|
* 元素的唯一标识
|
|
498
707
|
*/
|
|
499
708
|
id?: string;
|
|
709
|
+
/**
|
|
710
|
+
* canvasToTempFilePath 的组件查找作用域,必须与第二个参数共用引用稳定的对象。
|
|
711
|
+
* 建议使用 useRef 保存;不要内联传入 exportScope={{}},否则每次渲染都会重新注册。
|
|
712
|
+
*/
|
|
713
|
+
exportScope?: object;
|
|
500
714
|
/**
|
|
501
715
|
* 原生属性透传,一般由自带画布渲染的三方库使用,业务代码请改用 `ref` 上的绘图方法。
|
|
502
716
|
* 传入后画布交由外部通过 `attachToCanvasView(name)` 接管,组件不再创建自己的画布实例,`ref` 上的绘图方法随之失效。
|
|
@@ -610,6 +824,92 @@ export declare interface CanvasResizeEvent {
|
|
|
610
824
|
height: number;
|
|
611
825
|
}
|
|
612
826
|
|
|
827
|
+
/** 多选组,统一管理后代 Checkbox 的选中值。 */
|
|
828
|
+
export declare interface CheckboxGroupProps {
|
|
829
|
+
/** React 列表项标识。 */
|
|
830
|
+
key?: string | number | null;
|
|
831
|
+
/** 组件实例引用。 */
|
|
832
|
+
ref?: Ref<CheckboxGroupRef>;
|
|
833
|
+
/** 子元素;参与分组的 Checkbox 必须提供组内唯一的 value。 */
|
|
834
|
+
children?: ReactNode;
|
|
835
|
+
/**
|
|
836
|
+
* 当前选中的值(受控模式),优先于 defaultValue。暂未渲染的选项值会保留。
|
|
837
|
+
* 传入 value 或 defaultValue 后由组管理选中值,组内选项的 checked/defaultChecked 不生效;
|
|
838
|
+
* 两者都不传时,由各选项的 checked/defaultChecked 决定选中状态。
|
|
839
|
+
*/
|
|
840
|
+
value?: string[];
|
|
841
|
+
/** 默认选中的值,仅在非受控模式下生效。 */
|
|
842
|
+
defaultValue?: string[];
|
|
843
|
+
/**
|
|
844
|
+
* 是否禁用整组;子选项不能覆盖整组禁用状态。
|
|
845
|
+
* @defaultValue false
|
|
846
|
+
*/
|
|
847
|
+
disabled?: boolean;
|
|
848
|
+
/**
|
|
849
|
+
* 用户切换选项时返回完整的选中值数组;外部更新 value 或选项的 checked 不触发回调。
|
|
850
|
+
* 由组管理时保留已有值的顺序,新选中的值追加到末尾;由选项管理时按选项挂载顺序返回。
|
|
851
|
+
*/
|
|
852
|
+
onValueChange?: (value: string[]) => void;
|
|
853
|
+
/** 组件样式。默认纵向排列,可通过 flexDirection 和 gap 调整布局。 */
|
|
854
|
+
style?: CSSProperties;
|
|
855
|
+
/** 组件类名。 */
|
|
856
|
+
className?: string;
|
|
857
|
+
}
|
|
858
|
+
|
|
859
|
+
/** CheckboxGroup 实例方法。 */
|
|
860
|
+
export declare interface CheckboxGroupRef {
|
|
861
|
+
/** 返回当前选中值,包括由各选项 checked/defaultChecked 决定的选中状态。 */
|
|
862
|
+
getValue: () => string[];
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
/** 复选框,支持独立使用或通过 CheckboxGroup 管理多个选项。 */
|
|
866
|
+
export declare interface CheckboxProps {
|
|
867
|
+
/** React 列表项标识。 */
|
|
868
|
+
key?: string | number | null;
|
|
869
|
+
/** 组件实例引用。 */
|
|
870
|
+
ref?: Ref<CheckboxRef>;
|
|
871
|
+
/** 元素 id。 */
|
|
872
|
+
id?: string;
|
|
873
|
+
/**
|
|
874
|
+
* 选项标识。独立使用时可省略;参与 CheckboxGroup 时必须提供组内唯一的值。
|
|
875
|
+
* 所在组传入 value/defaultValue 时,选中状态由组管理,忽略单项 checked 和 defaultChecked。
|
|
876
|
+
*/
|
|
877
|
+
value?: string;
|
|
878
|
+
/** 当前是否选中(受控模式),优先于 defaultChecked。所在组由组管理选中值时不生效。 */
|
|
879
|
+
checked?: boolean;
|
|
880
|
+
/**
|
|
881
|
+
* 默认选中状态(非受控模式)。所在组由组管理选中值时不生效。
|
|
882
|
+
* @defaultValue false
|
|
883
|
+
*/
|
|
884
|
+
defaultChecked?: boolean;
|
|
885
|
+
/**
|
|
886
|
+
* 是否禁用。所在 CheckboxGroup 禁用时,单项也不可操作。
|
|
887
|
+
* @defaultValue false
|
|
888
|
+
*/
|
|
889
|
+
disabled?: boolean;
|
|
890
|
+
/** 选中颜色,默认使用主题主色。 */
|
|
891
|
+
color?: string;
|
|
892
|
+
/** 选项内容。字符串和数字自动应用文字样式,点击内容也会切换状态;点击不会冒泡到外层元素。 */
|
|
893
|
+
children?: ReactNode;
|
|
894
|
+
/** 无障碍名称。复杂内容或无文字选项应显式设置;纯文字内容可自动作为名称。 */
|
|
895
|
+
ariaLabel?: string;
|
|
896
|
+
/** 组件样式。 */
|
|
897
|
+
style?: CSSProperties;
|
|
898
|
+
/** 组件类名。 */
|
|
899
|
+
className?: string;
|
|
900
|
+
/**
|
|
901
|
+
* 用户切换时返回新的选中状态和触发切换的点击事件;禁用时不触发。
|
|
902
|
+
* 在组内使用时仍会触发,组的完整选中值通过 onValueChange 获取。
|
|
903
|
+
*/
|
|
904
|
+
onChange?: (checked: boolean, event?: TouchEvent_2) => void;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
/** Checkbox 实例方法。 */
|
|
908
|
+
export declare interface CheckboxRef {
|
|
909
|
+
/** 按用户点击处理一次切换,例如由外部标签触发;禁用时无效。 */
|
|
910
|
+
toggle: (event?: TouchEvent_2) => void;
|
|
911
|
+
}
|
|
912
|
+
|
|
613
913
|
export declare interface Circle {
|
|
614
914
|
/**
|
|
615
915
|
* 圆形唯一标识。
|
|
@@ -811,6 +1111,17 @@ export declare interface GetPhoneNumberResult {
|
|
|
811
1111
|
message?: string;
|
|
812
1112
|
}
|
|
813
1113
|
|
|
1114
|
+
declare interface GetPhoneNumberResult_2 {
|
|
1115
|
+
/**
|
|
1116
|
+
* 获取手机号结果码。
|
|
1117
|
+
*/
|
|
1118
|
+
code?: string;
|
|
1119
|
+
/**
|
|
1120
|
+
* 获取手机号结果信息。
|
|
1121
|
+
*/
|
|
1122
|
+
message?: string;
|
|
1123
|
+
}
|
|
1124
|
+
|
|
814
1125
|
/**
|
|
815
1126
|
* 图片展示组件,支持加载本地或网络图片资源,提供多种裁剪和缩放模式。
|
|
816
1127
|
*/
|
|
@@ -1138,6 +1449,13 @@ export declare type LatLng = {
|
|
|
1138
1449
|
*/
|
|
1139
1450
|
export declare type LaunchAppResult = OpenAppResult;
|
|
1140
1451
|
|
|
1452
|
+
/**
|
|
1453
|
+
* Button 通过 `openType="launchApp"` 跳转外部应用后的回调结果。
|
|
1454
|
+
*
|
|
1455
|
+
* @since 0.1.1
|
|
1456
|
+
*/
|
|
1457
|
+
declare type LaunchAppResult_2 = OpenAppResult;
|
|
1458
|
+
|
|
1141
1459
|
export { ListAttachedCell }
|
|
1142
1460
|
|
|
1143
1461
|
export { ListItemInfo }
|
|
@@ -1691,6 +2009,8 @@ export declare type MapMarkerRef = {
|
|
|
1691
2009
|
* 地图展示组件,支持标记点、路线、多边形等覆盖物,以及平移、缩放等交互。
|
|
1692
2010
|
*/
|
|
1693
2011
|
export declare interface MapProps {
|
|
2012
|
+
/** 节点 ID,可用于选择器查询。 */
|
|
2013
|
+
id?: string;
|
|
1694
2014
|
/**
|
|
1695
2015
|
* 用于获取组件实例的 ref
|
|
1696
2016
|
*/
|
|
@@ -2735,6 +3055,7 @@ export declare interface NavigationBarProps {
|
|
|
2735
3055
|
onBack?: (event: NavigationBarBackEvent) => void;
|
|
2736
3056
|
}
|
|
2737
3057
|
|
|
3058
|
+
/** @public */
|
|
2738
3059
|
declare interface OffscreenCanvas_2 {
|
|
2739
3060
|
/**
|
|
2740
3061
|
* 画布宽度(buffer 像素数)
|
|
@@ -2756,6 +3077,10 @@ declare interface OffscreenCanvas_2 {
|
|
|
2756
3077
|
* 创建图片对象
|
|
2757
3078
|
*/
|
|
2758
3079
|
createImage: () => CanvasImage | undefined;
|
|
3080
|
+
/**
|
|
3081
|
+
* 导出画布内容为 data URI
|
|
3082
|
+
*/
|
|
3083
|
+
toDataURL: (type?: string, encoderOptions?: number) => string;
|
|
2759
3084
|
}
|
|
2760
3085
|
|
|
2761
3086
|
declare interface onBounceParams {
|
|
@@ -2763,6 +3088,11 @@ declare interface onBounceParams {
|
|
|
2763
3088
|
offset: number;
|
|
2764
3089
|
}
|
|
2765
3090
|
|
|
3091
|
+
declare interface onBounceParams_2 {
|
|
3092
|
+
type: 'start' | 'end';
|
|
3093
|
+
offset: number;
|
|
3094
|
+
}
|
|
3095
|
+
|
|
2766
3096
|
/**
|
|
2767
3097
|
* button 通过 `openType="openSetting"` 打开授权设置页后的回调事件。
|
|
2768
3098
|
*/
|
|
@@ -2774,7 +3104,17 @@ export declare interface OpenSettingEvent {
|
|
|
2774
3104
|
}
|
|
2775
3105
|
|
|
2776
3106
|
/**
|
|
2777
|
-
*
|
|
3107
|
+
* button 通过 `openType="openSetting"` 打开授权设置页后的回调事件。
|
|
3108
|
+
*/
|
|
3109
|
+
declare interface OpenSettingEvent_2 {
|
|
3110
|
+
/**
|
|
3111
|
+
* 打开授权设置页的结果详情。
|
|
3112
|
+
*/
|
|
3113
|
+
detail: OpenSettingEventDetail_2;
|
|
3114
|
+
}
|
|
3115
|
+
|
|
3116
|
+
/**
|
|
3117
|
+
* 打开授权设置页后的事件详情。
|
|
2778
3118
|
*
|
|
2779
3119
|
* 可通过 `errMsg` 区分成功和失败:成功时同时返回最新的 `authSetting`,
|
|
2780
3120
|
* 失败时不包含 `authSetting` 字段。
|
|
@@ -2800,6 +3140,33 @@ export declare type OpenSettingEventDetail = {
|
|
|
2800
3140
|
errMsg: `openSetting:fail ${string}`;
|
|
2801
3141
|
};
|
|
2802
3142
|
|
|
3143
|
+
/**
|
|
3144
|
+
* 打开授权设置页后的事件详情。
|
|
3145
|
+
*
|
|
3146
|
+
* 可通过 `errMsg` 区分成功和失败:成功时同时返回最新的 `authSetting`,
|
|
3147
|
+
* 失败时不包含 `authSetting` 字段。
|
|
3148
|
+
*/
|
|
3149
|
+
declare type OpenSettingEventDetail_2 = {
|
|
3150
|
+
/**
|
|
3151
|
+
* 回调状态,成功时固定为 `openSetting:ok`。
|
|
3152
|
+
*/
|
|
3153
|
+
errMsg: 'openSetting:ok';
|
|
3154
|
+
/**
|
|
3155
|
+
* 用户授权设置结果。
|
|
3156
|
+
*
|
|
3157
|
+
* key 为权限 scope,value 表示用户是否已授权该权限。
|
|
3158
|
+
*/
|
|
3159
|
+
authSetting: Record<string, boolean>;
|
|
3160
|
+
} | {
|
|
3161
|
+
/**
|
|
3162
|
+
* 回调状态,失败时格式为 `openSetting:fail ${错误信息}`。
|
|
3163
|
+
*
|
|
3164
|
+
* 错误信息由客户端返回,没有固定枚举,例如 `openSetting:fail Applet bridge unavailable`;
|
|
3165
|
+
* 客户端未返回原因时为 `openSetting:fail unknown error`。
|
|
3166
|
+
*/
|
|
3167
|
+
errMsg: `openSetting:fail ${string}`;
|
|
3168
|
+
};
|
|
3169
|
+
|
|
2803
3170
|
/**
|
|
2804
3171
|
* PickerColumn 单个选项的数据结构
|
|
2805
3172
|
*/
|
|
@@ -3111,12 +3478,65 @@ export declare interface RadioProps {
|
|
|
3111
3478
|
disabled?: boolean;
|
|
3112
3479
|
}
|
|
3113
3480
|
|
|
3481
|
+
/**
|
|
3482
|
+
* 移动端下拉刷新头,作为 refresh 的直接子节点。只渲染传入的子节点。
|
|
3483
|
+
*
|
|
3484
|
+
* @since 0.10.0
|
|
3485
|
+
*
|
|
3486
|
+
* @remarks
|
|
3487
|
+
* 前端库版本不低于 `0.10.0`。
|
|
3488
|
+
*/
|
|
3489
|
+
export declare interface RefreshHeaderProps {
|
|
3490
|
+
/** 自定义刷新头内容。请通过 style 或 className 指定高度和布局。 */
|
|
3491
|
+
children?: ReactNode;
|
|
3492
|
+
id?: string;
|
|
3493
|
+
className?: string;
|
|
3494
|
+
style?: CSSProperties;
|
|
3495
|
+
ref?: Ref<NodesRef>;
|
|
3496
|
+
}
|
|
3497
|
+
|
|
3498
|
+
/**
|
|
3499
|
+
* 移动端原生下拉刷新容器。将刷新头 refresh-header 和纵向 scroll-view 作为直接子节点。
|
|
3500
|
+
* 可通过 ref 调用原生 autoStartRefresh 和 finishRefresh。
|
|
3501
|
+
* data-* 属性可以通过事件的 dataset 读取。
|
|
3502
|
+
*
|
|
3503
|
+
* @since 0.10.0
|
|
3504
|
+
*
|
|
3505
|
+
* @remarks
|
|
3506
|
+
* 前端库版本不低于 `0.10.0`。
|
|
3507
|
+
*/
|
|
3508
|
+
export declare interface RefreshProps {
|
|
3509
|
+
[key: `data-${string}`]: unknown;
|
|
3510
|
+
children?: ReactNode;
|
|
3511
|
+
id?: string;
|
|
3512
|
+
className?: string;
|
|
3513
|
+
style?: CSSProperties;
|
|
3514
|
+
ref?: Ref<NodesRef>;
|
|
3515
|
+
/**
|
|
3516
|
+
* 是否允许手势或程序触发刷新。
|
|
3517
|
+
* @defaultValue true
|
|
3518
|
+
*/
|
|
3519
|
+
enableRefresh?: boolean;
|
|
3520
|
+
/** 手势或程序开始刷新时触发。 */
|
|
3521
|
+
onStartRefresh?: (event: RefreshStartRefreshEvent) => void;
|
|
3522
|
+
/** 刷新头位置变化时触发。 */
|
|
3523
|
+
onHeaderOffset?: (event: RefreshHeaderOffsetEvent) => void;
|
|
3524
|
+
/** 原生刷新状态变化时触发。 */
|
|
3525
|
+
onRefreshStateChange?: (event: RefreshStateChangeEvent) => void;
|
|
3526
|
+
}
|
|
3527
|
+
|
|
3114
3528
|
declare interface RenderFunctionProps<T> {
|
|
3115
3529
|
item: T;
|
|
3116
3530
|
index: number;
|
|
3117
3531
|
realIndex: number;
|
|
3118
3532
|
}
|
|
3119
3533
|
|
|
3534
|
+
declare interface RenderFunctionProps_2<T> {
|
|
3535
|
+
item: T;
|
|
3536
|
+
index: number;
|
|
3537
|
+
realIndex: number;
|
|
3538
|
+
}
|
|
3539
|
+
|
|
3120
3540
|
export declare interface RenderLongImageSegmentsOptions {
|
|
3121
3541
|
/**
|
|
3122
3542
|
* 渲染模式:
|
|
@@ -3280,6 +3700,21 @@ export declare interface ScrollViewProps {
|
|
|
3280
3700
|
* @defaultValue 'vertical'
|
|
3281
3701
|
*/
|
|
3282
3702
|
scrollOrientation?: 'vertical' | 'horizontal';
|
|
3703
|
+
/**
|
|
3704
|
+
* 滚动到当前容器内指定 id 的子节点,纵向顶部对齐、横向左侧对齐。
|
|
3705
|
+
* id 不能以数字开头;目标节点需可查询(必要时设置 flatten=false)。
|
|
3706
|
+
* 首次设置和 id 变化时执行;相同 id 不重复滚动,可先清空再设置。
|
|
3707
|
+
* 节点未就绪时短暂重试,之后仅在渲染或内容变化时重试;成功后不再追踪布局变化。
|
|
3708
|
+
* 末项位置受可滚动范围限制。
|
|
3709
|
+
* @since 0.10.0
|
|
3710
|
+
*/
|
|
3711
|
+
scrollIntoView?: string;
|
|
3712
|
+
/**
|
|
3713
|
+
* 锚点滚动是否使用原生动画。
|
|
3714
|
+
* @defaultValue false
|
|
3715
|
+
* @since 0.10.0
|
|
3716
|
+
*/
|
|
3717
|
+
scrollWithAnimation?: boolean;
|
|
3283
3718
|
/**
|
|
3284
3719
|
* 是否启用弹性效果(iOS 回弹效果)
|
|
3285
3720
|
* @defaultValue true
|
|
@@ -3362,6 +3797,10 @@ export declare interface ScrollViewProps {
|
|
|
3362
3797
|
bindcontentsizechanged?: (event: ContentSizeChangedEvent) => void;
|
|
3363
3798
|
}
|
|
3364
3799
|
|
|
3800
|
+
export declare const Slider: typeof Slider_2;
|
|
3801
|
+
|
|
3802
|
+
declare function Slider_2({ value, min, max, showValue, disabled, style, className, key, onChange }: SliderProps_2): ReactNode;
|
|
3803
|
+
|
|
3365
3804
|
/**
|
|
3366
3805
|
* 滑块组件,支持在指定范围内选择连续或离散数值。
|
|
3367
3806
|
*/
|
|
@@ -3408,6 +3847,52 @@ export declare interface SliderProps {
|
|
|
3408
3847
|
onChange?: (value: number) => void;
|
|
3409
3848
|
}
|
|
3410
3849
|
|
|
3850
|
+
/**
|
|
3851
|
+
* 滑块组件,支持在指定范围内选择连续或离散数值。
|
|
3852
|
+
*/
|
|
3853
|
+
declare interface SliderProps_2 {
|
|
3854
|
+
/**
|
|
3855
|
+
* 组件样式。
|
|
3856
|
+
*/
|
|
3857
|
+
style?: CSSProperties;
|
|
3858
|
+
/**
|
|
3859
|
+
* 组件类名。
|
|
3860
|
+
*/
|
|
3861
|
+
className?: string;
|
|
3862
|
+
/**
|
|
3863
|
+
* React key 属性
|
|
3864
|
+
*/
|
|
3865
|
+
key?: string | number | null | undefined;
|
|
3866
|
+
/**
|
|
3867
|
+
* 当前数值(必填,只支持受控用法)
|
|
3868
|
+
*/
|
|
3869
|
+
value: number;
|
|
3870
|
+
/**
|
|
3871
|
+
* 最小值
|
|
3872
|
+
* @defaultValue 0
|
|
3873
|
+
*/
|
|
3874
|
+
min?: number;
|
|
3875
|
+
/**
|
|
3876
|
+
* 最大值
|
|
3877
|
+
* @defaultValue 100
|
|
3878
|
+
*/
|
|
3879
|
+
max?: number;
|
|
3880
|
+
/**
|
|
3881
|
+
* 是否展示数值
|
|
3882
|
+
* @defaultValue true
|
|
3883
|
+
*/
|
|
3884
|
+
showValue?: boolean;
|
|
3885
|
+
/**
|
|
3886
|
+
* 是否禁用
|
|
3887
|
+
* @defaultValue false
|
|
3888
|
+
*/
|
|
3889
|
+
disabled?: boolean;
|
|
3890
|
+
/**
|
|
3891
|
+
* 数值变化的回调
|
|
3892
|
+
*/
|
|
3893
|
+
onChange?: (value: number) => void;
|
|
3894
|
+
}
|
|
3895
|
+
|
|
3411
3896
|
/**
|
|
3412
3897
|
* SVG 图形渲染组件,支持内联展示 SVG 格式图片。
|
|
3413
3898
|
*/
|
|
@@ -3451,6 +3936,16 @@ export declare interface SvgProps {
|
|
|
3451
3936
|
bindtap?: (event: TouchEvent_2) => void;
|
|
3452
3937
|
}
|
|
3453
3938
|
|
|
3939
|
+
export declare const Swiper: typeof Swiper_2;
|
|
3940
|
+
|
|
3941
|
+
declare const Swiper_2: SwiperComponent;
|
|
3942
|
+
|
|
3943
|
+
declare type SwiperComponent = <T>(props: SwiperPropsReal<T> & RefAttributes<SwiperRef_2>) => ReactElement | null;
|
|
3944
|
+
|
|
3945
|
+
export declare const SwiperItem: typeof SwiperItem_2;
|
|
3946
|
+
|
|
3947
|
+
declare const SwiperItem_2: MemoExoticComponent<({ style, className, children, ...props }: SwiperItemProps_2) => JSX_2.Element>;
|
|
3948
|
+
|
|
3454
3949
|
/**
|
|
3455
3950
|
* 轮播项组件,用于包裹单个轮播内容,必须作为 Swiper 的直接子组件使用。
|
|
3456
3951
|
*/
|
|
@@ -3483,10 +3978,42 @@ export declare interface SwiperItemProps {
|
|
|
3483
3978
|
overlap?: boolean;
|
|
3484
3979
|
}
|
|
3485
3980
|
|
|
3981
|
+
/**
|
|
3982
|
+
* 轮播项组件,用于包裹单个轮播内容,必须作为 Swiper 的直接子组件使用。
|
|
3983
|
+
*/
|
|
3984
|
+
declare interface SwiperItemProps_2 {
|
|
3985
|
+
/**
|
|
3986
|
+
* 当前 SwiperItem 的索引,基于 Swiper 的数据
|
|
3987
|
+
*/
|
|
3988
|
+
index: number;
|
|
3989
|
+
/**
|
|
3990
|
+
* 子元素
|
|
3991
|
+
*/
|
|
3992
|
+
children: ReactElement | ReactElement[];
|
|
3993
|
+
/**
|
|
3994
|
+
* 样式
|
|
3995
|
+
*/
|
|
3996
|
+
style?: CSSProperties;
|
|
3997
|
+
/**
|
|
3998
|
+
* 类名
|
|
3999
|
+
*/
|
|
4000
|
+
className?: string;
|
|
4001
|
+
/**
|
|
4002
|
+
* 当前 SwiperItem 的真实索引,基于 Swiper 的数据
|
|
4003
|
+
* 与 `index` 相同,但在 loop 模式下会不同
|
|
4004
|
+
*/
|
|
4005
|
+
realIndex?: number;
|
|
4006
|
+
/**
|
|
4007
|
+
* 传递给 SwiperItem 直接子元素的 `overlap` 属性
|
|
4008
|
+
* 仅在透明度有问题时使用
|
|
4009
|
+
*/
|
|
4010
|
+
overlap?: boolean;
|
|
4011
|
+
}
|
|
4012
|
+
|
|
3486
4013
|
/**
|
|
3487
4014
|
* 轮播容器组件,支持自动播放、循环、自定义动画等功能。子节点须为 SwiperItem 组件。
|
|
3488
4015
|
*/
|
|
3489
|
-
export declare type SwiperProps<T = any> =
|
|
4016
|
+
export declare type SwiperProps<T = any> = SwiperPropsNormal_2<T> | SwiperPropsCustom_2<T>;
|
|
3490
4017
|
|
|
3491
4018
|
declare interface SwiperProps_2<T> {
|
|
3492
4019
|
/**
|
|
@@ -3631,6 +4158,149 @@ declare interface SwiperProps_2<T> {
|
|
|
3631
4158
|
RTL?: boolean | 'lynx-rtl';
|
|
3632
4159
|
}
|
|
3633
4160
|
|
|
4161
|
+
declare interface SwiperProps_2_2<T> {
|
|
4162
|
+
/**
|
|
4163
|
+
* 组件类名
|
|
4164
|
+
*/
|
|
4165
|
+
className?: string;
|
|
4166
|
+
/**
|
|
4167
|
+
* 轮播图数据集合
|
|
4168
|
+
*/
|
|
4169
|
+
data: T[];
|
|
4170
|
+
/**
|
|
4171
|
+
* 轮播项宽度
|
|
4172
|
+
*/
|
|
4173
|
+
itemWidth: number;
|
|
4174
|
+
/**
|
|
4175
|
+
* 轮播项高度
|
|
4176
|
+
*/
|
|
4177
|
+
itemHeight?: number | 'auto';
|
|
4178
|
+
/**
|
|
4179
|
+
* 子元素,应该是一个函数,返回 SwiperItem
|
|
4180
|
+
* @example
|
|
4181
|
+
* ```tsx
|
|
4182
|
+
* <swiper
|
|
4183
|
+
* data={items}
|
|
4184
|
+
* itemWidth={350}
|
|
4185
|
+
* >
|
|
4186
|
+
* {({ index, item }) => (
|
|
4187
|
+
* <swiper-item index={index} key={index}>
|
|
4188
|
+
* <image class="image" src={`${item}`}></image>
|
|
4189
|
+
* <text class="image-text">Number.{index}</text>
|
|
4190
|
+
* </swiper-item>
|
|
4191
|
+
* )}
|
|
4192
|
+
* </swiper>
|
|
4193
|
+
* ```
|
|
4194
|
+
*/
|
|
4195
|
+
children: (prop: RenderFunctionProps_2<T>) => ReactElement;
|
|
4196
|
+
/**
|
|
4197
|
+
* 容器宽度
|
|
4198
|
+
* @defaultValue screenWidth
|
|
4199
|
+
*/
|
|
4200
|
+
containerWidth?: number;
|
|
4201
|
+
/**
|
|
4202
|
+
* 初始索引,仅在首屏时使用,后续更新将被忽略
|
|
4203
|
+
* @defaultValue 0
|
|
4204
|
+
*/
|
|
4205
|
+
initialIndex?: number;
|
|
4206
|
+
/**
|
|
4207
|
+
* 是否开启循环轮播
|
|
4208
|
+
* @defaultValue false
|
|
4209
|
+
*/
|
|
4210
|
+
loop?: boolean;
|
|
4211
|
+
/**
|
|
4212
|
+
* 当 loop 为 true 时,Swiper 会复制前 2 个和后 2 个项目来创建循环效果。
|
|
4213
|
+
* 此属性可用于自定义复制第一个和最后一个项目的数量
|
|
4214
|
+
* @defaultValue 2
|
|
4215
|
+
*/
|
|
4216
|
+
loopDuplicateCount?: number;
|
|
4217
|
+
/**
|
|
4218
|
+
* 翻页或滑动动画的持续时间
|
|
4219
|
+
* @defaultValue 500
|
|
4220
|
+
*/
|
|
4221
|
+
duration?: number;
|
|
4222
|
+
/**
|
|
4223
|
+
* 当前索引改变时的回调函数
|
|
4224
|
+
*/
|
|
4225
|
+
onChange?: (current: number) => void;
|
|
4226
|
+
/**
|
|
4227
|
+
* 开始滑动时的回调函数,可与 onSwipeStop 配合使用,用于在滑动时禁用点击事件
|
|
4228
|
+
*/
|
|
4229
|
+
onSwipeStart?: (current: number) => void;
|
|
4230
|
+
/**
|
|
4231
|
+
* 停止滑动时的回调函数,可与 onSwipeStart 配合使用
|
|
4232
|
+
*/
|
|
4233
|
+
onSwipeStop?: (current: number) => void;
|
|
4234
|
+
/**
|
|
4235
|
+
* Swiper 偏移量改变时的回调函数,应该是一个主线程函数
|
|
4236
|
+
*/
|
|
4237
|
+
'main-thread:onOffsetChange'?: (offset: number) => void;
|
|
4238
|
+
/**
|
|
4239
|
+
* 自定义翻页效果的缓动函数
|
|
4240
|
+
*/
|
|
4241
|
+
'main-thread:easing'?: (progress: number) => number;
|
|
4242
|
+
/**
|
|
4243
|
+
* 自定义动画效果,应该是一个主线程函数
|
|
4244
|
+
*/
|
|
4245
|
+
'main-thread:customAnimation'?: (value: number, index: number) => CSSProperties;
|
|
4246
|
+
/**
|
|
4247
|
+
* 在 JS 中使用的自定义动画效果,应该是一个 JS 函数。
|
|
4248
|
+
* customAnimationFirstScreen 应该是与 'main-thread:customAnimation' 内容相同的函数,但不带 'main thread' 注解。
|
|
4249
|
+
* 这是对 MainThreadScript 不支持首屏的临时解决方案
|
|
4250
|
+
*/
|
|
4251
|
+
customAnimationFirstScreen?: (value: number, index: number) => CSSProperties;
|
|
4252
|
+
/**
|
|
4253
|
+
* 是否启用自动播放
|
|
4254
|
+
* @defaultValue false
|
|
4255
|
+
*/
|
|
4256
|
+
autoPlay?: boolean;
|
|
4257
|
+
/**
|
|
4258
|
+
* 自动播放间隔
|
|
4259
|
+
* @defaultValue 2000
|
|
4260
|
+
*/
|
|
4261
|
+
autoPlayInterval?: number;
|
|
4262
|
+
/**
|
|
4263
|
+
* 用于限制或扩展 Swiper 的偏移量范围,可用于限制偏移量以避免过度滚动
|
|
4264
|
+
*/
|
|
4265
|
+
offsetLimit?: [number, number];
|
|
4266
|
+
/**
|
|
4267
|
+
* 回弹参数配置
|
|
4268
|
+
*/
|
|
4269
|
+
bounceConfig?: BounceConfig_2;
|
|
4270
|
+
/**
|
|
4271
|
+
* Swiper 组件的 key,更改此值将重置 Swiper 的进度和状态
|
|
4272
|
+
*/
|
|
4273
|
+
swiperKey?: unknown;
|
|
4274
|
+
/**
|
|
4275
|
+
* 在重用 Swiper 组件时是否重置 Swiper 的进度和状态
|
|
4276
|
+
* @defaultValue false
|
|
4277
|
+
*/
|
|
4278
|
+
resetOnReuse?: boolean;
|
|
4279
|
+
/**
|
|
4280
|
+
* 根元素样式,控制包含轮播图的可见视口/框架
|
|
4281
|
+
*/
|
|
4282
|
+
style?: CSSProperties;
|
|
4283
|
+
/**
|
|
4284
|
+
* 内部滑动轨道的样式,这是实际移动/滑动的元素
|
|
4285
|
+
*/
|
|
4286
|
+
trackStyle?: CSSProperties;
|
|
4287
|
+
/**
|
|
4288
|
+
* 决定 Swiper 如何响应不同角度的触摸
|
|
4289
|
+
* @defaultValue [[-180, -135], [-45, 45], [135, 180]]
|
|
4290
|
+
*/
|
|
4291
|
+
consumeSlideEvent?: [number, number][];
|
|
4292
|
+
/**
|
|
4293
|
+
* 是否阻止原生事件
|
|
4294
|
+
* @defaultValue false
|
|
4295
|
+
*/
|
|
4296
|
+
blockNativeEvent?: boolean;
|
|
4297
|
+
/**
|
|
4298
|
+
* 是否启用 RTL 模式
|
|
4299
|
+
* @defaultValue false
|
|
4300
|
+
*/
|
|
4301
|
+
RTL?: boolean | 'lynx-rtl';
|
|
4302
|
+
}
|
|
4303
|
+
|
|
3634
4304
|
declare interface SwiperPropsCustom<T> extends SwiperProps_2<T> {
|
|
3635
4305
|
/**
|
|
3636
4306
|
* Swiper 的模式。普通模式会使 SwiperItem 依次排列。
|
|
@@ -3644,6 +4314,19 @@ declare interface SwiperPropsCustom<T> extends SwiperProps_2<T> {
|
|
|
3644
4314
|
modeConfig?: Record<string, unknown>;
|
|
3645
4315
|
}
|
|
3646
4316
|
|
|
4317
|
+
declare interface SwiperPropsCustom_2<T> extends SwiperProps_2_2<T> {
|
|
4318
|
+
/**
|
|
4319
|
+
* Swiper 的模式。普通模式会使 SwiperItem 依次排列。
|
|
4320
|
+
* 自定义模式会使 SwiperItem 以绝对定位方式放置在最左侧
|
|
4321
|
+
* @defaultValue normal
|
|
4322
|
+
*/
|
|
4323
|
+
mode?: 'custom';
|
|
4324
|
+
/**
|
|
4325
|
+
* 模式的额外配置
|
|
4326
|
+
*/
|
|
4327
|
+
modeConfig?: Record<string, unknown>;
|
|
4328
|
+
}
|
|
4329
|
+
|
|
3647
4330
|
declare interface SwiperPropsNormal<T> extends SwiperProps_2<T> {
|
|
3648
4331
|
/**
|
|
3649
4332
|
* Swiper 的模式。普通模式会使 SwiperItem 依次排列。
|
|
@@ -3668,7 +4351,56 @@ declare interface SwiperPropsNormal<T> extends SwiperProps_2<T> {
|
|
|
3668
4351
|
};
|
|
3669
4352
|
}
|
|
3670
4353
|
|
|
4354
|
+
declare interface SwiperPropsNormal_2<T> extends SwiperProps_2_2<T> {
|
|
4355
|
+
/**
|
|
4356
|
+
* Swiper 的模式。普通模式会使 SwiperItem 依次排列。
|
|
4357
|
+
* 自定义模式会使 SwiperItem 以绝对定位方式放置在最左侧
|
|
4358
|
+
* @defaultValue normal
|
|
4359
|
+
*/
|
|
4360
|
+
mode?: 'normal';
|
|
4361
|
+
/**
|
|
4362
|
+
* 模式的额外配置
|
|
4363
|
+
*/
|
|
4364
|
+
modeConfig?: {
|
|
4365
|
+
/**
|
|
4366
|
+
* SwiperItem 的对齐方式
|
|
4367
|
+
* @defaultValue start
|
|
4368
|
+
*/
|
|
4369
|
+
align?: 'start' | 'center' | 'end';
|
|
4370
|
+
/**
|
|
4371
|
+
* SwiperItem 之间的间距
|
|
4372
|
+
* @defaultValue 0
|
|
4373
|
+
*/
|
|
4374
|
+
spaceBetween?: number;
|
|
4375
|
+
};
|
|
4376
|
+
}
|
|
4377
|
+
|
|
4378
|
+
/**
|
|
4379
|
+
* 轮播容器组件,支持自动播放、循环、自定义动画等功能。子节点须为 SwiperItem 组件。
|
|
4380
|
+
*/
|
|
4381
|
+
declare type SwiperPropsReal<T = any> = SwiperPropsNormal<T> | SwiperPropsCustom<T>;
|
|
4382
|
+
|
|
3671
4383
|
export declare interface SwiperRef {
|
|
4384
|
+
/**
|
|
4385
|
+
* 滑动到指定索引的项目
|
|
4386
|
+
*/
|
|
4387
|
+
swipeTo: (index: number, options?: SwipeToOptions_2) => void;
|
|
4388
|
+
/**
|
|
4389
|
+
* 滑动到下一个项目
|
|
4390
|
+
*/
|
|
4391
|
+
swipeNext: () => void;
|
|
4392
|
+
/**
|
|
4393
|
+
* 滑动到上一个项目
|
|
4394
|
+
*/
|
|
4395
|
+
swipePrev: () => void;
|
|
4396
|
+
/**
|
|
4397
|
+
* 取消当前正在运行的动画。谨慎使用,可能会破坏内部状态
|
|
4398
|
+
* @experimental
|
|
4399
|
+
*/
|
|
4400
|
+
cancelAnimation: () => void;
|
|
4401
|
+
}
|
|
4402
|
+
|
|
4403
|
+
declare interface SwiperRef_2 {
|
|
3672
4404
|
/**
|
|
3673
4405
|
* 滑动到指定索引的项目
|
|
3674
4406
|
*/
|
|
@@ -3693,6 +4425,11 @@ declare interface SwipeToOptions {
|
|
|
3693
4425
|
onFinished?: () => void;
|
|
3694
4426
|
}
|
|
3695
4427
|
|
|
4428
|
+
declare interface SwipeToOptions_2 {
|
|
4429
|
+
animate?: boolean;
|
|
4430
|
+
onFinished?: () => void;
|
|
4431
|
+
}
|
|
4432
|
+
|
|
3696
4433
|
/**
|
|
3697
4434
|
* 开关切换组件,用于二元状态(开/关)的交互控制。
|
|
3698
4435
|
*/
|
|
@@ -3738,6 +4475,10 @@ export declare interface SwitchProps {
|
|
|
3738
4475
|
/** Switch 尺寸变体 */
|
|
3739
4476
|
declare type SwitchSize = 'default' | 'large';
|
|
3740
4477
|
|
|
4478
|
+
export declare const TextArea: typeof TextArea_2;
|
|
4479
|
+
|
|
4480
|
+
declare const TextArea_2: (props: TextAreaProps_2 & RefAttributes<NodesRef>) => React.ReactElement | null;
|
|
4481
|
+
|
|
3741
4482
|
/**
|
|
3742
4483
|
* 多行文本输入组件,支持自动高度、字数限制等功能。
|
|
3743
4484
|
*/
|
|
@@ -3851,6 +4592,119 @@ export declare interface TextAreaProps {
|
|
|
3851
4592
|
bindselection?: (event: BaseEvent<'bindselection', TextAreaSelectionChangeEvent>) => void;
|
|
3852
4593
|
}
|
|
3853
4594
|
|
|
4595
|
+
/**
|
|
4596
|
+
* 多行文本输入组件,支持自动高度、字数限制等功能。
|
|
4597
|
+
*/
|
|
4598
|
+
declare interface TextAreaProps_2 {
|
|
4599
|
+
/**
|
|
4600
|
+
* 组件样式
|
|
4601
|
+
*/
|
|
4602
|
+
style?: CSSProperties;
|
|
4603
|
+
/**
|
|
4604
|
+
* 组件类名
|
|
4605
|
+
*/
|
|
4606
|
+
className?: string;
|
|
4607
|
+
/**
|
|
4608
|
+
* 元素的唯一标识
|
|
4609
|
+
*/
|
|
4610
|
+
id?: string;
|
|
4611
|
+
/**
|
|
4612
|
+
* React key 属性
|
|
4613
|
+
*/
|
|
4614
|
+
key?: string | number | null | undefined;
|
|
4615
|
+
/**
|
|
4616
|
+
* 用于获取组件实例的 ref
|
|
4617
|
+
*/
|
|
4618
|
+
ref?: Ref<NodesRef>;
|
|
4619
|
+
/**
|
|
4620
|
+
* 占位符文本
|
|
4621
|
+
*/
|
|
4622
|
+
placeholder?: string;
|
|
4623
|
+
/**
|
|
4624
|
+
* 最大输入长度
|
|
4625
|
+
* @defaultValue 140
|
|
4626
|
+
*/
|
|
4627
|
+
maxlength?: number;
|
|
4628
|
+
/**
|
|
4629
|
+
* 最大行数
|
|
4630
|
+
*/
|
|
4631
|
+
maxlines?: number;
|
|
4632
|
+
/**
|
|
4633
|
+
* 行间距
|
|
4634
|
+
*/
|
|
4635
|
+
lineSpacing?: number | `${number}px` | `${number}rpx`;
|
|
4636
|
+
/**
|
|
4637
|
+
* 是否禁用
|
|
4638
|
+
* @defaultValue false
|
|
4639
|
+
*/
|
|
4640
|
+
disabled?: boolean;
|
|
4641
|
+
/**
|
|
4642
|
+
* 是否只读
|
|
4643
|
+
* @defaultValue false
|
|
4644
|
+
*/
|
|
4645
|
+
readonly?: boolean;
|
|
4646
|
+
/**
|
|
4647
|
+
* 键盘右下角确认按钮的类型
|
|
4648
|
+
* @defaultValue 'done'
|
|
4649
|
+
*/
|
|
4650
|
+
confirmType?: 'send' | 'search' | 'go' | 'done' | 'next';
|
|
4651
|
+
/**
|
|
4652
|
+
* 聚焦时是否显示软键盘
|
|
4653
|
+
* @defaultValue true
|
|
4654
|
+
*/
|
|
4655
|
+
showSoftInputOnFocus?: boolean;
|
|
4656
|
+
/**
|
|
4657
|
+
* iOS 弹性效果
|
|
4658
|
+
* @defaultValue true
|
|
4659
|
+
*/
|
|
4660
|
+
bounces?: boolean;
|
|
4661
|
+
/**
|
|
4662
|
+
* 输入内容变化时触发
|
|
4663
|
+
* @eventProperty
|
|
4664
|
+
*/
|
|
4665
|
+
onInput?: (event: BaseEvent<'bindinput', TextAreaInputEvent>) => void;
|
|
4666
|
+
/**
|
|
4667
|
+
* @deprecated 请使用 onInput 替代
|
|
4668
|
+
*/
|
|
4669
|
+
bindinput?: (event: BaseEvent<'bindinput', TextAreaInputEvent>) => void;
|
|
4670
|
+
/**
|
|
4671
|
+
* 聚焦时触发
|
|
4672
|
+
* @eventProperty
|
|
4673
|
+
*/
|
|
4674
|
+
onFocus?: (event: BaseEvent<'bindfocus', TextAreaFocusEvent>) => void;
|
|
4675
|
+
/**
|
|
4676
|
+
* @deprecated 请使用 onFocus 替代
|
|
4677
|
+
*/
|
|
4678
|
+
bindfocus?: (event: BaseEvent<'bindfocus', TextAreaFocusEvent>) => void;
|
|
4679
|
+
/**
|
|
4680
|
+
* 失焦时触发
|
|
4681
|
+
* @eventProperty
|
|
4682
|
+
*/
|
|
4683
|
+
onBlur?: (event: BaseEvent<'bindblur', TextAreaBlurEvent>) => void;
|
|
4684
|
+
/**
|
|
4685
|
+
* @deprecated 请使用 onBlur 替代
|
|
4686
|
+
*/
|
|
4687
|
+
bindblur?: (event: BaseEvent<'bindblur', TextAreaBlurEvent>) => void;
|
|
4688
|
+
/**
|
|
4689
|
+
* 点击键盘确认按钮时触发
|
|
4690
|
+
* @eventProperty
|
|
4691
|
+
*/
|
|
4692
|
+
onConfirm?: (event: BaseEvent<'bindconfirm', TextAreaConfirmEvent>) => void;
|
|
4693
|
+
/**
|
|
4694
|
+
* @deprecated 请使用 onConfirm 替代
|
|
4695
|
+
*/
|
|
4696
|
+
bindconfirm?: (event: BaseEvent<'bindconfirm', TextAreaConfirmEvent>) => void;
|
|
4697
|
+
/**
|
|
4698
|
+
* 选择区域变化时触发
|
|
4699
|
+
* @eventProperty
|
|
4700
|
+
*/
|
|
4701
|
+
onSelectionChange?: (event: BaseEvent<'bindselection', TextAreaSelectionChangeEvent>) => void;
|
|
4702
|
+
/**
|
|
4703
|
+
* @deprecated 请使用 onSelectionChange 替代
|
|
4704
|
+
*/
|
|
4705
|
+
bindselection?: (event: BaseEvent<'bindselection', TextAreaSelectionChangeEvent>) => void;
|
|
4706
|
+
}
|
|
4707
|
+
|
|
3854
4708
|
/**
|
|
3855
4709
|
* 文本渲染组件,是展示文字内容的基础元件,支持文字样式配置。
|
|
3856
4710
|
*/
|
|
@@ -4197,6 +5051,7 @@ export declare interface ViewProps {
|
|
|
4197
5051
|
bindlayoutchange?: (event: LayoutChangeEvent) => void;
|
|
4198
5052
|
}
|
|
4199
5053
|
|
|
5054
|
+
/** @public */
|
|
4200
5055
|
declare interface WebGLContextAttributes_2 {
|
|
4201
5056
|
/**
|
|
4202
5057
|
* 是否开启透明通道,开启后画布背景透明可与下层内容叠加显示
|