@aidc-toolkit/app-extension 1.0.52 → 1.0.53-beta

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 (182) hide show
  1. package/dist/app-extension-options.d.ts +52 -0
  2. package/dist/app-extension-options.d.ts.map +1 -0
  3. package/dist/app-extension-options.js +2 -0
  4. package/dist/app-extension-options.js.map +1 -0
  5. package/dist/app-extension.d.ts +194 -0
  6. package/dist/app-extension.d.ts.map +1 -0
  7. package/dist/app-extension.js +141 -0
  8. package/dist/app-extension.js.map +1 -0
  9. package/dist/app-helper-proxy.d.ts +57 -0
  10. package/dist/app-helper-proxy.d.ts.map +1 -0
  11. package/dist/app-helper-proxy.js +354 -0
  12. package/dist/app-helper-proxy.js.map +1 -0
  13. package/dist/{descriptor-Df-lif4q.d.cts → descriptor.d.ts} +13 -13
  14. package/dist/descriptor.d.ts.map +1 -0
  15. package/dist/descriptor.js +44 -0
  16. package/dist/descriptor.js.map +1 -0
  17. package/dist/generator/functions-generator.d.ts +103 -0
  18. package/dist/generator/functions-generator.d.ts.map +1 -0
  19. package/dist/generator/functions-generator.js +179 -0
  20. package/dist/generator/functions-generator.js.map +1 -0
  21. package/dist/generator/generator.d.ts +121 -0
  22. package/dist/generator/generator.d.ts.map +1 -0
  23. package/dist/generator/generator.js +186 -0
  24. package/dist/generator/generator.js.map +1 -0
  25. package/dist/generator/index.d.ts +18 -223
  26. package/dist/generator/index.d.ts.map +1 -0
  27. package/dist/generator/index.js +3 -1
  28. package/dist/generator/index.js.map +1 -0
  29. package/dist/generator/locale-resources-generator.d.ts +2 -0
  30. package/dist/generator/locale-resources-generator.d.ts.map +1 -0
  31. package/dist/generator/locale-resources-generator.js +333 -0
  32. package/dist/generator/locale-resources-generator.js.map +1 -0
  33. package/dist/gs1/character-set-proxy.d.ts +12 -0
  34. package/dist/gs1/character-set-proxy.d.ts.map +1 -0
  35. package/dist/gs1/character-set-proxy.js +126 -0
  36. package/dist/gs1/character-set-proxy.js.map +1 -0
  37. package/dist/gs1/check-proxy.d.ts +11 -0
  38. package/dist/gs1/check-proxy.d.ts.map +1 -0
  39. package/dist/gs1/check-proxy.js +163 -0
  40. package/dist/gs1/check-proxy.js.map +1 -0
  41. package/dist/gs1/gcp-length-proxy.d.ts +11 -0
  42. package/dist/gs1/gcp-length-proxy.d.ts.map +1 -0
  43. package/dist/gs1/gcp-length-proxy.js +187 -0
  44. package/dist/gs1/gcp-length-proxy.js.map +1 -0
  45. package/dist/gs1/gtin-creator-proxy.d.ts +10 -0
  46. package/dist/gs1/gtin-creator-proxy.d.ts.map +1 -0
  47. package/dist/gs1/gtin-creator-proxy.js +85 -0
  48. package/dist/gs1/gtin-creator-proxy.js.map +1 -0
  49. package/dist/gs1/gtin-descriptor.d.ts +3 -0
  50. package/dist/gs1/gtin-descriptor.d.ts.map +1 -0
  51. package/dist/gs1/gtin-descriptor.js +8 -0
  52. package/dist/gs1/gtin-descriptor.js.map +1 -0
  53. package/dist/gs1/gtin-validator-proxy.d.ts +26 -0
  54. package/dist/gs1/gtin-validator-proxy.d.ts.map +1 -0
  55. package/dist/gs1/gtin-validator-proxy.js +256 -0
  56. package/dist/gs1/gtin-validator-proxy.js.map +1 -0
  57. package/dist/gs1/identifier-creator-proxy.d.ts +30 -0
  58. package/dist/gs1/identifier-creator-proxy.d.ts.map +1 -0
  59. package/dist/gs1/identifier-creator-proxy.js +318 -0
  60. package/dist/gs1/identifier-creator-proxy.js.map +1 -0
  61. package/dist/gs1/identifier-descriptor.d.ts +4 -0
  62. package/dist/gs1/identifier-descriptor.d.ts.map +1 -0
  63. package/dist/gs1/identifier-descriptor.js +14 -0
  64. package/dist/gs1/identifier-descriptor.js.map +1 -0
  65. package/dist/gs1/identifier-type.d.ts +22 -0
  66. package/dist/gs1/identifier-type.d.ts.map +1 -0
  67. package/dist/gs1/identifier-type.js +34 -0
  68. package/dist/gs1/identifier-type.js.map +1 -0
  69. package/dist/gs1/identifier-validator-proxy.d.ts +29 -0
  70. package/dist/gs1/identifier-validator-proxy.d.ts.map +1 -0
  71. package/dist/gs1/identifier-validator-proxy.js +212 -0
  72. package/dist/gs1/identifier-validator-proxy.js.map +1 -0
  73. package/dist/gs1/index.d.ts +11 -185
  74. package/dist/gs1/index.d.ts.map +1 -0
  75. package/dist/gs1/index.js +11 -1
  76. package/dist/gs1/index.js.map +1 -0
  77. package/dist/gs1/non-gtin-creator-proxy.d.ts +37 -0
  78. package/dist/gs1/non-gtin-creator-proxy.d.ts.map +1 -0
  79. package/dist/gs1/non-gtin-creator-proxy.js +301 -0
  80. package/dist/gs1/non-gtin-creator-proxy.js.map +1 -0
  81. package/dist/gs1/non-gtin-validator-proxy.d.ts +36 -0
  82. package/dist/gs1/non-gtin-validator-proxy.d.ts.map +1 -0
  83. package/dist/gs1/non-gtin-validator-proxy.js +302 -0
  84. package/dist/gs1/non-gtin-validator-proxy.js.map +1 -0
  85. package/dist/gs1/prefix-definition-descriptor.d.ts +4 -0
  86. package/dist/gs1/prefix-definition-descriptor.d.ts.map +1 -0
  87. package/dist/gs1/prefix-definition-descriptor.js +16 -0
  88. package/dist/gs1/prefix-definition-descriptor.js.map +1 -0
  89. package/dist/gs1/prefix-manager-proxy.d.ts +8 -0
  90. package/dist/gs1/prefix-manager-proxy.d.ts.map +1 -0
  91. package/dist/gs1/prefix-manager-proxy.js +94 -0
  92. package/dist/gs1/prefix-manager-proxy.js.map +1 -0
  93. package/dist/gs1/variable-measure-proxy.d.ts +7 -0
  94. package/dist/gs1/variable-measure-proxy.d.ts.map +1 -0
  95. package/dist/gs1/variable-measure-proxy.js +114 -0
  96. package/dist/gs1/variable-measure-proxy.js.map +1 -0
  97. package/dist/gs1/verified-by-gs1-proxy.d.ts +7 -0
  98. package/dist/gs1/verified-by-gs1-proxy.d.ts.map +1 -0
  99. package/dist/gs1/verified-by-gs1-proxy.js +100 -0
  100. package/dist/gs1/verified-by-gs1-proxy.js.map +1 -0
  101. package/dist/index.d.ts +22 -847
  102. package/dist/index.d.ts.map +1 -0
  103. package/dist/index.js +7 -1
  104. package/dist/index.js.map +1 -0
  105. package/dist/lib-proxy.d.ts +121 -0
  106. package/dist/lib-proxy.d.ts.map +1 -0
  107. package/dist/lib-proxy.js +259 -0
  108. package/dist/lib-proxy.js.map +1 -0
  109. package/dist/{index.d.cts → locale/en/locale-resources.d.ts} +2 -98
  110. package/dist/locale/en/locale-resources.d.ts.map +1 -0
  111. package/dist/locale/en/locale-resources.js +754 -0
  112. package/dist/locale/en/locale-resources.js.map +1 -0
  113. package/dist/locale/fr/locale-resources.d.ts +755 -0
  114. package/dist/locale/fr/locale-resources.d.ts.map +1 -0
  115. package/dist/locale/fr/locale-resources.js +754 -0
  116. package/dist/locale/fr/locale-resources.js.map +1 -0
  117. package/dist/locale/i18n.d.ts +27 -0
  118. package/dist/locale/i18n.d.ts.map +1 -0
  119. package/dist/locale/i18n.js +36 -0
  120. package/dist/locale/i18n.js.map +1 -0
  121. package/dist/proxy.d.ts +135 -0
  122. package/dist/proxy.d.ts.map +1 -0
  123. package/dist/proxy.js +291 -0
  124. package/dist/proxy.js.map +1 -0
  125. package/dist/streaming.d.ts +10 -0
  126. package/dist/streaming.d.ts.map +1 -0
  127. package/dist/streaming.js +2 -0
  128. package/dist/streaming.js.map +1 -0
  129. package/dist/type.d.ts +72 -0
  130. package/dist/type.d.ts.map +1 -0
  131. package/dist/type.js +2 -0
  132. package/dist/type.js.map +1 -0
  133. package/dist/utility/character-set-descriptor.d.ts +6 -0
  134. package/dist/utility/character-set-descriptor.d.ts.map +1 -0
  135. package/dist/utility/character-set-descriptor.js +28 -0
  136. package/dist/utility/character-set-descriptor.js.map +1 -0
  137. package/dist/utility/character-set-proxy.d.ts +32 -0
  138. package/dist/utility/character-set-proxy.d.ts.map +1 -0
  139. package/dist/utility/character-set-proxy.js +278 -0
  140. package/dist/utility/character-set-proxy.js.map +1 -0
  141. package/dist/utility/index.d.ts +4 -0
  142. package/dist/utility/index.d.ts.map +1 -0
  143. package/dist/utility/index.js +4 -0
  144. package/dist/utility/index.js.map +1 -0
  145. package/dist/utility/reg-exp-proxy.d.ts +8 -0
  146. package/dist/utility/reg-exp-proxy.d.ts.map +1 -0
  147. package/dist/utility/reg-exp-proxy.js +103 -0
  148. package/dist/utility/reg-exp-proxy.js.map +1 -0
  149. package/dist/utility/string-descriptor.d.ts +4 -0
  150. package/dist/utility/string-descriptor.d.ts.map +1 -0
  151. package/dist/utility/string-descriptor.js +12 -0
  152. package/dist/utility/string-descriptor.js.map +1 -0
  153. package/dist/utility/string-proxy.d.ts +7 -0
  154. package/dist/utility/string-proxy.d.ts.map +1 -0
  155. package/dist/utility/string-proxy.js +63 -0
  156. package/dist/utility/string-proxy.js.map +1 -0
  157. package/dist/utility/transformer-descriptor.d.ts +6 -0
  158. package/dist/utility/transformer-descriptor.d.ts.map +1 -0
  159. package/dist/utility/transformer-descriptor.js +24 -0
  160. package/dist/utility/transformer-descriptor.js.map +1 -0
  161. package/dist/utility/transformer-proxy.d.ts +10 -0
  162. package/dist/utility/transformer-proxy.d.ts.map +1 -0
  163. package/dist/utility/transformer-proxy.js +111 -0
  164. package/dist/utility/transformer-proxy.js.map +1 -0
  165. package/dist/version.d.ts +5 -0
  166. package/dist/version.d.ts.map +1 -0
  167. package/dist/version.js +5 -0
  168. package/dist/version.js.map +1 -0
  169. package/package.json +5 -5
  170. package/src/version.ts +1 -1
  171. package/tsconfig-src.tsbuildinfo +1 -1
  172. package/dist/character-set-proxy-CQCOcqR3.d.cts +0 -473
  173. package/dist/character-set-proxy-CQCOcqR3.d.ts +0 -473
  174. package/dist/chunk-4BTJEN4N.js +0 -1
  175. package/dist/chunk-G5IU2ZOV.js +0 -1
  176. package/dist/chunk-WLXID4YR.js +0 -1
  177. package/dist/descriptor-Df-lif4q.d.ts +0 -185
  178. package/dist/generator/index.cjs +0 -17
  179. package/dist/generator/index.d.cts +0 -224
  180. package/dist/gs1/index.cjs +0 -1
  181. package/dist/gs1/index.d.cts +0 -185
  182. package/dist/index.cjs +0 -17
