@ims-view/server 1.2.0 → 1.2.2

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 (103) hide show
  1. package/README.md +20 -1
  2. package/lib/excel/excel-export.worker.cjs +70 -0
  3. package/lib/excel/excel-parse.worker.cjs +114 -0
  4. package/lib/server/src/app.module.js.map +1 -0
  5. package/lib/server/src/config/env.d.ts +31 -0
  6. package/lib/server/src/config/env.js +32 -0
  7. package/lib/server/src/config/env.js.map +1 -0
  8. package/lib/server/src/excel/dto/excel-task-id.dto.d.ts +19 -0
  9. package/lib/server/src/excel/dto/excel-task-id.dto.js +17 -0
  10. package/lib/server/src/excel/dto/excel-task-id.dto.js.map +1 -0
  11. package/lib/server/src/excel/dto/export-excel.dto.d.ts +67 -0
  12. package/lib/server/src/excel/dto/export-excel.dto.js +48 -0
  13. package/lib/server/src/excel/dto/export-excel.dto.js.map +1 -0
  14. package/lib/server/src/excel/excel-storage.service.d.ts +54 -0
  15. package/lib/server/src/excel/excel-storage.service.js +267 -0
  16. package/lib/server/src/excel/excel-storage.service.js.map +1 -0
  17. package/lib/server/src/excel/excel.controller.d.ts +17 -0
  18. package/lib/{excel → server/src/excel}/excel.controller.js +40 -11
  19. package/lib/server/src/excel/excel.controller.js.map +1 -0
  20. package/lib/server/src/excel/excel.converter.d.ts +15 -0
  21. package/lib/server/src/excel/excel.converter.js +53 -0
  22. package/lib/server/src/excel/excel.converter.js.map +1 -0
  23. package/lib/{excel → server/src/excel}/excel.module.js +3 -2
  24. package/lib/server/src/excel/excel.module.js.map +1 -0
  25. package/lib/server/src/excel/excel.service.d.ts +33 -0
  26. package/lib/server/src/excel/excel.service.js +390 -0
  27. package/lib/server/src/excel/excel.service.js.map +1 -0
  28. package/lib/server/src/excel/types.d.ts +6 -0
  29. package/lib/server/src/excel/types.js +44 -0
  30. package/lib/server/src/excel/types.js.map +1 -0
  31. package/lib/server/src/index.d.ts +12 -0
  32. package/lib/server/src/index.js +32 -0
  33. package/lib/server/src/index.js.map +1 -0
  34. package/lib/server/src/main.d.ts +1 -0
  35. package/lib/{main.js → server/src/main.js} +58 -2
  36. package/lib/server/src/main.js.map +1 -0
  37. package/lib/server/src/shared/create-zod-base-model.d.ts +29 -0
  38. package/lib/server/src/shared/create-zod-base-model.js +55 -0
  39. package/lib/server/src/shared/create-zod-base-model.js.map +1 -0
  40. package/lib/server/src/shared/index.d.ts +5 -0
  41. package/lib/server/src/shared/index.js +16 -0
  42. package/lib/server/src/shared/index.js.map +1 -0
  43. package/lib/server/src/shared/response-entity.d.ts +32 -0
  44. package/lib/server/src/shared/response-entity.js +74 -0
  45. package/lib/server/src/shared/response-entity.js.map +1 -0
  46. package/lib/server/src/shared/zod-exception.filter.d.ts +5 -0
  47. package/lib/server/src/shared/zod-exception.filter.js +25 -0
  48. package/lib/server/src/shared/zod-exception.filter.js.map +1 -0
  49. package/lib/server/src/shared/zod-validation.pipe.d.ts +4 -0
  50. package/lib/server/src/shared/zod-validation.pipe.js +25 -0
  51. package/lib/server/src/shared/zod-validation.pipe.js.map +1 -0
  52. package/lib/utils/src/excel/converter.d.ts +7 -0
  53. package/lib/utils/src/excel/converter.js +139 -0
  54. package/lib/utils/src/excel/converter.js.map +1 -0
  55. package/lib/utils/src/excel/exceljsChunked.d.ts +2 -0
  56. package/lib/utils/src/excel/exceljsChunked.js +16 -0
  57. package/lib/utils/src/excel/exceljsChunked.js.map +1 -0
  58. package/lib/utils/src/excel/exceljsDrawings.d.ts +2 -0
  59. package/lib/utils/src/excel/exceljsDrawings.js +8 -0
  60. package/lib/utils/src/excel/exceljsDrawings.js.map +1 -0
  61. package/lib/utils/src/excel/exceljsStyle.d.ts +2 -0
  62. package/lib/utils/src/excel/exceljsStyle.js +10 -0
  63. package/lib/utils/src/excel/exceljsStyle.js.map +1 -0
  64. package/lib/utils/src/excel/exportWorkerClient.d.ts +31 -0
  65. package/lib/utils/src/excel/exportWorkerClient.js +105 -0
  66. package/lib/utils/src/excel/exportWorkerClient.js.map +1 -0
  67. package/lib/utils/src/excel/index.d.ts +15 -0
  68. package/lib/utils/src/excel/index.js +57 -0
  69. package/lib/utils/src/excel/index.js.map +1 -0
  70. package/lib/utils/src/excel/luckyexcel.d.ts +13 -0
  71. package/lib/utils/src/excel/luckyexcel.js +211 -0
  72. package/lib/utils/src/excel/luckyexcel.js.map +1 -0
  73. package/lib/utils/src/excel/sheetjsConverter.d.ts +6 -0
  74. package/lib/utils/src/excel/sheetjsConverter.js +224 -0
  75. package/lib/utils/src/excel/sheetjsConverter.js.map +1 -0
  76. package/lib/utils/src/excel/types.d.ts +88 -0
  77. package/lib/utils/src/excel/types.js +11 -0
  78. package/lib/utils/src/excel/types.js.map +1 -0
  79. package/lib/utils/src/excel/workbookChunked.d.ts +13 -0
  80. package/lib/utils/src/excel/workbookChunked.js +152 -0
  81. package/lib/utils/src/excel/workbookChunked.js.map +1 -0
  82. package/package.json +12 -6
  83. package/lib/app.module.js.map +0 -1
  84. package/lib/excel/excel.controller.d.ts +0 -13
  85. package/lib/excel/excel.controller.js.map +0 -1
  86. package/lib/excel/excel.converter.d.ts +0 -2
  87. package/lib/excel/excel.converter.js +0 -11
  88. package/lib/excel/excel.converter.js.map +0 -1
  89. package/lib/excel/excel.module.js.map +0 -1
  90. package/lib/excel/excel.service.d.ts +0 -9
  91. package/lib/excel/excel.service.js +0 -33
  92. package/lib/excel/excel.service.js.map +0 -1
  93. package/lib/excel/types.d.ts +0 -6
  94. package/lib/excel/types.js +0 -6
  95. package/lib/excel/types.js.map +0 -1
  96. package/lib/index.d.ts +0 -7
  97. package/lib/index.js +0 -14
  98. package/lib/index.js.map +0 -1
  99. package/lib/main.d.ts +0 -1
  100. package/lib/main.js.map +0 -1
  101. /package/lib/{app.module.d.ts → server/src/app.module.d.ts} +0 -0
  102. /package/lib/{app.module.js → server/src/app.module.js} +0 -0
  103. /package/lib/{excel → server/src/excel}/excel.module.d.ts +0 -0
