ooxml-core 0.15.0 → 0.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/dist/automation/index.cjs +3058 -1968
  2. package/dist/automation/index.mjs +3058 -1968
  3. package/dist/docx/block-parser.d.ts.map +1 -1
  4. package/dist/docx/embedded.cjs +11 -0
  5. package/dist/docx/embedded.mjs +11 -0
  6. package/dist/docx/index.cjs +59 -4
  7. package/dist/docx/index.mjs +59 -4
  8. package/dist/docx/layout/index.cjs +1 -0
  9. package/dist/docx/layout/index.mjs +1 -0
  10. package/dist/docx/load/index.cjs +11 -0
  11. package/dist/docx/load/index.mjs +11 -0
  12. package/dist/docx/model-paragraph.d.ts +6 -1
  13. package/dist/docx/model-paragraph.d.ts.map +1 -1
  14. package/dist/docx/paragraph-styles.d.ts +2 -0
  15. package/dist/docx/paragraph-styles.d.ts.map +1 -1
  16. package/dist/docx/table-of-contents.d.ts.map +1 -1
  17. package/dist/docx/toc-switches.d.ts +16 -0
  18. package/dist/docx/toc-switches.d.ts.map +1 -0
  19. package/dist/xlsx/formula/functions/complex.d.ts +14 -0
  20. package/dist/xlsx/formula/functions/complex.d.ts.map +1 -0
  21. package/dist/xlsx/formula/functions/convert.d.ts +4 -0
  22. package/dist/xlsx/formula/functions/convert.d.ts.map +1 -0
  23. package/dist/xlsx/formula/functions/database.d.ts +4 -0
  24. package/dist/xlsx/formula/functions/database.d.ts.map +1 -0
  25. package/dist/xlsx/formula/functions/distributions-f.d.ts +6 -0
  26. package/dist/xlsx/formula/functions/distributions-f.d.ts.map +1 -0
  27. package/dist/xlsx/formula/functions/distributions.d.ts.map +1 -1
  28. package/dist/xlsx/formula/functions/engineering.d.ts.map +1 -1
  29. package/dist/xlsx/formula/functions/hypothesis-tests.d.ts +4 -0
  30. package/dist/xlsx/formula/functions/hypothesis-tests.d.ts.map +1 -0
  31. package/dist/xlsx/formula/functions/matrix.d.ts +5 -0
  32. package/dist/xlsx/formula/functions/matrix.d.ts.map +1 -1
  33. package/dist/xlsx/formula/functions/registry.d.ts.map +1 -1
  34. package/dist/xlsx/formula/functions/regression-core.d.ts +34 -0
  35. package/dist/xlsx/formula/functions/regression-core.d.ts.map +1 -0
  36. package/dist/xlsx/formula/functions/regression.d.ts +4 -0
  37. package/dist/xlsx/formula/functions/regression.d.ts.map +1 -0
  38. package/dist/xlsx/formula/functions/statistical.d.ts.map +1 -1
  39. package/dist/xlsx/index.cjs +2835 -1756
  40. package/dist/xlsx/index.mjs +2835 -1756
  41. package/dist/xlsx/load/index.cjs +2296 -1217
  42. package/dist/xlsx/load/index.mjs +2296 -1217
  43. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"block-parser.d.ts","sourceRoot":"","sources":["../../src/docx/block-parser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAY,KAAK,EAAsB,MAAM,YAAY,CAAC;AACxF,OAAO,EAON,KAAK,UAAU,EAEf,MAAM,UAAU,CAAC;AAKlB,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAsIjE,iBAAS,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CAwG/D;AAED,iBAAS,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,SAAS,EAAE,UAAU,EACrB,QAAQ,SAAK,EACb,OAAO,CAAC,EAAE,cAAc,GACtB,KAAK,EAAE,CAcT;AAYD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC"}