@@ -0,0 +1,354 @@
1
+ var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
2
+ var useValue = arguments.length > 2;
3
+ for (var i = 0; i < initializers.length; i++) {
4
+ value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
5
+ }
6
+ return useValue ? value : void 0;
7
+ };
8
+ var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
9
+ function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
10
+ var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
11
+ var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
12
+ var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
13
+ var _, done = false;
14
+ for (var i = decorators.length - 1; i >= 0; i--) {
15
+ var context = {};
16
+ for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
17
+ for (var p in contextIn.access) context.access[p] = contextIn.access[p];
18
+ context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
19
+ var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
20
+ if (kind === "accessor") {
21
+ if (result === void 0) continue;
22
+ if (result === null || typeof result !== "object") throw new TypeError("Object expected");
23
+ if (_ = accept(result.get)) descriptor.get = _;
24
+ if (_ = accept(result.set)) descriptor.set = _;
25
+ if (_ = accept(result.init)) initializers.unshift(_);
26
+ }
27
+ else if (_ = accept(result)) {
28
+ if (kind === "field") initializers.unshift(_);
29
+ else descriptor[key] = _;
30
+ }
31
+ }
32
+ if (target) Object.defineProperty(target, contextIn.name, descriptor);
33
+ done = true;
34
+ };
35
+ import { isNullish, logLevelOf } from "@aidc-toolkit/core";
36
+ import { Multiplicities, Types } from "./descriptor.js";
37
+ import { LibProxy } from "./lib-proxy.js";
38
+ import { i18nextAppExtension } from "./locale/i18n.js";
39
+ import { proxy } from "./proxy.js";
40
+ const spillArrayParameterDescriptor = {
41
+ name: "spillArray",
42
+ type: Types.Any,
43
+ multiplicity: Multiplicities.Array,
44
+ isRequired: true
45
+ };
46
+ const spillMaximumParameterDescriptor = {
47
+ name: "spillMaximum",
48
+ type: Types.Number,
49
+ multiplicity: Multiplicities.Singleton,
50
+ isRequired: false
51
+ };
52
+ const spillMaximumWidthParameterDescriptor = {
53
+ extendsDescriptor: spillMaximumParameterDescriptor,
54
+ sortOrder: 0,
55
+ name: "spillMaximumWidth"
56
+ };
57
+ const spillMaximumHeightParameterDescriptor = {
58
+ extendsDescriptor: spillMaximumParameterDescriptor,
59
+ sortOrder: 1,
60
+ name: "spillMaximumHeight"
61
+ };
62
+ const logLevelParameterDescriptor = {
63
+ name: "logLevel",
64
+ type: Types.String,
65
+ multiplicity: Multiplicities.Singleton,
66
+ isRequired: false
67
+ };
68
+ /**
69
+ * Application helper.
70
+ */
71
+ let AppHelperProxy = (() => {
72
+ let _classDecorators = [proxy.describeClass(false, {
73
+ category: "helper"
74
+ })];
75
+ let _classDescriptor;
76
+ let _classExtraInitializers = [];
77
+ let _classThis;
78
+ let _classSuper = LibProxy;
79
+ let _instanceExtraInitializers = [];
80
+ let _version_decorators;
81
+ let _spill_decorators;
82
+ let _loggerMessages_decorators;
83
+ let _loggerStream_decorators;
84
+ var AppHelperProxy = class extends _classSuper {
85
+ static { _classThis = this; }
86
+ static {
87
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
88
+ _version_decorators = [proxy.describeMethod({
89
+ type: Types.String,
90
+ multiplicity: Multiplicities.Singleton,
91
+ parameterDescriptors: []
92
+ })];
93
+ _spill_decorators = [proxy.describeMethod({
94
+ type: Types.Any,
95
+ multiplicity: Multiplicities.Matrix,
96
+ isAsync: true,
97
+ requiresContext: true,
98
+ parameterDescriptors: [spillArrayParameterDescriptor, spillMaximumHeightParameterDescriptor, spillMaximumWidthParameterDescriptor]
99
+ })];
100
+ _loggerMessages_decorators = [proxy.describeMethod({
101
+ type: Types.String,
102
+ multiplicity: Multiplicities.Array,
103
+ isHidden: true,
104
+ isVolatile: true,
105
+ parameterDescriptors: [logLevelParameterDescriptor]
106
+ })];
107
+ _loggerStream_decorators = [proxy.describeMethod({
108
+ type: Types.String,
109
+ multiplicity: Multiplicities.Array,
110
+ isHidden: true,
111
+ isStream: true,
112
+ parameterDescriptors: [logLevelParameterDescriptor]
113
+ })];
114
+ __esDecorate(this, null, _version_decorators, { kind: "method", name: "version", static: false, private: false, access: { has: obj => "version" in obj, get: obj => obj.version }, metadata: _metadata }, null, _instanceExtraInitializers);
115
+ __esDecorate(this, null, _spill_decorators, { kind: "method", name: "spill", static: false, private: false, access: { has: obj => "spill" in obj, get: obj => obj.spill }, metadata: _metadata }, null, _instanceExtraInitializers);
116
+ __esDecorate(this, null, _loggerMessages_decorators, { kind: "method", name: "loggerMessages", static: false, private: false, access: { has: obj => "loggerMessages" in obj, get: obj => obj.loggerMessages }, metadata: _metadata }, null, _instanceExtraInitializers);
117
+ __esDecorate(this, null, _loggerStream_decorators, { kind: "method", name: "loggerStream", static: false, private: false, access: { has: obj => "loggerStream" in obj, get: obj => obj.loggerStream }, metadata: _metadata }, null, _instanceExtraInitializers);
118
+ __esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
119
+ AppHelperProxy = _classThis = _classDescriptor.value;
120
+ if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
121
+ __runInitializers(_classThis, _classExtraInitializers);
122
+ }
123
+ /**
124
+ * Get the version.
125
+ *
126
+ * @returns
127
+ * Version.
128
+ */
129
+ version() {
130
+ return this.appExtension.version;
131
+ }
132
+ /**
133
+ * Provide default values for maximum width and height if required.
134
+ *
135
+ * @param maximumDimensions
136
+ * Maximum dimensions provided to function.
137
+ *
138
+ * @param invocationContext
139
+ * Invocation context.
140
+ *
141
+ * @returns
142
+ * Array of maximum width and maximum height.
143
+ */
144
+ async #defaultMaximums(maximumDimensions, invocationContext) {
145
+ if (isNullish(invocationContext)) {
146
+ // Application error; no localization necessary.
147
+ throw new Error("Invocation context not provided by application");
148
+ }
149
+ const maximumWidth = maximumDimensions.width;
150
+ const maximumHeight = maximumDimensions.height;
151
+ let definedMaximumWidth;
152
+ let definedMaximumHeight;
153
+ // Skip any extra work if both values are provided.
154
+ if (isNullish(maximumWidth) || isNullish(maximumHeight)) {
155
+ const sheetAddress = await this.appExtension.getSheetAddress(invocationContext);
156
+ definedMaximumWidth = maximumWidth ?? this.appExtension.maximumWidth - sheetAddress.columnIndex;
157
+ definedMaximumHeight = maximumHeight ?? this.appExtension.maximumHeight - sheetAddress.rowIndex;
158
+ }
159
+ else {
160
+ definedMaximumWidth = maximumWidth;
161
+ definedMaximumHeight = maximumHeight;
162
+ }
163
+ return {
164
+ width: definedMaximumWidth,
165
+ height: definedMaximumHeight
166
+ };
167
+ }
168
+ /**
169
+ * Spill a one-dimensional matrix to fit a rectangle within a given maximum height and width.
170
+ *
171
+ * @param arrayValues
172
+ * Matrix values. Matrix is length 1 or contains arrays of length 1 with the values.
173
+ *
174
+ * @param maximumHeight
175
+ * Maximum height.
176
+ *
177
+ * @param maximumWidth
178
+ * Maximum width.
179
+ *
180
+ * @param invocationContext
181
+ * Invocation context.
182
+ *
183
+ * @returns
184
+ * Matrix spilled within maximum height and maximum width.
185
+ */
186
+ async spill(arrayValues, maximumHeight, maximumWidth, invocationContext) {
187
+ let result;
188
+ // Assume matrix is uniformly two-dimensional.
189
+ const height = arrayValues.length;
190
+ const width = height !== 0 ? arrayValues[0].length : 0;
191
+ const isArrayOrError = this.singletonResult(() => {
192
+ if (height > 1 && width > 1) {
193
+ throw new RangeError(i18nextAppExtension.t("Proxy.matrixMustBeArray"));
194
+ }
195
+ return true;
196
+ });
197
+ if (isArrayOrError === true) {
198
+ const maximumDimensions = await this.#defaultMaximums({
199
+ width: maximumWidth,
200
+ height: maximumHeight
201
+ }, invocationContext);
202
+ const isHorizontal = height === 1;
203
+ const length = isHorizontal ? width : height;
204
+ const maximumParallel = isHorizontal ? maximumDimensions.width : maximumDimensions.height;
205
+ const maximumPerpendicular = isHorizontal ? maximumDimensions.height : maximumDimensions.width;
206
+ const maximumArea = maximumParallel * maximumPerpendicular;
207
+ // Lengths 0 and 1 are valid and require no special processing.
208
+ if (length > 1 && length <= maximumArea) {
209
+ const lengthSquareRoot = Math.sqrt(length);
210
+ let spillParallel = undefined;
211
+ // Array that has a length of a power of 10 is treated specially.
212
+ if (Number.isInteger(Math.log10(length))) {
213
+ // Try spill that is a power of 10, favouring the parallel direction.
214
+ let spillParallel10 = 10 ** Math.ceil(Math.log10(lengthSquareRoot));
215
+ // Favour the perpendicular direction if not enough parallel space.
216
+ if (spillParallel10 > maximumParallel) {
217
+ spillParallel10 /= 10;
218
+ }
219
+ // Take result as the spill parallel if it fits.
220
+ if (spillParallel10 <= maximumParallel && length / spillParallel10 <= maximumPerpendicular) {
221
+ spillParallel = spillParallel10;
222
+ }
223
+ }
224
+ // Make spill as square as possible, favouring the parallel direction.
225
+ spillParallel ??= Math.max(Math.min(Math.ceil(lengthSquareRoot), maximumParallel), Math.floor(length / maximumPerpendicular));
226
+ const spillPerpendicular = Math.ceil(length / spillParallel);
227
+ result = [];
228
+ if (isHorizontal) {
229
+ let startIndex = 0;
230
+ do {
231
+ const endIndex = startIndex + spillParallel;
232
+ // Each row is a slice of the original single row.
233
+ const row = arrayValues[0].slice(startIndex, endIndex);
234
+ // Row length will be anywhere from 1 to spillParallel.
235
+ if (row.length < spillParallel) {
236
+ const rowLength = row.length;
237
+ row.length = spillParallel;
238
+ // Fill empty cells with empty string.
239
+ row.fill("", rowLength, spillParallel);
240
+ }
241
+ result.push(row);
242
+ startIndex = endIndex;
243
+ } while (startIndex < length);
244
+ }
245
+ else {
246
+ for (let rowIndex = 0; rowIndex < spillParallel; rowIndex++) {
247
+ const row = [];
248
+ // Each column is a slice of the original single column.
249
+ for (let valueIndex = rowIndex; valueIndex < length; valueIndex += spillParallel) {
250
+ row.push(arrayValues[valueIndex][0]);
251
+ }
252
+ // Row length will always be spillPerpendicular or spillPerpendicular - 1.
253
+ if (row.length < spillPerpendicular) {
254
+ row[spillPerpendicular - 1] = "";
255
+ }
256
+ result.push(row);
257
+ }
258
+ }
259
+ }
260
+ else {
261
+ // Return matrix unmodified and let application handle spill error if any.
262
+ result = arrayValues;
263
+ }
264
+ }
265
+ else {
266
+ // Return error as only element in matrix.
267
+ result = [[isArrayOrError]];
268
+ }
269
+ return result;
270
+ }
271
+ /**
272
+ * Get the logger messages. This is a snapshot, with the option to change the log level for the next call.
273
+ *
274
+ * @param logLevelString
275
+ * Log level as string.
276
+ *
277
+ * @returns
278
+ * Logger messages.
279
+ */
280
+ loggerMessages(logLevelString) {
281
+ const appExtension = this.appExtension;
282
+ let logLevel = undefined;
283
+ if (!isNullish(logLevelString)) {
284
+ try {
285
+ logLevel = logLevelOf(logLevelString);
286
+ }
287
+ catch {
288
+ // Ignore error.
289
+ }
290
+ }
291
+ // Set log level if required.
292
+ if (logLevel !== undefined) {
293
+ appExtension.logger.settings.minLevel = logLevel;
294
+ }
295
+ return appExtension.memoryTransport.messages.map(message => [message]);
296
+ }
297
+ /**
298
+ * Get the logger messages as a stream.
299
+ *
300
+ * @param logLevelString
301
+ * Log level as string.
302
+ *
303
+ * @param streamingContext
304
+ * Streaming context.
305
+ */
306
+ loggerStream(logLevelString, streamingContext) {
307
+ if (isNullish(streamingContext)) {
308
+ // Application error; no localization necessary.
309
+ throw new Error("Streaming context not provided by application");
310
+ }
311
+ const appExtension = this.appExtension;
312
+ let notificationCallbackAdded = false;
313
+ let previousLogLevel = undefined;
314
+ const streamingConsumerCallback = appExtension.installStreaming(streamingContext, () => {
315
+ if (notificationCallbackAdded) {
316
+ appExtension.memoryTransport.removeNotificationCallback(AppHelperProxy.name);
317
+ }
318
+ if (previousLogLevel !== undefined) {
319
+ appExtension.logger.settings.minLevel = previousLogLevel;
320
+ }
321
+ });
322
+ if (appExtension.memoryTransport.addNotificationCallback(AppHelperProxy.name, (_message, messages) => {
323
+ streamingConsumerCallback(this.iterableResult(() => messages));
324
+ })) {
325
+ notificationCallbackAdded = true;
326
+ let logLevel = undefined;
327
+ if (!isNullish(logLevelString)) {
328
+ try {
329
+ logLevel = logLevelOf(logLevelString);
330
+ }
331
+ catch {
332
+ // Ignore error.
333
+ }
334
+ }
335
+ // Set log level if required.
336
+ if (logLevel !== undefined) {
337
+ previousLogLevel = appExtension.logger.settings.minLevel;
338
+ appExtension.logger.settings.minLevel = logLevel;
339
+ }
340
+ }
341
+ else {
342
+ // Diagnostic tool; localization not required.
343
+ streamingConsumerCallback([["Only one logger stream allowable per workbook"]]);
344
+ }
345
+ }
346
+ constructor() {
347
+ super(...arguments);
348
+ __runInitializers(this, _instanceExtraInitializers);
349
+ }
350
+ };
351
+ return AppHelperProxy = _classThis;
352
+ })();
353
+ export { AppHelperProxy };
354
+ //# sourceMappingURL=app-helper-proxy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"app-helper-proxy.js","sourceRoot":"","sources":["../src/app-helper-proxy.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,SAAS,EAAiB,UAAU,EAAyC,MAAM,oBAAoB,CAAC;AAEjH,OAAO,EAAmC,cAAc,EAA4B,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACnH,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAGnC,MAAM,6BAA6B,GAAwB;IACvD,IAAI,EAAE,YAAY;IAClB,IAAI,EAAE,KA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hSQ,mDAAc;;;;;SAAd,cAAc"}
@@ -10,7 +10,7 @@ interface Descriptor {
10
10
  /**
11
11
  * Types supported by proxy methods.
12
12
  */
13
- declare const Types: {
13
+ export declare const Types: {
14
14
  /**
15
15
  * String.
16
16
  */
@@ -31,15 +31,15 @@ declare const Types: {
31
31
  /**
32
32
  * Type key.
33
33
  */
34
- type TypeKey = keyof typeof Types;
34
+ export type TypeKey = keyof typeof Types;
35
35
  /**
36
36
  * Type.
37
37
  */
38
- type Type = typeof Types[TypeKey];
38
+ export type Type = typeof Types[TypeKey];
39
39
  /**
40
40
  * Multiplicities supported by proxy methods.
41
41
  */
42
- declare const Multiplicities: {
42
+ export declare const Multiplicities: {
43
43
  /**
44
44
  * Parameter or return value is a singleton.
45
45
  */
@@ -61,11 +61,11 @@ declare const Multiplicities: {
61
61
  /**
62
62
  * Multiplicity key.
63
63
  */
64
- type MultiplicityKey = keyof typeof Multiplicities;
64
+ export type MultiplicityKey = keyof typeof Multiplicities;
65
65
  /**
66
66
  * Multiplicity.
67
67
  */
68
- type Multiplicity = typeof Multiplicities[MultiplicityKey];
68
+ export type Multiplicity = typeof Multiplicities[MultiplicityKey];
69
69
  /**
70
70
  * Type descriptor.
71
71
  */
@@ -82,7 +82,7 @@ interface TypeDescriptor extends Descriptor {
82
82
  /**
83
83
  * Parameter descriptor.
84
84
  */
85
- interface ParameterDescriptor extends TypeDescriptor {
85
+ export interface ParameterDescriptor extends TypeDescriptor {
86
86
  /**
87
87
  * True if required.
88
88
  */
@@ -91,7 +91,7 @@ interface ParameterDescriptor extends TypeDescriptor {
91
91
  /**
92
92
  * Extends parameter descriptor.
93
93
  */
94
- interface ExtendsParameterDescriptor extends Partial<ParameterDescriptor> {
94
+ export interface ExtendsParameterDescriptor extends Partial<ParameterDescriptor> {
95
95
  /**
96
96
  * Parameter descriptor that this one extends.
97
97
  */
@@ -104,7 +104,7 @@ interface ExtendsParameterDescriptor extends Partial<ParameterDescriptor> {
104
104
  /**
105
105
  * Replacement parameter descriptor.
106
106
  */
107
- interface ReplacementParameterDescriptor {
107
+ export interface ReplacementParameterDescriptor {
108
108
  /**
109
109
  * Name to replace.
110
110
  */
@@ -117,7 +117,7 @@ interface ReplacementParameterDescriptor {
117
117
  /**
118
118
  * Method descriptor.
119
119
  */
120
- interface MethodDescriptor extends TypeDescriptor {
120
+ export interface MethodDescriptor extends TypeDescriptor {
121
121
  /**
122
122
  * If true, method is asynchronous.
123
123
  */
@@ -159,7 +159,7 @@ interface MethodDescriptor extends TypeDescriptor {
159
159
  /**
160
160
  * Class descriptor.
161
161
  */
162
- interface ClassDescriptor extends Descriptor {
162
+ export interface ClassDescriptor extends Descriptor {
163
163
  /**
164
164
  * Class namespace. If not provided, class is at the top level.
165
165
  */
@@ -181,5 +181,5 @@ interface ClassDescriptor extends Descriptor {
181
181
  */
182
182
  readonly methodDescriptors: readonly MethodDescriptor[];
183
183
  }
184
-
185
- export { type ClassDescriptor as C, type ExtendsParameterDescriptor as E, type MethodDescriptor as M, type ParameterDescriptor as P, type ReplacementParameterDescriptor as R, type Type as T, Multiplicities as a, type Multiplicity as b, type MultiplicityKey as c, type TypeKey as d, Types as e };
184
+ export {};
185
+ //# sourceMappingURL=descriptor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor.d.ts","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,UAAU,UAAU;IAChB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,KAAK;IACd;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;IAGH;;OAEG;;CAEG,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,IAAI,GAAG,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,cAAc;I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zB;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC;IAE5B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B;;OAEG;IACH,QAAQ,CAAC,oBAAoB,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAE9D;;OAEG;IACH,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CACjC;AAED;;GAEG;AACH,MAAM,WAAW,eAAgB,SAAQ,UAAU;IAC/C;;OAEG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAExC;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAE1B;;OAEG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE1C;;OAEG;IACH,QAAQ,CAAC,+BAA+B,CAAC,EAAE,8BAA8B,EAAE,CAAC;IAE5E;;OAEG;IACH,QAAQ,CAAC,iBAAiB,EAAE,SAAS,gBAAgB,EAAE,CAAC;CAC3D"}
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Types supported by proxy methods.
3
+ */
4
+ export const Types = {
5
+ /**
6
+ * String.
7
+ */
8
+ String: 0,
9
+ /**
10
+ * Number or enumeration.
11
+ */
12
+ Number: 1,
13
+ /**
14
+ * Boolean.
15
+ */
16
+ Boolean: 2,
17
+ /**
18
+ * Any.
19
+ */
20
+ Any: 3
21
+ };
22
+ /**
23
+ * Multiplicities supported by proxy methods.
24
+ */
25
+ export const Multiplicities = {
26
+ /**
27
+ * Parameter or return value is a singleton.
28
+ */
29
+ Singleton: 0,
30
+ /**
31
+ * Parameter or return value is a singleton or an array.
32
+ */
33
+ Array: 1,
34
+ /**
35
+ * Parameter or return value is a singleton, an array, or a matrix.
36
+ */
37
+ Matrix: 2,
38
+ /**
39
+ * Parameter value is a singleton or array but is treated as a singleton internally and doesn't drive multiplicity
40
+ * of the return value. Return value is an array for use as a singleton array parameter.
41
+ */
42
+ SingletonArray: 3
43
+ };
44
+ //# sourceMappingURL=descriptor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"descriptor.js","sourceRoot":"","sources":["../src/descriptor.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG;IACjB;;OAEG;IACH,MAAM,EAAE,CAAC;IAET;;OAEG;IACH,MAAM,EAAE,CAAC;IAET;;OAEG;IACH,OAAO,EAAE,CAAC;IAEV;;OAEG;IACH,GAAG,EAAE,CAAC;CACA,CAAC;AAYX;;GAEG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B;;OAEG;IACH,SAAS,EAAE,CAAC;IAEZ;;OAEG;IACH,KAAK,EAAE,CAAC;IAER;;OAEG;IACH,MAAM,EAAE,CAAC;IAET;;;OAGG;IACH,cAAc,EAAE,CAAC;CACX,CAAC"}
@@ -0,0 +1,103 @@
1
+ import { type ClassDescriptor, type MethodDescriptor, type ParameterDescriptor } from "../descriptor.js";
2
+ import { type FunctionLocalization, Generator, type Localization } from "./generator.js";
3
+ /**
4
+ * Class type alias.
5
+ */
6
+ export interface ClassTypeAlias {
7
+ /**
8
+ * Name.
9
+ */
10
+ readonly name: string;
11
+ /**
12
+ * Getter function.
13
+ */
14
+ readonly getter: string;
15
+ /**
16
+ * Declaration associating name with implementation type and creating getter function.
17
+ */
18
+ readonly declaration: string[];
19
+ }
20
+ /**
21
+ * Function implementation.
22
+ */
23
+ export interface FunctionImplementation {
24
+ /**
25
+ * Function name.
26
+ */
27
+ readonly functionName: string;
28
+ /**
29
+ * Parameter localizations with JavaScript type and parameter descriptor.
30
+ */
31
+ readonly parameterLocalizations: ReadonlyArray<Localization & {
32
+ /**
33
+ * JavaScript type.
34
+ */
35
+ javaScriptType: string;
36
+ /**
37
+ * Parameter descriptor.
38
+ */
39
+ parameterDescriptor?: ParameterDescriptor;
40
+ }>;
41
+ /**
42
+ * Declaration.
43
+ */
44
+ readonly declaration: string[];
45
+ }
46
+ /**
47
+ * Generator with helpers for writing TypeScript functions file.
48
+ */
49
+ export declare abstract class FunctionsGenerator extends Generator {
50
+ #private;
51
+ protected static readonly BASE_IMPORTS: string[];
52
+ /**
53
+ * Constructor.
54
+ *
55
+ * @param version
56
+ * Package version.
57
+ *
58
+ * @param inline
59
+ * If true, functions are declared inline rather than using `function`.
60
+ *
61
+ * @param supportsContext
62
+ * If true, application extension supports context.
63
+ */
64
+ constructor(version: string, inline: boolean, supportsContext: boolean);
65
+ /**
66
+ * Get the class type alias.
67
+ */
68
+ get classTypeAlias(): ClassTypeAlias;
69
+ /**
70
+ * Get the import statement for a namespace.
71
+ *
72
+ * @param namespace
73
+ * Namespace.
74
+ *
75
+ * @returns
76
+ * Import statement.
77
+ */
78
+ protected getNamespaceImport(namespace: string): string;
79
+ /**
80
+ * @inheritDoc
81
+ */
82
+ protected createClassProxy(classDescriptor: ClassDescriptor): void;
83
+ /**
84
+ * Get a function implementation.
85
+ *
86
+ * @param methodDescriptor
87
+ * Method descriptor.
88
+ *
89
+ * @param functionNamePrefix
90
+ * Function name prefix.
91
+ *
92
+ * @param functionLocalization
93
+ * Function localization. May be undefined for hidden functions, in which case generated
94
+ *
95
+ * @param parameterCallback
96
+ * Callback to modify parameter in implementation function call.
97
+ *
98
+ * @returns
99
+ * Function implementation.
100
+ */
101
+ protected getFunctionImplementation(methodDescriptor: MethodDescriptor, functionNamePrefix: string, functionLocalization: FunctionLocalization | undefined, parameterCallback?: (name: string, parameterDescriptor: ParameterDescriptor) => string): FunctionImplementation;
102
+ }
103
+ //# sourceMappingURL=functions-generator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"functions-generator.d.ts","sourceRoot":"","sources":["../../src/generator/functions-generator.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,eAAe,EACpB,KAAK,gBAAgB,EACrB,KAAK,mBAAmB,EAG3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,KAAK,oBAAo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