@agile-team/mach-report 2.6.1 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +59 -8
- package/dist/ReportPreview-BKKDAv8e.js +4481 -0
- package/dist/ReportPreview-E3cm67Tk.cjs +6 -0
- package/dist/{assets-NVA_sftu.js → assets-B9qJku3V.js} +54 -57
- package/dist/assets-RZan7EyL.cjs +1 -0
- package/dist/capabilities-joSutDF8.js +63 -0
- package/dist/capabilities-xGTpnPjJ.cjs +1 -0
- package/dist/designer.cjs +1 -1
- package/dist/designer.d.cts +922 -753
- package/dist/designer.d.ts +922 -753
- package/dist/designer.js +490 -234
- package/dist/index.cjs +8 -8
- package/dist/index.d.cts +128 -3
- package/dist/index.d.ts +128 -3
- package/dist/index.js +971 -699
- package/dist/pdf.cjs +30 -30
- package/dist/pdf.d.cts +11 -3
- package/dist/pdf.d.ts +11 -3
- package/dist/pdf.js +1501 -1500
- package/dist/{plugin-Ds10VnQO.js → plugin-PCgxBVB2.js} +1 -1
- package/dist/{plugin-BqBkn_kI.cjs → plugin-mAfvgSey.cjs} +1 -1
- package/dist/progress-DD964VAB.js +102 -0
- package/dist/progress-KvhwXZ1Q.cjs +1 -0
- package/dist/{report-source-B9bENO0F.js → report-source-BXHNy_AD.js} +337 -332
- package/dist/report-source-CCAvFE3t.cjs +1 -0
- package/dist/server/node.d.cts +26 -3
- package/dist/server/node.d.ts +26 -3
- package/dist/server-node.cjs +1 -1
- package/dist/server-node.js +125 -92
- package/dist/server.cjs +1 -1
- package/dist/server.d.cts +28 -3
- package/dist/server.d.ts +28 -3
- package/dist/server.js +172 -164
- package/dist/style.css +1 -1
- package/dist/task-events-DQ276fn2.cjs +1 -0
- package/dist/task-events-Dpsvf_t2.js +47 -0
- package/dist/vue/async.d.cts +1553 -2083
- package/dist/vue/async.d.ts +1553 -2083
- package/dist/vue/index.d.cts +2465 -3310
- package/dist/vue/index.d.ts +2465 -3310
- package/dist/vue-async.cjs +1 -1
- package/dist/vue-async.js +3 -3
- package/dist/vue.cjs +1 -1
- package/dist/vue.js +159 -132
- package/dist/worker.cjs +1 -1
- package/dist/worker.d.cts +26 -3
- package/dist/worker.d.ts +26 -3
- package/dist/worker.js +110 -85
- package/dist/xlsx.cjs +14 -14
- package/dist/xlsx.d.cts +11 -3
- package/dist/xlsx.d.ts +11 -3
- package/dist/xlsx.js +656 -652
- package/package.json +2 -2
- package/dist/ReportPreview-Dk-28QAi.js +0 -2946
- package/dist/ReportPreview-FSvcBLjH.cjs +0 -6
- package/dist/assets-66UBlhES.cjs +0 -1
- package/dist/capabilities-CNjIirfo.js +0 -36
- package/dist/capabilities-D4xeVYSR.cjs +0 -1
- package/dist/grid-geometry-BNptEcMm.js +0 -65
- package/dist/grid-geometry-CZ_cYB6O.cjs +0 -1
- package/dist/report-source-BbNkkBDy.cjs +0 -1
package/dist/vue-async.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./plugin-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("./plugin-mAfvgSey.cjs");function i(){return Promise.resolve().then(()=>require("./ReportPreview-E3cm67Tk.cjs")).then(e=>e.ReportPreview$1)}const t={install(e,o={}){r.machReportPlugin.install(e,o)}};exports.MachReportPreview=r.MachReportPreview;exports.default=t;exports.machReportAsyncPlugin=t;exports.preloadMachReport=i;
|
package/dist/vue-async.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as o } from "./plugin-
|
|
2
|
-
import { M as l } from "./plugin-
|
|
1
|
+
import { m as o } from "./plugin-PCgxBVB2.js";
|
|
2
|
+
import { M as l } from "./plugin-PCgxBVB2.js";
|
|
3
3
|
function a() {
|
|
4
|
-
return import("./ReportPreview-
|
|
4
|
+
return import("./ReportPreview-BKKDAv8e.js").then((t) => t.C);
|
|
5
5
|
}
|
|
6
6
|
const n = {
|
|
7
7
|
install(t, r = {}) {
|
package/dist/vue.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@agile-team/mach-report"),t=require("./ReportPreview-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@agile-team/mach-report"),t=require("./ReportPreview-E3cm67Tk.cjs"),l=require("./plugin-mAfvgSey.cjs"),P=require("vue");function C(r){const e=p.createReportSource(r),i=async o=>{if(o.reportIds.length===0)throw new t.PlanLoadError("缺少报表 ID");for(const n of o.reportIds)if(!Object.prototype.hasOwnProperty.call(r,n)||!r[n])throw new t.PlanLoadError(`本地模板 ${n} 不存在`);return e(o)};return i.getParamDefs=e.getParamDefs,i}const M=Object.freeze({loading:!1,hasPlan:!1,pageCount:0,currentPage:1,exporting:null,printing:!1,canExport:!1,canPrint:!1,error:null,pdfFont:Object.freeze({status:"unchecked",fontUrl:""})});function S(){const r=P.shallowRef(null),e=()=>r.value?.state??M,i=Object.freeze({get loading(){return e().loading},get hasPlan(){return e().hasPlan},get pageCount(){return e().pageCount},get currentPage(){return e().currentPage},get exporting(){return e().exporting},get printing(){return e().printing},get canExport(){return e().canExport},get canPrint(){return e().canPrint},get error(){return e().error},get pdfFont(){return e().pdfFont},get editing(){return e().editing??!1},get saving(){return e().saving??!1},get importing(){return e().importing??!1},get dirty(){return e().dirty??!1},get pendingLocalChanges(){return e().pendingLocalChanges??!1},get task(){return e().task??null},get diagnostics(){return e().diagnostics??[]},get reportIds(){return e().reportIds??[]},get params(){return e().params??{}},get canUndo(){return e().canUndo??!1},get canRedo(){return e().canRedo??!1},get changeCount(){return e().changeCount??0},get selection(){return e().selection??null}});function o(){if(!r.value)throw new t.MachReportError("config","报表预览尚未挂载,请在 ready 后调用控制器");return r.value}return{ref(n){const a=n;r.value=a&&typeof a.reload=="function"&&typeof a.print=="function"&&typeof a.exportAs=="function"&&typeof a.openPdfWindow=="function"&&typeof a.gotoPage=="function"&&typeof a.setParams=="function"?a:null},ready:P.computed(()=>r.value!==null),state:i,async checkPdfFont(){const n=o();return n.checkPdfFont?n.checkPdfFont():{status:"unverified",fontUrl:"",message:"旧自定义控制器未提供字体检查,请由宿主确认字体配置"}},cancelTask(){o().cancelTask?.()},async confirmDiscard(n){return await o().confirmDiscard?.(n)??!0},getOutputDiagnostics(n){return o().getOutputDiagnostics?.(n)??[]},async reload(){await o().reload()},async print(){await o().print()},async exportAs(n){await o().exportAs(n)},openPdfWindow(){o().openPdfWindow()},gotoPage(n){o().gotoPage(n)},async setParams(n,a){await o().setParams(n,a)},async importExcel(n,a){const f=o();if(!f.importExcel)throw new t.MachReportError("config","旧自定义控制器未提供 Excel 导入");return f.importExcel(n,a)},getPlan(){return o().getPlan?.()??null},getChanges(){return o().getChanges?.()??[]},getDifferences:()=>o().getDifferences?.()??[],undo:async()=>await o().undo?.()??!1,redo:async()=>await o().redo?.()??!1,restoreChanges:async()=>await o().restoreChanges?.()??!1,getSelection:()=>o().getSelection?.()??null,focusCell:async(n,a)=>await o().focusCell?.(n,a)??!1,focusField:async n=>await o().focusField?.(n)??!1,copySelection:()=>o().copySelection?.()??"",pasteSelection:async n=>await o().pasteSelection?.(n)??!1}}function v(){return P.inject(l.MACH_REPORT_CONTROLLER_KEY,null)}function h(r){return!!r&&typeof r=="object"&&!Array.isArray(r)}function A(r){return Array.isArray(r)&&r.every(e=>h(e)&&typeof e.code=="string"&&typeof e.message=="string"&&["info","warning","error"].includes(e.severity)&&(e.path===void 0||typeof e.path=="string"))}function I(r,e){return Array.isArray(r)&&r.every(i=>h(i)&&Number.isSafeInteger(i.editIndex)&&i.editIndex>=0&&i.editIndex<e&&typeof i.code=="string"&&typeof i.message=="string")}function L(r,e){let i;if(!h(r)||typeof r.revision!="string"||!r.revision.trim()?i="非空 revision(请先在适配器解包业务响应)":r.sourceToken!==void 0&&typeof r.sourceToken!="string"?i="字符串 sourceToken":r.diagnostics!==void 0&&!A(r.diagnostics)?i="结构化 diagnostics":r.conflicts!==void 0&&!I(r.conflicts,e)&&(i="有效 editIndex/code/message conflicts"),i)throw new t.MachReportError("edit",`ReportProvider.save 必须返回${i};服务器可能已提交,请重新查询确认后再编辑`)}function y(r){return typeof r=="function"?r():r}function D(r,e){const i=new Set(r.flatMap(o=>o.source?.[e]===void 0?[]:[String(o.source[e])]));return i.size===1?[...i][0]:void 0}function w(r,e,i,o){return typeof r=="function"?r():D(e,i)??o??r}function x(r){return r.requestId??globalThis.crypto?.randomUUID?.()??`mr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}function F(r,e){if(!r.save)throw new t.MachReportError("config","ReportProvider.save 未配置,无法启用业务保存");let i="",o,n,a=0;function f(s,c,g){s.conflicts?.length||c!==i||g!==a||(o=s.revision,n=s.sourceToken)}async function T(s,c){if(c.signal.aborted)throw c.signal.reason??new DOMException("Aborted","AbortError");const g=y(e.reportId),m={...y(e.params??{})},E=JSON.stringify([g,m]),O=++a;if(E!==i&&(i=E,o=void 0,n=void 0),e.requireSource!==!1&&s.edits.some(u=>!u.source))throw new p.ReportCellEditError("missing");const d=await r.save({reportId:g,params:m,signal:c.signal,requestId:s.requestId,action:c.action,edits:t.cloneReportSnapshot(s.edits),expectedRevision:w(e.expectedRevision,s.edits,"revision",o),sourceToken:w(e.sourceToken,s.edits,"sourceToken",n)});if(c.signal.aborted)throw c.signal.reason??new DOMException("Aborted","AbortError");L(d,s.edits.length),d.diagnostics?.forEach(u=>e.onDiagnostic?.(u));const R=d.diagnostics?.filter(u=>u.severity==="error");if(R?.length)throw new t.MachReportError("edit",R.map(u=>u.message).join(";"),{diagnostics:R});const _=d.conflicts?.map(u=>({source:s.edits[u.editIndex]?.source,address:s.edits[u.editIndex]?.address,message:u.message}));return f(d,E,O),{revision:d.revision,sourceToken:d.sourceToken,conflicts:_}}return{requireSource:e.requireSource??!0,canEdit:e.canEdit,validate:e.validate,saveBatch:T,save:(s,c)=>T({requestId:x(c),edits:[t.cloneReportSnapshot(s)]},c)}}exports.DEFAULT_CALCULATION_MESSAGES=t.DEFAULT_CALCULATION_MESSAGES;exports.DEFAULT_MESSAGES=t.DEFAULT_MESSAGES;exports.DEFAULT_THEME=t.DEFAULT_THEME;exports.MachReportError=t.MachReportError;exports.PlanLoadError=t.PlanLoadError;exports.REPORT_EXPORT_FORMATS=t.REPORT_EXPORT_FORMATS;exports.REPORT_PREVIEW_TOOLS=t.REPORT_PREVIEW_TOOLS;exports.ReportPagination=t.ReportPagination;exports.ReportParamPanel=t.ReportParamPanel;exports.ReportPreview=t.ReportPreview;exports.ReportToolbar=t.ReportToolbar;exports.SILENT_LOGGER=t.SILENT_LOGGER;exports.buildPrintDocument=t.buildPrintDocument;exports.buildWordHtml=t.buildWordHtml;exports.createDefaultPdfExporter=t.createDefaultPdfExporter;exports.createFetchRequest=t.createFetchRequest;exports.createReportStoragePreferences=t.createReportStoragePreferences;exports.defineMachReportConfig=t.defineMachReportConfig;exports.defineMachReportPreset=t.defineMachReportPreset;exports.joinReportIds=t.joinReportIds;exports.normalizeReportIds=t.normalizeReportIds;exports.normalizeReportLoadError=t.normalizeReportLoadError;exports.printPlans=t.printPlans;exports.provideMachReportConfig=t.provideMachReportConfig;exports.resolveCalculationMessages=t.resolveCalculationMessages;exports.resolveConfig=t.resolveConfig;exports.themeToCssVars=t.themeToCssVars;exports.toErrorDetail=t.toErrorDetail;exports.useMachReportConfig=t.useMachReportConfig;exports.usePageWindow=t.usePageWindow;exports.usePrintExport=t.usePrintExport;exports.useZoom=t.useZoom;exports.MACH_REPORT_CONFIG_KEY=l.MACH_REPORT_CONFIG_KEY;exports.MACH_REPORT_CONTROLLER_KEY=l.MACH_REPORT_CONTROLLER_KEY;exports.MACH_REPORT_FETCHER_KEY=l.MACH_REPORT_FETCHER_KEY;exports.MACH_REPORT_PDF_EXPORTER_KEY=l.MACH_REPORT_PDF_EXPORTER_KEY;exports.MachReportPreview=l.MachReportPreview;exports.machReportPlugin=l.machReportPlugin;exports.createLocalFetcher=C;exports.createProviderEditing=F;exports.useMachReport=S;exports.useReportPreview=v;Object.keys(p).forEach(r=>{r!=="default"&&!Object.prototype.hasOwnProperty.call(exports,r)&&Object.defineProperty(exports,r,{enumerable:!0,get:()=>p[r]})});
|
package/dist/vue.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { createReportSource as
|
|
1
|
+
import { createReportSource as S, ReportCellEditError as x } from "@agile-team/mach-report";
|
|
2
2
|
export * from "@agile-team/mach-report";
|
|
3
|
-
import { P as R, M as
|
|
4
|
-
import { D as $, a as
|
|
5
|
-
import { a as C } from "./plugin-
|
|
6
|
-
import { b as
|
|
7
|
-
import { shallowRef as
|
|
8
|
-
function
|
|
9
|
-
const e =
|
|
10
|
-
if (
|
|
11
|
-
for (const
|
|
12
|
-
if (!Object.prototype.hasOwnProperty.call(
|
|
13
|
-
throw new R(`本地模板 ${
|
|
14
|
-
return e(
|
|
3
|
+
import { P as R, M as f, c as y } from "./ReportPreview-BKKDAv8e.js";
|
|
4
|
+
import { D as $, a as B, b as V, R as X, d as J, e as Z, f as Q, g as ee, h as te, S as re, i as ne, j as oe, k as se, l as ae, m as ie, n as ce, o as ue, p as fe, q as de, r as ge, s as le, t as pe, u as me, v as Pe, w as Ee, x as Re, y as ye, z as we, A as he, B as Te } from "./ReportPreview-BKKDAv8e.js";
|
|
5
|
+
import { a as C } from "./plugin-PCgxBVB2.js";
|
|
6
|
+
import { b as Se, c as xe, d as Ce, M as Ae, m as Ie } from "./plugin-PCgxBVB2.js";
|
|
7
|
+
import { shallowRef as A, computed as I, inject as O } from "vue";
|
|
8
|
+
function z(t) {
|
|
9
|
+
const e = S(t), o = async (r) => {
|
|
10
|
+
if (r.reportIds.length === 0) throw new R("缺少报表 ID");
|
|
11
|
+
for (const n of r.reportIds)
|
|
12
|
+
if (!Object.prototype.hasOwnProperty.call(t, n) || !t[n])
|
|
13
|
+
throw new R(`本地模板 ${n} 不存在`);
|
|
14
|
+
return e(r);
|
|
15
15
|
};
|
|
16
|
-
return
|
|
16
|
+
return o.getParamDefs = e.getParamDefs, o;
|
|
17
17
|
}
|
|
18
18
|
const M = Object.freeze({
|
|
19
19
|
loading: !1,
|
|
@@ -27,8 +27,8 @@ const M = Object.freeze({
|
|
|
27
27
|
error: null,
|
|
28
28
|
pdfFont: Object.freeze({ status: "unchecked", fontUrl: "" })
|
|
29
29
|
});
|
|
30
|
-
function
|
|
31
|
-
const
|
|
30
|
+
function H() {
|
|
31
|
+
const t = A(null), e = () => t.value?.state ?? M, o = Object.freeze({
|
|
32
32
|
get loading() {
|
|
33
33
|
return e().loading;
|
|
34
34
|
},
|
|
@@ -71,6 +71,21 @@ function z() {
|
|
|
71
71
|
get dirty() {
|
|
72
72
|
return e().dirty ?? !1;
|
|
73
73
|
},
|
|
74
|
+
get pendingLocalChanges() {
|
|
75
|
+
return e().pendingLocalChanges ?? !1;
|
|
76
|
+
},
|
|
77
|
+
get task() {
|
|
78
|
+
return e().task ?? null;
|
|
79
|
+
},
|
|
80
|
+
get diagnostics() {
|
|
81
|
+
return e().diagnostics ?? [];
|
|
82
|
+
},
|
|
83
|
+
get reportIds() {
|
|
84
|
+
return e().reportIds ?? [];
|
|
85
|
+
},
|
|
86
|
+
get params() {
|
|
87
|
+
return e().params ?? {};
|
|
88
|
+
},
|
|
74
89
|
get canUndo() {
|
|
75
90
|
return e().canUndo ?? !1;
|
|
76
91
|
},
|
|
@@ -84,164 +99,176 @@ function z() {
|
|
|
84
99
|
return e().selection ?? null;
|
|
85
100
|
}
|
|
86
101
|
});
|
|
87
|
-
function
|
|
88
|
-
if (!
|
|
89
|
-
throw new
|
|
90
|
-
return
|
|
102
|
+
function r() {
|
|
103
|
+
if (!t.value)
|
|
104
|
+
throw new f("config", "报表预览尚未挂载,请在 ready 后调用控制器");
|
|
105
|
+
return t.value;
|
|
91
106
|
}
|
|
92
107
|
return {
|
|
93
|
-
ref(
|
|
94
|
-
const s =
|
|
95
|
-
|
|
108
|
+
ref(n) {
|
|
109
|
+
const s = n;
|
|
110
|
+
t.value = s && typeof s.reload == "function" && typeof s.print == "function" && typeof s.exportAs == "function" && typeof s.openPdfWindow == "function" && typeof s.gotoPage == "function" && typeof s.setParams == "function" ? s : null;
|
|
96
111
|
},
|
|
97
|
-
ready:
|
|
98
|
-
state:
|
|
112
|
+
ready: I(() => t.value !== null),
|
|
113
|
+
state: o,
|
|
99
114
|
async checkPdfFont() {
|
|
100
|
-
const
|
|
101
|
-
return
|
|
115
|
+
const n = r();
|
|
116
|
+
return n.checkPdfFont ? n.checkPdfFont() : { status: "unverified", fontUrl: "", message: "旧自定义控制器未提供字体检查,请由宿主确认字体配置" };
|
|
117
|
+
},
|
|
118
|
+
cancelTask() {
|
|
119
|
+
r().cancelTask?.();
|
|
120
|
+
},
|
|
121
|
+
async confirmDiscard(n) {
|
|
122
|
+
return await r().confirmDiscard?.(n) ?? !0;
|
|
123
|
+
},
|
|
124
|
+
getOutputDiagnostics(n) {
|
|
125
|
+
return r().getOutputDiagnostics?.(n) ?? [];
|
|
102
126
|
},
|
|
103
127
|
async reload() {
|
|
104
|
-
await
|
|
128
|
+
await r().reload();
|
|
105
129
|
},
|
|
106
130
|
async print() {
|
|
107
|
-
await
|
|
131
|
+
await r().print();
|
|
108
132
|
},
|
|
109
|
-
async exportAs(
|
|
110
|
-
await
|
|
133
|
+
async exportAs(n) {
|
|
134
|
+
await r().exportAs(n);
|
|
111
135
|
},
|
|
112
136
|
openPdfWindow() {
|
|
113
|
-
|
|
137
|
+
r().openPdfWindow();
|
|
114
138
|
},
|
|
115
|
-
gotoPage(
|
|
116
|
-
|
|
139
|
+
gotoPage(n) {
|
|
140
|
+
r().gotoPage(n);
|
|
117
141
|
},
|
|
118
|
-
async setParams(
|
|
119
|
-
await
|
|
142
|
+
async setParams(n, s) {
|
|
143
|
+
await r().setParams(n, s);
|
|
120
144
|
},
|
|
121
|
-
async importExcel(
|
|
122
|
-
const
|
|
123
|
-
if (!
|
|
124
|
-
return
|
|
145
|
+
async importExcel(n, s) {
|
|
146
|
+
const d = r();
|
|
147
|
+
if (!d.importExcel) throw new f("config", "旧自定义控制器未提供 Excel 导入");
|
|
148
|
+
return d.importExcel(n, s);
|
|
125
149
|
},
|
|
126
150
|
getPlan() {
|
|
127
|
-
return
|
|
151
|
+
return r().getPlan?.() ?? null;
|
|
128
152
|
},
|
|
129
153
|
getChanges() {
|
|
130
|
-
return
|
|
131
|
-
},
|
|
132
|
-
getDifferences: () =>
|
|
133
|
-
undo: async () => await
|
|
134
|
-
redo: async () => await
|
|
135
|
-
restoreChanges: async () => await
|
|
136
|
-
getSelection: () =>
|
|
137
|
-
focusCell: async (
|
|
138
|
-
focusField: async (
|
|
139
|
-
copySelection: () =>
|
|
140
|
-
pasteSelection: async (
|
|
154
|
+
return r().getChanges?.() ?? [];
|
|
155
|
+
},
|
|
156
|
+
getDifferences: () => r().getDifferences?.() ?? [],
|
|
157
|
+
undo: async () => await r().undo?.() ?? !1,
|
|
158
|
+
redo: async () => await r().redo?.() ?? !1,
|
|
159
|
+
restoreChanges: async () => await r().restoreChanges?.() ?? !1,
|
|
160
|
+
getSelection: () => r().getSelection?.() ?? null,
|
|
161
|
+
focusCell: async (n, s) => await r().focusCell?.(n, s) ?? !1,
|
|
162
|
+
focusField: async (n) => await r().focusField?.(n) ?? !1,
|
|
163
|
+
copySelection: () => r().copySelection?.() ?? "",
|
|
164
|
+
pasteSelection: async (n) => await r().pasteSelection?.(n) ?? !1
|
|
141
165
|
};
|
|
142
166
|
}
|
|
143
|
-
function
|
|
144
|
-
return
|
|
167
|
+
function G() {
|
|
168
|
+
return O(C, null);
|
|
145
169
|
}
|
|
146
|
-
function
|
|
147
|
-
return !!
|
|
170
|
+
function m(t) {
|
|
171
|
+
return !!t && typeof t == "object" && !Array.isArray(t);
|
|
148
172
|
}
|
|
149
|
-
function _(
|
|
150
|
-
return Array.isArray(
|
|
173
|
+
function _(t) {
|
|
174
|
+
return Array.isArray(t) && t.every((e) => m(e) && typeof e.code == "string" && typeof e.message == "string" && ["info", "warning", "error"].includes(e.severity) && (e.path === void 0 || typeof e.path == "string"));
|
|
151
175
|
}
|
|
152
|
-
function D(
|
|
153
|
-
return Array.isArray(
|
|
176
|
+
function D(t, e) {
|
|
177
|
+
return Array.isArray(t) && t.every((o) => m(o) && Number.isSafeInteger(o.editIndex) && o.editIndex >= 0 && o.editIndex < e && typeof o.code == "string" && typeof o.message == "string");
|
|
154
178
|
}
|
|
155
|
-
function
|
|
156
|
-
let
|
|
157
|
-
if (!
|
|
179
|
+
function k(t, e) {
|
|
180
|
+
let o;
|
|
181
|
+
if (!m(t) || typeof t.revision != "string" || !t.revision.trim() ? o = "非空 revision(请先在适配器解包业务响应)" : t.sourceToken !== void 0 && typeof t.sourceToken != "string" ? o = "字符串 sourceToken" : t.diagnostics !== void 0 && !_(t.diagnostics) ? o = "结构化 diagnostics" : t.conflicts !== void 0 && !D(t.conflicts, e) && (o = "有效 editIndex/code/message conflicts"), o) throw new f("edit", `ReportProvider.save 必须返回${o};服务器可能已提交,请重新查询确认后再编辑`);
|
|
158
182
|
}
|
|
159
|
-
function w(
|
|
160
|
-
return typeof
|
|
183
|
+
function w(t) {
|
|
184
|
+
return typeof t == "function" ? t() : t;
|
|
161
185
|
}
|
|
162
|
-
function
|
|
163
|
-
const
|
|
164
|
-
return
|
|
186
|
+
function F(t, e) {
|
|
187
|
+
const o = new Set(t.flatMap((r) => r.source?.[e] === void 0 ? [] : [String(r.source[e])]));
|
|
188
|
+
return o.size === 1 ? [...o][0] : void 0;
|
|
165
189
|
}
|
|
166
|
-
function h(
|
|
167
|
-
return typeof
|
|
190
|
+
function h(t, e, o, r) {
|
|
191
|
+
return typeof t == "function" ? t() : F(e, o) ?? r ?? t;
|
|
168
192
|
}
|
|
169
|
-
function
|
|
170
|
-
return
|
|
193
|
+
function L(t) {
|
|
194
|
+
return t.requestId ?? globalThis.crypto?.randomUUID?.() ?? `mr-${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
171
195
|
}
|
|
172
|
-
function
|
|
173
|
-
if (!
|
|
174
|
-
let
|
|
175
|
-
function
|
|
176
|
-
|
|
196
|
+
function N(t, e) {
|
|
197
|
+
if (!t.save) throw new f("config", "ReportProvider.save 未配置,无法启用业务保存");
|
|
198
|
+
let o = "", r, n, s = 0;
|
|
199
|
+
function d(a, i, g) {
|
|
200
|
+
a.conflicts?.length || i !== o || g !== s || (r = a.revision, n = a.sourceToken);
|
|
177
201
|
}
|
|
178
|
-
async function
|
|
179
|
-
if (
|
|
180
|
-
const
|
|
181
|
-
if (
|
|
182
|
-
const
|
|
183
|
-
reportId:
|
|
202
|
+
async function P(a, i) {
|
|
203
|
+
if (i.signal.aborted) throw i.signal.reason ?? new DOMException("Aborted", "AbortError");
|
|
204
|
+
const g = w(e.reportId), E = { ...w(e.params ?? {}) }, l = JSON.stringify([g, E]), T = ++s;
|
|
205
|
+
if (l !== o && (o = l, r = void 0, n = void 0), e.requireSource !== !1 && a.edits.some((c) => !c.source)) throw new x("missing");
|
|
206
|
+
const u = await t.save({
|
|
207
|
+
reportId: g,
|
|
184
208
|
params: E,
|
|
185
|
-
signal:
|
|
186
|
-
requestId:
|
|
187
|
-
action:
|
|
188
|
-
edits: y(
|
|
189
|
-
expectedRevision: h(e.expectedRevision,
|
|
190
|
-
sourceToken: h(e.sourceToken,
|
|
209
|
+
signal: i.signal,
|
|
210
|
+
requestId: a.requestId,
|
|
211
|
+
action: i.action,
|
|
212
|
+
edits: y(a.edits),
|
|
213
|
+
expectedRevision: h(e.expectedRevision, a.edits, "revision", r),
|
|
214
|
+
sourceToken: h(e.sourceToken, a.edits, "sourceToken", n)
|
|
191
215
|
});
|
|
192
|
-
if (
|
|
193
|
-
|
|
194
|
-
const p =
|
|
195
|
-
if (p?.length) throw new
|
|
196
|
-
const
|
|
197
|
-
return u
|
|
216
|
+
if (i.signal.aborted) throw i.signal.reason ?? new DOMException("Aborted", "AbortError");
|
|
217
|
+
k(u, a.edits.length), u.diagnostics?.forEach((c) => e.onDiagnostic?.(c));
|
|
218
|
+
const p = u.diagnostics?.filter((c) => c.severity === "error");
|
|
219
|
+
if (p?.length) throw new f("edit", p.map((c) => c.message).join(";"), { diagnostics: p });
|
|
220
|
+
const v = u.conflicts?.map((c) => ({ source: a.edits[c.editIndex]?.source, address: a.edits[c.editIndex]?.address, message: c.message }));
|
|
221
|
+
return d(u, l, T), { revision: u.revision, sourceToken: u.sourceToken, conflicts: v };
|
|
198
222
|
}
|
|
199
223
|
return {
|
|
200
224
|
requireSource: e.requireSource ?? !0,
|
|
201
225
|
canEdit: e.canEdit,
|
|
202
226
|
validate: e.validate,
|
|
203
|
-
saveBatch:
|
|
204
|
-
save: (
|
|
227
|
+
saveBatch: P,
|
|
228
|
+
save: (a, i) => P({ requestId: L(i), edits: [y(a)] }, i)
|
|
205
229
|
};
|
|
206
230
|
}
|
|
207
231
|
export {
|
|
208
|
-
$ as
|
|
232
|
+
$ as DEFAULT_CALCULATION_MESSAGES,
|
|
233
|
+
B as DEFAULT_MESSAGES,
|
|
209
234
|
V as DEFAULT_THEME,
|
|
210
|
-
|
|
235
|
+
Se as MACH_REPORT_CONFIG_KEY,
|
|
211
236
|
C as MACH_REPORT_CONTROLLER_KEY,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
237
|
+
xe as MACH_REPORT_FETCHER_KEY,
|
|
238
|
+
Ce as MACH_REPORT_PDF_EXPORTER_KEY,
|
|
239
|
+
f as MachReportError,
|
|
240
|
+
Ae as MachReportPreview,
|
|
216
241
|
R as PlanLoadError,
|
|
217
242
|
X as REPORT_EXPORT_FORMATS,
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
re as
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
ie as
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
de as
|
|
236
|
-
|
|
237
|
-
le as
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
Pe as
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
243
|
+
J as REPORT_PREVIEW_TOOLS,
|
|
244
|
+
Z as ReportPagination,
|
|
245
|
+
Q as ReportParamPanel,
|
|
246
|
+
ee as ReportPreview,
|
|
247
|
+
te as ReportToolbar,
|
|
248
|
+
re as SILENT_LOGGER,
|
|
249
|
+
ne as buildPrintDocument,
|
|
250
|
+
oe as buildWordHtml,
|
|
251
|
+
se as createDefaultPdfExporter,
|
|
252
|
+
ae as createFetchRequest,
|
|
253
|
+
z as createLocalFetcher,
|
|
254
|
+
N as createProviderEditing,
|
|
255
|
+
ie as createReportStoragePreferences,
|
|
256
|
+
ce as defineMachReportConfig,
|
|
257
|
+
ue as defineMachReportPreset,
|
|
258
|
+
fe as joinReportIds,
|
|
259
|
+
Ie as machReportPlugin,
|
|
260
|
+
de as normalizeReportIds,
|
|
261
|
+
ge as normalizeReportLoadError,
|
|
262
|
+
le as printPlans,
|
|
263
|
+
pe as provideMachReportConfig,
|
|
264
|
+
me as resolveCalculationMessages,
|
|
265
|
+
Pe as resolveConfig,
|
|
266
|
+
Ee as themeToCssVars,
|
|
267
|
+
Re as toErrorDetail,
|
|
268
|
+
H as useMachReport,
|
|
269
|
+
ye as useMachReportConfig,
|
|
270
|
+
we as usePageWindow,
|
|
271
|
+
he as usePrintExport,
|
|
272
|
+
G as useReportPreview,
|
|
273
|
+
Te as useZoom
|
|
247
274
|
};
|
package/dist/worker.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const x=require("./task-events-DQ276fn2.cjs"),A=require("./validate-DfHPD8wX.cjs"),u="mach-report-worker/1";class l extends Error{constructor(r){super(r.message),this.name=r.name,this.code=r.code,this.path=r.path,this.issues=r.issues,this.diagnostics=r.diagnostics}}function p(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function L(e){return p(e)?["rows","pages","cells"].every(r=>typeof e[r]=="number"&&Number.isSafeInteger(e[r])&&e[r]>=0)&&typeof e.durationMs=="number"&&Number.isFinite(e.durationMs)&&e.durationMs>=0:!1}function P(e){return Array.isArray(e)&&e.every(r=>p(r)&&typeof r.code=="string"&&typeof r.message=="string"&&["info","warning","error"].includes(r.severity))}function T(e){return p(e)&&Object.values(e).every(r=>p(r)&&(r.revision===void 0||typeof r.revision=="string")&&(r.sourceToken===void 0||typeof r.sourceToken=="string"))}function v(e,r){if(!p(e)||!L(e.stats)||!P(e.diagnostics)||!T(e.revisions))return!1;if(r==="prepare")return A.validateRenderPlan(e.plan).ok;const t=e.format==="pdf"?"application/pdf":"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";return e.bytes instanceof Uint8Array&&(e.format==="pdf"||e.format==="xlsx")&&e.contentType===t}function W(e){if(!e||typeof e!="object")return{message:String(e)};const r={};for(const t of["code","path","field","message"]){const o=e[t];typeof o=="string"&&(r[t]=o)}return r}function j(e){const r=W(e);if(!p(e))return r;for(const t of["format","severity","kind","nid"])typeof e[t]=="string"&&(r[t]=e[t]);for(const t of["pageIndex","componentIndex"])Number.isSafeInteger(e[t])&&e[t]>=0&&(r[t]=e[t]);return Array.isArray(e.componentPath)&&e.componentPath.every(t=>Number.isSafeInteger(t)&&t>=0)&&(r.componentPath=e.componentPath),r}function O(e){if(!(e instanceof Error))return{name:"Error",message:String(e)};const r=e;return{name:e.name,message:e.message,...typeof r.code=="string"?{code:r.code}:{},...typeof r.path=="string"?{path:r.path}:{},...Array.isArray(r.issues)?{issues:r.issues.map(W)}:{},...Array.isArray(r.diagnostics)?{diagnostics:r.diagnostics.map(j)}:{}}}function S(e){if(!e||typeof e!="object")return!1;const r=e;return r.protocol===u&&typeof r.id=="string"&&(r.operation==="prepare"||r.operation==="export")&&!!r.input&&typeof r.input=="object"}async function N(e,r,t){try{const o=r.operation==="prepare"?await e.prepare({...r.input,onEvent:t}):await e.export({...r.input,onEvent:t});return{protocol:u,id:r.id,result:o}}catch(o){return{protocol:u,id:r.id,error:O(o)}}}function z(e){const r=e.result;return!r||!("bytes"in r)||!(r.bytes.buffer instanceof ArrayBuffer)?[]:[r.bytes.buffer]}function _(e,r){if(!p(e)||typeof e.taskId!="string"||!e.taskId||r.taskId!==void 0&&e.taskId!==r.taskId||e.correlationId!==r.correlationId||e.reportId!==void 0&&(typeof e.reportId!="string"||!r.reportIds.includes(e.reportId))||!["query","validate","layout","encode"].includes(e.stage)||!["started","completed","failed"].includes(e.status))return!1;for(const t of["completed","total"])if(e[t]!==void 0&&(typeof e[t]!="number"||!Number.isFinite(e[t])||e[t]<0))return!1;return e.completed===void 0||e.total===void 0||e.completed<=e.total}let q=0;function w(e){const r=new Error("报表 Worker 任务已取消");return r.name="AbortError",Object.defineProperty(r,"cause",{value:e}),r}function B(e,r){if(!e||typeof e!="object")return;const t=e;return t.protocol===u&&t.id===r?t:void 0}function F(e,r={}){const t=r.timeoutMs??12e4;if(!Number.isFinite(t)||t<=0||t>2147483647)throw new RangeError("Worker timeoutMs 应为正有限数字,且不能超过 2147483647");const o=(i,c,n,d)=>n?.aborted?Promise.reject(w(n.reason)):new Promise((I,b)=>{let g;try{g=e()}catch(a){b(a);return}const R=`mach-report-${Date.now()}-${++q}`;let y=!1,E=()=>{},k;const f=(a,s)=>{y||(y=!0,k&&clearTimeout(k),E(),n?.removeEventListener("abort",h),Promise.resolve().then(()=>g.terminate()).then(()=>a===void 0?I(s):b(a),m=>b(a??m)))},h=()=>f(w(n?.reason)),M=a=>{const s=B(a,R);if(!(!s||y)){if("type"in s&&s.type==="event"){const m="event"in s?s.event:void 0;_(m,c)?x.notifyReportTaskEvent(d,m,n):f(new Error("报表 Worker 返回无效阶段事件"));return}s.error&&typeof s.error.name=="string"&&typeof s.error.message=="string"?f(new l(s.error)):v(s.result,i)&&(i!=="export"||"format"in s.result&&"format"in c&&s.result.format===c.format)?f(void 0,s.result):f(new Error("报表 Worker 返回无效响应"))}};try{if(E=g.subscribe(M,a=>f(a??new Error("报表 Worker 执行失败"))),y){E();return}if(n?.addEventListener("abort",h,{once:!0}),k=setTimeout(()=>f(new l({name:"ReportRuntimeError",code:"timeout",message:`报表 Worker 执行超过 ${t}ms`})),t),n?.aborted)h();else{const{onEvent:a,signal:s,...m}=c;g.postMessage({protocol:u,id:R,operation:i,input:m})}}catch(a){f(a)}});return{prepare:(i,c,n)=>o("prepare",i,c,n),export:(i,c,n)=>o("export",i,c,n)}}function $(e,r={}){return F(()=>{const t=e();return{postMessage:o=>t.postMessage(o),terminate:()=>t.terminate(),subscribe:(o,i)=>{const c=d=>o(d.data),n=d=>i(d instanceof ErrorEvent?new Error(d.message):new Error("报表 Worker 消息无法解码"));return t.addEventListener("message",c),t.addEventListener("error",n),t.addEventListener("messageerror",n),()=>{t.removeEventListener("message",c),t.removeEventListener("error",n),t.removeEventListener("messageerror",n)}}}},r)}function D(e,r=globalThis){const t=o=>{S(o.data)&&N(e,o.data,i=>r.postMessage({protocol:u,id:o.data.id,type:"event",event:i})).then(i=>r.postMessage(i,z(i)))};return r.addEventListener("message",t),()=>r.removeEventListener("message",t)}exports.ReportWorkerError=l;exports.createBrowserReportExecutor=$;exports.serveReportWorker=D;
|
package/dist/worker.d.cts
CHANGED
|
@@ -211,12 +211,14 @@ declare interface ReportRuntime {
|
|
|
211
211
|
|
|
212
212
|
/** 可用 worker_threads/进程/RPC 实现;接收可序列化请求,signal 由桥接层映射为取消消息。 */
|
|
213
213
|
declare interface ReportRuntimeExecutor {
|
|
214
|
-
prepare(input: Omit<ReportRuntimeInput, "signal">, signal?: AbortSignal): Promise<PreparedReport>;
|
|
215
|
-
export(input: Omit<ReportRuntimeExportInput, "signal">, signal?: AbortSignal): Promise<ReportRuntimeExportResult>;
|
|
214
|
+
prepare(input: Omit<ReportRuntimeInput, "signal" | "onEvent">, signal?: AbortSignal, onEvent?: ReportTaskObserver): Promise<PreparedReport>;
|
|
215
|
+
export(input: Omit<ReportRuntimeExportInput, "signal" | "onEvent">, signal?: AbortSignal, onEvent?: ReportTaskObserver): Promise<ReportRuntimeExportResult>;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
declare interface ReportRuntimeExportInput extends ReportRuntimeInput {
|
|
219
219
|
format: "pdf" | "xlsx";
|
|
220
|
+
/** strict 在编码前拒绝已识别的输出降级;默认保留诊断并继续。 */
|
|
221
|
+
fidelity?: "warn" | "strict";
|
|
220
222
|
/** PDF 中文需宿主显式提供有授权的字体;不隐式下载字体或资源。 */
|
|
221
223
|
pdf?: {
|
|
222
224
|
customFontBytes?: Uint8Array | ArrayBuffer;
|
|
@@ -241,7 +243,7 @@ declare interface ReportRuntimeExportResult extends Omit<PreparedReport, "plan">
|
|
|
241
243
|
contentType: string;
|
|
242
244
|
}
|
|
243
245
|
|
|
244
|
-
declare interface ReportRuntimeInput {
|
|
246
|
+
declare interface ReportRuntimeInput extends ReportTaskMonitoring {
|
|
245
247
|
reportIds: string[];
|
|
246
248
|
params?: Record<string, string>;
|
|
247
249
|
signal?: AbortSignal;
|
|
@@ -255,10 +257,30 @@ declare interface ReportRuntimeStats {
|
|
|
255
257
|
outputBytes?: number;
|
|
256
258
|
}
|
|
257
259
|
|
|
260
|
+
/** 阶段事件只包含可序列化值;不表示估算百分比,也不包含业务数据。 */
|
|
261
|
+
declare interface ReportTaskEvent {
|
|
262
|
+
taskId: string;
|
|
263
|
+
correlationId?: string;
|
|
264
|
+
stage: "query" | "validate" | "layout" | "encode";
|
|
265
|
+
status: "started" | "completed" | "failed";
|
|
266
|
+
reportId?: string;
|
|
267
|
+
completed?: number;
|
|
268
|
+
total?: number;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare interface ReportTaskMonitoring {
|
|
272
|
+
taskId?: string;
|
|
273
|
+
correlationId?: string;
|
|
274
|
+
onEvent?: ReportTaskObserver;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare type ReportTaskObserver = (event: ReportTaskEvent) => void;
|
|
278
|
+
|
|
258
279
|
export declare class ReportWorkerError extends Error {
|
|
259
280
|
readonly code?: string;
|
|
260
281
|
readonly path?: string;
|
|
261
282
|
readonly issues?: unknown;
|
|
283
|
+
readonly diagnostics?: unknown;
|
|
262
284
|
constructor(error: SerializedReportError);
|
|
263
285
|
}
|
|
264
286
|
|
|
@@ -294,6 +316,7 @@ declare interface SerializedReportError {
|
|
|
294
316
|
code?: string;
|
|
295
317
|
path?: string;
|
|
296
318
|
issues?: unknown;
|
|
319
|
+
diagnostics?: unknown;
|
|
297
320
|
}
|
|
298
321
|
|
|
299
322
|
/** 在 Worker 入口注册一次 runtime;返回函数可清理监听器,浏览器主线程无需引入 Node。 */
|
package/dist/worker.d.ts
CHANGED
|
@@ -211,12 +211,14 @@ declare interface ReportRuntime {
|
|
|
211
211
|
|
|
212
212
|
/** 可用 worker_threads/进程/RPC 实现;接收可序列化请求,signal 由桥接层映射为取消消息。 */
|
|
213
213
|
declare interface ReportRuntimeExecutor {
|
|
214
|
-
prepare(input: Omit<ReportRuntimeInput, "signal">, signal?: AbortSignal): Promise<PreparedReport>;
|
|
215
|
-
export(input: Omit<ReportRuntimeExportInput, "signal">, signal?: AbortSignal): Promise<ReportRuntimeExportResult>;
|
|
214
|
+
prepare(input: Omit<ReportRuntimeInput, "signal" | "onEvent">, signal?: AbortSignal, onEvent?: ReportTaskObserver): Promise<PreparedReport>;
|
|
215
|
+
export(input: Omit<ReportRuntimeExportInput, "signal" | "onEvent">, signal?: AbortSignal, onEvent?: ReportTaskObserver): Promise<ReportRuntimeExportResult>;
|
|
216
216
|
}
|
|
217
217
|
|
|
218
218
|
declare interface ReportRuntimeExportInput extends ReportRuntimeInput {
|
|
219
219
|
format: "pdf" | "xlsx";
|
|
220
|
+
/** strict 在编码前拒绝已识别的输出降级;默认保留诊断并继续。 */
|
|
221
|
+
fidelity?: "warn" | "strict";
|
|
220
222
|
/** PDF 中文需宿主显式提供有授权的字体;不隐式下载字体或资源。 */
|
|
221
223
|
pdf?: {
|
|
222
224
|
customFontBytes?: Uint8Array | ArrayBuffer;
|
|
@@ -241,7 +243,7 @@ declare interface ReportRuntimeExportResult extends Omit<PreparedReport, "plan">
|
|
|
241
243
|
contentType: string;
|
|
242
244
|
}
|
|
243
245
|
|
|
244
|
-
declare interface ReportRuntimeInput {
|
|
246
|
+
declare interface ReportRuntimeInput extends ReportTaskMonitoring {
|
|
245
247
|
reportIds: string[];
|
|
246
248
|
params?: Record<string, string>;
|
|
247
249
|
signal?: AbortSignal;
|
|
@@ -255,10 +257,30 @@ declare interface ReportRuntimeStats {
|
|
|
255
257
|
outputBytes?: number;
|
|
256
258
|
}
|
|
257
259
|
|
|
260
|
+
/** 阶段事件只包含可序列化值;不表示估算百分比,也不包含业务数据。 */
|
|
261
|
+
declare interface ReportTaskEvent {
|
|
262
|
+
taskId: string;
|
|
263
|
+
correlationId?: string;
|
|
264
|
+
stage: "query" | "validate" | "layout" | "encode";
|
|
265
|
+
status: "started" | "completed" | "failed";
|
|
266
|
+
reportId?: string;
|
|
267
|
+
completed?: number;
|
|
268
|
+
total?: number;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
declare interface ReportTaskMonitoring {
|
|
272
|
+
taskId?: string;
|
|
273
|
+
correlationId?: string;
|
|
274
|
+
onEvent?: ReportTaskObserver;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
declare type ReportTaskObserver = (event: ReportTaskEvent) => void;
|
|
278
|
+
|
|
258
279
|
export declare class ReportWorkerError extends Error {
|
|
259
280
|
readonly code?: string;
|
|
260
281
|
readonly path?: string;
|
|
261
282
|
readonly issues?: unknown;
|
|
283
|
+
readonly diagnostics?: unknown;
|
|
262
284
|
constructor(error: SerializedReportError);
|
|
263
285
|
}
|
|
264
286
|
|
|
@@ -294,6 +316,7 @@ declare interface SerializedReportError {
|
|
|
294
316
|
code?: string;
|
|
295
317
|
path?: string;
|
|
296
318
|
issues?: unknown;
|
|
319
|
+
diagnostics?: unknown;
|
|
297
320
|
}
|
|
298
321
|
|
|
299
322
|
/** 在 Worker 入口注册一次 runtime;返回函数可清理监听器,浏览器主线程无需引入 Node。 */
|