@silurus/ooxml 0.74.6 → 0.75.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 +105 -6
- package/dist/bounded-raw-part-cache-BTfZD_Sz.js +1248 -0
- package/dist/{docx-DftZMp7R.js → document-pull-client-H80_E10V.js} +11165 -11517
- package/dist/docx-BX0mJqS1.js +1274 -0
- package/dist/docx.mjs +6 -3
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/duotone-bitmap-by-path-Dv5Ikbzl.js +28 -0
- package/dist/find-cursor-Dc5iM6s7.js +815 -0
- package/dist/highlight-rect-cCvVU-MW.js +48 -0
- package/dist/hyperlink-D85FexTa.js +27 -0
- package/dist/index.mjs +4 -4
- package/dist/{highlight-rect-IjFkGg4X.js → line-distribute-DkLgIa7B.js} +37 -84
- package/dist/{find-cursor-DtgyGs5V.js → line-metrics-qwIyTk7Q.js} +1169 -3641
- package/dist/math.mjs +1 -1
- package/dist/node.mjs +998 -0
- package/dist/pptx-BEYjiTnZ.js +822 -0
- package/dist/pptx-CXgyi7wu.js +1705 -0
- package/dist/pptx.mjs +7 -3
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/preload-BEouWnlI.js +132 -0
- package/dist/render-C0wMf5eT.js +71 -0
- package/dist/render-worker-host-CLdOlxFu.js +27 -0
- package/dist/render-worker-host-DZ4u0RFs.js +27 -0
- package/dist/render-worker-host-s3J-mWBP.js +27 -0
- package/dist/renderer-CwzTv9hH.js +5225 -0
- package/dist/resource-measurement-6aReN3K0.js +93 -0
- package/dist/slide-pull-client-D_T0AIoX.js +175 -0
- package/dist/svg-image-by-path-C1M3N2pT.js +1623 -0
- package/dist/transfer-3QEJrsJa.js +6 -0
- package/dist/types/docx.d.ts +290 -105
- package/dist/types/index.d.ts +399 -142
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +4855 -0
- package/dist/types/pptx.d.ts +431 -245
- package/dist/types/xlsx.d.ts +320 -120
- package/dist/visible-index-CKvgpUrf.js +17 -0
- package/dist/worksheet-pull-worker-DCei8u-4.js +347 -0
- package/dist/{xlsx-BqMHvfsE.js → xlsx-DJyPlzjB.js} +1499 -1284
- package/dist/xlsx.mjs +7 -3
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +12 -2
- package/dist/pptx-qbadwIv4.js +0 -6761
- package/dist/render-worker-host-Bcm9j4-H.js +0 -27
- package/dist/render-worker-host-BqSTDaYt.js +0 -27
- package/dist/render-worker-host-C523QxVw.js +0 -27
- package/dist/visible-index-C3_3gBg-.js +0 -50
- /package/dist/{mathjax-BPjQ2C_j.js → mathjax-Dqo857oC.js} +0 -0
package/dist/types/xlsx.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region dist/.types-work/mathjax-
|
|
1
|
+
//#region dist/.types-work/mathjax-BO1uUSCW.d.ts
|
|
2
2
|
//#region packages/core/src/math/mathjax.d.ts
|
|
3
3
|
interface MathSvg {
|
|
4
4
|
/** standalone `<svg>…</svg>` markup. */
|
|
@@ -29,7 +29,7 @@ interface MathRenderer {
|
|
|
29
29
|
mathMLToSvg(mathml: string): Promise<MathSvg>;
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
|
-
//#region dist/.types-work/
|
|
32
|
+
//#region dist/.types-work/hyperlink-CHHEOeCL.d.ts
|
|
33
33
|
//#region packages/core/src/types/math.d.ts
|
|
34
34
|
type MathStyle = 'roman' | 'italic' | 'bold' | 'boldItalic';
|
|
35
35
|
interface MathRun {
|
|
@@ -949,7 +949,157 @@ interface LegendManualLayout {
|
|
|
949
949
|
h: number;
|
|
950
950
|
}
|
|
951
951
|
//#endregion
|
|
952
|
+
//#region packages/core/src/errors/ooxml-error.d.ts
|
|
953
|
+
/**
|
|
954
|
+
* Machine-readable code for a typed load-time failure.
|
|
955
|
+
*
|
|
956
|
+
* The container-level failures the `load()` factories detect on the main thread
|
|
957
|
+
* before handing bytes to the parser worker (see `sniffCfb` / `decryptOoxml`).
|
|
958
|
+
* This is the seed of the broader typed-error surface tracked as PD4 (OoxmlError
|
|
959
|
+
* typed errors). Add codes here rather than throwing bare `Error(string)`, so
|
|
960
|
+
* callers can `switch` on `err.code` instead of matching message text.
|
|
961
|
+
*
|
|
962
|
+
* - `'encrypted'` — password-protected, but no `password` was
|
|
963
|
+
* supplied (pass `LoadOptions.password` to decrypt).
|
|
964
|
+
* - `'invalid-password'` — a `password` was supplied but did not match.
|
|
965
|
+
* - `'unsupported-encryption'`— encrypted with a scheme other than Agile
|
|
966
|
+
* (Standard / Extensible / a legacy binary encryptor), which this library
|
|
967
|
+
* cannot decrypt (PD8 implements Agile only).
|
|
968
|
+
* - `'legacy-binary-format'` — a raw .doc / .xls / .ppt (not OOXML).
|
|
969
|
+
* - `'not-ooxml'` — a CFB of an unrecognised kind, or otherwise
|
|
970
|
+
* not an OOXML ZIP.
|
|
971
|
+
*/
|
|
972
|
+
type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml';
|
|
973
|
+
type OoxmlErrorStage = 'container' | 'decompression' | 'parsing' | 'serialization' | 'layout' | 'rendering' | 'worker';
|
|
974
|
+
/**
|
|
975
|
+
* @deprecated Use {@link OoxmlErrorStage}. Retained as a compatibility alias
|
|
976
|
+
* for the short-lived resource-governance API that exposed this vocabulary;
|
|
977
|
+
* scheduled for removal in a future breaking release.
|
|
978
|
+
*/
|
|
979
|
+
type OoxmlErrorSource = 'container' | 'zip-part' | 'parser' | 'serializer' | 'layout' | 'renderer' | 'worker';
|
|
980
|
+
/**
|
|
981
|
+
* Typed error thrown by the docx / pptx / xlsx `load()` factories for failures
|
|
982
|
+
* that carry a stable, programmatic {@link OoxmlErrorCode} (e.g. a
|
|
983
|
+
* password-protected or legacy-binary file detected from its container magic).
|
|
984
|
+
*
|
|
985
|
+
* Note on workers: `instanceof OoxmlError` does not survive a structured-clone
|
|
986
|
+
* across the worker boundary. Detection that needs a typed error is therefore
|
|
987
|
+
* done on the main thread (before the worker is involved) so a genuine
|
|
988
|
+
* `OoxmlError` instance is thrown to the caller. Errors that must cross the
|
|
989
|
+
* worker boundary should carry the `code` string and be reconstructed on the
|
|
990
|
+
* main side.
|
|
991
|
+
*/
|
|
992
|
+
declare class OoxmlError extends Error {
|
|
993
|
+
readonly code: OoxmlErrorCode;
|
|
994
|
+
constructor(code: OoxmlErrorCode, message: string);
|
|
995
|
+
}
|
|
996
|
+
type OoxmlFormat = 'docx' | 'xlsx' | 'pptx';
|
|
997
|
+
interface OoxmlResourceUsageSnapshot {
|
|
998
|
+
readonly archiveEntryCount: number;
|
|
999
|
+
readonly declaredInflatedBytes: number;
|
|
1000
|
+
/** Largest actual decompressed size observed for one ZIP entry. */
|
|
1001
|
+
readonly largestInflatedEntryBytes?: number;
|
|
1002
|
+
readonly distinctInflatedBytes: number;
|
|
1003
|
+
readonly operationInflatedBytes: number;
|
|
1004
|
+
}
|
|
1005
|
+
type ExtensibleLiteral<Known extends string> = Known | (string & Record<never, never>);
|
|
1006
|
+
/**
|
|
1007
|
+
* Resource family reported by a policy or hard-quota violation.
|
|
1008
|
+
*
|
|
1009
|
+
* The known literals provide editor completion. The string tail is deliberate:
|
|
1010
|
+
* adding a future format-owned unit must not break exhaustive switches compiled
|
|
1011
|
+
* against an older host while a newer worker is already able to report it.
|
|
1012
|
+
*/
|
|
1013
|
+
type OoxmlResourceName = ExtensibleLiteral<'archive' | 'archive-entry' | 'xml-event' | 'xml-context' | 'xml-tree' | 'worksheet-row' | 'worksheet-shell'>;
|
|
1014
|
+
/** Measurement axis used by an OOXML resource violation. Extensible by design. */
|
|
1015
|
+
type OoxmlResourceMetric = ExtensibleLiteral<'declared-inflated-bytes' | 'actual-inflated-bytes' | 'entry-count' | 'central-directory-bytes' | 'distinct-inflated-bytes' | 'bytes' | 'depth' | 'projected-bytes'>;
|
|
1016
|
+
/** Stable public violation record. Valid resource/metric pairings are enforced
|
|
1017
|
+
* by the emitting parser and the worker decoder rather than by a closed public
|
|
1018
|
+
* union that would require a breaking expansion for every new hard quota. */
|
|
1019
|
+
interface OoxmlResourceViolation {
|
|
1020
|
+
readonly format: OoxmlFormat;
|
|
1021
|
+
readonly operation: string;
|
|
1022
|
+
readonly resource: OoxmlResourceName;
|
|
1023
|
+
readonly metric: OoxmlResourceMetric;
|
|
1024
|
+
readonly part?: string;
|
|
1025
|
+
readonly limit: number;
|
|
1026
|
+
readonly observed: number;
|
|
1027
|
+
readonly configurable: boolean;
|
|
1028
|
+
readonly usage: OoxmlResourceUsageSnapshot;
|
|
1029
|
+
}
|
|
1030
|
+
interface OoxmlResourceLimitErrorDetails {
|
|
1031
|
+
readonly stage: OoxmlErrorStage;
|
|
1032
|
+
readonly violation: OoxmlResourceViolation;
|
|
1033
|
+
}
|
|
1034
|
+
/** Deterministic rejection caused by a measured OOXML resource-policy breach. */
|
|
1035
|
+
declare class OoxmlResourceLimitError extends Error {
|
|
1036
|
+
readonly code: "ooxml-resource-limit";
|
|
1037
|
+
readonly details: OoxmlResourceLimitErrorDetails;
|
|
1038
|
+
constructor(message: string, details: OoxmlResourceLimitErrorDetails);
|
|
1039
|
+
}
|
|
1040
|
+
//#endregion
|
|
1041
|
+
//#region packages/core/src/types/resource-metrics.d.ts
|
|
1042
|
+
/** Configured public admission policy used for one measured operation. */
|
|
1043
|
+
interface OoxmlResourcePolicySnapshot {
|
|
1044
|
+
readonly maxArchiveEntryBytes: number | null;
|
|
1045
|
+
readonly maxTotalInflatedBytes: number | null;
|
|
1046
|
+
}
|
|
1047
|
+
interface OoxmlResourceMetricsCheckpoint {
|
|
1048
|
+
readonly name: string;
|
|
1049
|
+
readonly elapsedMs: number;
|
|
1050
|
+
readonly usage?: OoxmlResourceUsageSnapshot;
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Content-free, machine-readable resource report for an OOXML load or bounded
|
|
1054
|
+
* Node session. Byte counters describe measured package work, not the JavaScript
|
|
1055
|
+
* heap, WASM allocator overhead, decoded images, canvas, or GPU. Browser engines
|
|
1056
|
+
* and Viewers can return a newer snapshot after lazy package access.
|
|
1057
|
+
*
|
|
1058
|
+
* No source URL, filename, OOXML part name, document text, password, or raw
|
|
1059
|
+
* error message is included. Sizes, counts, and timings are still
|
|
1060
|
+
* document-derived metadata; applications apply their own consent, retention,
|
|
1061
|
+
* and telemetry policy.
|
|
1062
|
+
*/
|
|
1063
|
+
interface OoxmlResourceMetrics {
|
|
1064
|
+
/** Version of this metrics payload, independent of the package version. */
|
|
1065
|
+
readonly schemaVersion: 1;
|
|
1066
|
+
/**
|
|
1067
|
+
* Browser factories report `load`; bounded Node sessions report `session`.
|
|
1068
|
+
*/
|
|
1069
|
+
readonly scope: 'load' | 'session';
|
|
1070
|
+
readonly format: OoxmlFormat;
|
|
1071
|
+
readonly mode: 'main' | 'worker' | 'node';
|
|
1072
|
+
/** Outcome of this measured load/session, not of later render operations. */
|
|
1073
|
+
readonly status: 'ok' | 'error';
|
|
1074
|
+
/** Compressed or decrypted OOXML container bytes supplied to the parser. */
|
|
1075
|
+
readonly sourceBytes?: number;
|
|
1076
|
+
readonly elapsedMs: number;
|
|
1077
|
+
readonly policy: Readonly<OoxmlResourcePolicySnapshot>;
|
|
1078
|
+
/** Last complete observed package-usage checkpoint. */
|
|
1079
|
+
readonly usage?: OoxmlResourceUsageSnapshot;
|
|
1080
|
+
readonly checkpoints: readonly OoxmlResourceMetricsCheckpoint[];
|
|
1081
|
+
readonly outcome?: Readonly<Record<string, number>>;
|
|
1082
|
+
readonly error?: Readonly<{
|
|
1083
|
+
readonly code?: string;
|
|
1084
|
+
readonly stage?: string;
|
|
1085
|
+
readonly resource?: string;
|
|
1086
|
+
readonly metric?: string;
|
|
1087
|
+
}>;
|
|
1088
|
+
}
|
|
1089
|
+
//#endregion
|
|
952
1090
|
//#region packages/core/src/types/load-options.d.ts
|
|
1091
|
+
/** A positive safe-integer byte count, or `null` to disable one public limit. */
|
|
1092
|
+
type OoxmlResourceLimit = number | null;
|
|
1093
|
+
/** Admission limits for the inflated contents of one OOXML package session. */
|
|
1094
|
+
interface OoxmlResourceLimits {
|
|
1095
|
+
/**
|
|
1096
|
+
* Maximum permitted inflated size for any one archive entry, including
|
|
1097
|
+
* media. Enforced against both the ZIP declaration and actual output.
|
|
1098
|
+
*/
|
|
1099
|
+
maxArchiveEntryBytes?: OoxmlResourceLimit;
|
|
1100
|
+
/** Maximum actual inflated bytes across distinct entries in the session. */
|
|
1101
|
+
maxTotalInflatedBytes?: OoxmlResourceLimit;
|
|
1102
|
+
}
|
|
953
1103
|
/**
|
|
954
1104
|
* Common load-time options shared by the docx / pptx / xlsx
|
|
955
1105
|
* `Document.load` / `Presentation.load` / `Workbook.load` factories and their
|
|
@@ -1016,12 +1166,44 @@ interface LoadOptions$1 {
|
|
|
1016
1166
|
*/
|
|
1017
1167
|
wasmUrl?: string | URL;
|
|
1018
1168
|
/**
|
|
1019
|
-
*
|
|
1020
|
-
*
|
|
1021
|
-
*
|
|
1022
|
-
*
|
|
1169
|
+
* @deprecated Use `resourceLimits.maxArchiveEntryBytes`. Scheduled for
|
|
1170
|
+
* removal in a future breaking release.
|
|
1171
|
+
*
|
|
1172
|
+
* Existing positive safe-integer values remain an all-entry inflated-byte
|
|
1173
|
+
* limit. Zero, negative, and NaN values retain their historical fallback
|
|
1174
|
+
* behavior; other invalid positive values reject during `load()`.
|
|
1023
1175
|
*/
|
|
1024
1176
|
maxZipEntryBytes?: number;
|
|
1177
|
+
/**
|
|
1178
|
+
* Inflated archive admission limits for one document session. Omitted fields
|
|
1179
|
+
* use the library defaults. A positive safe integer overrides a default;
|
|
1180
|
+
* `null` disables that configurable limit only. Limits are admission policy,
|
|
1181
|
+
* not guarantees of exact browser-process memory use.
|
|
1182
|
+
*/
|
|
1183
|
+
resourceLimits?: OoxmlResourceLimits;
|
|
1184
|
+
/**
|
|
1185
|
+
* Emit one content-free resource-usage card after load succeeds or fails.
|
|
1186
|
+
* Includes observed archive counters and configured limits, but never source
|
|
1187
|
+
* URLs, part names, document text, passwords, or error messages.
|
|
1188
|
+
*/
|
|
1189
|
+
debug?: boolean;
|
|
1190
|
+
/**
|
|
1191
|
+
* Receive the initial content-free, machine-readable report that powers the
|
|
1192
|
+
* debug card, without enabling console output. After resource options validate,
|
|
1193
|
+
* the callback runs once when the current load settles, including failed loads
|
|
1194
|
+
* for which no renderer instance is returned. The callback is not awaited;
|
|
1195
|
+
* synchronous exceptions and rejected promises are ignored and never change
|
|
1196
|
+
* load results.
|
|
1197
|
+
*
|
|
1198
|
+
* A browser report covers the underlying document/workbook/presentation
|
|
1199
|
+
* factory. It does not wait for a Viewer's first canvas paint; that paint and
|
|
1200
|
+
* later lazy worksheet, slide, image, or media access may increase counters or
|
|
1201
|
+
* surface a separate render error. Successfully opened packages include the
|
|
1202
|
+
* declared package total and source byte size in the report. On a successful
|
|
1203
|
+
* load, call `getResourceMetrics()` on the returned engine or Viewer for a fresh
|
|
1204
|
+
* snapshot that includes subsequently observed lazy package work.
|
|
1205
|
+
*/
|
|
1206
|
+
onResourceMetrics?: (metrics: OoxmlResourceMetrics) => void;
|
|
1025
1207
|
/**
|
|
1026
1208
|
* Reject the parse request if the parser worker does not answer within this
|
|
1027
1209
|
* many milliseconds. Opt-in safety net for a wedged or crashed worker that
|
|
@@ -1044,44 +1226,81 @@ interface LoadOptions$1 {
|
|
|
1044
1226
|
math?: MathRenderer;
|
|
1045
1227
|
}
|
|
1046
1228
|
//#endregion
|
|
1047
|
-
//#region packages/core/src/
|
|
1229
|
+
//#region packages/core/src/image/pixel-budget.d.ts
|
|
1230
|
+
type OoxmlDecodedImageLimitMetric = 'image-pixels' | 'active-decoded-bytes';
|
|
1231
|
+
/** Catchable hard-quota crossing for decoded image surfaces. */
|
|
1232
|
+
declare class OoxmlDecodedImageLimitError extends RangeError {
|
|
1233
|
+
readonly metric: OoxmlDecodedImageLimitMetric;
|
|
1234
|
+
readonly limit: number;
|
|
1235
|
+
readonly observed: number;
|
|
1236
|
+
readonly code: "ooxml-decoded-image-limit";
|
|
1237
|
+
constructor(metric: OoxmlDecodedImageLimitMetric, limit: number, observed: number);
|
|
1238
|
+
}
|
|
1239
|
+
declare function isOoxmlDecodedImageLimitError(error: unknown): error is OoxmlDecodedImageLimitError;
|
|
1240
|
+
//#endregion
|
|
1241
|
+
//#region packages/core/src/interaction/hyperlink.d.ts
|
|
1048
1242
|
/**
|
|
1049
|
-
*
|
|
1243
|
+
* Shared hyperlink model + URL sanitisation for docx / pptx / xlsx (IX1).
|
|
1050
1244
|
*
|
|
1051
|
-
*
|
|
1052
|
-
*
|
|
1053
|
-
*
|
|
1054
|
-
*
|
|
1055
|
-
*
|
|
1245
|
+
* All three formats carry the same two ECMA-376 concepts:
|
|
1246
|
+
* - an **external** hyperlink — an absolute URL resolved from a relationship
|
|
1247
|
+
* part target (`document.xml.rels` for docx §17.16.22, the slide rels for
|
|
1248
|
+
* pptx §21.1.2.3.5, the worksheet rels for xlsx §18.3.1.47), with
|
|
1249
|
+
* `TargetMode="External"`.
|
|
1250
|
+
* - an **internal** hyperlink — a jump within the document itself:
|
|
1251
|
+
* docx `w:anchor` -> a `<w:bookmarkStart w:name>` (§17.16.23), pptx
|
|
1252
|
+
* `action="ppaction://hlinksldjump"` -> a slide, xlsx `location` -> a defined
|
|
1253
|
+
* name or a `Sheet!A1` cell reference.
|
|
1056
1254
|
*
|
|
1057
|
-
*
|
|
1058
|
-
*
|
|
1059
|
-
*
|
|
1060
|
-
*
|
|
1061
|
-
*
|
|
1062
|
-
*
|
|
1063
|
-
*
|
|
1064
|
-
* - `'not-ooxml'` — a CFB of an unrecognised kind, or otherwise
|
|
1065
|
-
* not an OOXML ZIP.
|
|
1255
|
+
* The parsers (Rust, one per format) do the format-specific rels lookup and hand
|
|
1256
|
+
* each run / shape / cell a {@link HyperlinkTarget}. Everything downstream — the
|
|
1257
|
+
* text-layer overlay, the viewer default click behaviour, and any integrator
|
|
1258
|
+
* callback — is format-agnostic and consumes this one shape. Keeping the type +
|
|
1259
|
+
* the pure `sanitizeHyperlinkUrl` predicate here (not duplicated per package)
|
|
1260
|
+
* follows the cross-package unification principle: a scheme-allowlist bug fixed
|
|
1261
|
+
* once is fixed everywhere.
|
|
1066
1262
|
*/
|
|
1067
|
-
type OoxmlErrorCode = 'encrypted' | 'invalid-password' | 'unsupported-encryption' | 'legacy-binary-format' | 'not-ooxml';
|
|
1068
1263
|
/**
|
|
1069
|
-
*
|
|
1070
|
-
* that carry a stable, programmatic {@link OoxmlErrorCode} (e.g. a
|
|
1071
|
-
* password-protected or legacy-binary file detected from its container magic).
|
|
1264
|
+
* A resolved hyperlink attached to a run, shape, or cell.
|
|
1072
1265
|
*
|
|
1073
|
-
*
|
|
1074
|
-
*
|
|
1075
|
-
*
|
|
1076
|
-
* `
|
|
1077
|
-
*
|
|
1078
|
-
*
|
|
1266
|
+
* - `external` — `url` is the raw target as authored in the file. It is NOT
|
|
1267
|
+
* guaranteed safe; run it through {@link sanitizeHyperlinkUrl} before
|
|
1268
|
+
* navigating. It is kept verbatim here so an integrator can apply its own
|
|
1269
|
+
* policy (e.g. allow `file:` on a trusted intranet viewer).
|
|
1270
|
+
* - `internal` — `ref` is the in-document destination, verbatim from the file:
|
|
1271
|
+
* docx: the bookmark name (`w:anchor`).
|
|
1272
|
+
* pptx: the internal action (e.g. `ppaction://hlinksldjump`), with the
|
|
1273
|
+
* resolved 0-based `slideIndex` when the rels target names a slide.
|
|
1274
|
+
* xlsx: the `location` string (a defined name or `Sheet1!A1`).
|
|
1079
1275
|
*/
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
}
|
|
1276
|
+
type HyperlinkTarget = {
|
|
1277
|
+
kind: 'external';
|
|
1278
|
+
url: string;
|
|
1279
|
+
} | {
|
|
1280
|
+
kind: 'internal';
|
|
1281
|
+
ref: string;
|
|
1282
|
+
slideIndex?: number;
|
|
1283
|
+
};
|
|
1284
|
+
/**
|
|
1285
|
+
* The default action a viewer takes for an **external** hyperlink click when
|
|
1286
|
+
* the integrator supplies no `onHyperlinkClick` handler: sanitise the URL and,
|
|
1287
|
+
* if allowed, open it in a new tab with `noopener,noreferrer` so the opened page
|
|
1288
|
+
* gets no `window.opener` handle back into this document. A blocked scheme is a
|
|
1289
|
+
* silent no-op (returns `false`) — the click does nothing rather than navigate
|
|
1290
|
+
* somewhere dangerous.
|
|
1291
|
+
*
|
|
1292
|
+
* Internal targets are intentionally NOT handled here: the in-document jump
|
|
1293
|
+
* (page / slide / cell) is format-specific and lives in each viewer.
|
|
1294
|
+
*
|
|
1295
|
+
* Split out (not inlined in three viewers) so the "open in new tab, drop opener,
|
|
1296
|
+
* refuse unsafe schemes" policy is defined once. `win` is injected for tests;
|
|
1297
|
+
* defaults to the ambient `window`.
|
|
1298
|
+
*
|
|
1299
|
+
* @returns `true` if navigation was initiated, `false` if the URL was blocked.
|
|
1300
|
+
*/
|
|
1301
|
+
declare function openExternalHyperlink(url: string, allowed?: readonly string[], win?: Pick<Window, 'open'> | undefined): boolean;
|
|
1084
1302
|
//#endregion
|
|
1303
|
+
//#region dist/.types-work/find-highlight-gMP3FAnW.d.ts
|
|
1085
1304
|
//#region packages/core/src/autoResize.d.ts
|
|
1086
1305
|
interface AutoResizeOptions {
|
|
1087
1306
|
/**
|
|
@@ -1193,68 +1412,6 @@ interface ZoomableViewer {
|
|
|
1193
1412
|
* after a layout change to re-fit. */
|
|
1194
1413
|
fitPage(): void | Promise<void>;
|
|
1195
1414
|
}
|
|
1196
|
-
//#endregion
|
|
1197
|
-
//#region packages/core/src/interaction/hyperlink.d.ts
|
|
1198
|
-
/**
|
|
1199
|
-
* Shared hyperlink model + URL sanitisation for docx / pptx / xlsx (IX1).
|
|
1200
|
-
*
|
|
1201
|
-
* All three formats carry the same two ECMA-376 concepts:
|
|
1202
|
-
* - an **external** hyperlink — an absolute URL resolved from a relationship
|
|
1203
|
-
* part target (`document.xml.rels` for docx §17.16.22, the slide rels for
|
|
1204
|
-
* pptx §21.1.2.3.5, the worksheet rels for xlsx §18.3.1.47), with
|
|
1205
|
-
* `TargetMode="External"`.
|
|
1206
|
-
* - an **internal** hyperlink — a jump within the document itself:
|
|
1207
|
-
* docx `w:anchor` -> a `<w:bookmarkStart w:name>` (§17.16.23), pptx
|
|
1208
|
-
* `action="ppaction://hlinksldjump"` -> a slide, xlsx `location` -> a defined
|
|
1209
|
-
* name or a `Sheet!A1` cell reference.
|
|
1210
|
-
*
|
|
1211
|
-
* The parsers (Rust, one per format) do the format-specific rels lookup and hand
|
|
1212
|
-
* each run / shape / cell a {@link HyperlinkTarget}. Everything downstream — the
|
|
1213
|
-
* text-layer overlay, the viewer default click behaviour, and any integrator
|
|
1214
|
-
* callback — is format-agnostic and consumes this one shape. Keeping the type +
|
|
1215
|
-
* the pure `sanitizeHyperlinkUrl` predicate here (not duplicated per package)
|
|
1216
|
-
* follows the cross-package unification principle: a scheme-allowlist bug fixed
|
|
1217
|
-
* once is fixed everywhere.
|
|
1218
|
-
*/
|
|
1219
|
-
/**
|
|
1220
|
-
* A resolved hyperlink attached to a run, shape, or cell.
|
|
1221
|
-
*
|
|
1222
|
-
* - `external` — `url` is the raw target as authored in the file. It is NOT
|
|
1223
|
-
* guaranteed safe; run it through {@link sanitizeHyperlinkUrl} before
|
|
1224
|
-
* navigating. It is kept verbatim here so an integrator can apply its own
|
|
1225
|
-
* policy (e.g. allow `file:` on a trusted intranet viewer).
|
|
1226
|
-
* - `internal` — `ref` is the in-document destination, verbatim from the file:
|
|
1227
|
-
* docx: the bookmark name (`w:anchor`).
|
|
1228
|
-
* pptx: the internal action (e.g. `ppaction://hlinksldjump`), with the
|
|
1229
|
-
* resolved 0-based `slideIndex` when the rels target names a slide.
|
|
1230
|
-
* xlsx: the `location` string (a defined name or `Sheet1!A1`).
|
|
1231
|
-
*/
|
|
1232
|
-
type HyperlinkTarget = {
|
|
1233
|
-
kind: 'external';
|
|
1234
|
-
url: string;
|
|
1235
|
-
} | {
|
|
1236
|
-
kind: 'internal';
|
|
1237
|
-
ref: string;
|
|
1238
|
-
slideIndex?: number;
|
|
1239
|
-
};
|
|
1240
|
-
/**
|
|
1241
|
-
* The default action a viewer takes for an **external** hyperlink click when
|
|
1242
|
-
* the integrator supplies no `onHyperlinkClick` handler: sanitise the URL and,
|
|
1243
|
-
* if allowed, open it in a new tab with `noopener,noreferrer` so the opened page
|
|
1244
|
-
* gets no `window.opener` handle back into this document. A blocked scheme is a
|
|
1245
|
-
* silent no-op (returns `false`) — the click does nothing rather than navigate
|
|
1246
|
-
* somewhere dangerous.
|
|
1247
|
-
*
|
|
1248
|
-
* Internal targets are intentionally NOT handled here: the in-document jump
|
|
1249
|
-
* (page / slide / cell) is format-specific and lives in each viewer.
|
|
1250
|
-
*
|
|
1251
|
-
* Split out (not inlined in three viewers) so the "open in new tab, drop opener,
|
|
1252
|
-
* refuse unsafe schemes" policy is defined once. `win` is injected for tests;
|
|
1253
|
-
* defaults to the ambient `window`.
|
|
1254
|
-
*
|
|
1255
|
-
* @returns `true` if navigation was initiated, `false` if the URL was blocked.
|
|
1256
|
-
*/
|
|
1257
|
-
declare function openExternalHyperlink(url: string, allowed?: readonly string[], win?: Pick<Window, 'open'> | undefined): boolean;
|
|
1258
1415
|
/** Options for {@link findMatches}. */
|
|
1259
1416
|
interface FindMatchesOptions {
|
|
1260
1417
|
/**
|
|
@@ -1312,7 +1469,7 @@ interface FindHighlightColors {
|
|
|
1312
1469
|
active?: string;
|
|
1313
1470
|
}
|
|
1314
1471
|
//#endregion
|
|
1315
|
-
//#region dist/.types-work/common-
|
|
1472
|
+
//#region dist/.types-work/common-Bgczc_Eb.d.ts
|
|
1316
1473
|
type SpaceLine = {
|
|
1317
1474
|
type: 'pct';
|
|
1318
1475
|
val: number;
|
|
@@ -1321,7 +1478,7 @@ type SpaceLine = {
|
|
|
1321
1478
|
val: number;
|
|
1322
1479
|
};
|
|
1323
1480
|
//#endregion
|
|
1324
|
-
//#region dist/.types-work/xlsx-
|
|
1481
|
+
//#region dist/.types-work/xlsx-yYJn5jBA.d.ts
|
|
1325
1482
|
//#region packages/xlsx/src/types.d.ts
|
|
1326
1483
|
interface Workbook {
|
|
1327
1484
|
sheets: SheetMeta[];
|
|
@@ -1734,18 +1891,24 @@ interface DataValidation {
|
|
|
1734
1891
|
}
|
|
1735
1892
|
/**
|
|
1736
1893
|
* @deprecated Chart series are now the core {@link ChartModel}'s `ChartSeries`.
|
|
1737
|
-
* Kept as an alias for backward-compatible imports
|
|
1894
|
+
* Kept as an alias for backward-compatible imports; scheduled for removal in a
|
|
1895
|
+
* future breaking release.
|
|
1738
1896
|
*/
|
|
1739
1897
|
type XlsxChartSeries = ChartSeries;
|
|
1740
|
-
/** @deprecated Use `ChartSeriesDataLabels` from @silurus/ooxml-core.
|
|
1898
|
+
/** @deprecated Use `ChartSeriesDataLabels` from @silurus/ooxml-core. Scheduled
|
|
1899
|
+
* for removal in a future breaking release. */
|
|
1741
1900
|
type SeriesDataLabels = ChartSeriesDataLabels;
|
|
1742
|
-
/** @deprecated Use `ChartDataLabelOverride` from @silurus/ooxml-core.
|
|
1901
|
+
/** @deprecated Use `ChartDataLabelOverride` from @silurus/ooxml-core. Scheduled
|
|
1902
|
+
* for removal in a future breaking release. */
|
|
1743
1903
|
type DataLabelOverride = ChartDataLabelOverride;
|
|
1744
|
-
/** @deprecated Use `ChartDataPointOverride` from @silurus/ooxml-core.
|
|
1904
|
+
/** @deprecated Use `ChartDataPointOverride` from @silurus/ooxml-core. Scheduled
|
|
1905
|
+
* for removal in a future breaking release. */
|
|
1745
1906
|
type DataPointOverride = ChartDataPointOverride;
|
|
1746
|
-
/** @deprecated Use `ChartErrBars` from @silurus/ooxml-core.
|
|
1907
|
+
/** @deprecated Use `ChartErrBars` from @silurus/ooxml-core. Scheduled for
|
|
1908
|
+
* removal in a future breaking release. */
|
|
1747
1909
|
type ErrBars = ChartErrBars;
|
|
1748
|
-
/** @deprecated Use `ChartManualLayout` from @silurus/ooxml-core.
|
|
1910
|
+
/** @deprecated Use `ChartManualLayout` from @silurus/ooxml-core. Scheduled for
|
|
1911
|
+
* removal in a future breaking release. */
|
|
1749
1912
|
type ManualLayout = ChartManualLayout;
|
|
1750
1913
|
interface ChartAnchor {
|
|
1751
1914
|
fromCol: number;
|
|
@@ -2473,8 +2636,8 @@ type WireRenderViewportOptions = Omit<RenderViewportOptions, 'onTextRun' | 'load
|
|
|
2473
2636
|
//#endregion
|
|
2474
2637
|
//#region packages/xlsx/src/workbook.d.ts
|
|
2475
2638
|
/** Options for {@link XlsxWorkbook.load}. Extends the shared load-options type
|
|
2476
|
-
* from `@silurus/ooxml-core` (`useGoogleFonts`, `
|
|
2477
|
-
* with
|
|
2639
|
+
* from `@silurus/ooxml-core` (`useGoogleFonts`, `resourceLimits`, the
|
|
2640
|
+
* deprecated `maxZipEntryBytes` alias, and `math`) with worker rendering. */
|
|
2478
2641
|
interface LoadOptions extends LoadOptions$1 {
|
|
2479
2642
|
/**
|
|
2480
2643
|
* 'main' (default): parse in a worker, render on the main thread (current
|
|
@@ -2486,25 +2649,28 @@ interface LoadOptions extends LoadOptions$1 {
|
|
|
2486
2649
|
mode?: 'main' | 'worker';
|
|
2487
2650
|
}
|
|
2488
2651
|
declare class XlsxWorkbook {
|
|
2652
|
+
private metrics;
|
|
2489
2653
|
private worker;
|
|
2490
2654
|
private bridge;
|
|
2491
2655
|
private parsedWorkbook;
|
|
2492
2656
|
private sheetCache;
|
|
2493
|
-
/**
|
|
2494
|
-
*
|
|
2495
|
-
|
|
2657
|
+
/** One materialization per sheet at a time. This becomes the ownership seam
|
|
2658
|
+
* for the bounded worksheet cursor: concurrent callers share one cursor and
|
|
2659
|
+
* one eventual mutable compatibility object instead of doubling peak work. */
|
|
2660
|
+
private sheetLoads;
|
|
2496
2661
|
/** Cache of fetched image *bytes* (as Blobs) keyed by zip path, populated by
|
|
2497
2662
|
* {@link XlsxWorkbook.getImage}. Twin of pptx/docx's per-instance
|
|
2498
|
-
*
|
|
2499
|
-
|
|
2500
|
-
|
|
2663
|
+
* raw-part owner; decoded sources are owned separately by core. */
|
|
2664
|
+
private readonly rawParts;
|
|
2665
|
+
/** Public archive-queue reservations. Kept separate so an active render does
|
|
2666
|
+
* not await a same-path load that is queued behind that render. */
|
|
2667
|
+
private queuedImageLoads;
|
|
2501
2668
|
/** One stable closure per instance: core's path-keyed SVG cache namespaces on
|
|
2502
2669
|
* this identity, so two open workbooks never swap a shared zip path (e.g.
|
|
2503
2670
|
* xl/media/image1.svg). Reusing one reference also lets the SVG cache hit
|
|
2504
2671
|
* across viewport renders. */
|
|
2505
2672
|
private readonly _fetchImage;
|
|
2506
|
-
private
|
|
2507
|
-
private maxZipEntryBytes;
|
|
2673
|
+
private resourcePolicy;
|
|
2508
2674
|
/** Opt-in OMML equation engine, injected once at {@link load}. Every
|
|
2509
2675
|
* `renderViewport` call reuses it — equations in shapes render when present,
|
|
2510
2676
|
* and are skipped (engine tree-shaken) when omitted. */
|
|
@@ -2516,6 +2682,16 @@ declare class XlsxWorkbook {
|
|
|
2516
2682
|
* so a web font shared with another open workbook survives until both go). */
|
|
2517
2683
|
private googleFontFaces;
|
|
2518
2684
|
private _mode;
|
|
2685
|
+
private generation;
|
|
2686
|
+
private nextSheetSessionId;
|
|
2687
|
+
private archiveOperationTail;
|
|
2688
|
+
private sheetSessions;
|
|
2689
|
+
private workerTimeoutMs;
|
|
2690
|
+
private retainedSheetUsage;
|
|
2691
|
+
/** First fatal model/package violation. Compatibility materialization happens
|
|
2692
|
+
* on main, so this latch is the document-level poison boundary for every
|
|
2693
|
+
* later public operation on the same workbook instance. */
|
|
2694
|
+
private resourceFailure;
|
|
2519
2695
|
private constructor();
|
|
2520
2696
|
/** Parse an XLSX from a URL or ArrayBuffer. */
|
|
2521
2697
|
static load(source: string | ArrayBuffer, opts?: LoadOptions): Promise<XlsxWorkbook>;
|
|
@@ -2541,6 +2717,12 @@ declare class XlsxWorkbook {
|
|
|
2541
2717
|
*/
|
|
2542
2718
|
isHidden(sheetIndex: number): boolean;
|
|
2543
2719
|
getWorksheet(sheetIndex: number): Promise<Worksheet>;
|
|
2720
|
+
/** Return a fresh content-free metrics snapshot, including lazy worksheet and
|
|
2721
|
+
* media work completed since load. */
|
|
2722
|
+
getResourceMetrics(): Promise<OoxmlResourceMetrics>;
|
|
2723
|
+
private loadWorksheet;
|
|
2724
|
+
private loadWorksheetStream;
|
|
2725
|
+
private runArchiveOperation;
|
|
2544
2726
|
/**
|
|
2545
2727
|
* Fetch an embedded image's bytes by zip path (e.g. `xl/media/image1.png`),
|
|
2546
2728
|
* wrapped in a Blob of the given MIME. The bytes are pulled through the
|
|
@@ -2549,11 +2731,12 @@ declare class XlsxWorkbook {
|
|
|
2549
2731
|
* instance. The renderer's `fetchImage` option points here so image bytes are
|
|
2550
2732
|
* extracted lazily rather than inlined as base64 at parse time.
|
|
2551
2733
|
*
|
|
2552
|
-
* Routed through the worker
|
|
2553
|
-
*
|
|
2554
|
-
* route-through-worker decision).
|
|
2734
|
+
* Routed through the persistent worker so all WASM `extract_image` decoding
|
|
2735
|
+
* stays with the archive owner.
|
|
2555
2736
|
*/
|
|
2556
2737
|
getImage(imagePath: string, mimeType: string): Promise<Blob>;
|
|
2738
|
+
private getImageWithinArchiveOperation;
|
|
2739
|
+
private requestImage;
|
|
2557
2740
|
/**
|
|
2558
2741
|
* Project the workbook to GitHub-flavoured markdown: each sheet becomes a
|
|
2559
2742
|
* `## SheetName` section followed by a pipe table of its populated bounding
|
|
@@ -2620,7 +2803,9 @@ declare class XlsxWorkbook {
|
|
|
2620
2803
|
width: number;
|
|
2621
2804
|
height: number;
|
|
2622
2805
|
}): Promise<ImageBitmap>;
|
|
2806
|
+
private withWorksheetArchiveOperation;
|
|
2623
2807
|
destroy(): void;
|
|
2808
|
+
private assertResourceHealthy;
|
|
2624
2809
|
}
|
|
2625
2810
|
//#endregion
|
|
2626
2811
|
//#region packages/xlsx/src/find.d.ts
|
|
@@ -2679,6 +2864,19 @@ interface XlsxViewerOptions extends LoadOptions$1 {
|
|
|
2679
2864
|
* `onReady`).
|
|
2680
2865
|
*/
|
|
2681
2866
|
onSheetChange?: (index: number, total: number) => void;
|
|
2867
|
+
/**
|
|
2868
|
+
* Receives load failures and asynchronous render failures handled by the
|
|
2869
|
+
* Viewer. Supplying this callback changes load-failure delivery: `load()`
|
|
2870
|
+
* invokes it and resolves; without it, the same load/parse failure rejects
|
|
2871
|
+
* `load()`. Viewer-managed render failures invoke it, or fall back to
|
|
2872
|
+
* `console.error` when omitted.
|
|
2873
|
+
*
|
|
2874
|
+
* Stable cases can be narrowed with `OoxmlError`,
|
|
2875
|
+
* `OoxmlResourceLimitError`, or `OoxmlDecodedImageLimitError` re-exported by
|
|
2876
|
+
* this package. Other failures remain `Error` values; do not parse message
|
|
2877
|
+
* text as an API. A `code` of `parser-crashed` identifies a recognized WASM
|
|
2878
|
+
* trap, not a reliably classified OOM.
|
|
2879
|
+
*/
|
|
2682
2880
|
onError?: (err: Error) => void;
|
|
2683
2881
|
/** Called when the selected cell range changes. null means no selection. */
|
|
2684
2882
|
onSelectionChange?: (selection: CellRange | null) => void;
|
|
@@ -3320,6 +3518,8 @@ declare class XlsxViewer implements ZoomableViewer {
|
|
|
3320
3518
|
get sheetNames(): string[];
|
|
3321
3519
|
/** The underlying <canvas> element the grid is drawn on. */
|
|
3322
3520
|
get canvasElement(): HTMLCanvasElement;
|
|
3521
|
+
/** Latest content-free resource metrics for the loaded workbook. */
|
|
3522
|
+
getResourceMetrics(): Promise<OoxmlResourceMetrics>;
|
|
3323
3523
|
/**
|
|
3324
3524
|
* Tear down the viewer and release resources.
|
|
3325
3525
|
*
|
|
@@ -3353,4 +3553,4 @@ declare class XlsxViewer implements ZoomableViewer {
|
|
|
3353
3553
|
*/
|
|
3354
3554
|
declare function resolveSharedStrings(ws: Worksheet, sharedStrings: SharedString[]): Worksheet;
|
|
3355
3555
|
//#endregion
|
|
3356
|
-
export { type AutoResizeOptions, type Border, type BorderEdge, type Cell, type CellAddress, type CellFill, type CellFont, type CellRange, type CellValue, type CellXf, type CfIcon, type CfRule, type CfStop, type CfValue, type ChartAnchor, type ChartDataLabelOverride, type ChartDataPointOverride, type ChartErrBars, type ChartManualLayout, type ChartModel, type ChartSeries, type ChartSeriesDataLabels, type ConditionalFormat, type DataLabelOverride, type DataPointOverride, type DataValidation, type DefinedName, type Duotone, type Dxf, type ErrBars, type FindHighlightColors, type FindMatch, type FindMatchesOptions, type GradientFillSpec, type HiddenSheetMode, type Hyperlink, type HyperlinkTarget, type ImageAnchor, type LegendManualLayout, type LoadOptions, type ManualLayout, type MergeCell, type NumFmt, OoxmlError, type OoxmlErrorCode, type OutlinePr, type ParsedWorkbook, type PathCmd, type PathInfo, type PhoneticAlignment, type PhoneticProperties, type PhoneticRun, type PhoneticType, type PivotCacheSource, type PivotDataField, type PivotDiagnostic, type PivotLocation, type PivotMetadataStatus, type PivotPageField, type PivotPartialReason, type PivotTableMetadata, type RenderViewportOptions, type ResolvedList, type Row, type Run, type RunFont, type SelectionMode, type SeriesDataLabels, type ShapeAnchor, type ShapeGeom, type ShapeInfo, type ShapeParagraph, type ShapeText, type ShapeTextRun, type SharedString, type SheetMeta, type SheetVisibility, type SlicerAnchor, type SlicerElementStyle, type SlicerItem, type SlicerStyle, type Sparkline, type SparklineGroup, type Styles, type TableColumnInfo, type TableInfo, type ViewportRange, type WireRenderViewportOptions, type WireSizeOverrides, type Workbook, type Worksheet, type XlsxChartSeries, type XlsxComment, type XlsxMatchLocation, type XlsxTextRunInfo, XlsxViewer, type XlsxViewerOptions, XlsxWorkbook, autoResize, openExternalHyperlink, resolveSharedStrings };
|
|
3556
|
+
export { type AutoResizeOptions, type Border, type BorderEdge, type Cell, type CellAddress, type CellFill, type CellFont, type CellRange, type CellValue, type CellXf, type CfIcon, type CfRule, type CfStop, type CfValue, type ChartAnchor, type ChartDataLabelOverride, type ChartDataPointOverride, type ChartErrBars, type ChartManualLayout, type ChartModel, type ChartSeries, type ChartSeriesDataLabels, type ConditionalFormat, type DataLabelOverride, type DataPointOverride, type DataValidation, type DefinedName, type Duotone, type Dxf, type ErrBars, type FindHighlightColors, type FindMatch, type FindMatchesOptions, type GradientFillSpec, type HiddenSheetMode, type Hyperlink, type HyperlinkTarget, type ImageAnchor, type LegendManualLayout, type LoadOptions, type ManualLayout, type MergeCell, type NumFmt, OoxmlDecodedImageLimitError, type OoxmlDecodedImageLimitMetric, OoxmlError, type OoxmlErrorCode, type OoxmlErrorSource, type OoxmlErrorStage, type OoxmlFormat, type OoxmlResourceLimit, OoxmlResourceLimitError, type OoxmlResourceLimitErrorDetails, type OoxmlResourceLimits, type OoxmlResourceMetric, type OoxmlResourceMetrics, type OoxmlResourceMetricsCheckpoint, type OoxmlResourceName, type OoxmlResourcePolicySnapshot, type OoxmlResourceUsageSnapshot, type OoxmlResourceViolation, type OutlinePr, type ParsedWorkbook, type PathCmd, type PathInfo, type PhoneticAlignment, type PhoneticProperties, type PhoneticRun, type PhoneticType, type PivotCacheSource, type PivotDataField, type PivotDiagnostic, type PivotLocation, type PivotMetadataStatus, type PivotPageField, type PivotPartialReason, type PivotTableMetadata, type RenderViewportOptions, type ResolvedList, type Row, type Run, type RunFont, type SelectionMode, type SeriesDataLabels, type ShapeAnchor, type ShapeGeom, type ShapeInfo, type ShapeParagraph, type ShapeText, type ShapeTextRun, type SharedString, type SheetMeta, type SheetVisibility, type SlicerAnchor, type SlicerElementStyle, type SlicerItem, type SlicerStyle, type Sparkline, type SparklineGroup, type Styles, type TableColumnInfo, type TableInfo, type ViewportRange, type WireRenderViewportOptions, type WireSizeOverrides, type Workbook, type Worksheet, type XlsxChartSeries, type XlsxComment, type XlsxMatchLocation, type XlsxTextRunInfo, XlsxViewer, type XlsxViewerOptions, XlsxWorkbook, autoResize, isOoxmlDecodedImageLimitError, openExternalHyperlink, resolveSharedStrings };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
//#region packages/core/src/nav/visible-index.ts
|
|
2
|
+
function e(e, t, n, r) {
|
|
3
|
+
for (let i = e + t; i >= 0 && i < r; i += t) if (!n(i)) return i;
|
|
4
|
+
return e;
|
|
5
|
+
}
|
|
6
|
+
function t(t, n, r) {
|
|
7
|
+
if (r === 0 || !n(t)) return t;
|
|
8
|
+
let i = e(t, 1, n, r);
|
|
9
|
+
return i === t ? e(t, -1, n, r) : i;
|
|
10
|
+
}
|
|
11
|
+
function n(e, t) {
|
|
12
|
+
let n = 0;
|
|
13
|
+
for (let r = 0; r < t; r++) e(r) || n++;
|
|
14
|
+
return n;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
export { e as n, t as r, n as t };
|