@@ -0,0 +1,29 @@
1
+ import { z } from 'zod';
2
+ export declare const zodSchemaSymbol = "$$zod-schema";
3
+ export declare class ZodValidationError extends TypeError {
4
+ readonly cause: {
5
+ raw: unknown;
6
+ schema: z.ZodTypeAny;
7
+ error: z.ZodError;
8
+ };
9
+ constructor(message: string, cause: {
10
+ raw: unknown;
11
+ schema: z.ZodTypeAny;
12
+ error: z.ZodError;
13
+ });
14
+ }
15
+ export declare function isZodModel(o: unknown): o is ZodBaseModel;
16
+ export interface ZodBaseModel<T extends z.ZodTypeAny = z.ZodTypeAny> {
17
+ new (raw?: unknown): z.infer<T> & {
18
+ getRaw(): unknown;
19
+ getPlain(): z.infer<T>;
20
+ getSchema(): T;
21
+ getConfig(): ZodBaseModelConfig;
22
+ };
23
+ [zodSchemaSymbol]: T;
24
+ getSchema(): T;
25
+ }
26
+ interface ZodBaseModelConfig {
27
+ }
28
+ export declare function createZodBaseModel<T extends z.ZodTypeAny>(schema: T, config?: ZodBaseModelConfig): ZodBaseModel<T>;
29
+ export {};
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZodValidationError = exports.zodSchemaSymbol = void 0;
4
+ exports.isZodModel = isZodModel;
5
+ exports.createZodBaseModel = createZodBaseModel;
6
+ exports.zodSchemaSymbol = '$$zod-schema';
7
+ class ZodValidationError extends TypeError {
8
+ constructor(message, cause) {
9
+ super(message);
10
+ this.name = 'ZodValidationError';
11
+ this.cause = cause;
12
+ }
13
+ }
14
+ exports.ZodValidationError = ZodValidationError;
15
+ function isZodModel(o) {
16
+ if (!o)
17
+ return false;
18
+ return Boolean(o[exports.zodSchemaSymbol]);
19
+ }
20
+ function createZodBaseModel(schema, config = {}) {
21
+ function ZodBaseModelCtor(raw) {
22
+ const res = schema.safeParse(raw ?? {});
23
+ if (!res.success) {
24
+ const message = res.error.issues[0]?.message ||
25
+ res.error.message ||
26
+ '参数校验失败';
27
+ throw new ZodValidationError(message, { raw, schema, error: res.error });
28
+ }
29
+ const plain = res.data;
30
+ return Object.assign({}, plain, {
31
+ __raw__: raw,
32
+ getRaw() {
33
+ return this.__raw__;
34
+ },
35
+ __plain__: plain,
36
+ getPlain() {
37
+ return this.__plain__;
38
+ },
39
+ __schema__: schema,
40
+ getSchema() {
41
+ return this.__schema__;
42
+ },
43
+ __config__: config,
44
+ getConfig() {
45
+ return this.__config__;
46
+ },
47
+ });
48
+ }
49
+ ZodBaseModelCtor.getSchema = function getSchema() {
50
+ return schema;
51
+ };
52
+ ZodBaseModelCtor[exports.zodSchemaSymbol] = schema;
53
+ return ZodBaseModelCtor;
54
+ }
55
+ //# sourceMappingURL=create-zod-base-model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-zod-base-model.js","sourceRoot":"","sources":["../../../../src/shared/create-zod-base-model.ts"],"names":[],"mappings":";;;AAqBA,gCAGC;AAeD,gDAuCC;AA5EY,QAAA,eAAe,GAAG,cAAc,CAAC;AAE9C,MAAa,kBAAmB,SAAQ,SAAS;IAO/C,YACE,OAAe,EACf,KAAgE;QAEhE,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,oBAAoB,CAAC;QACjC,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;CACF;AAfD,gDAeC;AAED,SAAgB,UAAU,CAAC,CAAU;IACnC,IAAI,CAAC,CAAC;QAAE,OAAO,KAAK,CAAC;IACrB,OAAO,OAAO,CAAE,CAAqC,CAAC,uBAAe,CAAC,CAAC,CAAC;AAC1E,CAAC;AAeD,SAAgB,kBAAkB,CAChC,MAAS,EACT,SAA6B,EAAE;IAE/B,SAAS,gBAAgB,CAAC,GAAY;QACpC,MAAM,GAAG,GAAG,MAAM,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC;QACxC,IAAI,CAAC,GAAG,CAAC,OAAO,EAAE,CAAC;YACjB,MAAM,OAAO,GACX,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,OAAO;gBAC5B,GAAG,CAAC,KAAK,CAAC,OAAO;gBACjB,QAAQ,CAAC;YACX,MAAM,IAAI,kBAAkB,CAAC,OAAO,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;QAC3E,CAAC;QACD,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,CAAC;QACvB,OAAO,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,KAAK,EAAE;YAC9B,OAAO,EAAE,GAAG;YACZ,MAAM;gBACJ,OAAO,IAAI,CAAC,OAAO,CAAC;YACtB,CAAC;YACD,SAAS,EAAE,KAAK;YAChB,QAAQ;gBACN,OAAO,IAAI,CAAC,SAAS,CAAC;YACxB,CAAC;YACD,UAAU,EAAE,MAAM;YAClB,SAAS;gBACP,OAAO,IAAI,CAAC,UAAU,CAAC;YACzB,CAAC;YACD,UAAU,EAAE,MAAM;YAClB,SAAS;gBACP,OAAO,IAAI,CAAC,UAAU,CAAC;YACzB,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,gBAAgB,CAAC,SAAS,GAAG,SAAS,SAAS;QAC7C,OAAO,MAAM,CAAC;IAChB,CAAC,CAAC;IACD,gBAA+C,CAAC,uBAAe,CAAC,GAAG,MAAM,CAAC;IAC3E,OAAO,gBAA8C,CAAC;AACxD,CAAC"}
@@ -0,0 +1,5 @@
1
+ export { createZodBaseModel, isZodModel, zodSchemaSymbol, ZodValidationError, } from './create-zod-base-model';
2
+ export type { ZodBaseModel } from './create-zod-base-model';
3
+ export { ZodValidationPipe } from './zod-validation.pipe';
4
+ export { ResponseEntity, StatusCode } from './response-entity';
5
+ export { ZodExceptionFilter } from './zod-exception.filter';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZodExceptionFilter = exports.StatusCode = exports.ResponseEntity = exports.ZodValidationPipe = exports.ZodValidationError = exports.zodSchemaSymbol = exports.isZodModel = exports.createZodBaseModel = void 0;
4
+ var create_zod_base_model_1 = require("./create-zod-base-model");
5
+ Object.defineProperty(exports, "createZodBaseModel", { enumerable: true, get: function () { return create_zod_base_model_1.createZodBaseModel; } });
6
+ Object.defineProperty(exports, "isZodModel", { enumerable: true, get: function () { return create_zod_base_model_1.isZodModel; } });
7
+ Object.defineProperty(exports, "zodSchemaSymbol", { enumerable: true, get: function () { return create_zod_base_model_1.zodSchemaSymbol; } });
8
+ Object.defineProperty(exports, "ZodValidationError", { enumerable: true, get: function () { return create_zod_base_model_1.ZodValidationError; } });
9
+ var zod_validation_pipe_1 = require("./zod-validation.pipe");
10
+ Object.defineProperty(exports, "ZodValidationPipe", { enumerable: true, get: function () { return zod_validation_pipe_1.ZodValidationPipe; } });
11
+ var response_entity_1 = require("./response-entity");
12
+ Object.defineProperty(exports, "ResponseEntity", { enumerable: true, get: function () { return response_entity_1.ResponseEntity; } });
13
+ Object.defineProperty(exports, "StatusCode", { enumerable: true, get: function () { return response_entity_1.StatusCode; } });
14
+ var zod_exception_filter_1 = require("./zod-exception.filter");
15
+ Object.defineProperty(exports, "ZodExceptionFilter", { enumerable: true, get: function () { return zod_exception_filter_1.ZodExceptionFilter; } });
16
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/shared/index.ts"],"names":[],"mappings":";;;AAAA,iEAKiC;AAJ/B,2HAAA,kBAAkB,OAAA;AAClB,mHAAA,UAAU,OAAA;AACV,wHAAA,eAAe,OAAA;AACf,2HAAA,kBAAkB,OAAA;AAGpB,6DAA0D;AAAjD,wHAAA,iBAAiB,OAAA;AAC1B,qDAA+D;AAAtD,iHAAA,cAAc,OAAA;AAAE,6GAAA,UAAU,OAAA;AACnC,+DAA4D;AAAnD,0HAAA,kBAAkB,OAAA"}
@@ -0,0 +1,32 @@
1
+ export declare enum StatusCode {
2
+ OK = 0,
3
+ BAD_REQUEST = 400,
4
+ NOT_FOUND = 404,
5
+ INTERNAL_SERVER_ERROR = 999
6
+ }
7
+ export declare class ResponseEntity<T> {
8
+ static default: {
9
+ code: ResponseEntity<unknown>['code'];
10
+ data: ResponseEntity<unknown>['data'];
11
+ msg: ResponseEntity<unknown>['msg'];
12
+ retriable: ResponseEntity<unknown>['retriable'];
13
+ };
14
+ static of<T>(...args: ConstructorParameters<typeof ResponseEntity<T>>): ResponseEntity<T>;
15
+ static ofSuccess<T>(data?: T, code?: number): ResponseEntity<T>;
16
+ static ofSuccessWithMsg<T>(data: T, msg?: string, code?: number): ResponseEntity<T>;
17
+ static ofFailure(err: unknown, code?: number): ResponseEntity<null>;
18
+ static from<T>(object?: Record<string, unknown>): ResponseEntity<T>;
19
+ code: number;
20
+ msg?: string;
21
+ data?: T;
22
+ retriable?: boolean;
23
+ constructor(code: ResponseEntity<T>['code'], data?: ResponseEntity<T>['data'], msg?: ResponseEntity<T>['msg'], retriable?: ResponseEntity<T>['retriable']);
24
+ getCode(): number;
25
+ setCode(code: ResponseEntity<T>['code']): this;
26
+ getData(): T | undefined;
27
+ setData(data: ResponseEntity<T>['data']): this;
28
+ getMsg(): string | undefined;
29
+ setMsg(msg: ResponseEntity<T>['msg']): this;
30
+ getRetriable(): boolean | undefined;
31
+ setRetriable(retriable: ResponseEntity<T>['retriable']): this;
32
+ }
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResponseEntity = exports.StatusCode = void 0;
4
+ var StatusCode;
5
+ (function (StatusCode) {
6
+ StatusCode[StatusCode["OK"] = 0] = "OK";
7
+ StatusCode[StatusCode["BAD_REQUEST"] = 400] = "BAD_REQUEST";
8
+ StatusCode[StatusCode["NOT_FOUND"] = 404] = "NOT_FOUND";
9
+ StatusCode[StatusCode["INTERNAL_SERVER_ERROR"] = 999] = "INTERNAL_SERVER_ERROR";
10
+ })(StatusCode || (exports.StatusCode = StatusCode = {}));
11
+ class ResponseEntity {
12
+ static of(...args) {
13
+ return new ResponseEntity(...args);
14
+ }
15
+ static ofSuccess(data, code = StatusCode.OK) {
16
+ return new ResponseEntity(code, data);
17
+ }
18
+ static ofSuccessWithMsg(data, msg, code = StatusCode.OK) {
19
+ return new ResponseEntity(code, data, msg);
20
+ }
21
+ static ofFailure(err, code = 1) {
22
+ const message = err instanceof Error
23
+ ? err.message
24
+ : typeof err === 'string'
25
+ ? err
26
+ : 'Server Error';
27
+ return new ResponseEntity(code, null, message);
28
+ }
29
+ static from(object) {
30
+ return this.of(object?.code ?? this.default.code, object?.data, object?.msg, object?.retriable);
31
+ }
32
+ constructor(code, data, msg, retriable) {
33
+ this.code = code;
34
+ this.data = data;
35
+ this.msg = msg;
36
+ this.retriable = retriable;
37
+ }
38
+ getCode() {
39
+ return this.code;
40
+ }
41
+ setCode(code) {
42
+ this.code = code;
43
+ return this;
44
+ }
45
+ getData() {
46
+ return this.data;
47
+ }
48
+ setData(data) {
49
+ this.data = data;
50
+ return this;
51
+ }
52
+ getMsg() {
53
+ return this.msg;
54
+ }
55
+ setMsg(msg) {
56
+ this.msg = msg;
57
+ return this;
58
+ }
59
+ getRetriable() {
60
+ return this.retriable;
61
+ }
62
+ setRetriable(retriable) {
63
+ this.retriable = retriable;
64
+ return this;
65
+ }
66
+ }
67
+ exports.ResponseEntity = ResponseEntity;
68
+ ResponseEntity.default = Object.freeze({
69
+ code: StatusCode.OK,
70
+ data: undefined,
71
+ msg: undefined,
72
+ retriable: undefined,
73
+ });
74
+ //# sourceMappingURL=response-entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"response-entity.js","sourceRoot":"","sources":["../../../../src/shared/response-entity.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAKX;AALD,WAAY,UAAU;IACpB,uCAAM,CAAA;IACN,2DAAiB,CAAA;IACjB,uDAAe,CAAA;IACf,+EAA2B,CAAA;AAC7B,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB;AAED,MAAa,cAAc;IAazB,MAAM,C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,CAAC;IAED,OAAO,CAAC,IAA+B;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,OAAO;QACL,OAAO,IAAI,CAAC,IAAI,CAAC;IACnB,CAAC;IAED,OAAO,CAAC,IAA+B;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,OAAO,IAAI,CAAC;IACd,CAAC;IAED,MAAM;QACJ,OAAO,IAAI,CAAC,GAAG,CAAC;IAClB,CAAC;IAED,MAAM,CAAC,GAA6B;QAClC,IAAI,CAAC,GAAG,GAAG,GAAG,CAAC;QACf,OAAO,IAAI,CAAC;IACd,CAAC;IAED,YAAY;QACV,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,YAAY,CAAC,SAAyC;QACpD,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,OAAO,IAAI,CAAC;IACd,CAAC;;AA/FH,wCAgGC;AA/FQ,sBAAO,GAKV,MAAM,CAAC,MAAM,CAAC;IAChB,IAAI,EAAE,UAAU,CAAC,EAAE;IACnB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,SAAS,EAAE,SAAS;CACrB,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ import { type ExceptionFilter, type ArgumentsHost } from '@nestjs/common';
2
+ import { ZodValidationError } from './create-zod-base-model';
3
+ export declare class ZodExceptionFilter implements ExceptionFilter {
4
+ catch(exception: ZodValidationError, host: ArgumentsHost): void;
5
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ZodExceptionFilter = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const create_zod_base_model_1 = require("./create-zod-base-model");
12
+ const response_entity_1 = require("./response-entity");
13
+ let ZodExceptionFilter = class ZodExceptionFilter {
14
+ catch(exception, host) {
15
+ const ctx = host.switchToHttp();
16
+ const res = ctx.getResponse();
17
+ const message = exception.message || '参数校验失败';
18
+ res.status(400).json(response_entity_1.ResponseEntity.ofFailure(message, response_entity_1.StatusCode.BAD_REQUEST));
19
+ }
20
+ };
21
+ exports.ZodExceptionFilter = ZodExceptionFilter;
22
+ exports.ZodExceptionFilter = ZodExceptionFilter = __decorate([
23
+ (0, common_1.Catch)(create_zod_base_model_1.ZodValidationError)
24
+ ], ZodExceptionFilter);
25
+ //# sourceMappingURL=zod-exception.filter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod-exception.filter.js","sourceRoot":"","sources":["../../../../src/shared/zod-exception.filter.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAiF;AAEjF,mEAA6D;AAC7D,uDAA+D;AAGxD,IAAM,kBAAkB,GAAxB,MAAM,kBAAkB;IAC7B,KAAK,CAAC,SAA6B,EAAE,IAAmB;QACtD,MAAM,GAAG,GAAG,IAAI,CAAC,YAAY,EAAE,CAAC;QAChC,MAAM,GAAG,GAAG,GAAG,CAAC,WAAW,EAAY,CAAC;QACxC,MAAM,OAAO,GAAG,SAAS,CAAC,OAAO,IAAI,QAAQ,CAAC;QAC9C,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,gCAAc,CAAC,SAAS,CAAC,OAAO,EAAE,4BAAU,CAAC,WAAW,CAAC,CAAC,CAAC;IAClF,CAAC;CACF,CAAA;AAPY,gDAAkB;6BAAlB,kBAAkB;IAD9B,IAAA,cAAK,EAAC,0CAAkB,CAAC;GACb,kBAAkB,CAO9B"}
@@ -0,0 +1,4 @@
1
+ import { type ArgumentMetadata, type PipeTransform } from '@nestjs/common';
2
+ export declare class ZodValidationPipe implements PipeTransform {
3
+ transform(value: unknown, metadata: ArgumentMetadata): any;
4
+ }
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.ZodValidationPipe = void 0;
10
+ const common_1 = require("@nestjs/common");
11
+ const create_zod_base_model_1 = require("./create-zod-base-model");
12
+ let ZodValidationPipe = class ZodValidationPipe {
13
+ transform(value, metadata) {
14
+ const cstr = metadata?.metatype;
15
+ if ((0, create_zod_base_model_1.isZodModel)(cstr)) {
16
+ return new cstr(value);
17
+ }
18
+ return value;
19
+ }
20
+ };
21
+ exports.ZodValidationPipe = ZodValidationPipe;
22
+ exports.ZodValidationPipe = ZodValidationPipe = __decorate([
23
+ (0, common_1.Injectable)()
24
+ ], ZodValidationPipe);
25
+ //# sourceMappingURL=zod-validation.pipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zod-validation.pipe.js","sourceRoot":"","sources":["../../../../src/shared/zod-validation.pipe.ts"],"names":[],"mappings":";;;;;;;;;AAAA,2CAAuF;AACvF,mEAAqD;AAG9C,IAAM,iBAAiB,GAAvB,MAAM,iBAAiB;IAC5B,SAAS,CAAC,KAAc,EAAE,QAA0B;QAClD,MAAM,IAAI,GAAG,QAAQ,EAAE,QAAmB,CAAC;QAC3C,IAAI,IAAA,kCAAU,EAAC,IAAI,CAAC,EAAE,CAAC;YACrB,OAAO,IAAI,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;CACF,CAAA;AARY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,mBAAU,GAAE;GACA,iBAAiB,CAQ7B"}
@@ -0,0 +1,7 @@
1
+ import { type ExcelBinary, type ExcelImportResult, type IWorkbookData } from './types';
2
+ export declare const ensureXlsxBytes: (input: ExcelBinary, fileName?: string) => Uint8Array;
3
+ export declare const isLegacyExcelSource: (input: ExcelBinary, fileName?: string) => boolean;
4
+ export declare const assertSupportedExcelSource: (input: ExcelBinary, fileName?: string) => void;
5
+ export declare const excelBufferToImportResult: (input: ExcelBinary, fileName?: string) => Promise<ExcelImportResult>;
6
+ export declare const excelBufferToWorkbookData: (input: ExcelBinary, fileName?: string) => Promise<Partial<IWorkbookData>>;
7
+ export declare const workbookDataToExcelBytes: (data: Partial<IWorkbookData>) => Promise<Uint8Array>;
@@ -0,0 +1,139 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ var __importDefault = (this && this.__importDefault) || function (mod) {
36
+ return (mod && mod.__esModule) ? mod : { "default": mod };
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.workbookDataToExcelBytes = exports.excelBufferToWorkbookData = exports.excelBufferToImportResult = exports.assertSupportedExcelSource = exports.isLegacyExcelSource = exports.ensureXlsxBytes = void 0;
40
+ const exceljs_1 = __importDefault(require("exceljs"));
41
+ const toUint8Array = (input) => {
42
+ if (typeof Buffer !== 'undefined' && Buffer.isBuffer(input)) {
43
+ return new Uint8Array(input.buffer, input.byteOffset, input.byteLength);
44
+ }
45
+ if (input instanceof ArrayBuffer) {
46
+ return new Uint8Array(input);
47
+ }
48
+ return input;
49
+ };
50
+ const isLegacyXlsName = (fileName) => Boolean(fileName &&
51
+ /\.xls$/i.test(fileName) &&
52
+ !/\.xlsx$/i.test(fileName) &&
53
+ !/\.csv$/i.test(fileName));
54
+ const isOleCompoundBuffer = (bytes) => bytes.length >= 4 &&
55
+ bytes[0] === 0xd0 &&
56
+ bytes[1] === 0xcf &&
57
+ bytes[2] === 0x11 &&
58
+ bytes[3] === 0xe0;
59
+ const isZipBuffer = (bytes) => bytes.length >= 2 && bytes[0] === 0x50 && bytes[1] === 0x4b;
60
+ const needsXlsToXlsx = (bytes, fileName) => {
61
+ if (isOleCompoundBuffer(bytes))
62
+ return true;
63
+ if (isLegacyXlsName(fileName) && !isZipBuffer(bytes))
64
+ return true;
65
+ return false;
66
+ };
67
+ const ensureXlsxBytes = (input, fileName) => {
68
+ const bytes = toUint8Array(input);
69
+ if (needsXlsToXlsx(bytes, fileName)) {
70
+ throw new Error('仅支持 .xlsx / .csv,不支持旧版 .xls');
71
+ }
72
+ return bytes;
73
+ };
74
+ exports.ensureXlsxBytes = ensureXlsxBytes;
75
+ const isLegacyExcelSource = (input, fileName) => needsXlsToXlsx(toUint8Array(input), fileName);
76
+ exports.isLegacyExcelSource = isLegacyExcelSource;
77
+ const assertSupportedExcelSource = (input, fileName) => {
78
+ if ((0, exports.isLegacyExcelSource)(input, fileName)) {
79
+ throw new Error('仅支持 .xlsx / .csv,不支持旧版 .xls');
80
+ }
81
+ };
82
+ exports.assertSupportedExcelSource = assertSupportedExcelSource;
83
+ const excelBufferToImportResult = async (input, fileName = 'workbook.xlsx') => {
84
+ const { importExcelBinary } = await Promise.resolve().then(() => __importStar(require('./luckyexcel')));
85
+ return importExcelBinary(input, fileName);
86
+ };
87
+ exports.excelBufferToImportResult = excelBufferToImportResult;
88
+ const excelBufferToWorkbookData = async (input, fileName) => {
89
+ const result = await (0, exports.excelBufferToImportResult)(input, fileName);
90
+ return result.workbookData;
91
+ };
92
+ exports.excelBufferToWorkbookData = excelBufferToWorkbookData;
93
+ const workbookDataToExcelBytes = async (data) => {
94
+ const workbook = new exceljs_1.default.Workbook();
95
+ workbook.creator = data.name || 'Workbook';
96
+ const sheetOrder = data.sheetOrder?.length
97
+ ? data.sheetOrder
98
+ : Object.keys(data.sheets || {});
99
+ if (!sheetOrder.length) {
100
+ workbook.addWorksheet('Sheet1');
101
+ }
102
+ sheetOrder.forEach((sheetId) => {
103
+ const sheet = data.sheets?.[sheetId];
104
+ const worksheet = workbook.addWorksheet(sheet?.name || sheetId || 'Sheet1');
105
+ const cellData = sheet?.cellData || {};
106
+ Object.keys(cellData).forEach((rowKey) => {
107
+ const rowIndex = Number(rowKey);
108
+ const row = cellData[rowIndex] || {};
109
+ Object.keys(row).forEach((colKey) => {
110
+ const colIndex = Number(colKey);
111
+ const cell = row[colIndex];
112
+ if (!cell)
113
+ return;
114
+ const excelCell = worksheet.getCell(rowIndex + 1, colIndex + 1);
115
+ if (cell.f) {
116
+ excelCell.value = {
117
+ formula: cell.f.replace(/^=/, ''),
118
+ result: cell.v,
119
+ };
120
+ return;
121
+ }
122
+ if (cell.v != null) {
123
+ excelCell.value = cell.v;
124
+ }
125
+ });
126
+ });
127
+ (sheet?.mergeData || []).forEach((range) => {
128
+ try {
129
+ worksheet.mergeCells(range.startRow + 1, range.startColumn + 1, range.endRow + 1, range.endColumn + 1);
130
+ }
131
+ catch {
132
+ }
133
+ });
134
+ });
135
+ const arrayBuffer = await workbook.xlsx.writeBuffer();
136
+ return toUint8Array(arrayBuffer);
137
+ };
138
+ exports.workbookDataToExcelBytes = workbookDataToExcelBytes;
139
+ //# sourceMappingURL=converter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"converter.js","sourceRoot":"","sources":["../../../../../utils/src/excel/converter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sDAA8B;AAO9B,MAAM,YAAY,GAAG,CAAC,KAAkB,EAAc,EAAE;IACtD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5D,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,KAAK,YAAY,WAAW,EAAE,CAAC;QACjC,OAAO,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IACD,OAAO,KAAmB,CAAC;AAC7B,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,QAAiB,EAAE,EAAE,CAC5C,OAAO,CACL,QAAQ;IACN,SAAS,CAAC,IAAI,CAAC,QAAQ,CAAC;IACxB,CAAC,UAAU,CAAC,IAAI,CAAC,QA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,CAAC,CAAC;QAEH,CAAC,KAAK,EAAE,SAAS,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE;YACzC,IAAI,CAAC;gBACH,SAAS,CAAC,UAAU,CAClB,KAAK,CAAC,QAAQ,GAAG,CAAC,EAClB,KAAK,CAAC,WAAW,GAAG,CAAC,EACrB,KAAK,CAAC,MAAM,GAAG,CAAC,EAChB,KAAK,CAAC,SAAS,GAAG,CAAC,CACpB,CAAC;YACJ,CAAC;YAAC,MAAM,CAAC;YAET,CAAC;QACH,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;IACtD,OAAO,YAAY,CAAC,WAA0B,CAAC,CAAC;AAClD,CAAC,CAAC;AA5DW,QAAA,wBAAwB,4BA4DnC"}
@@ -0,0 +1,2 @@
1
+ export { CHUNKED_FILE_BYTES, CHUNKED_ROW_THRESHOLD, DEFAULT_BLOCK_ROW_SIZE, DEFAULT_MAX_ROWS, DEFAULT_PARSE_TIMEOUT_MS, chunkedBlockFileName, chunkedMetaFileName, excelBufferToChunkedWorkbook, resolveWorksheetRowCount, shouldUseChunkedImport, skeletonWorkbookFromMeta, } from '@ims-view/univer-import-excel';
2
+ export type { ChunkedBlock, ChunkedConvertOptions, ChunkedProgress, ChunkedSheetMeta, ChunkedWorkbookMeta, } from '@ims-view/univer-import-excel';
@@ -0,0 +1,16 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.skeletonWorkbookFromMeta = exports.shouldUseChunkedImport = exports.resolveWorksheetRowCount = exports.excelBufferToChunkedWorkbook = exports.chunkedMetaFileName = exports.chunkedBlockFileName = exports.DEFAULT_PARSE_TIMEOUT_MS = exports.DEFAULT_MAX_ROWS = exports.DEFAULT_BLOCK_ROW_SIZE = exports.CHUNKED_ROW_THRESHOLD = exports.CHUNKED_FILE_BYTES = void 0;
4
+ var univer_import_excel_1 = require("@ims-view/univer-import-excel");
5
+ Object.defineProperty(exports, "CHUNKED_FILE_BYTES", { enumerable: true, get: function () { return univer_import_excel_1.CHUNKED_FILE_BYTES; } });
6
+ Object.defineProperty(exports, "CHUNKED_ROW_THRESHOLD", { enumerable: true, get: function () { return univer_import_excel_1.CHUNKED_ROW_THRESHOLD; } });
7
+ Object.defineProperty(exports, "DEFAULT_BLOCK_ROW_SIZE", { enumerable: true, get: function () { return univer_import_excel_1.DEFAULT_BLOCK_ROW_SIZE; } });
8
+ Object.defineProperty(exports, "DEFAULT_MAX_ROWS", { enumerable: true, get: function () { return univer_import_excel_1.DEFAULT_MAX_ROWS; } });
9
+ Object.defineProperty(exports, "DEFAULT_PARSE_TIMEOUT_MS", { enumerable: true, get: function () { return univer_import_excel_1.DEFAULT_PARSE_TIMEOUT_MS; } });
10
+ Object.defineProperty(exports, "chunkedBlockFileName", { enumerable: true, get: function () { return univer_import_excel_1.chunkedBlockFileName; } });
11
+ Object.defineProperty(exports, "chunkedMetaFileName", { enumerable: true, get: function () { return univer_import_excel_1.chunkedMetaFileName; } });
12
+ Object.defineProperty(exports, "excelBufferToChunkedWorkbook", { enumerable: true, get: function () { return univer_import_excel_1.excelBufferToChunkedWorkbook; } });
13
+ Object.defineProperty(exports, "resolveWorksheetRowCount", { enumerable: true, get: function () { return univer_import_excel_1.resolveWorksheetRowCount; } });
14
+ Object.defineProperty(exports, "shouldUseChunkedImport", { enumerable: true, get: function () { return univer_import_excel_1.shouldUseChunkedImport; } });
15
+ Object.defineProperty(exports, "skeletonWorkbookFromMeta", { enumerable: true, get: function () { return univer_import_excel_1.skeletonWorkbookFromMeta; } });
16
+ //# sourceMappingURL=exceljsChunked.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceljsChunked.js","sourceRoot":"","sources":["../../../../../utils/src/excel/exceljsChunked.ts"],"names":[],"mappings":";;;AACA,qEAYuC;AAXrC,yHAAA,kBAAkB,OAAA;AAClB,4HAAA,qBAAqB,OAAA;AACrB,6HAAA,sBAAsB,OAAA;AACtB,uHAAA,gBAAgB,OAAA;AAChB,+HAAA,wBAAwB,OAAA;AACxB,2HAAA,oBAAoB,OAAA;AACpB,0HAAA,mBAAmB,OAAA;AACnB,mIAAA,4BAA4B,OAAA;AAC5B,+HAAA,wBAAwB,OAAA;AACxB,6HAAA,sBAAsB,OAAA;AACtB,+HAAA,wBAAwB,OAAA"}
@@ -0,0 +1,2 @@
1
+ export { collectWorkbookDrawingResources, collectWorksheetFreeze, emuToPx, } from '@ims-view/univer-import-excel';
2
+ export type { SheetFreeze } from '@ims-view/univer-import-excel';
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.emuToPx = exports.collectWorksheetFreeze = exports.collectWorkbookDrawingResources = void 0;
4
+ var univer_import_excel_1 = require("@ims-view/univer-import-excel");
5
+ Object.defineProperty(exports, "collectWorkbookDrawingResources", { enumerable: true, get: function () { return univer_import_excel_1.collectWorkbookDrawingResources; } });
6
+ Object.defineProperty(exports, "collectWorksheetFreeze", { enumerable: true, get: function () { return univer_import_excel_1.collectWorksheetFreeze; } });
7
+ Object.defineProperty(exports, "emuToPx", { enumerable: true, get: function () { return univer_import_excel_1.emuToPx; } });
8
+ //# sourceMappingURL=exceljsDrawings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceljsDrawings.js","sourceRoot":"","sources":["../../../../../utils/src/excel/exceljsDrawings.ts"],"names":[],"mappings":";;;AACA,qEAIuC;AAHrC,sIAAA,+BAA+B,OAAA;AAC/B,6HAAA,sBAAsB,OAAA;AACtB,8GAAA,OAAO,OAAA"}
@@ -0,0 +1,2 @@
1
+ export { BorderStyleTypes, StyleInterner, argbToRgb, excelColorToRgb, excelStyleToUniver, } from '@ims-view/univer-import-excel';
2
+ export type { UniverStyleData } from '@ims-view/univer-import-excel';
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.excelStyleToUniver = exports.excelColorToRgb = exports.argbToRgb = exports.StyleInterner = exports.BorderStyleTypes = void 0;
4
+ var univer_import_excel_1 = require("@ims-view/univer-import-excel");
5
+ Object.defineProperty(exports, "BorderStyleTypes", { enumerable: true, get: function () { return univer_import_excel_1.BorderStyleTypes; } });
6
+ Object.defineProperty(exports, "StyleInterner", { enumerable: true, get: function () { return univer_import_excel_1.StyleInterner; } });
7
+ Object.defineProperty(exports, "argbToRgb", { enumerable: true, get: function () { return univer_import_excel_1.argbToRgb; } });
8
+ Object.defineProperty(exports, "excelColorToRgb", { enumerable: true, get: function () { return univer_import_excel_1.excelColorToRgb; } });
9
+ Object.defineProperty(exports, "excelStyleToUniver", { enumerable: true, get: function () { return univer_import_excel_1.excelStyleToUniver; } });
10
+ //# sourceMappingURL=exceljsStyle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exceljsStyle.js","sourceRoot":"","sources":["../../../../../utils/src/excel/exceljsStyle.ts"],"names":[],"mappings":";;;AACA,qEAMuC;AALrC,uHAAA,gBAAgB,OAAA;AAChB,oHAAA,aAAa,OAAA;AACb,gHAAA,SAAS,OAAA;AACT,sHAAA,eAAe,OAAA;AACf,yHAAA,kBAAkB,OAAA"}
@@ -0,0 +1,31 @@
1
+ import type { IWorkbookData } from './types';
2
+ export type ExcelExportWorkerMode = 'off' | 'auto' | 'on';
3
+ export declare const DEFAULT_EXPORT_WORKER_THRESHOLD_BYTES: number;
4
+ export type ExcelExportOptions = {
5
+ fileName?: string;
6
+ worker?: ExcelExportWorkerMode;
7
+ workerThresholdBytes?: number;
8
+ createWorker?: () => Worker;
9
+ };
10
+ export type ExcelExportWorkerInMessage = {
11
+ type: 'export';
12
+ snapshot: Partial<IWorkbookData>;
13
+ fileName: string;
14
+ };
15
+ export type ExcelExportWorkerOutMessage = {
16
+ type: 'done';
17
+ buffer: ArrayBuffer;
18
+ } | {
19
+ type: 'error';
20
+ error: string;
21
+ };
22
+ export declare const estimateWorkbookSnapshotBytes: (data: Partial<IWorkbookData>) => number;
23
+ export declare const resolveShouldUseExportWorker: (sizeBytes: number, options?: Pick<ExcelExportOptions, "worker" | "workerThresholdBytes" | "createWorker">) => boolean;
24
+ export declare const workbookDataToExcelArrayBuffer: (data: Partial<IWorkbookData>, fileName?: string) => Promise<ArrayBuffer>;
25
+ export declare const installExcelExportWorker: (scope?: {
26
+ postMessage: (msg: ExcelExportWorkerOutMessage, transfer?: Transferable[]) => void;
27
+ addEventListener: (type: "message", listener: (event: MessageEvent) => void) => void;
28
+ }) => void;
29
+ export declare const runExcelExportInBrowserWorker: (snapshot: Partial<IWorkbookData>, options: ExcelExportOptions & {
30
+ createWorker: () => Worker;
31
+ }) => Promise<ArrayBuffer>;