@agile-team/mach-report 2.16.0 → 2.18.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 (177) hide show
  1. package/README.md +25 -12
  2. package/dist/{ExcelBindingWizard-CP6h2x1f.cjs → ExcelBindingWizard-Czn3C2yE.cjs} +1 -1
  3. package/dist/{ExcelBindingWizard-HhB3hAJE.js → ExcelBindingWizard-DMGZj6I6.js} +3 -3
  4. package/dist/ParamEditor-KzDQvbHY.js +732 -0
  5. package/dist/ParamEditor-oDfD8LgE.cjs +1 -0
  6. package/dist/{ReportBatchPanel-ruxcbfY6.js → ReportBatchPanel-BJK7PvZ4.js} +39 -39
  7. package/dist/ReportBatchPanel-DnmNRssu.cjs +1 -0
  8. package/dist/ReportParamPanel-mQkeN70Q.js +1020 -0
  9. package/dist/ReportParamPanel-sOANVRz-.cjs +1 -0
  10. package/dist/ReportPreview-BxWWTUL5.js +5583 -0
  11. package/dist/ReportPreview-Yf99omi3.cjs +6 -0
  12. package/dist/{ReportTemplateLibrary-DcwrH-63.js → ReportTemplateLibrary-BFjB08Wu.js} +1 -1
  13. package/dist/{ReportTemplateLibrary-BDlNT8JN.cjs → ReportTemplateLibrary-BO42QnWd.cjs} +1 -1
  14. package/dist/RuleEditor-CqxT1a-W.js +2337 -0
  15. package/dist/RuleEditor-D7YWigD9.cjs +1 -0
  16. package/dist/{TemplateOutlinePanel-CGrT5DFN.cjs → TemplateOutlinePanel-B0XX350V.cjs} +1 -1
  17. package/dist/{TemplateOutlinePanel-SXCjaPKR.js → TemplateOutlinePanel-zG0DrsIB.js} +2 -2
  18. package/dist/{TemplateReusePanel-6Z3wRFz8.cjs → TemplateReusePanel-BD0HSKp_.cjs} +1 -1
  19. package/dist/{TemplateReusePanel-lHLOS9Wn.js → TemplateReusePanel-Czwe5GbC.js} +2 -2
  20. package/dist/{TemplateReviewPanel-Dpk7sLcF.cjs → TemplateReviewPanel-CA5sdffM.cjs} +1 -1
  21. package/dist/{TemplateReviewPanel-CJ9PLc48.js → TemplateReviewPanel-NhmQI65C.js} +2 -2
  22. package/dist/analytics.cjs +1 -1
  23. package/dist/analytics.d.cts +163 -42
  24. package/dist/analytics.d.ts +163 -42
  25. package/dist/analytics.js +76 -141
  26. package/dist/artifact-integrity.json +110 -108
  27. package/dist/assets-2eC3mOcV.js +232 -0
  28. package/dist/assets-B0Hxn4l6.cjs +1 -0
  29. package/dist/{auto-uVBjX1j5.cjs → auto-B0EZFIK1.cjs} +1 -1
  30. package/dist/{auto-YR7a4BtF.js → auto-BlchZ1b8.js} +10 -10
  31. package/dist/{batch-WzDIXJAt.js → batch-DGCt44XM.js} +1 -1
  32. package/dist/{batch-z6Aw5GEY.cjs → batch-DYcokH4v.cjs} +1 -1
  33. package/dist/charts-Dlv8j2AG.js +141 -0
  34. package/dist/charts-aCtoswXq.cjs +1 -0
  35. package/dist/codes.cjs +9 -9
  36. package/dist/codes.d.cts +54 -0
  37. package/dist/codes.d.ts +54 -0
  38. package/dist/codes.js +12097 -13668
  39. package/dist/column-visual-BpgQVWwT.js +238 -0
  40. package/dist/column-visual-CtYxnBCP.cjs +1 -0
  41. package/dist/component-tree-6TV7W6Yj.cjs +1 -0
  42. package/dist/component-tree-CvW4lzpv.js +67 -0
  43. package/dist/computed-4TnxzgIh.cjs +1 -0
  44. package/dist/computed-C8NRZQss.js +739 -0
  45. package/dist/data-bar-Ce38juRZ.cjs +1 -0
  46. package/dist/data-bar-PtjXhMgN.js +9 -0
  47. package/dist/dataset-DL83majE.js +161 -0
  48. package/dist/dataset-IrlXbUvh.cjs +1 -0
  49. package/dist/designer--TKECSEc.cjs +2 -0
  50. package/dist/designer-d6hJS41w.js +5683 -0
  51. package/dist/designer.cjs +1 -1
  52. package/dist/designer.d.cts +835 -45
  53. package/dist/designer.d.ts +835 -45
  54. package/dist/designer.js +23 -20
  55. package/dist/{encoding-BYF9ZTl9.cjs → encoding-B--eZpp1.cjs} +1 -1
  56. package/dist/{encoding-BOGq4qYL.js → encoding-mctOLocI.js} +2 -2
  57. package/dist/{font-loader-EKLzOJxf.cjs → font-loader-DBBJ5KE9.cjs} +1 -1
  58. package/dist/{font-loader-CzI1GuBc.js → font-loader-DW8tIaNp.js} +1 -1
  59. package/dist/index-CPh6tqge.js +1575 -0
  60. package/dist/index-CUNw7dL9.cjs +1 -0
  61. package/dist/index.cjs +8 -8
  62. package/dist/index.d.cts +534 -16
  63. package/dist/index.d.ts +534 -16
  64. package/dist/index.js +1393 -955
  65. package/dist/json-snapshot-By4ZVVUt.js +1967 -0
  66. package/dist/json-snapshot-jiXff4lc.cjs +2 -0
  67. package/dist/matrix-0hywp0-F.cjs +1 -0
  68. package/dist/matrix-Dy-tyY7E.js +381 -0
  69. package/dist/param-validation-C-8sRJLq.cjs +1 -0
  70. package/dist/param-validation-CnDEd2l-.js +333 -0
  71. package/dist/{pdf-DJ5S6ukC.js → pdf-CKROKygt.js} +1845 -1845
  72. package/dist/{pdf-ByVCb1i6.cjs → pdf-DqyxJ96U.cjs} +47 -47
  73. package/dist/pdf.cjs +1 -1
  74. package/dist/pdf.d.cts +66 -0
  75. package/dist/pdf.d.ts +66 -0
  76. package/dist/pdf.js +2 -2
  77. package/dist/{plugin-C2j5_mhx.js → plugin-ByjF2kiV.js} +5 -5
  78. package/dist/{plugin-Dr39GBRG.cjs → plugin-DM1M2wlI.cjs} +1 -1
  79. package/dist/prefill-B8H9qwE4.js +371 -0
  80. package/dist/prefill-D7EswyTI.cjs +1 -0
  81. package/dist/{prepared-DqtpvRTn.js → prepared-BE-4jfX5.js} +2 -2
  82. package/dist/{prepared-DdrjLC7L.cjs → prepared-CGVphji3.cjs} +1 -1
  83. package/dist/{protocol-BzwMP4Vw.cjs → protocol-ByRVzzQG.cjs} +1 -1
  84. package/dist/{protocol-kt4Iy6-3.js → protocol-Cr81vFSQ.js} +3 -3
  85. package/dist/{record-bindings-CZWBJ1fU.js → record-bindings-DEJtmo3p.js} +67 -107
  86. package/dist/record-bindings-ehjnCDHt.cjs +1 -0
  87. package/dist/{region-binding-workflow-CWNvIjkV.js → region-binding-workflow-CBg0l_tj.js} +2 -2
  88. package/dist/{region-binding-workflow-CqSMxQ4p.cjs → region-binding-workflow-D05tOYn3.cjs} +1 -1
  89. package/dist/report-encoding-worker.cjs +1 -1
  90. package/dist/report-encoding-worker.js +1 -1
  91. package/dist/{report-params-B1RzkhJj.js → report-params-D9tBuM9B.js} +1 -1
  92. package/dist/{report-params-WDGrA4oP.cjs → report-params-VTg8MoCp.cjs} +1 -1
  93. package/dist/runtime-CDA6d263.cjs +1 -0
  94. package/dist/runtime-CEMvybO7.js +170 -0
  95. package/dist/sbom.cdx.json +1 -1
  96. package/dist/server/node.d.cts +121 -7
  97. package/dist/server/node.d.ts +121 -7
  98. package/dist/server-node.cjs +4 -4
  99. package/dist/server-node.js +3446 -2115
  100. package/dist/server.cjs +1 -1
  101. package/dist/server.d.cts +417 -29
  102. package/dist/server.d.ts +417 -29
  103. package/dist/server.js +787 -544
  104. package/dist/sha256-BDQ1Qk7A.js +158 -0
  105. package/dist/sha256-DgZAKXqI.cjs +1 -0
  106. package/dist/style.css +1 -1
  107. package/dist/template-bindings-Cg5oBLFT.cjs +1 -0
  108. package/dist/template-bindings-TKnXM7ll.js +62 -0
  109. package/dist/{template-catalog-BtR2JmCL.js → template-catalog-CmbWOJqy.js} +16 -16
  110. package/dist/template-catalog-Utu4GP09.cjs +1 -0
  111. package/dist/{template-fragments-BVsbxs4a.cjs → template-fragments-C_zSHJAa.cjs} +1 -1
  112. package/dist/{template-fragments-By0aZC1D.js → template-fragments-DWgo9tlZ.js} +2 -2
  113. package/dist/{template-outline-BwRV_eRo.cjs → template-outline-DWkzZXVC.cjs} +1 -1
  114. package/dist/{template-outline-cnWfT_LK.js → template-outline-DiADphlq.js} +1 -1
  115. package/dist/{template-registry-Cw3vRTX2.js → template-registry-BIhIHOab.js} +319 -314
  116. package/dist/template-registry-DzWswQI5.cjs +1 -0
  117. package/dist/vue/async.d.cts +636 -35
  118. package/dist/vue/async.d.ts +636 -35
  119. package/dist/vue/index.d.cts +746 -67
  120. package/dist/vue/index.d.ts +746 -67
  121. package/dist/vue-async.cjs +1 -1
  122. package/dist/vue-async.js +3 -3
  123. package/dist/vue.cjs +1 -1
  124. package/dist/vue.js +94 -89
  125. package/dist/{workbook-session-Cbts-22R.cjs → workbook-session-B94EwVa_.cjs} +1 -1
  126. package/dist/{workbook-session-BeSO8PFB.js → workbook-session-BoScoOg-.js} +2 -2
  127. package/dist/worker.cjs +1 -1
  128. package/dist/worker.d.cts +75 -7
  129. package/dist/worker.d.ts +75 -7
  130. package/dist/worker.js +4 -4
  131. package/dist/xlsx.cjs +4 -4
  132. package/dist/xlsx.d.cts +208 -15
  133. package/dist/xlsx.d.ts +208 -15
  134. package/dist/xlsx.js +288 -252
  135. package/package.json +1 -1
  136. package/dist/ParamEditor-CUQLgoxa.cjs +0 -1
  137. package/dist/ParamEditor-OKesP_nO.js +0 -594
  138. package/dist/ReportBatchPanel-cZCAMAwH.cjs +0 -1
  139. package/dist/ReportPreview-BcDKCLiK.js +0 -4834
  140. package/dist/ReportPreview-Bk9nLfO9.cjs +0 -6
  141. package/dist/RuleEditor-BX5S8RSF.cjs +0 -1
  142. package/dist/RuleEditor-CGl9XY2s.js +0 -2037
  143. package/dist/assets-CqIbfbTr.js +0 -126
  144. package/dist/assets-e4YSke8n.cjs +0 -1
  145. package/dist/capabilities-DDwXr_cA.js +0 -103
  146. package/dist/capabilities-DNLyZdNw.cjs +0 -1
  147. package/dist/component-tree-Ca6YYfHq.js +0 -61
  148. package/dist/component-tree-DkGLEfZC.cjs +0 -1
  149. package/dist/computed-C-4C2S5h.js +0 -521
  150. package/dist/computed-CGV2a809.cjs +0 -1
  151. package/dist/config-Dg_o8e7m.cjs +0 -1
  152. package/dist/config-XQ4qrQ7Q.js +0 -844
  153. package/dist/dataset-BkRmwgeJ.cjs +0 -1
  154. package/dist/dataset-H5pFuQGU.js +0 -121
  155. package/dist/designer-BfQSahxq.js +0 -5163
  156. package/dist/designer-CPPdeM5_.cjs +0 -2
  157. package/dist/diagnostic-notification-B9K9We3h.cjs +0 -1
  158. package/dist/diagnostic-notification-qGAYZdkB.js +0 -7
  159. package/dist/drill-CsdjgkRM.cjs +0 -1
  160. package/dist/drill-DIGsZfyB.js +0 -145
  161. package/dist/json-snapshot-D6ioHth9.js +0 -1702
  162. package/dist/json-snapshot-DknkjvxP.cjs +0 -2
  163. package/dist/matrix-CGRGkn5s.js +0 -112
  164. package/dist/matrix-gEO7ZM_u.cjs +0 -1
  165. package/dist/param-validation-C3HlcLLO.cjs +0 -1
  166. package/dist/param-validation-Do7Eg8Zv.js +0 -181
  167. package/dist/record-bindings-DUX1VMlR.cjs +0 -1
  168. package/dist/runtime-BjKBI530.js +0 -168
  169. package/dist/runtime-CBFEPKEs.cjs +0 -1
  170. package/dist/sha256-BshdOkCC.cjs +0 -1
  171. package/dist/sha256-DTG-Gq8i.js +0 -157
  172. package/dist/template-bindings-C2SpvsMU.js +0 -58
  173. package/dist/template-bindings-CEtWyiLX.cjs +0 -1
  174. package/dist/template-catalog-C2NLdrwB.cjs +0 -1
  175. package/dist/template-registry-C62vpv4a.cjs +0 -1
  176. package/dist/tree-BX380Rr7.cjs +0 -1
  177. package/dist/tree-CjVZLRw7.js +0 -172
