@dcloudio/uni-app-x 0.7.115 → 0.7.117
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/package.json +1 -1
- package/types/dom2-internal/UniElement.d.ts +1 -0
- package/types/dom2-internal/sharedData.d.ts +235 -127
- package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-api/lib/uni-editor/utssdk/interface.d.ts +57 -3
- package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/global.d.ts +2 -0
- package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/index.d.ts +1 -0
- package/types/uni/uts-plugin-component/lib/uni-editor/utssdk/interface.d.ts +57 -3
- package/types/node_modules/.package-lock.json +0 -20
- package/types/node_modules/typescript/LICENSE.txt +0 -55
- package/types/node_modules/typescript/ThirdPartyNoticeText.txt +0 -193
- package/types/node_modules/typescript/bin/tsc +0 -2
- package/types/node_modules/typescript/bin/tsserver +0 -2
- package/types/node_modules/typescript/lib/cancellationToken.js +0 -90
- package/types/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/de/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/es/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/it/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/lib.d.ts +0 -22
- package/types/node_modules/typescript/lib/lib.decorators.d.ts +0 -386
- package/types/node_modules/typescript/lib/lib.decorators.legacy.d.ts +0 -22
- package/types/node_modules/typescript/lib/lib.dom.asynciterable.d.ts +0 -33
- package/types/node_modules/typescript/lib/lib.dom.d.ts +0 -28596
- package/types/node_modules/typescript/lib/lib.dom.iterable.d.ts +0 -475
- package/types/node_modules/typescript/lib/lib.es2015.collection.d.ts +0 -147
- package/types/node_modules/typescript/lib/lib.es2015.core.d.ts +0 -597
- package/types/node_modules/typescript/lib/lib.es2015.d.ts +0 -28
- package/types/node_modules/typescript/lib/lib.es2015.generator.d.ts +0 -77
- package/types/node_modules/typescript/lib/lib.es2015.iterable.d.ts +0 -495
- package/types/node_modules/typescript/lib/lib.es2015.promise.d.ts +0 -81
- package/types/node_modules/typescript/lib/lib.es2015.proxy.d.ts +0 -128
- package/types/node_modules/typescript/lib/lib.es2015.reflect.d.ts +0 -144
- package/types/node_modules/typescript/lib/lib.es2015.symbol.d.ts +0 -46
- package/types/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts +0 -326
- package/types/node_modules/typescript/lib/lib.es2016.array.include.d.ts +0 -116
- package/types/node_modules/typescript/lib/lib.es2016.d.ts +0 -21
- package/types/node_modules/typescript/lib/lib.es2016.full.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.es2016.intl.d.ts +0 -31
- package/types/node_modules/typescript/lib/lib.es2017.d.ts +0 -25
- package/types/node_modules/typescript/lib/lib.es2017.date.d.ts +0 -31
- package/types/node_modules/typescript/lib/lib.es2017.full.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.es2017.intl.d.ts +0 -44
- package/types/node_modules/typescript/lib/lib.es2017.object.d.ts +0 -49
- package/types/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts +0 -135
- package/types/node_modules/typescript/lib/lib.es2017.string.d.ts +0 -45
- package/types/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts +0 -53
- package/types/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts +0 -77
- package/types/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts +0 -43
- package/types/node_modules/typescript/lib/lib.es2018.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2018.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2018.intl.d.ts +0 -83
- package/types/node_modules/typescript/lib/lib.es2018.promise.d.ts +0 -30
- package/types/node_modules/typescript/lib/lib.es2018.regexp.d.ts +0 -37
- package/types/node_modules/typescript/lib/lib.es2019.array.d.ts +0 -79
- package/types/node_modules/typescript/lib/lib.es2019.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2019.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2019.intl.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.es2019.object.d.ts +0 -33
- package/types/node_modules/typescript/lib/lib.es2019.string.d.ts +0 -37
- package/types/node_modules/typescript/lib/lib.es2019.symbol.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2020.bigint.d.ts +0 -727
- package/types/node_modules/typescript/lib/lib.es2020.d.ts +0 -27
- package/types/node_modules/typescript/lib/lib.es2020.date.d.ts +0 -42
- package/types/node_modules/typescript/lib/lib.es2020.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2020.intl.d.ts +0 -474
- package/types/node_modules/typescript/lib/lib.es2020.number.d.ts +0 -28
- package/types/node_modules/typescript/lib/lib.es2020.promise.d.ts +0 -47
- package/types/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts +0 -97
- package/types/node_modules/typescript/lib/lib.es2020.string.d.ts +0 -42
- package/types/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts +0 -37
- package/types/node_modules/typescript/lib/lib.es2021.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.es2021.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2021.intl.d.ts +0 -166
- package/types/node_modules/typescript/lib/lib.es2021.promise.d.ts +0 -48
- package/types/node_modules/typescript/lib/lib.es2021.string.d.ts +0 -33
- package/types/node_modules/typescript/lib/lib.es2021.weakref.d.ts +0 -76
- package/types/node_modules/typescript/lib/lib.es2022.array.d.ts +0 -121
- package/types/node_modules/typescript/lib/lib.es2022.d.ts +0 -26
- package/types/node_modules/typescript/lib/lib.es2022.error.d.ts +0 -73
- package/types/node_modules/typescript/lib/lib.es2022.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2022.intl.d.ts +0 -117
- package/types/node_modules/typescript/lib/lib.es2022.object.d.ts +0 -26
- package/types/node_modules/typescript/lib/lib.es2022.regexp.d.ts +0 -39
- package/types/node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts +0 -39
- package/types/node_modules/typescript/lib/lib.es2022.string.d.ts +0 -25
- package/types/node_modules/typescript/lib/lib.es2023.array.d.ts +0 -924
- package/types/node_modules/typescript/lib/lib.es2023.collection.d.ts +0 -21
- package/types/node_modules/typescript/lib/lib.es2023.d.ts +0 -22
- package/types/node_modules/typescript/lib/lib.es2023.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.es2023.intl.d.ts +0 -56
- package/types/node_modules/typescript/lib/lib.es5.d.ts +0 -4585
- package/types/node_modules/typescript/lib/lib.es6.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.esnext.array.d.ts +0 -35
- package/types/node_modules/typescript/lib/lib.esnext.collection.d.ts +0 -106
- package/types/node_modules/typescript/lib/lib.esnext.d.ts +0 -28
- package/types/node_modules/typescript/lib/lib.esnext.decorators.d.ts +0 -28
- package/types/node_modules/typescript/lib/lib.esnext.disposable.d.ts +0 -185
- package/types/node_modules/typescript/lib/lib.esnext.full.d.ts +0 -24
- package/types/node_modules/typescript/lib/lib.esnext.intl.d.ts +0 -21
- package/types/node_modules/typescript/lib/lib.esnext.object.d.ts +0 -29
- package/types/node_modules/typescript/lib/lib.esnext.promise.d.ts +0 -35
- package/types/node_modules/typescript/lib/lib.esnext.regexp.d.ts +0 -25
- package/types/node_modules/typescript/lib/lib.esnext.string.d.ts +0 -29
- package/types/node_modules/typescript/lib/lib.scripthost.d.ts +0 -322
- package/types/node_modules/typescript/lib/lib.webworker.asynciterable.d.ts +0 -33
- package/types/node_modules/typescript/lib/lib.webworker.d.ts +0 -9431
- package/types/node_modules/typescript/lib/lib.webworker.importscripts.d.ts +0 -23
- package/types/node_modules/typescript/lib/lib.webworker.iterable.d.ts +0 -276
- package/types/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/tsc.js +0 -129741
- package/types/node_modules/typescript/lib/tsserver.js +0 -621
- package/types/node_modules/typescript/lib/tsserverlibrary.d.ts +0 -17
- package/types/node_modules/typescript/lib/tsserverlibrary.js +0 -21
- package/types/node_modules/typescript/lib/typesMap.json +0 -497
- package/types/node_modules/typescript/lib/typescript.d.ts +0 -11240
- package/types/node_modules/typescript/lib/typescript.js +0 -194910
- package/types/node_modules/typescript/lib/typingsInstaller.js +0 -236
- package/types/node_modules/typescript/lib/watchGuard.js +0 -53
- package/types/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +0 -1880
- package/types/node_modules/typescript/package.json +0 -116
package/package.json
CHANGED
|
@@ -142,6 +142,7 @@ declare global {
|
|
|
142
142
|
getStyleBorderLeftWidth(): UniCSSUnitValue
|
|
143
143
|
/**
|
|
144
144
|
* 设置Flex相关CSS属性
|
|
145
|
+
* 注意:组合属性(如flex、flex-flow)不需要定义结构,由编译器拆分处理
|
|
145
146
|
*/
|
|
146
147
|
setStyleFlexDirection(value: UniCSSFlexDirectionType): void
|
|
147
148
|
getStyleFlexDirection(): UniCSSFlexDirectionType
|
|
@@ -333,220 +333,328 @@ declare global {
|
|
|
333
333
|
|
|
334
334
|
declare global {
|
|
335
335
|
/**
|
|
336
|
-
* 动态 sharedData
|
|
336
|
+
* 动态 sharedData 字段定义。
|
|
337
337
|
*
|
|
338
|
-
*
|
|
339
|
-
*
|
|
338
|
+
* 这里保留最小运行时需要的信息:
|
|
339
|
+
* - fieldId:字段编号
|
|
340
|
+
* - flagGroupId:所在 flag group
|
|
341
|
+
* - flagBit:所在 bit
|
|
340
342
|
*/
|
|
341
|
-
interface
|
|
343
|
+
interface UniSharedDataDynamicFieldDefinition {
|
|
342
344
|
/**
|
|
343
|
-
*
|
|
345
|
+
* 当前 template 内唯一的字段编号。
|
|
346
|
+
*/
|
|
347
|
+
readonly fieldId: number
|
|
348
|
+
|
|
349
|
+
/**
|
|
350
|
+
* 该字段对应的 flag group 编号。
|
|
351
|
+
*/
|
|
352
|
+
readonly flagGroupId: number
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* 该字段在 flag group 中对应的 bit。
|
|
356
|
+
*/
|
|
357
|
+
readonly flagBit: number
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
/**
|
|
361
|
+
* 动态 sharedData class 定义。
|
|
362
|
+
*
|
|
363
|
+
* 用于:
|
|
364
|
+
* - 构造动态 sharedData 实例时初始化字段槽
|
|
365
|
+
* - 初始化 flag group
|
|
366
|
+
* - 调试 / 诊断 / 宿主校验
|
|
367
|
+
*/
|
|
368
|
+
interface UniSharedDataDynamicClassDefinition {
|
|
369
|
+
/**
|
|
370
|
+
* 对齐静态 sharedData class 的名称。
|
|
344
371
|
*
|
|
345
|
-
*
|
|
372
|
+
* 主要用于调试、日志和对照,不参与热路径判断。
|
|
346
373
|
*/
|
|
347
374
|
readonly sharedDataClassName: string
|
|
348
375
|
|
|
349
376
|
/**
|
|
350
377
|
* 当前 template 内唯一的 sharedData class 编号。
|
|
351
378
|
*
|
|
352
|
-
*
|
|
379
|
+
* root page / root component 固定为 0。
|
|
353
380
|
*/
|
|
354
381
|
readonly sharedDataClassId: number
|
|
355
382
|
|
|
356
383
|
/**
|
|
357
|
-
*
|
|
384
|
+
* 当前 class 的字段数量。
|
|
358
385
|
*/
|
|
359
386
|
readonly fieldCount: number
|
|
360
387
|
|
|
361
388
|
/**
|
|
362
|
-
*
|
|
389
|
+
* 当前 class 的 flag group 数量。
|
|
363
390
|
*/
|
|
364
391
|
readonly flagGroupCount: number
|
|
365
392
|
|
|
366
393
|
/**
|
|
367
|
-
* 当前 class
|
|
368
|
-
*
|
|
369
|
-
* 动态实现通过这些字段声明完成 fieldId -> flag 标记。
|
|
370
|
-
*
|
|
371
|
-
* 当前阶段不额外放 `nullable` / `valueTag`:
|
|
372
|
-
* - 动态 `_setData(fieldId, value)` 不依赖这两类信息
|
|
373
|
-
* - 解释器读取 `getField(fieldId)` / `getFlag(flagGroupId)` 也不依赖
|
|
374
|
-
* - 如后续宿主实现证明需要,再单独补充
|
|
394
|
+
* 当前 class 的字段定义。
|
|
375
395
|
*/
|
|
376
|
-
readonly fields: ReadonlyArray<
|
|
396
|
+
readonly fields: ReadonlyArray<UniSharedDataDynamicFieldDefinition>
|
|
377
397
|
}
|
|
378
398
|
|
|
379
399
|
/**
|
|
380
|
-
* 动态 sharedData
|
|
400
|
+
* 动态 sharedData 的初始化参数。
|
|
401
|
+
*
|
|
402
|
+
* 这是 renderSharedData 直接使用的构造参数。
|
|
381
403
|
*/
|
|
382
|
-
interface
|
|
404
|
+
interface UniDynamicSharedDataInitOptions {
|
|
383
405
|
/**
|
|
384
|
-
*
|
|
406
|
+
* 当前动态 bundle 的稳定标识。
|
|
385
407
|
*/
|
|
386
|
-
readonly
|
|
408
|
+
readonly bundleKey: string
|
|
387
409
|
|
|
388
410
|
/**
|
|
389
|
-
*
|
|
411
|
+
* 当前实例对应的 sharedData class 编号。
|
|
412
|
+
*
|
|
413
|
+
* 约束:
|
|
414
|
+
* - root page:0
|
|
415
|
+
* - root component:0
|
|
416
|
+
* - scoped sharedData:编译器分配的实际 classId
|
|
390
417
|
*/
|
|
391
|
-
readonly
|
|
418
|
+
readonly sharedDataClassId: number
|
|
419
|
+
}
|
|
392
420
|
|
|
421
|
+
/**
|
|
422
|
+
* UniSharedDataDynamicState 的初始化参数。
|
|
423
|
+
*
|
|
424
|
+
* 这是宿主真实实现类在内部创建 state 时使用的参数。
|
|
425
|
+
* renderSharedData 不直接传这个对象。
|
|
426
|
+
*/
|
|
427
|
+
interface UniSharedDataDynamicStateOptions extends UniDynamicSharedDataInitOptions {
|
|
393
428
|
/**
|
|
394
|
-
*
|
|
429
|
+
* 按 bundleKey 读取原始二进制 bytes。
|
|
430
|
+
*
|
|
431
|
+
* 只负责读取 bytes。
|
|
432
|
+
* 缓存、decode、classDefinition 查询由当前仓库实现。
|
|
395
433
|
*/
|
|
396
|
-
readonly
|
|
434
|
+
readonly readBytes: (bundleKey: string) => Uint8Array
|
|
397
435
|
}
|
|
398
436
|
|
|
399
437
|
/**
|
|
400
|
-
* 普通动态 sharedData
|
|
401
|
-
*
|
|
402
|
-
* 解释器只依赖字段与 flag 读取。
|
|
403
|
-
*
|
|
404
|
-
* 非解释器使用的内部字段、方法,命名尽量贴近静态 sharedData:
|
|
405
|
-
* - 复用已有静态基类字段
|
|
406
|
-
* - 内部方法沿用 `_xxx` 风格
|
|
438
|
+
* 普通动态 sharedData 的最小读取协议。
|
|
407
439
|
*
|
|
408
|
-
*
|
|
440
|
+
* 解释器只依赖这些读取能力。
|
|
409
441
|
*/
|
|
410
442
|
interface IUniDynamicSharedData {
|
|
443
|
+
/**
|
|
444
|
+
* 当前实例所属 bundleKey。
|
|
445
|
+
*/
|
|
446
|
+
readonly _bundleKey: string
|
|
447
|
+
|
|
448
|
+
/**
|
|
449
|
+
* 当前实例对应的 sharedData class 编号。
|
|
450
|
+
*/
|
|
451
|
+
readonly _sharedDataClassId: number
|
|
452
|
+
|
|
453
|
+
/**
|
|
454
|
+
* 当前实例绑定的 class 定义。
|
|
455
|
+
*/
|
|
456
|
+
readonly _sharedDataClass: UniSharedDataDynamicClassDefinition
|
|
457
|
+
|
|
411
458
|
/**
|
|
412
459
|
* 按字段编号读取值。
|
|
413
|
-
*
|
|
414
|
-
* 这里的 `fieldId` 由编译器 shared schema 分配,
|
|
415
|
-
* 解释器与真实实现都以该编号作为统一索引。
|
|
416
460
|
*/
|
|
417
461
|
getField(fieldId: number): UniSharedDataAny
|
|
418
462
|
|
|
419
463
|
/**
|
|
420
|
-
* 按 flag
|
|
421
|
-
*
|
|
422
|
-
* 返回值与静态 sharedData 的 flag group 对齐,
|
|
423
|
-
* 解释器只关心位图值本身,不关心内部存储结构。
|
|
464
|
+
* 按 flag group 编号读取脏标记位图。
|
|
424
465
|
*/
|
|
425
466
|
getFlag(flagGroupId: number): number
|
|
426
467
|
}
|
|
427
468
|
|
|
428
469
|
/**
|
|
429
|
-
* 动态组件 sharedData
|
|
470
|
+
* 动态组件 sharedData 的最小读取协议。
|
|
430
471
|
*
|
|
431
|
-
* 对齐静态 renderer 会直接读取的
|
|
432
|
-
* - `_vueId`
|
|
433
|
-
* - `_flatten`
|
|
434
|
-
* - `_renderer`
|
|
472
|
+
* 对齐静态 renderer 会直接读取的 builtin。
|
|
435
473
|
*/
|
|
436
474
|
interface IUniDynamicSharedDataComponent extends IUniDynamicSharedData {
|
|
437
|
-
/**
|
|
438
|
-
* 返回组件或页面实例的 vueId。
|
|
439
|
-
*/
|
|
440
475
|
getVueId(): number
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* 返回组件当前 flatten 状态。
|
|
444
|
-
*/
|
|
445
476
|
getFlatten(): UniSharedDataComponentFlatten
|
|
446
|
-
|
|
447
|
-
/**
|
|
448
|
-
* 返回当前 renderer 类型。
|
|
449
|
-
*/
|
|
450
477
|
getRenderer(): UniSharedDataComponentRenderer
|
|
451
478
|
}
|
|
452
479
|
|
|
453
480
|
/**
|
|
454
|
-
* 动态页面 sharedData
|
|
481
|
+
* 动态页面 sharedData 的最小读取协议。
|
|
455
482
|
*
|
|
456
|
-
*
|
|
457
|
-
*
|
|
458
|
-
* 当前阶段 page 不额外增加读取能力,直接继承 component 接口。
|
|
459
|
-
* `_flushJobs`、`_render`、`_textLayouts` 等行为属于真实运行时职责,
|
|
460
|
-
* 不放进当前解释器契约。
|
|
483
|
+
* 当前阶段 page 不额外增加读取面,直接继承 component 协议。
|
|
461
484
|
*/
|
|
462
485
|
interface IUniDynamicSharedDataPage extends IUniDynamicSharedDataComponent {}
|
|
463
486
|
|
|
464
487
|
/**
|
|
465
|
-
*
|
|
488
|
+
* 动态 sharedData 的运行时状态对象。
|
|
466
489
|
*
|
|
467
|
-
*
|
|
468
|
-
*
|
|
490
|
+
* 职责:
|
|
491
|
+
* - load bytes
|
|
492
|
+
* - bundle cache
|
|
493
|
+
* - decode
|
|
494
|
+
* - sharedDataClassId -> classDefinition
|
|
495
|
+
* - 字段值存储
|
|
496
|
+
* - flags 存储
|
|
497
|
+
* - render callback 执行
|
|
469
498
|
*/
|
|
470
|
-
|
|
499
|
+
class UniSharedDataDynamicState {
|
|
500
|
+
constructor(owner: IUniDynamicSharedData | IUniDynamicSharedDataComponent | IUniDynamicSharedDataPage, options: UniSharedDataDynamicStateOptions)
|
|
501
|
+
|
|
502
|
+
/**
|
|
503
|
+
* 当前实例绑定的 classDefinition。
|
|
504
|
+
*/
|
|
505
|
+
getClassDefinition(): UniSharedDataDynamicClassDefinition
|
|
506
|
+
|
|
507
|
+
/**
|
|
508
|
+
* 读取字段值。
|
|
509
|
+
*/
|
|
510
|
+
getField(fieldId: number): UniSharedDataAny
|
|
511
|
+
|
|
512
|
+
/**
|
|
513
|
+
* 读取 flag group。
|
|
514
|
+
*/
|
|
515
|
+
getFlag(flagGroupId: number): number
|
|
516
|
+
|
|
517
|
+
/**
|
|
518
|
+
* 写字段值。
|
|
519
|
+
*
|
|
520
|
+
* 返回值表示该写入是否产生有效变化。
|
|
521
|
+
*/
|
|
522
|
+
setField(fieldId: number, value: UniSharedDataAny | null): boolean
|
|
523
|
+
|
|
471
524
|
/**
|
|
472
|
-
*
|
|
525
|
+
* 清空当前实例的 flags。
|
|
473
526
|
*/
|
|
474
|
-
|
|
527
|
+
resetFlags(): void
|
|
475
528
|
|
|
476
|
-
|
|
529
|
+
/**
|
|
530
|
+
* 执行动态 renderElement callback。
|
|
531
|
+
*
|
|
532
|
+
* 返回值必须和静态渲染一致。
|
|
533
|
+
*/
|
|
534
|
+
renderElement(): UniElementBlock
|
|
477
535
|
|
|
478
|
-
|
|
479
|
-
|
|
536
|
+
/**
|
|
537
|
+
* 执行动态 renderKotlinElement callback。
|
|
538
|
+
*
|
|
539
|
+
* 返回值必须和静态渲染一致。
|
|
540
|
+
*/
|
|
541
|
+
renderKotlinElement(): UniElementBlock
|
|
480
542
|
|
|
481
543
|
/**
|
|
482
|
-
*
|
|
483
|
-
* 但动态 `renderSharedData` 代码应优先传 `fieldId`,避免运行时再做
|
|
484
|
-
* `key -> fieldId` 匹配。
|
|
544
|
+
* 执行动态 renderNativeView callback。
|
|
485
545
|
*
|
|
486
|
-
*
|
|
487
|
-
* - `string`:兼容静态 sharedData 风格,仅做类型定义无需实现
|
|
488
|
-
* - `number`:动态 sharedData 主路径,表示 `fieldId`
|
|
546
|
+
* 返回值必须和静态渲染一致。
|
|
489
547
|
*/
|
|
490
|
-
|
|
491
|
-
abstract _setData(key: string, value: any | null): void
|
|
492
|
-
abstract _setData(fieldId: number, value: any | null): void
|
|
548
|
+
renderNativeView(): UniNativeViewBlock
|
|
493
549
|
}
|
|
494
550
|
|
|
495
551
|
/**
|
|
496
|
-
*
|
|
552
|
+
* 普通动态 scope sharedData。
|
|
497
553
|
*
|
|
498
|
-
*
|
|
499
|
-
*
|
|
500
|
-
*
|
|
501
|
-
* 这里的 class 继承表达“复用哪一个静态基类”:
|
|
502
|
-
* - component 复用 `UniSharedDataComponent`
|
|
503
|
-
*
|
|
504
|
-
* 因为这里不继承 `UniDynamicSharedData`,所以动态读取接口仍需显式声明,
|
|
505
|
-
* 不能只留在 `IUniDynamicSharedDataComponent` 里。
|
|
554
|
+
* 真实实现由宿主仓库提供。
|
|
555
|
+
* renderSharedData 会直接 new 该类。
|
|
506
556
|
*/
|
|
507
|
-
|
|
508
|
-
readonly
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
557
|
+
class UniDynamicSharedData extends UniSharedData implements IUniDynamicSharedData {
|
|
558
|
+
readonly _bundleKey: string
|
|
559
|
+
readonly _sharedDataClassId: number
|
|
560
|
+
readonly _sharedDataClass: UniSharedDataDynamicClassDefinition
|
|
561
|
+
readonly _dynamicState: UniSharedDataDynamicState
|
|
562
|
+
|
|
563
|
+
constructor(dynamicOptions: UniDynamicSharedDataInitOptions)
|
|
564
|
+
|
|
565
|
+
getField(fieldId: number): UniSharedDataAny
|
|
566
|
+
getFlag(flagGroupId: number): number
|
|
567
|
+
|
|
568
|
+
/**
|
|
569
|
+
* 仅做类型,动态 sharedData 不支持按 name 写入。
|
|
570
|
+
*/
|
|
571
|
+
_setData(name: string, value: UniSharedDataAny | null): void
|
|
572
|
+
/**
|
|
573
|
+
* 动态渲染始终按 fieldId 写入。
|
|
574
|
+
*/
|
|
575
|
+
_setData(fieldId: number, value: UniSharedDataAny | null): void
|
|
576
|
+
|
|
577
|
+
/**
|
|
578
|
+
* 对齐静态 sharedData 生命周期。
|
|
579
|
+
*/
|
|
580
|
+
_resetFlags(): void
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* 保持和静态渲染一致的 callback 入口。
|
|
584
|
+
*/
|
|
585
|
+
_renderElement(): UniElementBlock
|
|
586
|
+
_renderKotlinElement(): UniElementBlock
|
|
587
|
+
_renderNativeView(): UniNativeViewBlock
|
|
520
588
|
}
|
|
521
589
|
|
|
522
590
|
/**
|
|
523
|
-
*
|
|
591
|
+
* 动态组件 root sharedData。
|
|
524
592
|
*
|
|
525
|
-
*
|
|
526
|
-
*
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
593
|
+
* renderSharedData 会直接 new 该类,
|
|
594
|
+
* 且 sharedDataClassId 固定为 0。
|
|
595
|
+
*/
|
|
596
|
+
class UniDynamicSharedDataComponent extends UniSharedDataComponent implements IUniDynamicSharedDataComponent {
|
|
597
|
+
readonly _bundleKey: string
|
|
598
|
+
readonly _sharedDataClassId: number
|
|
599
|
+
readonly _sharedDataClass: UniSharedDataDynamicClassDefinition
|
|
600
|
+
readonly _dynamicState: UniSharedDataDynamicState
|
|
601
|
+
|
|
602
|
+
constructor(dynamicOptions: UniDynamicSharedDataInitOptions)
|
|
603
|
+
|
|
604
|
+
getField(fieldId: number): UniSharedDataAny
|
|
605
|
+
getFlag(flagGroupId: number): number
|
|
606
|
+
getVueId(): number
|
|
607
|
+
getFlatten(): UniSharedDataComponentFlatten
|
|
608
|
+
getRenderer(): UniSharedDataComponentRenderer
|
|
609
|
+
/**
|
|
610
|
+
* 仅做类型,动态 sharedData 不支持按 name 写入。
|
|
611
|
+
*/
|
|
612
|
+
_setData(name: string, value: UniSharedDataAny | null): void
|
|
613
|
+
/**
|
|
614
|
+
* 动态渲染始终按 fieldId 写入。
|
|
615
|
+
*/
|
|
616
|
+
_setData(fieldId: number, value: UniSharedDataAny | null): void
|
|
617
|
+
|
|
618
|
+
_resetFlags(): void
|
|
619
|
+
|
|
620
|
+
_renderElement(): UniElementBlock
|
|
621
|
+
_renderKotlinElement(): UniElementBlock
|
|
622
|
+
_renderNativeView(): UniNativeViewBlock
|
|
623
|
+
}
|
|
624
|
+
|
|
625
|
+
/**
|
|
626
|
+
* 动态页面 root sharedData。
|
|
533
627
|
*
|
|
534
|
-
*
|
|
535
|
-
*
|
|
628
|
+
* renderSharedData 会直接 new 该类,
|
|
629
|
+
* 且 sharedDataClassId 固定为 0。
|
|
536
630
|
*/
|
|
537
|
-
|
|
538
|
-
readonly
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
631
|
+
class UniDynamicSharedDataPage extends UniSharedDataPage implements IUniDynamicSharedDataPage {
|
|
632
|
+
readonly _bundleKey: string
|
|
633
|
+
readonly _sharedDataClassId: number
|
|
634
|
+
readonly _sharedDataClass: UniSharedDataDynamicClassDefinition
|
|
635
|
+
readonly _dynamicState: UniSharedDataDynamicState
|
|
636
|
+
|
|
637
|
+
constructor(dynamicOptions: UniDynamicSharedDataInitOptions)
|
|
638
|
+
|
|
639
|
+
getField(fieldId: number): UniSharedDataAny
|
|
640
|
+
getFlag(flagGroupId: number): number
|
|
641
|
+
getVueId(): number
|
|
642
|
+
getFlatten(): UniSharedDataComponentFlatten
|
|
643
|
+
getRenderer(): UniSharedDataComponentRenderer
|
|
644
|
+
|
|
645
|
+
/**
|
|
646
|
+
* 仅做类型,动态 sharedData 不支持按 name 写入。
|
|
647
|
+
*/
|
|
648
|
+
_setData(name: string, value: UniSharedDataAny | null): void
|
|
649
|
+
/**
|
|
650
|
+
* 动态渲染始终按 fieldId 写入。
|
|
651
|
+
*/
|
|
652
|
+
_setData(fieldId: number, value: UniSharedDataAny | null): void
|
|
653
|
+
_resetFlags(): void
|
|
654
|
+
|
|
655
|
+
_renderElement(): UniElementBlock
|
|
656
|
+
_renderKotlinElement(): UniElementBlock
|
|
657
|
+
_renderNativeView(): UniNativeViewBlock
|
|
550
658
|
}
|
|
551
659
|
}
|
|
552
660
|
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
UniEditorElementOptions as UniEditorElementOptionsOrigin,
|
|
7
7
|
UniEditorElementInsertImageOptions as UniEditorElementInsertImageOptionsOrigin,
|
|
8
8
|
UniEditorElementInsertTextOptions as UniEditorElementInsertTextOptionsOrigin,
|
|
9
|
+
UniEditorElementInsertMentionOptions as UniEditorElementInsertMentionOptionsOrigin,
|
|
9
10
|
UniEditorElementSetContentsOptions as UniEditorElementSetContentsOptionsOrigin,
|
|
10
11
|
UniEditorElementGetSelectionTextOptionsRes as UniEditorElementGetSelectionTextOptionsResOrigin,
|
|
11
12
|
UniEditorElementGetSelectionTextOptions as UniEditorElementGetSelectionTextOptionsOrigin,
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
type UniEditorElementOptions = UniEditorElementOptionsOrigin
|
|
26
27
|
type UniEditorElementInsertImageOptions = UniEditorElementInsertImageOptionsOrigin
|
|
27
28
|
type UniEditorElementInsertTextOptions = UniEditorElementInsertTextOptionsOrigin
|
|
29
|
+
type UniEditorElementInsertMentionOptions = UniEditorElementInsertMentionOptionsOrigin
|
|
28
30
|
type UniEditorElementSetContentsOptions = UniEditorElementSetContentsOptionsOrigin
|
|
29
31
|
type UniEditorElementGetSelectionTextOptionsRes = UniEditorElementGetSelectionTextOptionsResOrigin
|
|
30
32
|
type UniEditorElementGetSelectionTextOptions = UniEditorElementGetSelectionTextOptionsOrigin
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
UniEditorElementOptions,
|
|
7
7
|
UniEditorElementInsertImageOptions,
|
|
8
8
|
UniEditorElementInsertTextOptions,
|
|
9
|
+
UniEditorElementInsertMentionOptions,
|
|
9
10
|
UniEditorElementSetContentsOptions,
|
|
10
11
|
UniEditorElementGetSelectionTextOptionsRes,
|
|
11
12
|
UniEditorElementGetSelectionTextOptions,
|
|
@@ -33,6 +33,35 @@ export type UniEditorElementInsertTextOptions = {
|
|
|
33
33
|
complete ?: ((res : UniEditorElementOptionsCompleteRes) => void) | null
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
export type UniEditorElementInsertMentionOptions = {
|
|
37
|
+
/**
|
|
38
|
+
* 被 @ 的人 id
|
|
39
|
+
*/
|
|
40
|
+
id ?: string | null,
|
|
41
|
+
/**
|
|
42
|
+
* 被 @ 的人名字
|
|
43
|
+
*/
|
|
44
|
+
name?: string | null,
|
|
45
|
+
/**
|
|
46
|
+
* 提及文本颜色,默认为 #1677ff
|
|
47
|
+
* @defaultValue #1677ff
|
|
48
|
+
*/
|
|
49
|
+
color?: string | null,
|
|
50
|
+
/**
|
|
51
|
+
* 提及背景颜色,默认为 #e6f3ff
|
|
52
|
+
* @defaultValue #e6f3ff
|
|
53
|
+
*/
|
|
54
|
+
background?: string | null,
|
|
55
|
+
/**
|
|
56
|
+
* 提及圆角,默认为 4px
|
|
57
|
+
* @defaultValue 4px
|
|
58
|
+
*/
|
|
59
|
+
radius?: string | null,
|
|
60
|
+
success ?: ((res : UniEditorElementOptionsSuccessRes) => void) | null
|
|
61
|
+
fail ?: ((res : UniEditorElementOptionsFailRes) => void) | null
|
|
62
|
+
complete ?: ((res : UniEditorElementOptionsCompleteRes) => void) | null
|
|
63
|
+
}
|
|
64
|
+
|
|
36
65
|
export type UniEditorElementSetContentsOptions = {
|
|
37
66
|
delta ?: any | null,
|
|
38
67
|
html ?: string | null,
|
|
@@ -70,6 +99,7 @@ export interface IUniEditorElement extends UniElement {
|
|
|
70
99
|
insertDivider(options : UniEditorElementOptions | null) : void
|
|
71
100
|
insertImage(options : UniEditorElementInsertImageOptions | null) : void
|
|
72
101
|
insertText(options : UniEditorElementInsertTextOptions | null) : void
|
|
102
|
+
insertMention(options ?: UniEditorElementInsertMentionOptions | null) : void
|
|
73
103
|
setContents(options : UniEditorElementSetContentsOptions | null) : void
|
|
74
104
|
getContents(options : UniEditorElementGetContentsOptions | null) : void
|
|
75
105
|
clear(options : UniEditorElementOptions | null) : void
|
|
@@ -554,6 +584,30 @@ export interface EditorContext {
|
|
|
554
584
|
* }
|
|
555
585
|
*/
|
|
556
586
|
insertText(options ?: UniEditorElementInsertTextOptions | null) : void
|
|
587
|
+
/**
|
|
588
|
+
* 插入可整块删除的提及,提及文本默认为 @名字,当选区存在时覆盖选区文本,当选区不存在时插入到光标处
|
|
589
|
+
* @uniPlatform {
|
|
590
|
+
* "app": {
|
|
591
|
+
* "android": {
|
|
592
|
+
* "osVer": "4.4",
|
|
593
|
+
* "uniVer": "x",
|
|
594
|
+
* "unixVer": "5.04"
|
|
595
|
+
* },
|
|
596
|
+
* "ios": {
|
|
597
|
+
* "osVer": "12.0",
|
|
598
|
+
* "uniVer": "x",
|
|
599
|
+
* "unixVer": "5.04"
|
|
600
|
+
* },
|
|
601
|
+
* "harmony": {
|
|
602
|
+
* "osVer": "√",
|
|
603
|
+
* "uniVer": "x",
|
|
604
|
+
* "unixVer": "5.04",
|
|
605
|
+
* "unixVaporVer": "5.04"
|
|
606
|
+
* }
|
|
607
|
+
* },
|
|
608
|
+
* }
|
|
609
|
+
*/
|
|
610
|
+
insertMention(options ?: UniEditorElementInsertMentionOptions | null) : void
|
|
557
611
|
/**
|
|
558
612
|
* 初始化编辑器内容,html和delta同时存在时仅delta生效
|
|
559
613
|
* @uniPlatform {
|
|
@@ -771,8 +825,8 @@ export interface EditorContext {
|
|
|
771
825
|
*/
|
|
772
826
|
blur(options ?: UniEditorElementOptions | null) : void
|
|
773
827
|
}
|
|
774
|
-
|
|
775
|
-
export type CreateEditorContextAsync = (options: CreateEditorContextAsyncOptions) => void
|
|
828
|
+
|
|
829
|
+
export type CreateEditorContextAsync = (options: CreateEditorContextAsyncOptions) => void
|
|
776
830
|
|
|
777
831
|
export interface Uni {
|
|
778
832
|
/**
|
|
@@ -852,4 +906,4 @@ export interface Uni {
|
|
|
852
906
|
* @tutorial https://doc.dcloud.net.cn/uni-app-x/api/create-editor-context-async.html
|
|
853
907
|
*/
|
|
854
908
|
createEditorContextAsync : CreateEditorContextAsync
|
|
855
|
-
}
|
|
909
|
+
}
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
UniEditorElementOptions as UniEditorElementOptionsOrigin,
|
|
7
7
|
UniEditorElementInsertImageOptions as UniEditorElementInsertImageOptionsOrigin,
|
|
8
8
|
UniEditorElementInsertTextOptions as UniEditorElementInsertTextOptionsOrigin,
|
|
9
|
+
UniEditorElementInsertMentionOptions as UniEditorElementInsertMentionOptionsOrigin,
|
|
9
10
|
UniEditorElementSetContentsOptions as UniEditorElementSetContentsOptionsOrigin,
|
|
10
11
|
UniEditorElementGetSelectionTextOptionsRes as UniEditorElementGetSelectionTextOptionsResOrigin,
|
|
11
12
|
UniEditorElementGetSelectionTextOptions as UniEditorElementGetSelectionTextOptionsOrigin,
|
|
@@ -25,6 +26,7 @@
|
|
|
25
26
|
type UniEditorElementOptions = UniEditorElementOptionsOrigin
|
|
26
27
|
type UniEditorElementInsertImageOptions = UniEditorElementInsertImageOptionsOrigin
|
|
27
28
|
type UniEditorElementInsertTextOptions = UniEditorElementInsertTextOptionsOrigin
|
|
29
|
+
type UniEditorElementInsertMentionOptions = UniEditorElementInsertMentionOptionsOrigin
|
|
28
30
|
type UniEditorElementSetContentsOptions = UniEditorElementSetContentsOptionsOrigin
|
|
29
31
|
type UniEditorElementGetSelectionTextOptionsRes = UniEditorElementGetSelectionTextOptionsResOrigin
|
|
30
32
|
type UniEditorElementGetSelectionTextOptions = UniEditorElementGetSelectionTextOptionsOrigin
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
UniEditorElementOptions,
|
|
7
7
|
UniEditorElementInsertImageOptions,
|
|
8
8
|
UniEditorElementInsertTextOptions,
|
|
9
|
+
UniEditorElementInsertMentionOptions,
|
|
9
10
|
UniEditorElementSetContentsOptions,
|
|
10
11
|
UniEditorElementGetSelectionTextOptionsRes,
|
|
11
12
|
UniEditorElementGetSelectionTextOptions,
|