1
+ {"version":3,"file":"block-parser.d.ts","sourceRoot":"","sources":["../../src/docx/block-parser.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,KAAK,EAAE,SAAS,EAAY,KAAK,EAAsB,MAAM,YAAY,CAAC;AACxF,OAAO,EAON,KAAK,UAAU,EAEf,MAAM,UAAU,CAAC;AAKlB,OAAO,EAAgB,KAAK,cAAc,EAAE,MAAM,cAAc,CAAC;AAsIjE,iBAAS,cAAc,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,SAAS,CA0G/D;AAED,iBAAS,UAAU,CAAC,IAAI,EAAE,UAAU,EAAE,EAAE,EAAE,MAAM,GAAG,KAAK,CAEvD;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,CACvC,SAAS,EAAE,UAAU,EACrB,QAAQ,SAAK,EACb,OAAO,CAAC,EAAE,cAAc,GACtB,KAAK,EAAE,CAcT;AAYD,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,CAAC"}
@@ -609,6 +609,13 @@ var PAGINATION_KEYS = [
609
609
  "contextualSpacing",
610
610
  "suppressLineNumbers"
611
611
  ];
612
+ function parseOutlineLevel(element) {
613
+ const raw = getW(element, "val");
614
+ if (raw === void 0) return void 0;
615
+ const value = Number(raw);
616
+ if (!Number.isInteger(value) || value < 0 || value > 9) return void 0;
617
+ return value === 9 ? 0 : value + 1;
618
+ }
612
619
  function parseFormatting(pPr) {
613
620
  const result = {};
614
621
  const { align, justification } = parseJustification(pPr);
@@ -620,6 +627,8 @@ function parseFormatting(pPr) {
620
627
  const value = enabled(first2(pPr, key));
621
628
  if (value !== void 0) result[key] = value;
622
629
  }
630
+ const outline2 = parseOutlineLevel(first2(pPr, "outlineLvl"));
631
+ if (outline2 !== void 0) result.outlineLevel = outline2;
623
632
  const borders = parseParagraphBorders(first2(pPr, "pBdr"));
624
633
  if (borders) result.borders = borders;
625
634
  const shading = parseShadingFill(first2(pPr, "shd"));
@@ -6957,6 +6966,8 @@ function parseParagraph2(node, id) {
6957
6966
  const value = onOffElement(first2(props, key));
6958
6967
  if (value !== void 0) paragraph[key] = value;
6959
6968
  }
6969
+ const outline2 = parseOutlineLevel(first2(props, "outlineLvl"));
6970
+ if (outline2 !== void 0) paragraph.outlineLevel = outline2;
6960
6971
  const frame = first2(props, "framePr");
6961
6972
  const dropCap = getW(frame, "dropCap");
6962
6973
  if (dropCap === "drop" || dropCap === "margin") {
@@ -603,6 +603,13 @@ var PAGINATION_KEYS = [
603
603
  "contextualSpacing",
604
604
  "suppressLineNumbers"
605
605
  ];
606
+ function parseOutlineLevel(element) {
607
+ const raw = getW(element, "val");
608
+ if (raw === void 0) return void 0;
609
+ const value = Number(raw);
610
+ if (!Number.isInteger(value) || value < 0 || value > 9) return void 0;
611
+ return value === 9 ? 0 : value + 1;
612
+ }
606
613
  function parseFormatting(pPr) {
607
614
  const result = {};
608
615
  const { align, justification } = parseJustification(pPr);
@@ -614,6 +621,8 @@ function parseFormatting(pPr) {
614
621
  const value = enabled(first2(pPr, key));
615
622
  if (value !== void 0) result[key] = value;
616
623
  }
624
+ const outline2 = parseOutlineLevel(first2(pPr, "outlineLvl"));
625
+ if (outline2 !== void 0) result.outlineLevel = outline2;
617
626
  const borders = parseParagraphBorders(first2(pPr, "pBdr"));
618
627
  if (borders) result.borders = borders;
619
628
  const shading = parseShadingFill(first2(pPr, "shd"));
@@ -6951,6 +6960,8 @@ function parseParagraph2(node, id) {
6951
6960
  const value = onOffElement(first2(props, key));
6952
6961
  if (value !== void 0) paragraph[key] = value;
6953
6962
  }
6963
+ const outline2 = parseOutlineLevel(first2(props, "outlineLvl"));
6964
+ if (outline2 !== void 0) paragraph.outlineLevel = outline2;
6954
6965
  const frame = first2(props, "framePr");
6955
6966
  const dropCap = getW(frame, "dropCap");
6956
6967
  if (dropCap === "drop" || dropCap === "margin") {
@@ -955,6 +955,13 @@ var PAGINATION_KEYS = [
955
955
  "contextualSpacing",
956
956
  "suppressLineNumbers"
957
957
  ];
958
+ function parseOutlineLevel(element) {
959
+ const raw = getW(element, "val");
960
+ if (raw === void 0) return void 0;
961
+ const value = Number(raw);
962
+ if (!Number.isInteger(value) || value < 0 || value > 9) return void 0;
963
+ return value === 9 ? 0 : value + 1;
964
+ }
958
965
  function parseFormatting(pPr) {
959
966
  const result = {};
960
967
  const { align, justification } = parseJustification(pPr);
@@ -966,6 +973,8 @@ function parseFormatting(pPr) {
966
973
  const value = enabled(first2(pPr, key));
967
974
  if (value !== void 0) result[key] = value;
968
975
  }
976
+ const outline2 = parseOutlineLevel(first2(pPr, "outlineLvl"));
977
+ if (outline2 !== void 0) result.outlineLevel = outline2;
969
978
  const borders = parseParagraphBorders(first2(pPr, "pBdr"));
970
979
  if (borders) result.borders = borders;
971
980
  const shading = parseShadingFill(first2(pPr, "shd"));
@@ -1083,6 +1092,7 @@ function resolveParagraphFormatting(paragraph, catalog) {
1083
1092
  "firstLineTwips",
1084
1093
  "hangingTwips",
1085
1094
  ...PAGINATION_KEYS,
1095
+ "outlineLevel",
1086
1096
  "borders",
1087
1097
  "shadingFill"
1088
1098
  ];
@@ -7849,6 +7859,8 @@ function parseParagraph2(node, id) {
7849
7859
  const value = onOffElement(first2(props, key));
7850
7860
  if (value !== void 0) paragraph[key] = value;
7851
7861
  }
7862
+ const outline2 = parseOutlineLevel(first2(props, "outlineLvl"));
7863
+ if (outline2 !== void 0) paragraph.outlineLevel = outline2;
7852
7864
  const frame = first2(props, "framePr");
7853
7865
  const dropCap = getW(frame, "dropCap");
7854
7866
  if (dropCap === "drop" || dropCap === "margin") {
@@ -9356,6 +9368,33 @@ function dateFieldResult(name, instr, now, locale) {
9356
9368
  return formatWordDate(now, picture, locale);
9357
9369
  }
9358
9370
 
9371
+ // src/docx/toc-switches.ts
9372
+ function styleMap(instruction) {
9373
+ const map = /* @__PURE__ */ new Map();
9374
+ const match = /\\t\s*(?:"([^"]*)"|(\S+))/.exec(instruction);
9375
+ const parts = (match?.[1] ?? match?.[2] ?? "").split(/[,;]/).map((part) => part.trim());
9376
+ for (let i = 0; i + 1 < parts.length; i += 2) {
9377
+ const name = parts[i];
9378
+ const level = Number(parts[i + 1]);
9379
+ if (name && Number.isInteger(level) && level >= 1 && level <= 9)
9380
+ map.set(name.toLowerCase(), level);
9381
+ }
9382
+ return map;
9383
+ }
9384
+ function tocSwitches(instruction) {
9385
+ const range = /\\o\s*"?(\d)\s*-\s*(\d)"?/.exec(instruction);
9386
+ const hasO = /\\o(?![a-z])/i.test(instruction);
9387
+ const outline2 = /\\u(?![a-z])/i.test(instruction);
9388
+ const styles = styleMap(instruction);
9389
+ return {
9390
+ headings: hasO || !outline2 && styles.size === 0,
9391
+ outline: outline2,
9392
+ styles,
9393
+ from: range ? Number(range[1]) : 1,
9394
+ to: range ? Number(range[2]) : 9
9395
+ };
9396
+ }
9397
+
9359
9398
  // src/docx/table-of-figures.ts
9360
9399
  function tocCaptionLabel(instruction) {
9361
9400
  return /\\c\s*"([^"]+)"/.exec(instruction)?.[1];
@@ -9400,17 +9439,33 @@ function tocEntries(model, instruction = DEFAULT_TOC_INSTRUCTION) {
9400
9439
  const label = tocCaptionLabel(instruction);
9401
9440
  if (label)
9402
9441
  return captionParagraphs(model, label).map((paragraph) => ({ level: 1, text: plainText(paragraph), blockId: paragraph.id })).filter((entry) => entry.text);
9403
- const { from, to } = tocLevels(instruction);
9442
+ const switches = tocSwitches(instruction);
9404
9443
  const entries = [];
9405
9444
  for (const block of model.blocks) {
9406
9445
  if (block.type !== "paragraph") continue;
9407
- const level = headingLevel(block, model.paragraphStyles);
9446
+ const level = entryLevel(block, model.paragraphStyles, switches);
9408
9447
  const text = plainText(block);
9409
- if (level !== void 0 && level >= from && level <= to && text)
9410
- entries.push({ level, text, blockId: block.id });
9448
+ if (level !== void 0 && text) entries.push({ level, text, blockId: block.id });
9411
9449
  }
9412
9450
  return entries;
9413
9451
  }
9452
+ function entryLevel(paragraph, catalog, switches) {
9453
+ const inRange = (level) => level !== void 0 && level >= switches.from && level <= switches.to ? level : void 0;
9454
+ if (switches.styles.size > 0 && paragraph.style) {
9455
+ const name = catalog?.styles[paragraph.style]?.name;
9456
+ const mapped = switches.styles.get(paragraph.style.toLowerCase()) ?? (name ? switches.styles.get(name.toLowerCase()) : void 0);
9457
+ if (mapped !== void 0) return mapped;
9458
+ }
9459
+ if (switches.headings) {
9460
+ const heading2 = inRange(headingLevel(paragraph, catalog));
9461
+ if (heading2 !== void 0) return heading2;
9462
+ }
9463
+ if (switches.outline) {
9464
+ const outline2 = catalog ? resolveParagraphFormatting(paragraph, catalog).outlineLevel : paragraph.outlineLevel;
9465
+ return inRange(outline2 || void 0);
9466
+ }
9467
+ return void 0;
9468
+ }
9414
9469
  function linkedEntry(text, bookmark, page) {
9415
9470
  const link = { anchor: bookmark };
9416
9471
  const runs = [{ text: page === void 0 ? text : `${text} `, link }];
@@ -949,6 +949,13 @@ var PAGINATION_KEYS = [
949
949
  "contextualSpacing",
950
950
  "suppressLineNumbers"
951
951
  ];
952
+ function parseOutlineLevel(element) {
953
+ const raw = getW(element, "val");
954
+ if (raw === void 0) return void 0;
955
+ const value = Number(raw);
956
+ if (!Number.isInteger(value) || value < 0 || value > 9) return void 0;
957
+ return value === 9 ? 0 : value + 1;
958
+ }
952
959
  function parseFormatting(pPr) {
953
960
  const result = {};
954
961
  const { align, justification } = parseJustification(pPr);
@@ -960,6 +967,8 @@ function parseFormatting(pPr) {
960
967
  const value = enabled(first2(pPr, key));
961
968
  if (value !== void 0) result[key] = value;
962
969
  }
970
+ const outline2 = parseOutlineLevel(first2(pPr, "outlineLvl"));
971
+ if (outline2 !== void 0) result.outlineLevel = outline2;
963
972
  const borders = parseParagraphBorders(first2(pPr, "pBdr"));
964
973
  if (borders) result.borders = borders;
965
974
  const shading = parseShadingFill(first2(pPr, "shd"));
@@ -1077,6 +1086,7 @@ function resolveParagraphFormatting(paragraph, catalog) {
1077
1086
  "firstLineTwips",
1078
1087
  "hangingTwips",
1079
1088
  ...PAGINATION_KEYS,
1089
+ "outlineLevel",
1080
1090
  "borders",
1081
1091
  "shadingFill"
1082
1092
  ];
@@ -7843,6 +7853,8 @@ function parseParagraph2(node, id) {
7843
7853
  const value = onOffElement(first2(props, key));
7844
7854
  if (value !== void 0) paragraph[key] = value;
7845
7855
  }
7856
+ const outline2 = parseOutlineLevel(first2(props, "outlineLvl"));
7857
+ if (outline2 !== void 0) paragraph.outlineLevel = outline2;
7846
7858
  const frame = first2(props, "framePr");
7847
7859
  const dropCap = getW(frame, "dropCap");
7848
7860
  if (dropCap === "drop" || dropCap === "margin") {
@@ -9350,6 +9362,33 @@ function dateFieldResult(name, instr, now, locale) {
9350
9362
  return formatWordDate(now, picture, locale);
9351
9363
  }
9352
9364
 
9365
+ // src/docx/toc-switches.ts
9366
+ function styleMap(instruction) {
9367
+ const map = /* @__PURE__ */ new Map();
9368
+ const match = /\\t\s*(?:"([^"]*)"|(\S+))/.exec(instruction);
9369
+ const parts = (match?.[1] ?? match?.[2] ?? "").split(/[,;]/).map((part) => part.trim());
9370
+ for (let i = 0; i + 1 < parts.length; i += 2) {
9371
+ const name = parts[i];
9372
+ const level = Number(parts[i + 1]);
9373
+ if (name && Number.isInteger(level) && level >= 1 && level <= 9)
9374
+ map.set(name.toLowerCase(), level);
9375
+ }
9376
+ return map;
9377
+ }
9378
+ function tocSwitches(instruction) {
9379
+ const range = /\\o\s*"?(\d)\s*-\s*(\d)"?/.exec(instruction);
9380
+ const hasO = /\\o(?![a-z])/i.test(instruction);
9381
+ const outline2 = /\\u(?![a-z])/i.test(instruction);
9382
+ const styles = styleMap(instruction);
9383
+ return {
9384
+ headings: hasO || !outline2 && styles.size === 0,
9385
+ outline: outline2,
9386
+ styles,
9387
+ from: range ? Number(range[1]) : 1,
9388
+ to: range ? Number(range[2]) : 9
9389
+ };
9390
+ }
9391
+
9353
9392
  // src/docx/table-of-figures.ts
9354
9393
  function tocCaptionLabel(instruction) {
9355
9394
  return /\\c\s*"([^"]+)"/.exec(instruction)?.[1];
@@ -9394,17 +9433,33 @@ function tocEntries(model, instruction = DEFAULT_TOC_INSTRUCTION) {
9394
9433
  const label = tocCaptionLabel(instruction);
9395
9434
  if (label)
9396
9435
  return captionParagraphs(model, label).map((paragraph) => ({ level: 1, text: plainText(paragraph), blockId: paragraph.id })).filter((entry) => entry.text);
9397
- const { from, to } = tocLevels(instruction);
9436
+ const switches = tocSwitches(instruction);
9398
9437
  const entries = [];
9399
9438
  for (const block of model.blocks) {
9400
9439
  if (block.type !== "paragraph") continue;
9401
- const level = headingLevel(block, model.paragraphStyles);
9440
+ const level = entryLevel(block, model.paragraphStyles, switches);
9402
9441
  const text = plainText(block);
9403
- if (level !== void 0 && level >= from && level <= to && text)
9404
- entries.push({ level, text, blockId: block.id });
9442
+ if (level !== void 0 && text) entries.push({ level, text, blockId: block.id });
9405
9443
  }
9406
9444
  return entries;
9407
9445
  }
9446
+ function entryLevel(paragraph, catalog, switches) {
9447
+ const inRange = (level) => level !== void 0 && level >= switches.from && level <= switches.to ? level : void 0;
9448
+ if (switches.styles.size > 0 && paragraph.style) {
9449
+ const name = catalog?.styles[paragraph.style]?.name;
9450
+ const mapped = switches.styles.get(paragraph.style.toLowerCase()) ?? (name ? switches.styles.get(name.toLowerCase()) : void 0);
9451
+ if (mapped !== void 0) return mapped;
9452
+ }
9453
+ if (switches.headings) {
9454
+ const heading2 = inRange(headingLevel(paragraph, catalog));
9455
+ if (heading2 !== void 0) return heading2;
9456
+ }
9457
+ if (switches.outline) {
9458
+ const outline2 = catalog ? resolveParagraphFormatting(paragraph, catalog).outlineLevel : paragraph.outlineLevel;
9459
+ return inRange(outline2 || void 0);
9460
+ }
9461
+ return void 0;
9462
+ }
9408
9463
  function linkedEntry(text, bookmark, page) {
9409
9464
  const link = { anchor: bookmark };
9410
9465
  const runs = [{ text: page === void 0 ? text : `${text} `, link }];
@@ -80,6 +80,7 @@ function resolveParagraphFormatting(paragraph, catalog) {
80
80
  "firstLineTwips",
81
81
  "hangingTwips",
82
82
  ...PAGINATION_KEYS,
83
+ "outlineLevel",
83
84
  "borders",
84
85
  "shadingFill"
85
86
  ];
@@ -78,6 +78,7 @@ function resolveParagraphFormatting(paragraph, catalog) {
78
78
  "firstLineTwips",
79
79
  "hangingTwips",
80
80
  ...PAGINATION_KEYS,
81
+ "outlineLevel",
81
82
  "borders",
82
83
  "shadingFill"
83
84
  ];
@@ -7977,6 +7977,13 @@ var PAGINATION_KEYS = [
7977
7977
  "contextualSpacing",
7978
7978
  "suppressLineNumbers"
7979
7979
  ];
7980
+ function parseOutlineLevel(element) {
7981
+ const raw = getW(element, "val");
7982
+ if (raw === void 0) return void 0;
7983
+ const value = Number(raw);
7984
+ if (!Number.isInteger(value) || value < 0 || value > 9) return void 0;
7985
+ return value === 9 ? 0 : value + 1;
7986
+ }
7980
7987
  function parseFormatting(pPr) {
7981
7988
  const result = {};
7982
7989
  const { align, justification } = parseJustification(pPr);
@@ -7988,6 +7995,8 @@ function parseFormatting(pPr) {
7988
7995
  const value = enabled(first2(pPr, key));
7989
7996
  if (value !== void 0) result[key] = value;
7990
7997
  }
7998
+ const outline2 = parseOutlineLevel(first2(pPr, "outlineLvl"));
7999
+ if (outline2 !== void 0) result.outlineLevel = outline2;
7991
8000
  const borders = parseParagraphBorders(first2(pPr, "pBdr"));
7992
8001
  if (borders) result.borders = borders;
7993
8002
  const shading = parseShadingFill(first2(pPr, "shd"));
@@ -8699,6 +8708,8 @@ function parseParagraph2(node, id) {
8699
8708
  const value = onOffElement(first2(props, key));
8700
8709
  if (value !== void 0) paragraph[key] = value;
8701
8710
  }
8711
+ const outline2 = parseOutlineLevel(first2(props, "outlineLvl"));
8712
+ if (outline2 !== void 0) paragraph.outlineLevel = outline2;
8702
8713
  const frame = first2(props, "framePr");
8703
8714
  const dropCap = getW(frame, "dropCap");
8704
8715
  if (dropCap === "drop" || dropCap === "margin") {
@@ -7971,6 +7971,13 @@ var PAGINATION_KEYS = [
7971
7971
  "contextualSpacing",
7972
7972
  "suppressLineNumbers"
7973
7973
  ];
7974
+ function parseOutlineLevel(element) {
7975
+ const raw = getW(element, "val");
7976
+ if (raw === void 0) return void 0;
7977
+ const value = Number(raw);
7978
+ if (!Number.isInteger(value) || value < 0 || value > 9) return void 0;
7979
+ return value === 9 ? 0 : value + 1;
7980
+ }
7974
7981
  function parseFormatting(pPr) {
7975
7982
  const result = {};
7976
7983
  const { align, justification } = parseJustification(pPr);
@@ -7982,6 +7989,8 @@ function parseFormatting(pPr) {
7982
7989
  const value = enabled(first2(pPr, key));
7983
7990
  if (value !== void 0) result[key] = value;
7984
7991
  }
7992
+ const outline2 = parseOutlineLevel(first2(pPr, "outlineLvl"));
7993
+ if (outline2 !== void 0) result.outlineLevel = outline2;
7985
7994
  const borders = parseParagraphBorders(first2(pPr, "pBdr"));
7986
7995
  if (borders) result.borders = borders;
7987
7996
  const shading = parseShadingFill(first2(pPr, "shd"));
@@ -8693,6 +8702,8 @@ function parseParagraph2(node, id) {
8693
8702
  const value = onOffElement(first2(props, key));
8694
8703
  if (value !== void 0) paragraph[key] = value;
8695
8704
  }
8705
+ const outline2 = parseOutlineLevel(first2(props, "outlineLvl"));
8706
+ if (outline2 !== void 0) paragraph.outlineLevel = outline2;
8696
8707
  const frame = first2(props, "framePr");
8697
8708
  const dropCap = getW(frame, "dropCap");
8698
8709
  if (dropCap === "drop" || dropCap === "margin") {
@@ -57,6 +57,11 @@ export interface Paragraph {
57
57
  contextualSpacing?: boolean;
58
58
  /** `w:suppressLineNumbers`: omit this paragraph from line numbering; false overrides a style. */
59
59
  suppressLineNumbers?: boolean;
60
+ /**
61
+ * `w:outlineLvl` as a 1-9 level, or 0 for body text (`w:val="9"`, which cancels a style's
62
+ * level). Read-only like `borders`: the source XML keeps it and it is not written for new paragraphs.
63
+ */
64
+ outlineLevel?: number;
60
65
  /**
61
66
  * `w:framePr/@w:dropCap`: this paragraph is a drop cap frame (the initial letter) for the
62
67
  * paragraph that follows. `lines` is the number of text lines it spans.
@@ -78,7 +83,7 @@ export interface Paragraph {
78
83
  bookmarks?: string[];
79
84
  }
80
85
  /** Direct paragraph properties supported by the editor, in native Word units. */
81
- export type ParagraphFormatting = Pick<Paragraph, 'align' | 'justification' | 'direction' | 'spacingBeforeTwips' | 'spacingAfterTwips' | 'lineSpacingTwips' | 'lineSpacingRule' | 'indentLeftTwips' | 'indentRightTwips' | 'indentStartTwips' | 'indentEndTwips' | 'firstLineTwips' | 'hangingTwips' | 'keepNext' | 'keepLines' | 'widowControl' | 'contextualSpacing' | 'suppressLineNumbers' | 'borders' | 'shadingFill'>;
86
+ export type ParagraphFormatting = Pick<Paragraph, 'align' | 'justification' | 'direction' | 'spacingBeforeTwips' | 'spacingAfterTwips' | 'lineSpacingTwips' | 'lineSpacingRule' | 'indentLeftTwips' | 'indentRightTwips' | 'indentStartTwips' | 'indentEndTwips' | 'firstLineTwips' | 'hangingTwips' | 'keepNext' | 'keepLines' | 'widowControl' | 'contextualSpacing' | 'suppressLineNumbers' | 'outlineLevel' | 'borders' | 'shadingFill'>;
82
87
  export interface ParagraphStyleDefinition {
83
88
  id: string;
84
89
  name?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"model-paragraph.d.ts","sourceRoot":"","sources":["../../src/docx/model-paragraph.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAErD,gGAAgG;AAChG,MAAM,WAAW,OAAO;IACvB,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,CAAC,EAAE,QAAQ,CAAC;CAClB;AACD,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,WAAW,CAAC;IAClB,oEAAoE;IACpE,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,OAAO,EAAE,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,GAAG,QAAQ,GAAG,OAAO,GAAG,SAAS,CAAC;IAChD;;;;OAIG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC;IACrB,yEA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C,aAAa,CAAC,EAAE,KAAK,CAAA;KAAE,CAAC;IAC7E,yFAAyF;IACzF,OAAO,CAAC,EAAE,OAAO,kBAAkB,EAAE,gBAAgB,CAAC;IACtD,8DAA8D;IAC9D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACrB;AACD,iFAAiF;AACjF,MAAM,MAAM,mBAAmB,GAAG,IAAI,CACrC,SAAS,EACP,OAAO,GACP,eAAe,GACf,WAAW,GACX,oBAAoB,GACpB,mBAAmB,GACnB,kBAAkB,GAClB,iBAAiB,GACjB,iBAAiB,GACjB,kBAAkB,GAClB,kBAAkB,GAClB,gBAAgB,GAChB,gBAAgB,GAChB,cAAc,GACd,UAAU,GACV,WAAW,GACX,cAAc,GACd,mBAAmB,GACnB,qBAAqB,GACrB,SAAS,GACT,aAAa,CACf,CAAC;AACF,MAAM,WAAW,wBAAwB;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,mBAAmB,CAAC;IAChC,kGAAkG;IAClG,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C;AACD,4FAA4F;AAC5F,MAAM,WAAW,qBAAqB;IACrC,WAAW,EAAE,mBAAmB,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB"}
1
+ {"version":3,"file":"model-paragraph.d.ts","sourceRoot":"","sources":["../../src/docx/model-paragraph.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC/E,OAAO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AE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,mBAAmB,CAAC;IAChC,kGAAkG;IAClG,SAAS,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;CAC7C;AACD,4FAA4F;AAC5F,MAAM,WAAW,qBAAqB;IACrC,WAAW,EAAE,mBAAmB,CAAC;IACjC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,wBAAwB,CAAC,CAAC;IACjD,QAAQ,EAAE,MAAM,EAAE,CAAC;CACnB"}
@@ -2,6 +2,8 @@ import type { Paragraph, ParagraphFormatting, ParagraphStyleCatalog } from './mo
2
2
  import { type XmlElement } from './xml.js';
3
3
  /** Pagination toggles whose element names match their model keys. */
4
4
  export declare const PAGINATION_KEYS: readonly ['keepNext', 'keepLines', 'widowControl', 'contextualSpacing', 'suppressLineNumbers'];
5
+ /** `w:outlineLvl` as a 1-9 level (0 for body text, `w:val="9"`); undefined when absent or invalid. */
6
+ export declare function parseOutlineLevel(element: XmlElement | undefined): number | undefined;
5
7
  /** Parses `w:pPr` formatting (shared by styles, docDefaults and direct paragraph properties). */
6
8
  export declare function parseFormatting(pPr: XmlElement | undefined): ParagraphFormatting;
7
9
  export declare function parseParagraphStyleCatalog(xml: string): ParagraphStyleCatalog;
@@ -1 +1 @@
1
- {"version":3,"file":"paragraph-styles.d.ts","sourceRoot":"","sources":["../../src/docx/paragraph-styles.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,SAAS,EACT,mBAAmB,EACnB,qBAAqB,EAErB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAkD,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAe3F,qEAAqE;AACrE,eAAO,MAAM,eAAe,YAC3B,UAAU,EACV,WAAW,EACX,cAAc,EACd,mBAAmB,EACnB,qBAAqB,CACZ,CAAC;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gB,YAAY,CAC3B,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,QAAQ,EAAE,GACjB;IAAE,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;CAAE,CA4BhE;AAED,qEAAqE;AACrE,eAAO,MAAM,aAAa,gBAAiB,MAAM,KAAG,OAAoC,CAAC;AAEzF,0FAA0F;AAC1F,wBAAgB,gBAAgB,CAC/B,KAAK,EAAE,aAAa,EACpB,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAChC,aAAa,CAmBf;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,aAAa,EAAE,OAAO,EAAE,UAAU,GAAG,SAAS,EAAE,CAqC3F;AAED,MAAM,WAAW,WAAW;IAC3B,sFAAsF;IACtF,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,WAAW,EAAE,MAAM,CAAC;IACpB,2FAA2F;IAC3F,MAAM,EAAE,OAAO,EAAE,CAAC;IAClB,KAAK,EAAE,OAAO,EAAE,CAAC;CACjB;AAED,yHAAyH;AACzH,wBAAgB,mBAAmB,CAClC,MAAM,EAAE,KAAK,EAAE,EACf,OAAO,GAAE,CAAC,WAAW,EAAE,MAAM,KAAK,OACS,GACzC,WAAW,GAAG,SAAS,CAwBzB;AAED,0GAA0G;AAC1G,wBAAgB,qBAAqB,CACpC,KAAK,EAAE,aAAa,EACpB,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,aAAa,CAAC,GACtC,aAAa,GAAG,SAAS,CAkB3B"}
@@ -0,0 +1,16 @@
1
+ export interface TocSwitches {
2
+ /** `\o` was given: heading styles within `from`-`to` are collected. */
3
+ headings: boolean;
4
+ /** `\u`: paragraphs with an outline level within `from`-`to` are collected. */
5
+ outline: boolean;
6
+ /** `\t`: style name or id (lower case) to the level its paragraphs get. */
7
+ styles: Map<string, number>;
8
+ from: number;
9
+ to: number;
10
+ }
11
+ /**
12
+ * What a TOC instruction collects. With no collecting switch at all the field keeps this
13
+ * package's historic reading (every heading level), so a bare `TOC` still lists its headings.
14
+ */
15
+ export declare function tocSwitches(instruction: string): TocSwitches;
16
+ //# sourceMappingURL=toc-switches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toc-switches.d.ts","sourceRoot":"","sources":["../../src/docx/toc-switches.ts"],"names":[],"mappings":"AAGA,MAAM,WAAW,WAAW;IAC3B,uEAAuE;IACvE,QAAQ,EAAE,OAAO,CAAC;IAClB,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAC;IACjB,2EAA2E;IAC3E,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;CACX;AAgBD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,WAAW,EAAE,MAAM,GAAG,WAAW,CAY5D"}
@@ -0,0 +1,14 @@
1
+ import { type Scalar } from '../values.js';
2
+ import type { FunctionSpec } from './types.js';
3
+ interface Complex {
4
+ re: number;
5
+ im: number;
6
+ suffix: 'i' | 'j';
7
+ }
8
+ /** A complex number from Excel text such as `3+4i`, `-j` or `5`; anything else is `#NUM!`. */
9
+ export declare function parseComplex(value: Scalar): Complex;
10
+ export declare function formatComplex({ re, im, suffix }: Complex): string;
11
+ /** Complex numbers held as text (`COMPLEX` and the `IM` functions). */
12
+ export declare const COMPLEX_FUNCTIONS: FunctionSpec[];
13
+ export {};
14
+ //# sourceMappingURL=complex.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"complex.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/complex.ts"],"names":[],"mappings":"AAEA,OAAO,EAAsB,KAAK,MAAM,EAAc,MAAM,cAAc,CAAC;AAE3E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAI/C,UAAU,OAAO;IAChB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC;CAClB;AAUD,8FAA8F;AAC9F,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAsBnD;AASD,wBAAgB,aAAa,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,GAAG,MAAM,CAOjE;AAuFD,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAuF3C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FunctionSpec } from './types.js';
2
+ export declare function convertUnits(value: number, from: string, to: string): number;
3
+ export declare const CONVERT_FUNCTIONS: FunctionSpec[];
4
+ //# sourceMappingURL=convert.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/convert.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA2M/C,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAS5E;AAED,eAAO,MAAM,iBAAiB,EAAE,YAAY,EAU3C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FunctionSpec } from './types.js';
2
+ /** Database functions: aggregate one column of the records that match a criteria range. */
3
+ export declare const DATABASE_FUNCTIONS: FunctionSpec[];
4
+ //# sourceMappingURL=database.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"database.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/database.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAkF/C,2FAA2F;AAC3F,eAAO,MAAM,kBAAkB,EAAE,YAAY,EAoC5C,CAAC"}
@@ -0,0 +1,6 @@
1
+ import type { FunctionSpec } from './types.js';
2
+ /** The F cumulative distribution for `x >= 0`. */
3
+ export declare const fCdf: (x: number, d1: number, d2: number) => number;
4
+ /** F, beta and gamma inverses, plus the pre-2010 names of the distribution functions. */
5
+ export declare const DISTRIBUTION_F: FunctionSpec[];
6
+ //# sourceMappingURL=distributions-f.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"distributions-f.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/distributions-f.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW/C,kDAAkD;AAClD,eAAO,MAAM,IAAI,MAAO,MAAM,MAAM,MAAM,MAAM,MAAM,KAAG,MACI,CAAC;AAiE9D,yFAAyF;AACzF,eAAO,MAAM,cAAc,EAAE,YAAY,EAwLxC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"distributions.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/distributions.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAK/C,eAAO,MAAM,sBAAsB,EAAE,YAAY,EAiPhD,CAAC"}
1
+ {"version":3,"file":"distributions.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/distributions.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAM/C,eAAO,MAAM,sBAAsB,EAAE,YAAY,EAkPhD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"engineering.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/engineering.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqF/C,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAoH/C,CAAC"}
1
+ {"version":3,"file":"engineering.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/engineering.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqF/C,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAsH/C,CAAC"}
@@ -0,0 +1,4 @@
1
+ import type { FunctionSpec } from './types.js';
2
+ /** Significance tests on samples (Z.TEST, T.TEST, F.TEST, CHISQ.TEST) and PROB. */
3
+ export declare const HYPOTHESIS_TESTS: FunctionSpec[];
4
+ //# sourceMappingURL=hypothesis-tests.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hypothesis-tests.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/hypothesis-tests.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA+F/C,mFAAmF;AACnF,eAAO,MAAM,gBAAgB,EAAE,YAAY,EAyE1C,CAAC"}
@@ -1,3 +1,8 @@
1
1
  import type { FunctionSpec } from './types.js';
2
+ /** Gaussian elimination with partial pivoting; returns the determinant and, optionally, the inverse. */
3
+ export declare function eliminate(input: number[][], invert: boolean): {
4
+ det: number;
5
+ inverse?: number[][];
6
+ };
2
7
  export declare const MATRIX_FUNCTIONS: FunctionSpec[];
3
8
  //# sourceMappingURL=matrix.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/matrix.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AA+D/C,eAAO,MAAM,gBAAgB,EAAE,YAAY,EAmD1C,CAAC"}
1
+ {"version":3,"file":"matrix.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/matrix.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqB/C,wGAAwG;AACxG,wBAAgB,SAAS,CACxB,KAAK,EAAE,MAAM,EAAE,EAAE,EACjB,MAAM,EAAE,OAAO,GACb;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,MAAM,EAAE,EAAE,CAAA;CAAE,CAuCvC;AAED,eAAO,MAAM,gBAAgB,EAAE,YAAY,EAmD1C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/registry.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAqB7D,uFAAuF;AACvF,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,YAAY,GAAG,SAA+B,CAAC;AAE1F,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,OAAgD,CAAC;AAEnG,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,EAAE,SAAS,YAAY,EAInD,CAAC"}
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/registry.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAsB7D,uFAAuF;AACvF,eAAO,MAAM,WAAW,SAAU,MAAM,KAAG,YAAY,GAAG,SAA+B,CAAC;AAE1F,mFAAmF;AACnF,eAAO,MAAM,kBAAkB,SAAU,MAAM,KAAG,OAAgD,CAAC;AAEnG,kDAAkD;AAClD,eAAO,MAAM,gBAAgB,EAAE,SAAS,YAAY,EAInD,CAAC"}
@@ -0,0 +1,34 @@
1
+ /** The least-squares fit of `y` on the columns of `x` (observations are rows). */
2
+ export interface Fit {
3
+ /** One slope per x column, in column order. */
4
+ slopes: number[];
5
+ /** The intercept (0 when the fit was forced through the origin). */
6
+ intercept: number;
7
+ /** `(X'X)^-1` of the centred columns (or of the raw columns without an intercept). */
8
+ inverse: number[][];
9
+ /** Column means, used for the intercept's standard error. */
10
+ means: number[];
11
+ n: number;
12
+ hasIntercept: boolean;
13
+ ssTotal: number;
14
+ ssResid: number;
15
+ }
16
+ /**
17
+ * Ordinary least squares by the normal equations on mean-centred data (which keeps polynomial
18
+ * and offset data well conditioned). Collinear columns are `#NUM!`; Excel instead zeroes the
19
+ * redundant coefficient, which this does not reproduce.
20
+ */
21
+ export declare function fitLeastSquares(x: number[][], y: number[], hasIntercept: boolean): Fit;
22
+ /** The regression statistics LINEST reports, from a fit. */
23
+ export interface FitStats {
24
+ slopeErrors: number[];
25
+ interceptError: number | undefined;
26
+ rSquared: number;
27
+ standardError: number;
28
+ fStatistic: number;
29
+ df: number;
30
+ ssRegression: number;
31
+ ssResidual: number;
32
+ }
33
+ export declare function fitStatistics(fit: Fit): FitStats;
34
+ //# sourceMappingURL=regression-core.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regression-core.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/regression-core.ts"],"names":[],"mappings":"AAGA,kFAAkF;AAClF,MAAM,WAAW,GAAG;IACnB,+CAA+C;IAC/C,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,oEAAoE;IACpE,SAAS,EAAE,MAAM,CAAC;IAClB,sFAAsF;IACtF,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;IACpB,6DAA6D;IAC7D,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,YAAY,EAAE,OAAO,CAAC;IACtB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;CAChB;AAID;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,YAAY,EAAE,OAAO,GAAG,GAAG,CA4BtF;AAED,4DAA4D;AAC5D,MAAM,WAAW,QAAQ;IACxB,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,cAAc,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,MAAM,CAAC;IACnB,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CA0BhD"}
@@ -0,0 +1,4 @@
1
+ import type { FunctionSpec } from './types.js';
2
+ /** Multiple linear and exponential regression. */
3
+ export declare const REGRESSION_FUNCTIONS: FunctionSpec[];
4
+ //# sourceMappingURL=regression.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"regression.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/regression.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAmG/C,kDAAkD;AAClD,eAAO,MAAM,oBAAoB,EAAE,YAAY,EA8D9C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"statistical.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/statistical.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW/C,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAoL/C,CAAC"}
1
+ {"version":3,"file":"statistical.d.ts","sourceRoot":"","sources":["../../../../src/xlsx/formula/functions/statistical.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAW/C,eAAO,MAAM,qBAAqB,EAAE,YAAY,EAsL/C,CAAC"}