package/dist/index.d.cts CHANGED
@@ -10,6 +10,14 @@ declare interface AggregateDefinition {
10
10
 
11
11
  declare type AggregateOperation = "sum" | "count" | "avg" | "min" | "max" | "weightedAvg";
12
12
 
13
+ declare interface AggregateRequest {
14
+ op: AggregateOperation;
15
+ field?: string;
16
+ weightField?: string;
17
+ numeric?: "number" | "decimal";
18
+ digits?: number;
19
+ }
20
+
13
21
  /** 复制发生变化的页/组件/行;原计划保持不变,并拒绝覆盖已改变的单元格。 */
14
22
  export declare function applyReportCellEdit(plan: RenderPlan, edit: ReportCellEdit): RenderPlan;
15
23
 
@@ -29,6 +37,8 @@ export declare function assertRenderPlan(input: unknown): PlanPage[];
29
37
 
30
38
  export declare function assertReportParams(defs: readonly ReportParamDef[], input?: Record<string, unknown>): Record<string, string>;
31
39
 
40
+ export declare function assertReportValidation(issues: readonly ReportValidationIssue[], warningPolicy?: "allow" | "block"): void;
41
+
32
42
  export declare interface AssetRenderBudget {
33
43
  /** Maximum newly rendered assets, default 1000. Existing imageData is kept unchanged. */
34
44
  maxAssets?: number;
@@ -42,6 +52,8 @@ export declare interface AssetRenderBudget {
42
52
 
43
53
  export declare interface AssetRenderOptions extends OutputDiagnosticOptions, ImageMediaOptions {
44
54
  assetRenderers?: Partial<Record<ImageComponentKind, ComponentImageRenderer>>;
55
+ /** Explicit id/version registry; unbound components continue using assetRenderers by kind. */
56
+ assetRegistry?: ComponentAssetRegistry;
45
57
  assetBudget?: AssetRenderBudget;
46
58
  /** Default throw prevents an incomplete export; placeholder retains the component and emits diagnostics. */
47
59
  assetFailure?: "throw" | "placeholder";
@@ -162,6 +174,36 @@ export declare type ColumnFormat = {
162
174
  /** 同一字段契约生成列语义和表头,业务侧无需复制另一份字段清单。 */
163
175
  export declare function columnsFromContract(contract: DatasetContract, overrides?: Record<string, Partial<TableTemplateColumn>>): TableTemplateColumn[];
164
176
 
177
+ export declare type ColumnVisual = {
178
+ /** Defaults to the column field; never changes the cell's raw value or business identity. */
179
+ field?: string;
180
+ /** Numeric text requires explicit opt-in; formatting an identifier does not turn it into a measure. */
181
+ numeric?: "number" | "decimal";
182
+ min?: number;
183
+ max?: number;
184
+ } & ({
185
+ kind: "colorScale";
186
+ lowColor?: string;
187
+ highColor?: string;
188
+ } | {
189
+ kind: "dataBar";
190
+ color?: string;
191
+ negativeColor?: string;
192
+ });
193
+
194
+ /** Stable-key comparison of business data or instance snapshots. Never compares report coordinates. */
195
+ export declare function compareReportData(before: ReportDataSnapshot, after: ReportDataSnapshot, options: ReportDataComparisonOptions): ReportDataComparison;
196
+
197
+ /** Bounded declarative conditions shared by visibility, styles, IF and candidate validation. */
198
+ export declare function compileReportPredicate(predicate: ReportPredicate, budget?: {
199
+ nodes: number;
200
+ }, depth?: number): ReportPredicateReader;
201
+
202
+ export declare interface ComponentAssetRegistry {
203
+ rendererFor(component: Readonly<PlanComponent>): ComponentImageRenderer | undefined;
204
+ hasExtension(id: string, version: string, kind: string): boolean;
205
+ }
206
+
165
207
  /** A literal own field of the current label record; expressions and paths are not evaluated. */
166
208
  export declare interface ComponentBinding {
167
209
  field: string;
@@ -265,6 +307,16 @@ export declare function createLocalTemplateCatalog(input: LocalTemplateCatalogIt
265
307
  /** 单进程参考适配器;多实例服务请实现具备数据库事务/CAS 的持久化适配器。 */
266
308
  export declare function createMemoryTemplateStore(): ReportTemplateStore;
267
309
 
310
+ /** Owned preview controller; only mounted grids are windowed. Static renderPage and exports stay complete. */
311
+ export declare function createPageViewportRenderer(page: PlanPage, dpi: number, options: RenderOptions, doc: Document): {
312
+ element: HTMLElement;
313
+ update(viewport: ReportViewport, retained?: {
314
+ componentIndex: number;
315
+ rowIndex: number;
316
+ columnIndex: number;
317
+ }): boolean;
318
+ };
319
+
268
320
  export declare function createProviderReport(definition: Omit<ReportDefinition, "load" | "datasets"> & {
269
321
  provider: ReportProvider;
270
322
  }): ReportDefinition;
@@ -278,6 +330,12 @@ export declare function createReportCellEditBatch(plan: RenderPlan, inputs: read
278
330
  /** Operation-scoped index: avoids repeated geometry work without caching mutable plans globally. */
279
331
  export declare function createReportCellResolver(plan: RenderPlan): (address: ReportCellAddress) => ReportCellContext | null;
280
332
 
333
+ /** One bounded scan, shared aggregate semantics; labels never coerce identifier source values. */
334
+ export declare function createReportChartData(rows: readonly Record<string, unknown>[], binding: ReportChartBinding, signal?: AbortSignal): ReportChartData;
335
+
336
+ /** Explicit per-host registry. Templates contain bounded JSON bindings; loaders never come from a template. */
337
+ export declare function createReportComponentRegistry(definitions: readonly ReportComponentExtensionDefinition[]): ReportComponentRegistry;
338
+
281
339
  /** Revalidates the current cell on activation; returns only bounded scalar values and explicit return state. */
282
340
  export declare function createReportDrillRequest(plan: RenderPlan, address: ReportCellAddress, action: ReportDrillAction, params?: Readonly<Record<string, string>>): ReportDrillRequest;
283
341
 
@@ -288,6 +346,9 @@ export declare function createReportEditSession(options: {
288
346
  pagination?: PaginateOptions;
289
347
  }): ReportEditSession;
290
348
 
349
+ /** Explicit field allowlist + stable business keys. Does not mutate, persist or replace a workbook. */
350
+ export declare function createReportPrefill(plan: RenderPlan, options: ReportPrefillOptions): ReportPrefillPreview;
351
+
291
352
  /**
292
353
  * 框架无关的报表数据源:注册一次模板与取数,包内完成分页、校验、按 ID 顺序合并。
293
354
  * 不缓存业务结果、不推断接口包装、不自动重试;鉴权与完整数据范围由宿主决定。
@@ -297,6 +358,7 @@ export declare function createReportSource(reports: ReportRegistry, options?: {
297
358
  onDatasets?: (reportId: string, datasets: DatasetRows, template: ReportTemplate) => void;
298
359
  maxPages?: number;
299
360
  maxCells?: number;
361
+ maxChartComponents?: number;
300
362
  }): ReportSource;
301
363
 
302
364
  /**
@@ -310,6 +372,8 @@ export declare function createTemplate(): TemplateBuilder;
310
372
  /** 持久化和框架无关的发布流程;历史返回快照,回滚会产生新修订而不会覆盖旧历史。 */
311
373
  export declare function createTemplateManager(store: ReportTemplateStore, options?: {
312
374
  migrate?: (input: unknown) => unknown | Promise<unknown>;
375
+ /** Explicit schema chain, applied to saved drafts and loaded/rolled-back documents. Legacy migrate remains save-only. */
376
+ migrations?: readonly ReportTemplateMigration[];
313
377
  now?: () => Date;
314
378
  /** Optional publication gate; receives explicit draft snapshots and never replaces CAS. */
315
379
  beforePublish?: (context: {
@@ -319,6 +383,9 @@ export declare function createTemplateManager(store: ReportTemplateStore, option
319
383
  }) => ReportTemplateReview | Promise<ReportTemplateReview>;
320
384
  }): ReportTemplateManager;
321
385
 
386
+ /** Explicit, bounded migration chain. Unknown/future versions are never silently downgraded. */
387
+ export declare function createTemplateMigrator(steps?: readonly ReportTemplateMigration[]): (input: unknown) => Promise<ReportTemplateMigrationResult>;
388
+
322
389
  /** 存储无关的模板目录;后台 CRUD、权限、发布审批与持久化由宿主接入。 */
323
390
  export declare function createTemplateRegistry(documents?: readonly ReportTemplateDocument[]): ReportTemplateRegistry;
324
391
 
@@ -409,6 +476,11 @@ export declare function evalStyleRule(row: Record<string, unknown>, when: StyleR
409
476
  /** A tiny arithmetic parser: no functions, property access, globals, assignments or executable source. */
410
477
  export declare function evaluateReportAggregateExpression(expression: string, values: Readonly<Record<string, number>>): number;
411
478
 
479
+ export declare function evaluateReportPredicate(row: Readonly<Record<string, unknown>>, predicate: ReportPredicate): boolean;
480
+
481
+ /** Derives locatable explanations only from explicit business declarations; never evaluates formulas. */
482
+ export declare function explainDatasetField(contract: DatasetContract, target: ReportDataTarget): ReportDiagnostic[];
483
+
412
484
  declare interface ExpressionOptions {
413
485
  numeric?: "number" | "decimal";
414
486
  digits?: number;
@@ -416,6 +488,8 @@ declare interface ExpressionOptions {
416
488
  divisionByZero?: "null" | "error";
417
489
  }
418
490
 
491
+ export declare function formatReportCascaderPath(value: readonly string[]): string;
492
+
419
493
  /** 同步 text/raw value,所有输出后端读取同一份更新后的 RenderPlan。 */
420
494
  export declare function formatReportCellEdit(context: ReportCellContext, value: ReportCellValue): string;
421
495
 
@@ -424,6 +498,10 @@ export declare function formatReportClipboard(rows: readonly (readonly string[])
424
498
 
425
499
  export declare function formatReportDateRange(range: ReportDateRange): string;
426
500
 
501
+ export declare function formatReportNumberRange(value: ReportNumberRange): string;
502
+
503
+ export declare function formatReportParamSelection(value: readonly string[]): string;
504
+
427
505
  /**
428
506
  * 应用格式化。非数值/无法解析时原样返回基础文本(降级不报错):
429
507
  * - number:digits 小数位 + 可选千分位(12,345.60;thousands 默认 false)
@@ -448,6 +526,12 @@ export declare function getReportCellContext(plan: RenderPlan, address: ReportCe
448
526
  export declare function getReportEditSession(plan: RenderPlan): ReportEditSession | undefined;
449
527
 
450
528
  export declare interface GridCell {
529
+ /** Resolved visual only. Original value, text, editability and source are unchanged. */
530
+ dataBar?: {
531
+ start: number;
532
+ end: number;
533
+ color: string;
534
+ };
451
535
  /** Styled cell content; text remains a plain-text fallback. Imported rich cells are read-only. */
452
536
  richParagraphs?: RichParagraph[];
453
537
  text?: string;
@@ -660,6 +744,8 @@ export declare interface ListColumn {
660
744
  format?: ColumnFormat;
661
745
  /** 条件格式规则(声明式,命中合并进单元格样式;如负数红字) */
662
746
  rules?: StyleRule[];
747
+ /** Optional resolved color scale or value-preserving data bar. */
748
+ visual?: ColumnVisual;
663
749
  /** 内容列编辑控制;仍需由预览显式开启 editing,不影响表头/小计只读规则。 */
664
750
  editable?: boolean;
665
751
  /** 空值列或特殊数据类型可显式声明编辑输入类型。 */
@@ -779,6 +865,26 @@ export declare interface LocalTemplateCatalogItem {
779
865
  /** O(action count), no row scans or listeners per cell; invoke for the focused cell only. */
780
866
  export declare function matchReportDrillActions(plan: RenderPlan, address: ReportCellAddress, actions: readonly ReportDrillAction[]): ReportDrillAction[];
781
867
 
868
+ declare interface MatrixAxisOptions {
869
+ /** Display names in the same outer-to-inner order as the dimension fields. */
870
+ labels?: readonly string[];
871
+ /** Per-level sibling order; omitted levels retain first-seen order. */
872
+ sort?: readonly MatrixDimensionOrder[];
873
+ /** One-based prefix depths. Leaf depths are not subtotals. */
874
+ subtotals?: readonly number[];
875
+ }
876
+
877
+ declare type MatrixDimensionOrder = "source" | "asc" | "desc";
878
+
879
+ declare interface MatrixHierarchyOptions {
880
+ row?: MatrixAxisOptions;
881
+ column?: MatrixAxisOptions;
882
+ /** Only null/missing values use this label; empty strings and zero stay distinct. */
883
+ emptyLabel?: string;
884
+ subtotalLabel?: string;
885
+ totalLabel?: string;
886
+ }
887
+
782
888
  declare interface MatrixTableOptions {
783
889
  rowFields: readonly string[];
784
890
  columnFields: readonly string[];
@@ -793,6 +899,10 @@ declare interface MatrixTableOptions {
793
899
  maxColumns?: number;
794
900
  maxInputRows?: number;
795
901
  maxCells?: number;
902
+ /** Opt-in hierarchical dimensions, physical merged headers and prefix subtotals. */
903
+ hierarchy?: MatrixHierarchyOptions;
904
+ /** Hierarchical aggregate work, checked before measure reads; default 10 million updates. */
905
+ maxAggregateUpdates?: number;
796
906
  }
797
907
 
798
908
  export declare function measurePageSizePx(page: Pick<PlanPage, "pageWidthMm" | "pageHeightMm">, dpi?: number): {
@@ -827,6 +937,11 @@ export declare interface OutputDiagnostic {
827
937
  componentPath?: readonly number[];
828
938
  kind: string;
829
939
  nid?: string;
940
+ /** Declarative extension identity only; no property values or business binding data enter diagnostics. */
941
+ extension?: {
942
+ id: string;
943
+ version: string;
944
+ };
830
945
  message: string;
831
946
  }
832
947
 
@@ -898,6 +1013,13 @@ export declare class PaginateCellLimitError extends Error {
898
1013
  constructor(limit: number, actual: number);
899
1014
  }
900
1015
 
1016
+ export declare class PaginateChartComponentLimitError extends Error {
1017
+ readonly limit: number;
1018
+ readonly estimated: number;
1019
+ readonly code = "chart-component-limit";
1020
+ constructor(limit: number, estimated: number);
1021
+ }
1022
+
901
1023
  export declare interface PaginateOptions {
902
1024
  /** 每行额外占高(mm),压测专用钩子 */
903
1025
  mmPerRow?: number;
@@ -907,6 +1029,8 @@ export declare interface PaginateOptions {
907
1029
  maxPages?: number;
908
1030
  /** Actual grid cells, including repeated furniture and nested children; checked before each page is appended. */
909
1031
  maxCells?: number;
1032
+ /** Shared bound-chart primitive budget, checked before expansion; default 50000, range 1..1000000. */
1033
+ maxChartComponents?: number;
910
1034
  signal?: AbortSignal;
911
1035
  /** Streaming total-page anchors can skip the bounded counting pass when known. */
912
1036
  knownTotalPages?: number;
@@ -925,6 +1049,8 @@ export declare class PaginatePageLimitError extends Error {
925
1049
  export declare interface PaginateResult {
926
1050
  plan: RenderPlan;
927
1051
  warnings: string[];
1052
+ /** Actual resolved bound-chart primitives, including empty placeholders. */
1053
+ chartComponents: number;
928
1054
  }
929
1055
 
930
1056
  /** Compatibility collector: the pagination engine is shared with the bounded page iterator. */
@@ -944,6 +1070,8 @@ export declare type PaperName = keyof typeof PAPER_SIZES;
944
1070
  /** 日历日字符串 → 本地 Date(不含时间的纯日期,杜绝 UTC 偏移) */
945
1071
  export declare function parseDateLocal(input: string): Date | null;
946
1072
 
1073
+ export declare function parseReportCascaderPath(value: unknown): string[] | undefined;
1074
+
947
1075
  /** Core type parsing is authoritative; field controls add restrictions, never coerce IDs or bypass readonly. */
948
1076
  export declare function parseReportCellFieldInput(context: ReportCellContext, input: ReportCellValue, field?: ReportCellFieldOptions): ReportCellValue;
949
1077
 
@@ -956,10 +1084,16 @@ export declare function parseReportClipboard(text: string, maxCells?: number): s
956
1084
  /** Only complete, ordered, real calendar dates are accepted; there is no timezone conversion. */
957
1085
  export declare function parseReportDateRange(value: string): ReportDateRange | undefined;
958
1086
 
1087
+ export declare function parseReportNumberRange(value: unknown): ReportNumberRange | undefined;
1088
+
1089
+ export declare function parseReportParamSelection(value: unknown): string[] | undefined;
1090
+
959
1091
  /** 校验文件 JSON 文本或接口返回的未知对象,返回独立模板快照。 */
960
1092
  export declare function parseReportTemplate(input: unknown): ReportTemplateDocument;
961
1093
 
962
1094
  export declare interface PlanComponent {
1095
+ /** Template-only aggregate binding, expanded into shared primitives during layout. */
1096
+ chartBinding?: ReportChartBinding;
963
1097
  /** Optional QR/barcode encoding configuration; no encoder is loaded by the core. */
964
1098
  code?: CodeOptions;
965
1099
  /** Template-only binding; resolved and removed before constructing the output plan. */
@@ -1111,6 +1245,11 @@ export declare interface ReportCalculationSelection {
1111
1245
  focus: ReportCellAddress;
1112
1246
  }
1113
1247
 
1248
+ export declare interface ReportCandidateValidationOptions extends Pick<ReportDatasetValidationOptions, "rules" | "maxChecks" | "maxIssues"> {
1249
+ /** Warnings are visible and allowed by default; block explicitly when required by business policy. */
1250
+ warningPolicy?: "allow" | "block";
1251
+ }
1252
+
1114
1253
  /** 预览中的物理坐标;合并单元格使用左上角坐标。 */
1115
1254
  export declare interface ReportCellAddress {
1116
1255
  pageIndex: number;
@@ -1225,6 +1364,209 @@ export declare type ReportCellValue = string | number | boolean | null;
1225
1364
 
1226
1365
  export declare type ReportCellValueType = NonNullable<GridCell["valueType"]>;
1227
1366
 
1367
+ /** Serializable binding; data and authorization continue to come from the existing report source. */
1368
+ export declare interface ReportChartBinding {
1369
+ dataset: string;
1370
+ categoryField: string;
1371
+ measures: readonly ReportChartMeasure[];
1372
+ type: ReportChartOptions["type"];
1373
+ sort?: "asc" | "desc";
1374
+ title?: string;
1375
+ showValues?: boolean;
1376
+ maxRows?: number;
1377
+ maxCategories?: number;
1378
+ }
1379
+
1380
+ export declare interface ReportChartData {
1381
+ categories: string[];
1382
+ series: ReportChartSeries[];
1383
+ }
1384
+
1385
+ export declare interface ReportChartMeasure extends AggregateRequest {
1386
+ label?: string;
1387
+ color?: string;
1388
+ }
1389
+
1390
+ declare interface ReportChartOptions {
1391
+ type: "bar" | "line" | "stackedBar" | "percentBar";
1392
+ categories: readonly string[];
1393
+ series: readonly ReportChartSeries[];
1394
+ leftMm: number;
1395
+ topMm: number;
1396
+ widthMm: number;
1397
+ heightMm: number;
1398
+ title?: string;
1399
+ showValues?: boolean;
1400
+ }
1401
+
1402
+ declare interface ReportChartSeries {
1403
+ name: string;
1404
+ values: readonly (number | null)[];
1405
+ color?: string;
1406
+ }
1407
+
1408
+ export declare interface ReportComparison {
1409
+ field: string;
1410
+ op: ">" | ">=" | "<" | "<=" | "==" | "!=" | "between" | "contains" | "isNull" | "isNotNull";
1411
+ /** Legacy scalar thresholds remain supported. Use right for field-to-field comparisons. */
1412
+ value?: ReportPredicateScalar;
1413
+ right?: ReportPredicateOperand;
1414
+ values?: readonly [ReportPredicateScalar, ReportPredicateScalar];
1415
+ numeric?: "number" | "decimal";
1416
+ valueType?: "number" | "decimal" | "text" | "date" | "boolean";
1417
+ }
1418
+
1419
+ export declare interface ReportComponentExtensionBinding {
1420
+ id: string;
1421
+ version: string;
1422
+ props: Readonly<Record<string, ReportComponentValue>>;
1423
+ /** Host-defined JSON only: core does not execute queries, scripts or property paths in this binding. */
1424
+ binding?: ReportComponentJson;
1425
+ }
1426
+
1427
+ export declare interface ReportComponentExtensionContext extends ComponentImageContext {
1428
+ readonly extension: Readonly<ReportComponentExtensionBinding>;
1429
+ }
1430
+
1431
+ export declare interface ReportComponentExtensionDefinition extends ReportComponentExtensionMetadata {
1432
+ /** Trusted runtime loader, never read from template JSON or a remote import URL. */
1433
+ load(signal: AbortSignal): ReportComponentExtensionRenderer | Promise<ReportComponentExtensionRenderer>;
1434
+ }
1435
+
1436
+ export declare class ReportComponentExtensionError extends Error {
1437
+ readonly code: "definition" | "binding" | "load" | "disposed";
1438
+ readonly path: string;
1439
+ readonly extensionId?: string | undefined;
1440
+ constructor(code: "definition" | "binding" | "load" | "disposed", message: string, path?: string, extensionId?: string | undefined);
1441
+ }
1442
+
1443
+ export declare interface ReportComponentExtensionMetadata {
1444
+ id: string;
1445
+ version: string;
1446
+ kind: ImageComponentKind;
1447
+ label: string;
1448
+ description?: string;
1449
+ properties?: Readonly<Record<string, ReportComponentProperty>>;
1450
+ }
1451
+
1452
+ export declare interface ReportComponentExtensionRenderer {
1453
+ render(context: ReportComponentExtensionContext): string | Promise<string>;
1454
+ dispose?(): void | Promise<void>;
1455
+ }
1456
+
1457
+ export declare type ReportComponentJson = ReportComponentValue | readonly ReportComponentJson[] | {
1458
+ readonly [key: string]: ReportComponentJson;
1459
+ };
1460
+
1461
+ export declare interface ReportComponentProperty {
1462
+ label: string;
1463
+ type: "string" | "number" | "boolean";
1464
+ required?: boolean;
1465
+ default?: ReportComponentValue;
1466
+ options?: readonly ReportComponentValue[];
1467
+ min?: number;
1468
+ max?: number;
1469
+ maxLength?: number;
1470
+ }
1471
+
1472
+ export declare interface ReportComponentRegistry extends ComponentAssetRegistry {
1473
+ /** Pass directly as Preview/Runtime assets; no component-specific adapter wiring is needed. */
1474
+ readonly assets: Readonly<Pick<AssetRenderOptions, "assetRegistry">>;
1475
+ describe(kind?: ImageComponentKind): readonly Readonly<ReportComponentExtensionMetadata>[];
1476
+ /** Add native geometry and insert into the existing template/canvas command path. */
1477
+ createComponent(id: string, values?: {
1478
+ props?: Readonly<Record<string, ReportComponentValue>>;
1479
+ binding?: ReportComponentJson;
1480
+ }): Pick<PlanComponent, "kind" | "meta">;
1481
+ /** Idempotent. Abort active consumers, release loaded renderers, and release a late loader when it finishes. */
1482
+ dispose(): Promise<void>;
1483
+ }
1484
+
1485
+ export declare type ReportComponentValue = string | number | boolean | null;
1486
+
1487
+ export declare interface ReportDataComparison {
1488
+ sourceScope?: string;
1489
+ datasetId: string;
1490
+ differences: readonly ReportDataDifference[];
1491
+ counts: {
1492
+ added: number;
1493
+ removed: number;
1494
+ changed: number;
1495
+ unchanged: number;
1496
+ cells: number;
1497
+ };
1498
+ }
1499
+
1500
+ export declare interface ReportDataComparisonField {
1501
+ field: string;
1502
+ label?: string;
1503
+ /** Numeric comparison is explicit; identifiers containing digits stay text. */
1504
+ type?: "value" | "decimal";
1505
+ /** Absolute decimal tolerance, inclusive. No binary floating-point subtraction. */
1506
+ tolerance?: string;
1507
+ /** Fractional ratio digits. changeRatio is (after - before) / before, not a percent. */
1508
+ ratioDigits?: number;
1509
+ zeroDenominator?: "omit" | "zero-if-equal";
1510
+ missing?: "distinct" | "empty-equivalent" | "zero";
1511
+ }
1512
+
1513
+ export declare interface ReportDataComparisonOptions extends ReportDataLimits {
1514
+ fields: readonly ReportDataComparisonField[];
1515
+ maxDifferences?: number;
1516
+ }
1517
+
1518
+ export declare interface ReportDataDifference {
1519
+ rowKey: string | number;
1520
+ kind: "added" | "removed" | "changed";
1521
+ field: string;
1522
+ label: string;
1523
+ before: ReportCellValue | undefined;
1524
+ after: ReportCellValue | undefined;
1525
+ /** Exact base-ten difference. Undefined when either input is missing/non-numeric. */
1526
+ delta?: string;
1527
+ changeRatio?: string;
1528
+ ratioUnavailable?: "zero-denominator" | "missing";
1529
+ }
1530
+
1531
+ export declare class ReportDataError extends Error {
1532
+ readonly code: "identity" | "duplicate" | "limit" | "value" | "conflict";
1533
+ constructor(code: "identity" | "duplicate" | "limit" | "value" | "conflict", message: string);
1534
+ }
1535
+
1536
+ export declare interface ReportDataLimits {
1537
+ maxRows?: number;
1538
+ maxFields?: number;
1539
+ maxCells?: number;
1540
+ }
1541
+
1542
+ /** A business record, never a physical report row index. */
1543
+ export declare interface ReportDataRecord {
1544
+ rowKey: string | number;
1545
+ values: Readonly<Record<string, ReportCellValue>>;
1546
+ }
1547
+
1548
+ export declare interface ReportDatasetValidationOptions {
1549
+ rules: readonly ReportValidationRule[];
1550
+ rowKey?: string;
1551
+ computed?: readonly ComputedField[];
1552
+ /** Explicit trusted engine, shared with pagination; never read from a serialized template. */
1553
+ formula?: FormulaAdapter;
1554
+ /** Uses the same bounded tree preparation and descendant-leaf summaries as pagination. */
1555
+ tree?: TreeTableOptions;
1556
+ maxChecks?: number;
1557
+ maxIssues?: number;
1558
+ signal?: AbortSignal;
1559
+ }
1560
+
1561
+ export declare interface ReportDataSnapshot {
1562
+ sourceScope?: string;
1563
+ datasetId: string;
1564
+ rows: readonly ReportDataRecord[];
1565
+ }
1566
+
1567
+ /** Extracts explicit fields from the same rendered query; never makes a second business request. */
1568
+ export declare function reportDataSnapshotFromPlan(plan: RenderPlan, options: ReportPlanDataOptions): ReportDataSnapshot;
1569
+
1228
1570
  export declare interface ReportDataTarget {
1229
1571
  datasetId: string;
1230
1572
  field: string;
@@ -1235,6 +1577,17 @@ export declare interface ReportDataTarget {
1235
1577
  reportScope?: string;
1236
1578
  }
1237
1579
 
1580
+ /** Resolve a business calendar default once per request; returns only a portable date value. */
1581
+ export declare function reportDateDefault(options: ReportDateDefaultOptions): string;
1582
+
1583
+ export declare interface ReportDateDefaultOptions {
1584
+ preset: "today" | "yesterday" | "month-start" | "month-end";
1585
+ /** Explicit business clock in milliseconds or Date; no hidden browser/server clock. */
1586
+ now: number | Date;
1587
+ timeZone: string;
1588
+ offsetDays?: number;
1589
+ }
1590
+
1238
1591
  /** Wire values deliberately remain strings in browsers, Workers and backend runtimes. */
1239
1592
  export declare interface ReportDateRange {
1240
1593
  start: string;
@@ -1337,6 +1690,7 @@ export declare interface ReportEditConflict {
1337
1690
 
1338
1691
  export declare interface ReportEditPreparationOptions {
1339
1692
  signal?: AbortSignal;
1693
+ validation?: ReportCandidateValidationOptions;
1340
1694
  }
1341
1695
 
1342
1696
  export declare interface ReportEditResult {
@@ -1361,6 +1715,8 @@ declare interface ReportEditSessionPart {
1361
1715
 
1362
1716
  export declare interface ReportEditSessionRegistration {
1363
1717
  parts: readonly ReportEditSessionPart[];
1718
+ /** Trusted runtime adapters stay outside the serializable guarded source snapshot. */
1719
+ validationFormulas?: readonly (FormulaAdapter | undefined)[];
1364
1720
  rebuild(parts: readonly ReportEditSessionPart[], signal?: AbortSignal): Promise<RenderPlan>;
1365
1721
  }
1366
1722
 
@@ -1373,10 +1729,14 @@ declare type ReportExpression = {
1373
1729
  field?: string;
1374
1730
  weightField?: string;
1375
1731
  } | {
1376
- op: "add" | "subtract" | "multiply" | "divide" | "coalesce";
1732
+ op: ReportExpressionOperation;
1733
+ /** Required for if; args are [then, else], and only the selected branch is evaluated. */
1734
+ condition?: ReportPredicate;
1377
1735
  args: readonly ReportExpression[];
1378
1736
  };
1379
1737
 
1738
+ declare type ReportExpressionOperation = "add" | "subtract" | "multiply" | "divide" | "coalesce" | "if" | "round" | "abs" | "concat" | "trim" | "upper" | "lower" | "dateYear" | "dateMonth" | "dateDay";
1739
+
1380
1740
  /** 保持 Promise<RenderPlan> 契约;元数据为可选,旧业务 fetcher 无需改造。 */
1381
1741
  export declare interface ReportFetcher {
1382
1742
  (input: ReportFetchInput): Promise<RenderPlan>;
@@ -1393,7 +1753,15 @@ export declare interface ReportFetchInput extends ReportTaskMonitoring {
1393
1753
  onQueryResult?: (reportId: string, result: ReportQueryResult, reportIndex?: number) => void;
1394
1754
  }
1395
1755
 
1396
- export declare interface ReportFieldContract {
1756
+ export declare type ReportFieldAggregation = "sum" | "avg" | "min" | "max" | "count" | "none";
1757
+
1758
+ export declare interface ReportFieldCalculation {
1759
+ /** Business-owned explanation, never executable JavaScript or an inferred business formula. */
1760
+ description: string;
1761
+ dependsOn: readonly string[];
1762
+ }
1763
+
1764
+ export declare interface ReportFieldContract extends ReportFieldSemantics {
1397
1765
  field: string;
1398
1766
  label?: string;
1399
1767
  type: "text" | "number" | "boolean" | "date" | "decimal";
@@ -1408,6 +1776,17 @@ export declare interface ReportFieldContract {
1408
1776
  unit?: string;
1409
1777
  }
1410
1778
 
1779
+ export declare interface ReportFieldSemantics {
1780
+ description?: string;
1781
+ /** Explicit meaning of null/missing; does not convert blanks into zero. */
1782
+ missingMeaning?: string;
1783
+ /** Recommended aggregation; none marks non-additive measures such as ratios. No aggregation runs implicitly. */
1784
+ aggregation?: ReportFieldAggregation;
1785
+ /** Shared presentation only; raw values and calculation precision remain unchanged. */
1786
+ format?: ColumnFormat;
1787
+ calculation?: ReportFieldCalculation;
1788
+ }
1789
+
1411
1790
  export declare interface ReportFlowBand {
1412
1791
  /** Exact stable component IDs. Static components use nid, lists use id. */
1413
1792
  componentIds: string[];
@@ -1429,6 +1808,8 @@ export declare interface ReportLoadContext {
1429
1808
  signal?: AbortSignal;
1430
1809
  }
1431
1810
 
1811
+ export declare type ReportNumberRange = readonly [number, number];
1812
+
1432
1813
  export declare function reportOutputDiagnostics(plan: RenderPlan, format: OutputFormat, options: OutputDiagnosticOptions): OutputDiagnostic[];
1433
1814
 
1434
1815
  export declare interface ReportPageFlow {
@@ -1441,12 +1822,9 @@ export declare interface ReportParamDef {
1441
1822
  field: string;
1442
1823
  /** 显示名(缺省用 field) */
1443
1824
  label?: string;
1444
- type?: "text" | "number" | "date" | "month" | "year" | "dateRange" | "select";
1825
+ type?: "text" | "number" | "date" | "month" | "year" | "dateRange" | "select" | "multiSelect" | "cascader" | "numberRange";
1445
1826
  /** select 选项 */
1446
- options?: Array<{
1447
- label: string;
1448
- value: string;
1449
- }>;
1827
+ options?: ReportParamTreeOption[];
1450
1828
  /** Opaque host-resolved source key. No URL, credentials or executable code is stored. */
1451
1829
  optionsSource?: string;
1452
1830
  /** Select dependencies must be declared parameters; changing a parent clears descendants. */
@@ -1459,6 +1837,9 @@ export declare interface ReportParamDef {
1459
1837
  max?: number | string;
1460
1838
  minLength?: number;
1461
1839
  maxLength?: number;
1840
+ /** multiSelect item count (maximum 100). Cascader paths are bounded to 16 levels. */
1841
+ minItems?: number;
1842
+ maxItems?: number;
1462
1843
  }
1463
1844
 
1464
1845
  export declare interface ReportParamIssue {
@@ -1468,17 +1849,26 @@ export declare interface ReportParamIssue {
1468
1849
  message: string;
1469
1850
  }
1470
1851
 
1471
- export declare type ReportParamIssueCode = "definition" | "required" | "type" | "option" | "dependency" | "minimum" | "maximum" | "minLength" | "maxLength";
1852
+ export declare type ReportParamIssueCode = "definition" | "required" | "type" | "option" | "dependency" | "minimum" | "maximum" | "minLength" | "maxLength" | "minItems" | "maxItems";
1472
1853
 
1473
1854
  /** 描述 typedValues 的 Draft 2020-12 Schema;日期区间额外保留 x-report-* 扩展。 */
1474
1855
  export declare function reportParamsJsonSchema(defs: readonly ReportParamDef[]): Record<string, unknown>;
1475
1856
 
1857
+ /** Cascader values are unique within each sibling list. */
1858
+ export declare interface ReportParamTreeOption {
1859
+ label: string;
1860
+ value: string;
1861
+ children?: ReportParamTreeOption[];
1862
+ }
1863
+
1864
+ export declare type ReportParamTypedValue = string | number | string[] | ReportNumberRange;
1865
+
1476
1866
  export declare interface ReportParamValidation {
1477
1867
  ok: boolean;
1478
1868
  /** 保留历史取数契约的字符串形式;未知参数保留,不能代替接口权限白名单。 */
1479
1869
  values: Record<string, string>;
1480
1870
  /** JSON Schema 对应的规范值:number 参数转换为有限数字。 */
1481
- typedValues: Record<string, string | number>;
1871
+ typedValues: Record<string, ReportParamTypedValue>;
1482
1872
  issues: ReportParamIssue[];
1483
1873
  }
1484
1874
 
@@ -1488,9 +1878,80 @@ export declare class ReportParamValidationError extends Error {
1488
1878
  constructor(issues: readonly ReportParamIssue[]);
1489
1879
  }
1490
1880
 
1881
+ export declare interface ReportPlanDataOptions extends ReportDataLimits {
1882
+ sourceScope?: string;
1883
+ datasetId: string;
1884
+ fields: readonly string[];
1885
+ }
1886
+
1887
+ export declare type ReportPredicate = ReportComparison | {
1888
+ all: readonly ReportPredicate[];
1889
+ } | {
1890
+ any: readonly ReportPredicate[];
1891
+ } | {
1892
+ not: ReportPredicate;
1893
+ };
1894
+
1895
+ export declare function reportPredicateFields(predicate: ReportPredicate): string[];
1896
+
1897
+ export declare type ReportPredicateOperand = {
1898
+ field: string;
1899
+ } | {
1900
+ value: ReportPredicateScalar;
1901
+ };
1902
+
1903
+ export declare type ReportPredicateReader = (row: Readonly<Record<string, unknown>>) => boolean;
1904
+
1905
+ export declare type ReportPredicateScalar = string | number | boolean | null;
1906
+
1907
+ export declare interface ReportPrefillField {
1908
+ field: string;
1909
+ sourceField?: string;
1910
+ label?: string;
1911
+ }
1912
+
1913
+ /** Re-resolve coordinates after reflow; any changed value/token rejects the complete application. */
1914
+ export declare function reportPrefillInputs(plan: RenderPlan, preview: ReportPrefillPreview, canEdit?: (context: ReportCellContext) => boolean): ReportCellInput[];
1915
+
1916
+ export declare interface ReportPrefillItem {
1917
+ source: Readonly<ReportCellSource>;
1918
+ label: string;
1919
+ status: ReportPrefillStatus;
1920
+ reason?: ReportPrefillReason;
1921
+ before?: ReportCellValue;
1922
+ after?: ReportCellValue;
1923
+ }
1924
+
1925
+ export declare interface ReportPrefillOptions extends ReportDataLimits {
1926
+ sourceScope?: string;
1927
+ datasetId: string;
1928
+ fields: readonly ReportPrefillField[];
1929
+ rows: readonly ReportDataRecord[];
1930
+ /** Default: fill only null/empty string. Existing zero, false and whitespace are data. */
1931
+ mode?: "empty" | "replace";
1932
+ maxChanges?: number;
1933
+ canEdit?(context: ReportCellContext): boolean;
1934
+ }
1935
+
1936
+ export declare interface ReportPrefillPreview {
1937
+ sourceScope?: string;
1938
+ datasetId: string;
1939
+ items: readonly ReportPrefillItem[];
1940
+ counts: Readonly<Record<ReportPrefillStatus, number>>;
1941
+ /** Optimistic source tokens and previous values are retained for an atomic edit. */
1942
+ edits: readonly ReportCellEdit[];
1943
+ }
1944
+
1945
+ export declare type ReportPrefillReason = "unchanged" | "readonly" | "occupied" | "missing-source" | "missing-target" | "ambiguous" | "invalid";
1946
+
1947
+ export declare type ReportPrefillStatus = "matched" | "changed" | "skipped" | "conflict";
1948
+
1491
1949
  export declare interface ReportPreparedEdit {
1492
1950
  /** Calculated preview; no source/session state changes until commit succeeds. */
1493
1951
  readonly plan: RenderPlan;
1952
+ readonly validationIssues: readonly ReportValidationIssue[];
1953
+ /** Validate complete candidate source rows and derived fields before invoking persistence. */
1954
+ validate(options: ReportCandidateValidationOptions): readonly ReportValidationIssue[];
1494
1955
  /** Call after persistence. A stale or repeated commit fails instead of publishing mixed state. */
1495
1956
  commit(result?: void | ReportEditResult): RenderPlan;
1496
1957
  }
@@ -1703,6 +2164,26 @@ export declare interface ReportTemplateManager {
1703
2164
  rollback(id: string, revision: string, options: TemplateMutationOptions): Promise<ReportTemplateRecord>;
1704
2165
  }
1705
2166
 
2167
+ export declare interface ReportTemplateMigration {
2168
+ from: string;
2169
+ to: string;
2170
+ /** Pure document transformation; business data, credentials and I/O belong to the host. */
2171
+ migrate(input: Readonly<Record<string, unknown>>): unknown | Promise<unknown>;
2172
+ }
2173
+
2174
+ export declare class ReportTemplateMigrationError extends Error {
2175
+ readonly code: "definition" | "unsupported" | "result";
2176
+ constructor(code: "definition" | "unsupported" | "result", message: string);
2177
+ }
2178
+
2179
+ export declare interface ReportTemplateMigrationResult {
2180
+ document: ReportTemplateDocument;
2181
+ steps: readonly {
2182
+ from: string;
2183
+ to: string;
2184
+ }[];
2185
+ }
2186
+
1706
2187
  export declare interface ReportTemplateProvider {
1707
2188
  list(context: {
1708
2189
  signal?: AbortSignal;
@@ -1818,9 +2299,47 @@ export declare interface ReportTemplateVersion {
1818
2299
  restoredFrom?: string;
1819
2300
  }
1820
2301
 
2302
+ export declare class ReportValidationError extends Error {
2303
+ readonly issues: readonly ReportValidationIssue[];
2304
+ constructor(issues: readonly ReportValidationIssue[]);
2305
+ }
2306
+
2307
+ export declare interface ReportValidationIssue {
2308
+ ruleId: string;
2309
+ rowKey?: string | number;
2310
+ rowIndex?: number;
2311
+ field?: string;
2312
+ dataset?: string;
2313
+ sourceScope?: string;
2314
+ severity: "error" | "warning";
2315
+ message: string;
2316
+ }
2317
+
2318
+ export declare interface ReportValidationRule {
2319
+ id: string;
2320
+ /** Optional target; omitted applies to each candidate dataset. */
2321
+ dataset?: string;
2322
+ assert: ReportPredicate;
2323
+ when?: ReportPredicate;
2324
+ field?: string;
2325
+ severity?: "error" | "warning";
2326
+ message: string;
2327
+ scope?: "row" | "dataset";
2328
+ /** Dataset-scope assertions read this explicit summary row, never an arbitrary detail row. */
2329
+ aggregates?: readonly AggregateDefinition[];
2330
+ }
2331
+
1821
2332
  /** Optional business explanations never replace raw data or schema validation. */
1822
2333
  export declare type ReportValueState = "missing-source" | "not-applicable" | "not-calculable";
1823
2334
 
2335
+ /** Preview coordinates only. Output plans and their complete geometry remain unchanged. */
2336
+ export declare interface ReportViewport {
2337
+ leftMm: number;
2338
+ topMm: number;
2339
+ widthMm: number;
2340
+ heightMm: number;
2341
+ }
2342
+
1824
2343
  /**
1825
2344
  * 边框开关解析:
1826
2345
  * - 未声明(undefined)→ 四边全开(与既有 rect 总有边框的行为兼容)
@@ -1921,13 +2440,7 @@ export declare function serializeReportTemplate(document: ReportTemplateDocument
1921
2440
 
1922
2441
  /** 条件格式规则求值(声明式,见 ListColumn.rules) */
1923
2442
  export declare interface StyleRule {
1924
- when: {
1925
- field: string;
1926
- op: ">" | ">=" | "<" | "<=" | "==" | "!=";
1927
- value: number | string;
1928
- /** Explicit decimal comparisons retain decimal thresholds as text. */
1929
- numeric?: "number" | "decimal";
1930
- };
2443
+ when: ReportPredicate;
1931
2444
  /** 命中时合并进单元格样式(color/bold/backgroundColor 等) */
1932
2445
  style: Record<string, unknown>;
1933
2446
  }
@@ -2151,6 +2664,11 @@ export declare function validateRenderPlan(input: unknown): ValidationResult;
2151
2664
  /** Check configuration before opening an input, including JSON/JavaScript callers. */
2152
2665
  export declare function validateReportCellFieldDefinition(context: ReportCellContext, field: ReportCellFieldOptions): void;
2153
2666
 
2667
+ export declare function validateReportChartBinding(binding: ReportChartBinding): void;
2668
+
2669
+ /** Pure candidate validation shared by browsers and Node; checks the complete proposed dataset before persistence. */
2670
+ export declare function validateReportDataset(input: readonly Record<string, unknown>[], options: ReportDatasetValidationOptions): ReportValidationIssue[];
2671
+
2154
2672
  export declare function validateReportDrillActions(actions: readonly ReportDrillAction[]): void;
2155
2673
 
2156
2674
  /** 模板参数配置错误也统一返回结构化问题,不让无效默认值或边界静默进入后端。 */