@gct-paas/word 1.0.2 → 1.0.3-beta.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.
Files changed (128) hide show
  1. package/README.md +20 -11
  2. package/dist/browser.js +1 -1
  3. package/dist/chunks/{ModelEditor-CXoezurC.js → ModelEditor-DqavEAJg.js} +113 -4
  4. package/dist/chunks/ModelEditor-DqavEAJg.js.map +1 -0
  5. package/dist/chunks/NodeFactory-DzFnWaWf.js +500 -0
  6. package/dist/chunks/NodeFactory-DzFnWaWf.js.map +1 -0
  7. package/dist/chunks/{browser-DY0wE3Uz.js → browser-OAJIVM8O.js} +412 -185
  8. package/dist/chunks/browser-OAJIVM8O.js.map +1 -0
  9. package/dist/chunks/legacy-template-converter-DFsd-elN.js +125 -0
  10. package/dist/chunks/legacy-template-converter-DFsd-elN.js.map +1 -0
  11. package/dist/chunks/migrate-YJTylIpz.js +5193 -0
  12. package/dist/chunks/migrate-YJTylIpz.js.map +1 -0
  13. package/dist/chunks/{sdk-Dz96Ca_-.js → sdk-BmwE5mZn.js} +1069 -615
  14. package/dist/chunks/sdk-BmwE5mZn.js.map +1 -0
  15. package/dist/chunks/src-BFXPGLus.js +3338 -0
  16. package/dist/chunks/src-BFXPGLus.js.map +1 -0
  17. package/dist/chunks/{table-borders-Dwuj7lFp.js → table-borders-B9bZMj5o.js} +2 -2
  18. package/dist/chunks/{table-borders-Dwuj7lFp.js.map → table-borders-B9bZMj5o.js.map} +1 -1
  19. package/dist/chunks/templates-Djcl21k4.js.map +1 -1
  20. package/dist/chunks/{types-Bq4hbWKT.js → types-CMkQ6Lvg.js} +122 -6
  21. package/dist/chunks/types-CMkQ6Lvg.js.map +1 -0
  22. package/dist/chunks/{NodeFactory-D9gVGSok.js → validation-DkCy8wHI.js} +10 -495
  23. package/dist/chunks/validation-DkCy8wHI.js.map +1 -0
  24. package/dist/docx.js +3 -2
  25. package/dist/docx.js.map +1 -1
  26. package/dist/index.js +6 -5
  27. package/dist/legacy.js +1 -0
  28. package/dist/platform.js +2 -2
  29. package/dist/style.css +760 -480
  30. package/dist/types/adapters/browser/canvas/CanvasPages.d.ts +1 -1
  31. package/dist/types/adapters/browser/canvas/paint-context.d.ts +4 -0
  32. package/dist/types/adapters/browser/canvas/paint-signature.d.ts +4 -0
  33. package/dist/types/adapters/browser/input/SignatureFieldInput.d.ts +10 -1
  34. package/dist/types/adapters/browser/input/signature-panel.d.ts +6 -0
  35. package/dist/types/adapters/browser/input/validation/CanvasValidationPanel.d.ts +1 -1
  36. package/dist/types/adapters/browser/input/word-error-text.d.ts +8 -2
  37. package/dist/types/adapters/platform/index.d.ts +1 -0
  38. package/dist/types/adapters/platform/templates.d.ts +11 -1
  39. package/dist/types/adapters/vue/GctWordPrintRenderer.vue.d.ts +1 -1
  40. package/dist/types/adapters/vue/GctWordTemplateDesigner.vue.d.ts +3 -0
  41. package/dist/types/adapters/vue/SignatureCardReader.vue.d.ts +1 -0
  42. package/dist/types/adapters/vue/SignatureVisual.vue.d.ts +10 -0
  43. package/dist/types/adapters/vue/WordFeedback.vue.d.ts +11 -0
  44. package/dist/types/adapters/vue/WordLayoutNotices.vue.d.ts +8 -0
  45. package/dist/types/adapters/vue/WordOperationError.vue.d.ts +11 -0
  46. package/dist/types/adapters/vue/field-properties/dependency-strategies.d.ts +7 -0
  47. package/dist/types/adapters/vue/index.d.ts +1 -0
  48. package/dist/types/adapters/vue/layout-notices.d.ts +15 -0
  49. package/dist/types/adapters/vue/legacy-template-converter.d.ts +14 -0
  50. package/dist/types/adapters/vue/region-properties/WordBusinessRegion.vue.d.ts +3 -0
  51. package/dist/types/adapters/vue/region-properties/WordDataLockConfig.vue.d.ts +16 -0
  52. package/dist/types/adapters/vue/useWordWorkspace.d.ts +6 -3
  53. package/dist/types/adapters/vue/word-feedback.d.ts +21 -0
  54. package/dist/types/data/DataManager.d.ts +2 -2
  55. package/dist/types/data/rows/copy-row.d.ts +5 -0
  56. package/dist/types/data/services/DataDependencies.d.ts +2 -2
  57. package/dist/types/data/types/manager.d.ts +2 -0
  58. package/dist/types/data/types/rules.d.ts +8 -1
  59. package/dist/types/import/legacy/autofill.d.ts +3 -0
  60. package/dist/types/import/legacy/bindings.d.ts +9 -0
  61. package/dist/types/import/legacy/boundary.d.ts +10 -0
  62. package/dist/types/import/legacy/business-fields.d.ts +25 -0
  63. package/dist/types/import/legacy/context.d.ts +61 -0
  64. package/dist/types/import/legacy/data-sources.d.ts +29 -0
  65. package/dist/types/import/legacy/document-rules.d.ts +38 -0
  66. package/dist/types/import/legacy/document-signature.d.ts +16 -0
  67. package/dist/types/import/legacy/fields.d.ts +34 -0
  68. package/dist/types/import/legacy/index.d.ts +3 -0
  69. package/dist/types/import/legacy/initialization.d.ts +34 -0
  70. package/dist/types/import/legacy/json-data.d.ts +25 -0
  71. package/dist/types/import/legacy/materials.d.ts +40 -0
  72. package/dist/types/import/legacy/media.d.ts +18 -0
  73. package/dist/types/import/legacy/metadata.d.ts +23 -0
  74. package/dist/types/import/legacy/migrate.d.ts +9 -0
  75. package/dist/types/import/legacy/page-widgets.d.ts +30 -0
  76. package/dist/types/import/legacy/relations.d.ts +25 -0
  77. package/dist/types/import/legacy/scalar-fields.d.ts +7 -0
  78. package/dist/types/import/legacy/styles.d.ts +52 -0
  79. package/dist/types/import/legacy/table-variants.d.ts +18 -0
  80. package/dist/types/import/legacy/tables.d.ts +27 -0
  81. package/dist/types/import/legacy/trace-fields.d.ts +21 -0
  82. package/dist/types/import/legacy/types.d.ts +141 -0
  83. package/dist/types/import/legacy/widget-presentation.d.ts +10 -0
  84. package/dist/types/layout/engine/atoms/control-text.d.ts +16 -0
  85. package/dist/types/layout/engine/atoms/field-control.d.ts +0 -13
  86. package/dist/types/layout/engine/atoms/signatures.d.ts +2 -2
  87. package/dist/types/layout/engine/blocks/placement-types.d.ts +7 -0
  88. package/dist/types/layout/engine/pagination/content-flow.d.ts +8 -0
  89. package/dist/types/layout/engine/tables/place-table-window.d.ts +3 -2
  90. package/dist/types/layout/engine/tables/row-flow.d.ts +3 -2
  91. package/dist/types/layout/engine/tables/table-flow.d.ts +3 -1
  92. package/dist/types/layout/geometry/control-brackets.d.ts +4 -0
  93. package/dist/types/layout/types/presentation/controls.d.ts +13 -0
  94. package/dist/types/layout/types/presentation/images.d.ts +8 -0
  95. package/dist/types/layout/types/presentation/signatures.d.ts +6 -0
  96. package/dist/types/model/business/business-types.d.ts +9 -1
  97. package/dist/types/model/business/data-lock-config.d.ts +27 -0
  98. package/dist/types/runtime/form/business/signatures/NativeSignatures.d.ts +3 -1
  99. package/dist/types/runtime/form/business/signatures/device-signature-lock.d.ts +2 -0
  100. package/dist/types/runtime/form/business/tables/row-fields.d.ts +1 -1
  101. package/dist/types/runtime/form/copy-field-paths.d.ts +3 -0
  102. package/dist/types/runtime/form/fields/core/rules/CommonFieldRules.d.ts +5 -1
  103. package/dist/types/runtime/form/validation/NativeFieldValidation.d.ts +14 -2
  104. package/dist/types/runtime/form/validation/targets.d.ts +1 -1
  105. package/dist/types/runtime/form/validation/types.d.ts +2 -0
  106. package/dist/types/runtime/interaction/EditorController.d.ts +2 -0
  107. package/dist/types/runtime/interaction/browse/types.d.ts +5 -0
  108. package/dist/types/runtime/interaction/design/format/EditorFormat.d.ts +2 -2
  109. package/dist/types/runtime/interaction/design/format/summary.d.ts +1 -2
  110. package/dist/types/runtime/interaction/design/format/targets.d.ts +11 -0
  111. package/dist/types/runtime/interaction/design/format/types.d.ts +3 -3
  112. package/dist/types/runtime/interaction/design/tables/regions/definitions.d.ts +7 -0
  113. package/dist/types/runtime/interaction/field-signature.d.ts +3 -0
  114. package/dist/types/runtime/presentation/fields/signatures.d.ts +5 -2
  115. package/dist/types/shared/platform-gct/form-credentials.d.ts +0 -1
  116. package/dist/types/shared/platform-gct/templates.d.ts +2 -0
  117. package/dist/types/shared/signature-graphic.d.ts +27 -0
  118. package/dist/types/shared/text/shading.d.ts +12 -0
  119. package/dist/types/shared/ui/select/src/select.types.d.ts +2 -0
  120. package/dist/types/shared/ui/tree-select/src/unified-tree-select.vue.d.ts +1 -1
  121. package/dist/vue.js +2101 -4470
  122. package/dist/vue.js.map +1 -1
  123. package/package.json +9 -3
  124. package/dist/chunks/ModelEditor-CXoezurC.js.map +0 -1
  125. package/dist/chunks/NodeFactory-D9gVGSok.js.map +0 -1
  126. package/dist/chunks/browser-DY0wE3Uz.js.map +0 -1
  127. package/dist/chunks/sdk-Dz96Ca_-.js.map +0 -1
  128. package/dist/chunks/types-Bq4hbWKT.js.map +0 -1
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @file 文档规则迁移:归并唯一判定树与单位转换声明,拆出显示缓存及无消费属性。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext } from './context';
6
+ import type { JsonObject } from '../../model';
7
+ /** 将实际文档规则转成一份声明树和最小单位转换配置,不导入旧执行器或界面组件。 */
8
+ export declare class LegacyDocumentRules {
9
+ private readonly c;
10
+ /** 每份源模板独立使用的诊断与资产上下文。 */
11
+ constructor(c: MigrationContext);
12
+ /** 读取已知文档级规则键,未知配置继续阻断正式迁移。 */
13
+ convert(value: unknown, path: string): JsonObject;
14
+ /** 规则树是唯一事实;旧查询缓存必须与树一致,不能靠未经确认的优先级覆盖。 */
15
+ private inspection;
16
+ /** 先核对旧缓存,再按既有布尔消费语义规范固定值;原始表示单独记录,不改变输入。 */
17
+ private normalizeBooleans;
18
+ /** 读取有稳定局部身份的树节点,移除可由拥有结构推导的父级、层级和样式信息。 */
19
+ private node;
20
+ /** 只保留业务模型和字段地址,将字段名、选项和接口身份快照移到迁移附件。 */
21
+ private field;
22
+ /** 右值只有一种模式;字段模式的重复 result 键必须与完整地址一致。 */
23
+ private operand;
24
+ /** 根据已核对的旧序列化规则重建查询缓存,只用于一致性核对,不存回新 model。 */
25
+ private queryCache;
26
+ /** 单位转换规则保留外部身份、表达式和映射,去掉固定 UI 行的重复包装。 */
27
+ private conversion;
28
+ /** 单位、数量输入和公式参数分别表达,禁止多层选择器编码变成业务字段地址。 */
29
+ private mapping;
30
+ /** 固定行在实际执行器中始终读取当前物耗行,额外模型选择只是旧界面派生元数据。 */
31
+ private relativeMetadata;
32
+ /** 仅剥离已核对类型的 UI 元信息,不把任意未知子树标成缓存丢掉。 */
33
+ private metadata;
34
+ /** 严格解析内嵌 JSON,错误、过深或未知格式不回退成空配置。 */
35
+ private json;
36
+ /** 声明中的列表必须确为数组,非法值不能按空列表当作成功迁移。 */
37
+ private list;
38
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @file 签名互斥迁移:保留有效的签名地址、作用范围与互斥配置。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext } from './context';
6
+ import type { JsonObject } from '../../model';
7
+ /** 将旧签名校验的业务路径拆成唯一地址,不生成绑定、节点身份或运行时比较缓存。 */
8
+ export declare class LegacyDocumentSignature {
9
+ private readonly c;
10
+ /** 只持有本次迁移上下文,没有跨模板签名配置缓存。 */
11
+ constructor(c: MigrationContext);
12
+ /** 读取文档级签名开关及规则;关闭时仍保留声明,不调用在线签名执行器。 */
13
+ convert(config: Record<string, unknown>, path: string): JsonObject;
14
+ /** 旧执行器只支持主表字段或子表.字段,超过两段时阻断,不猜测嵌套或画布行号。 */
15
+ private address;
16
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @file 字段迁移协调器:分派常用或业务字段,处理配置、范围、枚举选项与附属内容。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext } from './context';
6
+ import type { FieldNode } from '../../model';
7
+ /** 转换字段配置和附属字段,不引用 manifest、Vue、权限或填报状态。 */
8
+ export declare class LegacyFields {
9
+ private readonly c;
10
+ /** 旧字段实例 ID 不得来自不同源位置;共享浮层的同源复制允许重复,绑定路径可共享。 */
11
+ private readonly occurrences;
12
+ /** 本次迁移的业务字段适配器,不挂载到文档或全局对象。 */
13
+ private readonly business;
14
+ /** 本次迁移的人员/部门和记录关联适配器。 */
15
+ private readonly relations;
16
+ /** 记录选择器共用基础关联配置,追溯专属声明由此局部适配器补齐。 */
17
+ private readonly trace;
18
+ /** 仅保存本次迁移的局部上下文。 */
19
+ constructor(c: MigrationContext);
20
+ /** 从旧 widgetMeta 构造字段与绑定,run.valuePath 与元数据必须一致。 */
21
+ convert(value: unknown, path: string, runPath?: unknown, attached?: boolean, anchored?: boolean): FieldNode;
22
+ /** 沿用实际间距消费者的标量规范化;对象/数组没有设计契约,明确阻断而不执行隐式转换。 */
23
+ private spacing;
24
+ /** 挑选共享属性;输入边界已省略 undefined,显式空串、false、0 和 null 都保留。 */
25
+ private common;
26
+ /** 将范围模式收拢为唯一声明;沿用旧校验器的空端点草稿语义,不丢失选中模式。 */
27
+ private range;
28
+ /** 旧面板切换模式只更新模式键;未生效的已知草稿独立归档,错误形状仍阻断。 */
29
+ private inactiveRange;
30
+ /** 解析旧枚举 JSON 字符串,解析失败不回退成空选项。 */
31
+ private options;
32
+ /** 将 MultipleItem 列表变成独立附属内容树,条件只保存在父字段上。 */
33
+ private attachment;
34
+ }
@@ -0,0 +1,3 @@
1
+ /** @file Word 旧模板转换子入口,主入口和原生运行时不加载转换算法。 */
2
+ export { inspectLegacyTemplate, migrateLegacyTemplate } from './migrate';
3
+ export type * from './types';
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @file 旧初始化迁移:归并参数、查询、请求结构和结果目标,并组织新数源与字段填充转换。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext } from './context';
6
+ import type { JsonObject } from '../../model';
7
+ /** 读取已核对的参数映射与初始化查询,迁移时不调用模型加载器、SQL 解析器或业务网络。 */
8
+ export declare class LegacyInitialization {
9
+ private readonly c;
10
+ /** 当前模板的局部迁移上下文,没有跨文档缓存。 */
11
+ constructor(c: MigrationContext);
12
+ /** 已知初始化与对象策略映射到同一版本化配置,外部 BOM 基线通过报告返回。 */
13
+ convert(value: unknown, path: string): JsonObject;
14
+ /** 同组模型和子表地址仅保存一次;旧逐字段 model 只在实际被用作回退时保留。 */
15
+ private parameterMapping;
16
+ /** 查询保留来源、条件和目标组,忽略的字段选择器编码不会进入业务协议。 */
17
+ private query;
18
+ /** 按旧执行器真实来源语义转换,错误或不相容的非空休眠配置不静默丢掉。 */
19
+ private source;
20
+ /** 将普通来源与关联路径收敛成互斥声明,cascaderKey 仅留在迁移附件。 */
21
+ private resultMapping;
22
+ /** 解码请求参数的闭合树,属性类型和原文只保存一次,绝不求值实参。 */
23
+ private request;
24
+ /** 目标子表身份只由明确的旧子表标记导入,不因存在一个陈旧键而猜测作用域。 */
25
+ private targetScope;
26
+ /** 组件参数是旧执行器明确采用的缺省,未选参数键不生成当前值或假身份。 */
27
+ private parameter;
28
+ /** 明确的空选择整理为缺省,非字符串值仍诊断,不能借清理空值吞掉非法类型。 */
29
+ private copyStrings;
30
+ /** 严格读取嵌套 JSON;仅已知的空请求输入可以表示无参数定义。 */
31
+ private json;
32
+ /** 要求真实列表,不以空数组替代未知的源数据形状。 */
33
+ private list;
34
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @file JSON 数据边界:检查值、访问器、循环引用和绝对深度,区分公开输入与编辑日志的限制。
3
+ * 阅读定位:validation/ · 核心结构、语义与 JSON 边界校验。
4
+ */
5
+ import type { ValidationIssue } from '../../model';
6
+ export declare const at: (path: string, key: string | number) => string;
7
+ export declare function issue(issues: ValidationIssue[], path: string, code: string, message: string): void;
8
+ /** 文档和片段的默认绝对 JSON 深度。 */
9
+ export declare const DEFAULT_DOCUMENT_DEPTH = 200;
10
+ /** 文档和片段可显式配置的最高绝对 JSON 深度。 */
11
+ export declare const MAX_DOCUMENT_DEPTH = 500;
12
+ /** 递归只读 JSON 载荷,具名递归避免公共查询类型无限展开任意初值。 */
13
+ export type ReadonlyJsonValue = null | boolean | number | string | readonly ReadonlyJsonValue[] | ReadonlyJsonObject;
14
+ /** 持久化 JSON 对象的只读视图,不允许调用方修改嵌套值。 */
15
+ export interface ReadonlyJsonObject {
16
+ /** 动态业务键,外围配置仍由所属闭合 schema 约束。 */
17
+ readonly [key: string]: ReadonlyJsonValue;
18
+ }
19
+ /**
20
+ * 校验局部 JSON;baseDepth 表达真实深度,描述符检查避免执行访问器。
21
+ * 公开对象输入可显式允许省略 undefined 属性;内部复制、日志及数组元素仍使用严格默认值。
22
+ */
23
+ export declare function validateJsonValue(value: unknown, maxDepth?: number, baseDepth?: number, omitUndefinedProperties?: boolean): ValidationIssue[];
24
+ /** 编辑载荷和日志的完整 JSON 守卫;固定包装余量不改变文档提交时的实际深度限制。 @internal */
25
+ export declare function validateEditData(value: unknown, omitUndefinedProperties?: boolean): ValidationIssue[];
@@ -0,0 +1,40 @@
1
+ /**
2
+ * @file 物耗与对象初始化迁移:收敛 BOM 和初值声明,将接口记录、版本与删除基线拆到外部快照。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext } from './context';
6
+ import type { JsonObject } from '../../model';
7
+ /** 物耗声明的单向适配;外部记录留在报告中,不把接口记录或运行时控制器塞回模板。 */
8
+ export declare class LegacyMaterials {
9
+ private readonly c;
10
+ /** 每次迁移独立使用上下文,不保存外部记录全局缓存。 */
11
+ constructor(c: MigrationContext);
12
+ /** 提取原始外部记录快照;保留未知接口元数据和版本原值,不能作为新模板配置读取。 */
13
+ snapshot(value: unknown, path: string): void;
14
+ /** 对象声明只保留一份初值、扫码和用料策略,重复包装有冲突时阻断。 */
15
+ objects(value: unknown, path: string): JsonObject[];
16
+ /** 区域路径是唯一表身份;重复 table_key_ 必须匹配,接口身份和删除信息另存附件。 */
17
+ table(value: unknown, path: string, bindingPath?: string): JsonObject;
18
+ /** 独立配置只按实际表路径/对象键匹配;缺失沿用嵌入配置,歧义不取第一条。 */
19
+ private external;
20
+ /** 明细只保存物料业务身份和策略,记录身份、展示快照、排序及删除标记移出定义。 */
21
+ private entry;
22
+ /** 对象和 BOM 明细共用同一策略转换,保留关闭状态下的设计值。 */
23
+ private policy;
24
+ /** 合并条码规则的对象与旧 JSON 编码,重复声明冲突时不选择其中一份覆盖。 */
25
+ private barcode;
26
+ /** 条码映射仅保留外部规则键和业务路径,不复制规则详情或扫描数据。 */
27
+ private parseRule;
28
+ /** 解码唯一的边界公式;旧执行器无法解析的字符串不自动变成可执行公式。 */
29
+ private formula;
30
+ /** 需求数量来源直接保留业务字段键,不把计算结果写入模板。 */
31
+ private required;
32
+ /** 合并重复来源的完整属性;有差异时报告冲突,不通过最后写入取胜。 */
33
+ private combine;
34
+ /** 保留已声明属性的存在性及 false/0,形状由新 schema 统一校验。 */
35
+ private copy;
36
+ /** 核对外部身份与版本的基本载荷,始终保留原值而不与文档 ID 相互转换。 */
37
+ private record;
38
+ /** 可选列表 null/undefined 视为未配置;非空对象不包装成数组,数组元素仍严格检查。 */
39
+ private list;
40
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @file 旧图片资源迁移:按作用域解析图片关系,保留有效内嵌尺寸和资产,归档未消费的绘图属性。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext, SourceElement } from './context';
6
+ import type { ImageNode } from '../../model';
7
+ /** 按正文、页眉、页脚作用域管理旧关系,在输出中统一为资产字典。 */
8
+ export declare class LegacyMedia {
9
+ private readonly c;
10
+ /** 作用域和关系 ID 的复合索引,生命周期仅为本次迁移。 */
11
+ private readonly assets;
12
+ /** 接收局部迁移上下文,不连接网络或请求图片。 */
13
+ constructor(c: MigrationContext);
14
+ /** 登记一组旧关系;页眉关系中的非图片关系没有对应定义时明确报错。 */
15
+ load(value: unknown, path: string, scope: string, wrapped: boolean): void;
16
+ /** 解析旧产品实际显示的内嵌图片;未消费的锚定图形另存附件。 */
17
+ image(n: SourceElement, scope: string): ImageNode | undefined;
18
+ }
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @file 旧元数据处置清单:归档已核对未被旧产品消费的 Word 属性、包关系与设置。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext, SourceElement } from './context';
6
+ /** 表格已有列网格时旧布局不读取这些 Word 宽度、自动适应和内边距声明。 */
7
+ export declare const retiredTableProperties: string[];
8
+ /** 单元格宽度使用表格列网格,内边距使用产品默认值;其余列明属性无旧消费者。 */
9
+ export declare const retiredCellProperties: string[];
10
+ /** 旧 WrPr.directStyle 未读取的 Word 属性,不在新模型中新增未曾生效的显示行为。 */
11
+ export declare const retiredTextProperties: string[];
12
+ /** 旧 WpPr.directStyle 未读取的 Word 段落属性,编号、网格与分页控制未进入旧排版。 */
13
+ export declare const retiredParagraphProperties: string[];
14
+ /** 只为 DOCX 包往返保留、当前 Wsettings/画布均未消费的已知设置。 */
15
+ export declare const retiredDocumentSettings: readonly ["w:zoom", "w:rsids", "w:proofState", "w:attachedTemplate", "w:savePreviewPicture", "w:embedSystemFonts", "w:bordersDoNotSurroundHeader", "w:bordersDoNotSurroundFooter", "w:documentProtection", "w:defaultTabStop", "w:drawingGridVerticalSpacing", "w:displayHorizontalDrawingGridEvery", "w:displayVerticalDrawingGridEvery", "w:characterSpacingControl", "w:compat", "m:mathPr", "w:themeFontLang", "w:clrSchemeMapping", "w:doNotIncludeSubdocsInStats", "w:stylePaneFormatFilter", "w:trackRevisions", "w:drawingGridHorizontalSpacing", "w:noPunctuationKerning", "w:hdrShapeDefaults", "w:footnotePr", "w:endnotePr", "w:shapeDefaults", "w:decimalSymbol", "w:listSeparator", "w14:docId", "w15:chartTrackingRefBased", "w15:docId"];
16
+ /** 提取不参与资源查找的包关系头;内容不进入新定义,也不因内部格式阻断。 */
17
+ export declare function extractMetadataRelationships(c: MigrationContext, value: Record<string, unknown>, path: string): void;
18
+ /** 已知无消费的 XML 元数据完整留档;无需验证只服务于 DOCX 往返的内部结构。 */
19
+ export declare function extractXmlMetadata(c: MigrationContext, value: unknown, path: string): void;
20
+ /** 主题和字体目录没有运行时查找入口,按原来源完整提取,不物化未曾生效的 Word 主题。 */
21
+ export declare function extractDocumentMetadata(c: MigrationContext, root: Record<string, unknown>): void;
22
+ /** 设置子树原样留在迁移附件中,不执行 Word 保护、兼容或字体嵌入指令。 */
23
+ export declare function extractSettingMetadata(c: MigrationContext, node: SourceElement): void;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @file 旧模板迁移总入口:组织正文、章节、页部件与业务解析,校验新文档,并提供诊断预览。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { LegacyTemplateInspection, MigrationOptions, MigrationResult } from './types';
6
+ /** 将旧持久化 XML JSON 单向迁移为原生定义;不修改输入,也不返回无效半成品。 */
7
+ export declare function migrateLegacyTemplate(input: unknown, options: MigrationOptions): MigrationResult;
8
+ /** 生成控制台检查快照;被阻断的中间结构明确标为 preview,不放宽正式迁移规则。 */
9
+ export declare function inspectLegacyTemplate(input: unknown, options: MigrationOptions): LegacyTemplateInspection;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * @file 旧页面组件迁移:转换八类组件、内容来源和显式引用,与正文和浮层解析协作。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext } from './context';
6
+ import type { PageWidget } from '../../model';
7
+ /** 单次迁移的页面组件适配器,保留设计声明,移除结果缓存,不调用排版或公式引擎。 */
8
+ export declare class LegacyPageWidgets {
9
+ private readonly c;
10
+ /** 按源位置检查旧身份重复,允许共享浮层的同源复制;不持有跨文档数据。 */
11
+ private readonly ids;
12
+ /** 单次转换上下文。 */
13
+ constructor(c: MigrationContext);
14
+ /** 直接由旧元数据创建页面组件;脱流组件必须已经处在有锚点的 Overlay。 */
15
+ convert(value: unknown, path: string, anchored: boolean): PageWidget;
16
+ /** 内容用可辨识分支表达,不把字段选择器的 UI 身份继续嵌入配置。 */
17
+ private content;
18
+ /** 读取字段选择器的唯一绑定,元数据快照不变成字段组件或虚拟节点。 */
19
+ private selectedBinding;
20
+ /** 保留时间字段的业务模型与区域地址,当前数据行和日期计算留给消费端。 */
21
+ private timeField;
22
+ /** 将三组平行数组收敛为固定槽,并按旧顶点规则消化方向兼容逻辑。 */
23
+ private diagonal;
24
+ /** 标签样式复用核心 TextStyle,原画布字号 px 换算成 pt,保留显式 false。 */
25
+ private labelStyle;
26
+ /** 只剥离已知结果缓存,未知特有配置不作为任意对象透传。 */
27
+ private caches;
28
+ /** 可选枚举 null 保留为未配置;未知非空枚举仍明确阻断。 */
29
+ private literal;
30
+ }
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @file 关联字段迁移:转换人员、部门、业务记录和 SOP 版本的选择、展示、搜索与过滤配置。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext } from './context';
6
+ /** 已核对使用同一记录关联配置的业务身份,保留原身份到 binding.source。 */
7
+ export declare const relationFieldComponents: Readonly<Record<string, readonly string[]>>;
8
+ /** 关联业务的原生组件,UI 选择器名称不作为新数据协议。 */
9
+ export type RelationFieldWidget = 'user' | 'org' | 'relation' | 'rdo-relation' | 'sop-version';
10
+ /** 按明确的旧业务身份和控件组合取原生类别,不对未知字段进行通用降级。 */
11
+ export declare function relationFieldWidget(fieldType: string, component: string): RelationFieldWidget | undefined;
12
+ /** 直接读取关系字段的持久化配置,不调用模型加载器或用户/部门接口。 */
13
+ export declare class LegacyRelations {
14
+ private readonly c;
15
+ /** 本次转换上下文,没有跨文档全局状态。 */
16
+ constructor(c: MigrationContext);
17
+ /** 给主迁移器提供闭合旧属性白名单。 */
18
+ keys(widget: RelationFieldWidget): readonly string[];
19
+ /** 将系统默认、外部记录身份、搜索显示和属性填充声明直接整理成新配置。 */
20
+ convert(widget: RelationFieldWidget, props: Record<string, unknown>, path: string): Record<string, unknown>;
21
+ /** 只保留列键、标题和锁定声明,将接口字段快照单独交给迁移 artifacts。 */
22
+ private displayField;
23
+ /** 缺省填充列表为空,但显式错误形状不被空数组掩盖。 */
24
+ private list;
25
+ }
@@ -0,0 +1,7 @@
1
+ import type { MigrationContext } from './context';
2
+ /** 已逐类核对复用基础字段声明的业务身份;未知身份不因组件相同而自动放行。 */
3
+ export declare const scalarFieldComponents: Readonly<Record<string, string>>;
4
+ /** 标量控件只有明确业务身份才可持有附加设计配置。 */
5
+ export declare function scalarFieldKeys(fieldType: string): readonly string[];
6
+ /** 实例数保留表单模板绑定和选择策略,不调用模板接口,也不预先计算实例数。 */
7
+ export declare function migrateScalarFieldConfig(c: MigrationContext, fieldType: string, props: Record<string, unknown>, path: string): Record<string, unknown>;
@@ -0,0 +1,52 @@
1
+ /**
2
+ * @file 旧样式迁移:解析直接属性与样式继承,换算单位,按旧生效顺序处理重复声明和缺省值。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext, SourceElement } from './context';
6
+ import type { Borders, CellStyle, Paragraph, TableStyle, TextStyle } from '../../model';
7
+ /** 检查有效叶属性和子节点;已确认无消费者的属性仅留档,不校验其内部表示。 */
8
+ export declare function leaf(c: MigrationContext, n: SourceElement, keys?: readonly string[], retiredAttributes?: readonly string[]): Record<string, unknown>;
9
+ /** 转换 OOXML 颜色值;auto 保持为 auto,不猜测主题色或计算着色。 */
10
+ export declare function readColor(c: MigrationContext, value: unknown, path: string): string;
11
+ /** 迁移文字、段落与表格样式,样式身份和继承按类别隔离。 */
12
+ export declare class LegacyStyles {
13
+ private readonly c;
14
+ /** 旧字符样式 ID 到新身份。 */
15
+ readonly textIds: Map<string, string>;
16
+ /** 旧段落样式 ID 到新身份。 */
17
+ readonly paragraphIds: Map<string, string>;
18
+ /** 旧表格样式 ID 到新身份。 */
19
+ readonly tableIds: Map<string, string>;
20
+ /** 段落样式自带的文字样式,和旧字符样式身份隔离。 */
21
+ private readonly paragraphTextIds;
22
+ /** 原始默认表格样式,新模板没有全局默认表格槽位,因此按表引用。 */
23
+ defaultTableId?: string;
24
+ /** 仅供迁移读取的局部依赖。 */
25
+ constructor(c: MigrationContext);
26
+ /** 读取文字属性;实例取首项,样式表与文档默认声明按旧属性类取末项。 */
27
+ text(n: SourceElement, duplicates?: 'first' | 'last'): {
28
+ /** 文字样式的实例覆盖。 */
29
+ textStyle?: TextStyle;
30
+ /** 文字样式字典引用。 */
31
+ textStyleId?: string;
32
+ };
33
+ /** 转换段落的显式缩进、间距与行距,返回内嵌节属性供文档分节。 */
34
+ paragraph(n: SourceElement, target: Pick<Paragraph, 'paragraphStyle' | 'paragraphStyleId' | 'textStyle' | 'textStyleId'>, duplicates?: 'first' | 'last'): SourceElement | undefined;
35
+ /** 转换边框宽度、线型和颜色;保留 0 宽的显式无边框覆盖。 */
36
+ borders(n: SourceElement): Borders;
37
+ /** 一次读取样式和结构属性;不把旧布局未消费的 Word 尺寸与内边距引入新定义。 */
38
+ table(n: SourceElement, cell: boolean, structural?: readonly string[]): {
39
+ /** 实例级样式覆盖。 */
40
+ style: TableStyle & CellStyle;
41
+ /** 表格样式字典引用。 */
42
+ tableStyleId?: string;
43
+ /** 已读取的网格跨度等结构声明,交给表格迁移器复用,避免再次遍历属性。 */
44
+ structural: SourceElement[];
45
+ };
46
+ /** 先登记所有样式身份,再读取属性及 basedOn,支持向后引用。 */
47
+ load(value: unknown): void;
48
+ /** 转换文档默认属性,避免把默认样式展开到每个文字对象。 */
49
+ private defaults;
50
+ /** 缺失样式按旧解析器忽略该引用;保留直接格式和已有默认值,不伪造悬空身份。 */
51
+ private reference;
52
+ }
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @file 重复业务表变体清单:集中定义原生命名空间、旧表型及条码或盘点能力,供 schema 和迁移共用。
3
+ * 阅读定位:business/ · 业务配置类型及对应 schema。
4
+ */
5
+ import type { ExtensionName } from '../../model';
6
+ /** 重复业务表的静态配置契约,不包含旧业务执行器、主题、接口记录或布局结果。 */
7
+ export interface RepeatingTableVariantDefinition {
8
+ /** 原生业务变体的稳定命名空间。 */
9
+ readonly name: ExtensionName;
10
+ /** 旧模板转换器识别的表型名称,必须精确匹配。 */
11
+ readonly legacyLayoutType: string;
12
+ /** 当前面板和扫码消费链是否支持条码规则声明。 */
13
+ readonly barcode: boolean;
14
+ /** 是否具有库存盘点维度和自动加载配置。 */
15
+ readonly inventory: boolean;
16
+ }
17
+ /** 当前注册业务表的唯一配置清单;原生 schema 与旧表型迁移共用,声明本身不可变。 */
18
+ export declare const repeatingTableVariants: readonly RepeatingTableVariantDefinition[];
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @file 旧表格迁移:建立完整物理网格、合并和业务区域,转换表型配置,并处理旧空表留白。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext, SourceElement } from './context';
6
+ import type { LegacyStyles } from './styles';
7
+ import type { Block } from '../../model';
8
+ /** 普通表、业务区域、物理网格与合并的直接迁移器。 */
9
+ export declare class LegacyTables {
10
+ private readonly c;
11
+ private readonly styles;
12
+ private readonly blocks;
13
+ /** 内容读取器由上层注入,避免引用旧类或排版层。 */
14
+ constructor(c: MigrationContext, styles: LegacyStyles, blocks: (nodes: readonly SourceElement[], scope: string) => Block[]);
15
+ /** 无列无单元格的旧表仅提供行高留白,转换为空段落;正常表仍严格检查网格。 */
16
+ convertBlock(n: SourceElement, scope: string): Block[];
17
+ /** 读取并检查完整表结构;仅已确认没有单元格的留白表允许缺省列网格。 */
18
+ private read;
19
+ /** 合并纵向延续必须来自上一行同列同宽的 restart,孤立标记会阻断。 */
20
+ private merges;
21
+ /** 旧 cellBorders 是实际编辑覆盖,宽度映射到 px,显式 0 不能被默认边框覆盖。 */
22
+ private cellBorders;
23
+ /** 将坐标矩形换为本表 CellId 端点,非法坐标不夹取到表内。 */
24
+ private range;
25
+ /** 展平业务子区域,并在同一物理表内解析表头对业务区域的引用。 */
26
+ private regions;
27
+ }
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @file 追溯附加配置迁移:转换设备和物料条码解析、设备组及关联过滤,不连接业务接口。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext } from './context';
6
+ /** 已有记录选择器的追溯配置适配器,只处理设计声明,不连接条码、设备或物料接口。 */
7
+ export declare class LegacyTraceFields {
8
+ private readonly c;
9
+ /** 每次迁移独立持有上下文,不创建跨文档缓存。 */
10
+ constructor(c: MigrationContext);
11
+ /** 按已核对的业务字段列出额外旧属性,未知组合不会因此得到通用白名单。 */
12
+ keys(fieldType: string): readonly string[];
13
+ /** 合并旧追溯字段的附加配置,关闭开关及未完成的设计行均不被静默删去。 */
14
+ convert(fieldType: string, props: Record<string, unknown>, path: string): Record<string, unknown>;
15
+ /** 把条码规则压成外部 ID 和业务字段地址;不保留整份模型字段或解析结果。 */
16
+ private barcode;
17
+ /** 关联过滤源以主表字段或当前子表字段表达,不制造画布节点引用或运行时行号。 */
18
+ private association;
19
+ /** 严格解析编辑器产生的单键/双键地址,不把 JSONPath、行索引或多层地址截断成有效值。 */
20
+ private address;
21
+ }
@@ -0,0 +1,141 @@
1
+ /**
2
+ * @file 迁移公共类型:定义选项、结果、问题报告、身份与资源映射,以及不写入文档的迁移附件。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { DocumentDefinition, JsonObject, JsonValue, PageSettings } from '../../model';
6
+ /** 单向迁移参数;来源标记只用于报告,不参与生成节点身份。 */
7
+ export interface MigrationOptions {
8
+ /** 模板详情中单独保存的 OCR / 设备通信配置,转换器会将其合并到新版文档业务配置。 */
9
+ communicationConfig?: JsonValue;
10
+ /** 独立审计默认保留完整附件;运行入口可只保留剥离计数,避免复制已退役缓存和接口快照。 */
11
+ artifactMode?: 'full' | 'summary';
12
+ /** 用于定位模板的报告标记;重复转换不要求生成相同 ID。 */
13
+ sourceId: string;
14
+ /** 旧模板缺少页面声明时使用的明确回退,使用时会报告警告。 */
15
+ fallbackPage?: PageSettings;
16
+ /** 平台已读取的独立 BOM 配置;仅旧格式迁移消费,完整外部基线另存附件,不进入新 model。 */
17
+ materialRecords?: readonly JsonObject[];
18
+ }
19
+ /** 可定位的迁移问题;存在 error 时不返回新文档。 */
20
+ export interface MigrationIssue {
21
+ /** 源逻辑 Pointer;optionsJson 内部指向解码后节点,恢复的虚拟格使用 virtual 路径。 */
22
+ sourcePath: string;
23
+ /** 原生校验失败时对应的新文档 JSON Pointer。 */
24
+ targetPath?: string;
25
+ /** 信息、需要业务复核的回退、阻断错误。 */
26
+ severity: 'info' | 'warning' | 'error';
27
+ /** 稳定问题代码,供批量迁移汇总。 */
28
+ code: string;
29
+ /** 中文问题说明。 */
30
+ message: string;
31
+ }
32
+ /** 新旧实体身份映射;源位置是权威,旧 ID 允许缺失。 */
33
+ export interface MigrationIdMapping {
34
+ /** 实体来源的逻辑 Pointer;嵌套 JSON 字符串和虚拟恢复节点使用派生路径。 */
35
+ sourcePath: string;
36
+ /** 实体类别或字典类别。 */
37
+ role: string;
38
+ /** 原始实体 ID,仅用于追踪。 */
39
+ legacyId?: string;
40
+ /** 新模型中的稳定 ID。 */
41
+ newId: string;
42
+ /** 相邻文字合并后,该来源在目标文字中的 UTF-16 区间。 */
43
+ textRange?: {
44
+ /** 起点,包含。 */
45
+ from: number;
46
+ /** 终点,不包含。 */
47
+ to: number;
48
+ };
49
+ }
50
+ /** 图片关系 ID 按旧部件作用域解析,不跨部件混用 rId。 */
51
+ export interface MigrationResourceMapping {
52
+ /** document 或旧页眉/页脚的源位置。 */
53
+ scope: string;
54
+ /** 旧资源关系 ID。 */
55
+ relationshipId: string;
56
+ /** 新资源字典身份。 */
57
+ assetId: string;
58
+ /** 原始资源声明位置。 */
59
+ sourcePath: string;
60
+ }
61
+ /** 旧浮层关系对应的原生章节;旧印章页序可能跨越同一关系引用的多个节。 */
62
+ export interface MigrationOverlaySectionMapping {
63
+ /** 旧浮层关系 ID,对应旧业务值的 sheetId。 */
64
+ relationshipId: string;
65
+ /** 当前引用拥有的原生章节。 */
66
+ sectionId: string;
67
+ /** 旧章节浮层引用的逻辑 Pointer。 */
68
+ sourcePath: string;
69
+ }
70
+ /** 从定义中剥离但必须由批量迁移调用方保存的旧数据。 */
71
+ export interface MigrationArtifact {
72
+ /** 原始数据位置。 */
73
+ sourcePath: string;
74
+ /** 运行时缓存、外部记录快照或经源码核对已废弃的配置。 */
75
+ kind: 'runtime-cache' | 'external-snapshot' | 'retired-config';
76
+ /** 与输入隔离的原始 JSON 副本。 */
77
+ value: JsonValue;
78
+ }
79
+ /** 运行入口只需要剥离数量,不把旧值或旧输入树带入新会话。 */
80
+ export interface MigrationArtifactSummary {
81
+ /** 本次剥离的总项数。 */
82
+ total: number;
83
+ /** 按用途分类的项数,不保存任何原始值。 */
84
+ byKind: Record<MigrationArtifact['kind'], number>;
85
+ }
86
+ /** 本次迁移的可审计报告,不写进文档持久化协议。 */
87
+ export interface MigrationReport {
88
+ /** 仅摘要模式返回计数,此时 artifacts 为空;独立完整报告的默认行为保持。 */
89
+ artifactSummary?: MigrationArtifactSummary;
90
+ /** 已发布迁移算法的版本;当前 v1 尚在实现,发布后调整映射规则须升级版本。 */
91
+ migrationVersion: 1;
92
+ /** 调用方给定的模板来源标记。 */
93
+ sourceId: string;
94
+ /** 非零错误数会阻断输出。 */
95
+ issues: MigrationIssue[];
96
+ /** 包括合并文字来源的实体身份映射。 */
97
+ ids: MigrationIdMapping[];
98
+ /** 旧关系作用域到新资产的映射。 */
99
+ resources: MigrationResourceMapping[];
100
+ /** 仅供业务值位置迁移使用,不写入 model 或混入普通实体 ID 映射。 */
101
+ overlaySections?: MigrationOverlaySectionMapping[];
102
+ /** 调用方需另存的剥离数据。 */
103
+ artifacts: MigrationArtifact[];
104
+ }
105
+ /** 成功仅表示支持的语义已通过新模型校验;warning 仍需调用方复核。 */
106
+ export type MigrationResult = {
107
+ /** 是否完成转换。 */
108
+ ok: true;
109
+ /** 完整合法的新定义。 */
110
+ document: DocumentDefinition;
111
+ /** 迁移报告。 */
112
+ report: MigrationReport;
113
+ } | {
114
+ /** 是否完成转换。 */
115
+ ok: false;
116
+ /** 错误及追踪报告,不暴露半成品文档。 */
117
+ report: MigrationReport;
118
+ };
119
+ /** 手动调试的检查结果;被阻断的预览不承诺符合原生协议,不能用于保存或编辑。 */
120
+ export type LegacyTemplateInspection = {
121
+ /** 已完整转换并通过校验。 */
122
+ status: 'valid';
123
+ /** 与输入隔离的合法原生文档。 */
124
+ document: DocumentDefinition;
125
+ /** 本次转换的问题和身份映射。 */
126
+ report: MigrationReport;
127
+ } | {
128
+ /** 转换存在阻断项,正式迁移 API 仍不返回文档。 */
129
+ status: 'blocked';
130
+ /** 只供控制台展开的独立中间快照;输入边界失败时为空,不具备文档类型。 */
131
+ preview: unknown;
132
+ /** 未覆盖或非法数据的完整诊断。 */
133
+ report: MigrationReport;
134
+ };
135
+ /** Word 内置转换流程和自定义转换回调共用的单次请求。 */
136
+ export interface LegacyTemplateConversionRequest {
137
+ id: string;
138
+ value: unknown;
139
+ signal: AbortSignal;
140
+ communicationConfig?: unknown;
141
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @file 字段外观迁移:统一名称、尺寸、文字展示与编辑能力,按有效来源归并旧声明。
3
+ * 阅读定位:migration/ · 旧模板到原生协议的单向转换。
4
+ */
5
+ import type { MigrationContext } from './context';
6
+ import type { FieldNode, PageWidget } from '../../model';
7
+ /** 普通字段与附属字段共用名称归并;来源冲突明确报告,不覆盖另一处有效声明。 */
8
+ export declare function migrateFieldLabel(c: MigrationContext, config: Record<string, unknown>, value: unknown, sourcePath: string): void;
9
+ /** 保留有效外观,旧编辑限制归档;任意 CSS、事件和未知扩展必须单独适配。 */
10
+ export declare function migrateWidgetPresentation(c: MigrationContext, meta: Record<string, unknown>, path: string, node: FieldNode | PageWidget, anchored: boolean): void;
@@ -0,0 +1,16 @@
1
+ /** @file 控件文字的字素分割与断行,不依赖图形控件度量或业务展示。 */
2
+ import type { LayoutTextMeasurer } from '../../ports/measurement';
3
+ import type { LayoutControlPresentation } from '../../types/presentation/controls';
4
+ /** 一段最终文字行与完整展示文字的源区间,不创建逐字数据对象。 */
5
+ export interface WrappedControlText {
6
+ /** 完整本行文字。 */
7
+ readonly text: string;
8
+ /** 原始 UTF-16 起点。 */
9
+ readonly from: number;
10
+ /** 原始 UTF-16 终点。 */
11
+ readonly to: number;
12
+ }
13
+ /** 字段内按合法字素换行,空行保留;不创建字符节点或内部模型地址。 */
14
+ export declare function wrapTextRanges(text: string, width: number, presentation: Pick<LayoutControlPresentation, 'style'>, measurer: LayoutTextMeasurer): WrappedControlText[];
15
+ /** 通用标签继续使用相同断行算法,字段额外保留原文区间供活动输入定位。 */
16
+ export declare function wrapText(text: string, width: number, presentation: Pick<LayoutControlPresentation, 'style'>, measurer: LayoutTextMeasurer): string[];