@sheetxl/query 0.8.0-beta.2 → 0.8.0-beta.21

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 (44) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/index.mjs +2659 -1433
  3. package/node/esm/index.mjs +2893 -1641
  4. package/package.json +7 -8
  5. package/types/src/api/_aliases.d.ts +16 -0
  6. package/types/src/api/_offered.d.ts +13 -0
  7. package/types/src/api/lookupApi.d.ts +45 -1
  8. package/types/src/delta/describeDelta.d.ts +148 -0
  9. package/types/src/delta/index.d.ts +4 -0
  10. package/types/src/delta/readRunDelta.d.ts +21 -0
  11. package/types/src/delta/renderDelta.d.ts +20 -0
  12. package/types/src/encode/encodeCell.d.ts +19 -7
  13. package/types/src/grep/GrepTypes.d.ts +30 -36
  14. package/types/src/grep/grep.d.ts +3 -2
  15. package/types/src/index.d.ts +1 -0
  16. package/types/src/markdown/appendDataTables.d.ts +39 -0
  17. package/types/src/markdown/appendDependencies.d.ts +2 -2
  18. package/types/src/markdown/appendPivotTables.d.ts +10 -9
  19. package/types/src/markdown/appendSections.d.ts +50 -5
  20. package/types/src/markdown/caps.d.ts +4 -0
  21. package/types/src/markdown/describeAnomaly.d.ts +31 -0
  22. package/types/src/markdown/describeChart.d.ts +2 -2
  23. package/types/src/markdown/describeExternalCitation.d.ts +27 -0
  24. package/types/src/markdown/describeHistogram.d.ts +3 -3
  25. package/types/src/markdown/describeRegionPayload.d.ts +3 -3
  26. package/types/src/markdown/describeRule.d.ts +5 -5
  27. package/types/src/markdown/describeShape.d.ts +41 -0
  28. package/types/src/markdown/describeSparkline.d.ts +15 -0
  29. package/types/src/markdown/describeStyle.d.ts +7 -7
  30. package/types/src/markdown/findLabels.d.ts +5 -12
  31. package/types/src/markdown/index.d.ts +3 -1
  32. package/types/src/markdown/registry.d.ts +8 -3
  33. package/types/src/markdown/renderCell.d.ts +2 -1
  34. package/types/src/markdown/renderFormula.d.ts +2 -2
  35. package/types/src/markdown/renderMovable.d.ts +14 -1
  36. package/types/src/markdown/renderPageLayout.d.ts +22 -0
  37. package/types/src/markdown/renderProtection.d.ts +4 -4
  38. package/types/src/markdown/renderRecords.d.ts +8 -0
  39. package/types/src/markdown/renderRegions.d.ts +8 -0
  40. package/types/src/markdown/renderStyle.d.ts +2 -2
  41. package/types/src/markdown/renderTable.d.ts +3 -1
  42. package/types/src/markdown/renderWorkbook.d.ts +1 -1
  43. package/types/src/markdown/{renderSheet.d.ts → renderWorksheet.d.ts} +5 -5
  44. package/browser/cjs/index.cjs +0 -45
@@ -1,4 +1,4 @@
1
- import { ICellRange, IAnchored, ICellRanges, ICellRegion, INamed } from '@sheetxl/sdk';
1
+ import { ICellRange, IAnchored, ICellRanges, ICellRegion, INamed, IWorksheet } from '@sheetxl/sdk';
2
2
  import { MarkdownBuilder } from './MarkdownBuilder';
3
3
  /**
4
4
  * Options for the feature sections.
@@ -20,6 +20,17 @@ export interface AppendFeatureOptions {
20
20
  * never produce a section.
21
21
  */
22
22
  features?: ICellRange.Feature | readonly ICellRange.Feature[];
23
+ /**
24
+ * The extent the layers authored over cells list over, when it is not the range's: the
25
+ * `Sparkline`, `Conditionals` and `DataValidations` sections.
26
+ *
27
+ * @remarks
28
+ * They are not cell content, so a layer over empty cells lies outside the used range a sheet
29
+ * report is scoped to, as it does in Excel's `UsedRange`. A sheet report passes the whole sheet,
30
+ * so a layer that exists is always reported. Direct style stays scoped to the range: a column
31
+ * style is a format, not a layer, and its cells are not used either.
32
+ */
33
+ layerScope?: ICellRange;
23
34
  /**
24
35
  * Cap on regions listed per feature; the report notes truncation when exceeded.
25
36
  *
@@ -92,7 +103,7 @@ export declare const describeExtent: (range: ICellRange) => string;
92
103
  */
93
104
  export declare const describeSheetName: (name: string | null | undefined) => string;
94
105
  /**
95
- * `wb.getSheet("My Sheet")` — the range's sheet as a callable expression.
106
+ * `wb.getWorksheet("My Sheet")` — the range's sheet as a callable expression.
96
107
  *
97
108
  * @remarks
98
109
  * Not {@link describeSheetName}: that quotes for the *formula* language (`'My Sheet'!A1`), and a
@@ -126,6 +137,17 @@ export declare const describeQualifiedExtent: (range: ICellRange) => string;
126
137
  * Zero kinds are elided, and blanks appear nowhere — empty is not a kind of content.
127
138
  */
128
139
  export declare function appendKinds(md: MarkdownBuilder, range: ICellRange): void;
140
+ /**
141
+ * The role census: per role (`ICellRange.Feature.Role`), how many cells and the font colors they
142
+ * are written in — `input 36 · #0000FF 34 · #000000 2`.
143
+ *
144
+ * @remarks
145
+ * The pairing the `styleRole` check reads, laid out for the reader: the check names a link in
146
+ * the wrong color and says nothing about a typed cell, whose color reads like the data beside it,
147
+ * so the census carries the constants' colors and the reader judges them with the counts in
148
+ * hand. A color is the authored font color (`#RRGGBB`), the Normal style's where none is authored.
149
+ */
150
+ export declare function appendRoles(md: MarkdownBuilder, range: ICellRange): void;
129
151
  /**
130
152
  * Appends one section per feature partition, headed by the feature's own name.
131
153
  *
@@ -196,6 +218,17 @@ export interface AppendNamesOptions {
196
218
  * since a bare `Sales` in an expression is a `named` token that resolves to a table.
197
219
  */
198
220
  symbols?: readonly INamed[];
221
+ /**
222
+ * Gives rows only to the names some formula reads; the rest are one count on the closing line.
223
+ *
224
+ * @defaultValue `false` — every name gets a row (a name manager must be complete)
225
+ *
226
+ * @remarks
227
+ * For a report whose job is routing. A name nothing reads changes no value and breaks no cell,
228
+ * and a decades-old model carries them by the ten thousand (macro-sheet constants, dead
229
+ * `#REF!`s): listed, they are the whole section; counted, the section is the names that matter.
230
+ */
231
+ omitUnread?: boolean;
199
232
  }
200
233
  /**
201
234
  * A name's spelling as a formula would write it — qualified when it is scoped to one sheet.
@@ -248,6 +281,15 @@ export declare const describeQualifiedName: (named: INamed) => string;
248
281
  * row is token noise, and blank-means-normal is how these reports already speak.
249
282
  */
250
283
  export declare function appendNames(md: MarkdownBuilder, names: readonly INamed[], options?: AppendNamesOptions): Promise<void>;
284
+ /**
285
+ * The outline in a line — `rows 2 levels, 3 groups (1 collapsed) · columns 1 level, 1 group` —
286
+ * or `null` when nothing is grouped.
287
+ *
288
+ * @remarks
289
+ * Counts only: the groups themselves (level, span, summary, collapsed) are `IOutline.getGroups`,
290
+ * which is also what a script reads, so the report routes there instead of listing them.
291
+ */
292
+ export declare function describeOutline(sheet: IWorksheet): string | null;
251
293
  /**
252
294
  * One rule listing — `## Conditional Formats (2)` over ` A1:D10 > 100 → fill #FFFF00` rows.
253
295
  *
@@ -264,11 +306,14 @@ export declare function appendNames(md: MarkdownBuilder, names: readonly INamed[
264
306
  */
265
307
  export declare function appendRules<T extends IAnchored>(md: MarkdownBuilder, heading: string, items: readonly T[], describe: (item: T) => string): void;
266
308
  /**
267
- * The defined names whose target region intersects `range`, in collection order.
309
+ * The defined names whose target region intersects `range`, by name.
268
310
  *
269
311
  * @remarks
270
- * Scope-checked, not merely rectangle-checked: a name pointing at `Sheet2!A1:D4` overlaps this
271
- * sheet's `A1:D4` as coordinates and is a different region entirely. Defined names only — a
312
+ * Asked of the sheet's collection by address rather than resolved name by name here: the
313
+ * collection scope-checks (a name pointing at `Sheet2!A1:D4` overlaps this sheet's `A1:D4` as
314
+ * coordinates and is a different region entirely), and it resolves what the names designate as
315
+ * ONE step. A legacy file carries thousands of names nothing reads; asked one at a time, each
316
+ * compiled on its own, and a cell report over such a file ran out of memory. Defined names only — a
272
317
  * table's name has its own section.
273
318
  *
274
319
  * @param includeOwned Also admit this sheet's private names that designate no region
@@ -21,4 +21,8 @@
21
21
  * that would have to read further to find out.
22
22
  */
23
23
  export declare const pageWithLookahead: (total: number, pageSize: number) => number;
24
+ /** `ICellRange.getValues()`'s default `maxSize`: a range over it is too big to copy out in one read. */
25
+ export declare const GET_VALUES_LIMIT = 10000;
26
+ /** The value sample a report prints for a range over {@link GET_VALUES_LIMIT}. */
27
+ export declare const OVERSIZED_SAMPLE_CELLS = 200;
24
28
  //# sourceMappingURL=caps.d.ts.map
@@ -0,0 +1,31 @@
1
+ import { ICell, IRange } from '@sheetxl/sdk';
2
+ /** The reader's name for each check, in the order a report lists them. */
3
+ export declare const ANOMALY_LABELS: ReadonlyMap<string, string>;
4
+ /** `inconsistent formula` — the label, or the check's own name for one without a label. */
5
+ export declare const anomalyLabel: (check: string) => string;
6
+ /**
7
+ * One finding as a reader's line, its positions read at `cell`: `inconsistent formula · the cells
8
+ * above and below have =B2*2`.
9
+ *
10
+ * @remarks
11
+ * The evidence holds positions relative to the cell (R1C1), which is what lets a filled row share
12
+ * one finding. Read at the region's anchor they become the addresses a next call takes.
13
+ */
14
+ export declare function describeAnomaly(anomaly: ICell.Anomaly, cell: ICell): string;
15
+ /** Every finding at `cell`, `;`-joined; `null` when none fires. */
16
+ export declare function describeAnomalies(cell: ICell, options?: {
17
+ constants?: boolean;
18
+ }): string | null;
19
+ /** A `constantFrequency` finding's constant as a formula types it: `12`, `"Total"`, `FALSE`. */
20
+ export declare const describeConstant: (evidence: ICell.Anomaly["evidence"]) => string;
21
+ /**
22
+ * Whether a region's findings are constants alone: the reports count those in the `Constants`
23
+ * census rather than listing each region among the breaks.
24
+ */
25
+ export declare const isConstantOnly: (anomalies: readonly ICell.Anomaly[]) => boolean;
26
+ /**
27
+ * R1C1 references in `text` as A1, read from `at`: `=R[-1]C*2` at `B3` is `=B2*2`. Absolute
28
+ * parts take a `$`, as Excel writes them.
29
+ */
30
+ export declare function r1c1ToA1(text: string, at: IRange.CellCoords): string;
31
+ //# sourceMappingURL=describeAnomaly.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ISheet, ICellRange, ICellRanges, IChart, IMovable } from '@sheetxl/sdk';
1
+ import { IWorksheet, ICellRange, ICellRanges, IChart, IMovable } from '@sheetxl/sdk';
2
2
  import { MarkdownBuilder } from './MarkdownBuilder';
3
3
  /** The chart a movable holds, or `null` for any other content. */
4
4
  export declare const chartOf: (movable: IMovable) => IChart | null;
@@ -49,7 +49,7 @@ export interface BrokenChartReference {
49
49
  * A broken series reference is an audit finding exactly like one in a formula — the chart has
50
50
  * stopped plotting what its author pointed it at — and no cell carries it, so no cell scan finds it.
51
51
  */
52
- export declare function collectBrokenChartReferences(sheet: ISheet): BrokenChartReference[];
52
+ export declare function collectBrokenChartReferences(sheet: IWorksheet): BrokenChartReference[];
53
53
  /** A chart that plots the subject of a report, or something computed from it. */
54
54
  export interface ChartReader {
55
55
  movable: IMovable;
@@ -0,0 +1,27 @@
1
+ import { ICalculation, IWorkbook } from '@sheetxl/sdk';
2
+ /** One external citation that resolves to nothing, and why. */
3
+ export interface BrokenExternalCitation {
4
+ /** The scope as the formula spells it: `'[1]ex 1 - ibo'`. */
5
+ scope: string;
6
+ /** `no external link [1] — this workbook has none`. */
7
+ reason: string;
8
+ /** How many references in the formula carry this scope. */
9
+ uses: number;
10
+ }
11
+ /**
12
+ * The external citations in a formula that resolve to nothing: a `[n]` past the workbook's links,
13
+ * or a sheet its link does not list. Each evaluates to `#REF!`.
14
+ *
15
+ * @remarks
16
+ * Excel stores a reference to a sheet that does not exist as a reference to another workbook, so
17
+ * `'[1]ex 1 - ibo'!F27` is often a misspelled local sheet whose link was later lost (LibreOffice
18
+ * drops every link on save and keeps the `[1]`). The scope's text is the only record of what was
19
+ * meant, so it is quoted back rather than summarized.
20
+ *
21
+ * A citation that binds is never reported. A DDE or OLE slot holds its position without a book, so
22
+ * a `[n]` naming one is not broken either.
23
+ */
24
+ export declare function findBrokenExternalCitations(tokens: readonly ICalculation.FormulaToken[], workbook: IWorkbook | null | undefined): BrokenExternalCitation[];
25
+ /** `cites '[1]ex 1 - ibo': no external link [1] — this workbook has none`, `; `-joined; `''` when none. */
26
+ export declare function describeBrokenExternalCitations(citations: readonly BrokenExternalCitation[]): string;
27
+ //# sourceMappingURL=describeExternalCitation.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ICellRange, ICellRegion, IRange, ISheet, IStyle } from '@sheetxl/sdk';
1
+ import { ICellRange, ICellRegion, IRange, IWorksheet, ICellStyle } from '@sheetxl/sdk';
2
2
  /**
3
3
  * Per-attribute histograms for the style feature sections.
4
4
  *
@@ -127,7 +127,7 @@ export interface StyleHistogram {
127
127
  * is only recognizable unclipped: the used-range view cuts `O:Q` to `O1:Q43` and it looks like a
128
128
  * block. Cell counts are then taken inside the used range, where finite numbers live.
129
129
  */
130
- export declare function describeStyleHistogram(sheet: ISheet, feature: ICellRange.Feature, normal: IStyle | null, options?: HistogramLineOptions & {
130
+ export declare function describeStyleHistogram(sheet: IWorksheet, feature: ICellRange.Feature, normal: ICellStyle | null, options?: HistogramLineOptions & {
131
131
  /** The sheet's contentful rectangles, when the caller already has them (one partition serves every feature). */
132
132
  content?: readonly IRange.Coords[];
133
133
  }): StyleHistogram | null;
@@ -181,6 +181,6 @@ export declare function describeKinds(range: ICellRange, formulaRegions: readonl
181
181
  * then there is no line; but a `Normal` that carries a fill or a number format paints every
182
182
  * untouched cell in the book, and no region reports it, because nobody authored it on a cell.
183
183
  */
184
- export declare function describeNormal(feature: ICellRange.Feature, normal: IStyle): string | null;
184
+ export declare function describeNormal(feature: ICellRange.Feature, normal: ICellStyle): string | null;
185
185
  export {};
186
186
  //# sourceMappingURL=describeHistogram.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ICellRange, ICellRegion, IStyle } from '@sheetxl/sdk';
1
+ import { ICellRange, ICellRegion, ICellStyle } from '@sheetxl/sdk';
2
2
  /**
3
3
  * Describes one region's payload — the anchor cell's read for the feature that produced it.
4
4
  *
@@ -27,7 +27,7 @@ export interface RegionPayload {
27
27
  * lie of omission rather than a fact — see the TODOs below. The goal is that every partition
28
28
  * says something useful about what it found.
29
29
  */
30
- export declare function regionPayload(feature: ICellRange.Feature, normal: IStyle | null): RegionPayload | undefined;
30
+ export declare function regionPayload(feature: ICellRange.Feature, normal: ICellStyle | null): RegionPayload | undefined;
31
31
  /**
32
32
  * One payload describer covering **every** feature a partition was built from.
33
33
  *
@@ -42,5 +42,5 @@ export declare function regionPayload(feature: ICellRange.Feature, normal: IStyl
42
42
  * an empty column, and a partition where none of them do returns `undefined` so the listing stays
43
43
  * addresses-only.
44
44
  */
45
- export declare function regionPayloads(features: readonly ICellRange.Feature[], normal: IStyle | null): RegionPayload | undefined;
45
+ export declare function regionPayloads(features: readonly ICellRange.Feature[], normal: ICellStyle | null): RegionPayload | undefined;
46
46
  //# sourceMappingURL=describeRegionPayload.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ICondition, IConditionalFormat, IDataValidation, IStyle } from '@sheetxl/sdk';
1
+ import { ICondition, IConditionalFormat, IDataValidation, ICellStyle } from '@sheetxl/sdk';
2
2
  /**
3
3
  * The differential style a rule applies — the OOXML `dxf`, as the facets it actually names.
4
4
  *
@@ -7,7 +7,7 @@ import { ICondition, IConditionalFormat, IDataValidation, IStyle } from '@sheetx
7
7
  * property present in it is by construction something the rule author set. Absent facets are not
8
8
  * reported — a rule that only fills says `fill #FFFF00` and nothing about the font it leaves alone.
9
9
  */
10
- export declare const describeRuleStyle: (style: IStyle.Properties | null | undefined) => string | null;
10
+ export declare const describeRuleStyle: (style: ICellStyle.Properties | null | undefined) => string | null;
11
11
  /**
12
12
  * A value→visual mapping — `colorScale · min #FFFFFF → max #FF0000`.
13
13
  *
@@ -46,9 +46,9 @@ export declare const describeDataValidation: (validation: IDataValidation) => st
46
46
  * @remarks
47
47
  * **A list validation IS a vocabulary**, and frequently the only place a sheet states one: what
48
48
  * `Region` is allowed to contain is exactly what a writer needs before writing, and what a reader
49
- * needs to recognize `ZZ` as wrong rather than as new. The rule text reports it as a count (`In 3
50
- * Items`) because a filter dropdown cannot show a hundred values, so a report that only carried the
51
- * rule left the vocabulary unreadable.
49
+ * needs to recognize `ZZ` as wrong rather than as new. The rule text reports a picked set as a
50
+ * count (`List 3 Items`) because a filter dropdown cannot show a hundred values, so a report
51
+ * that only carried the rule left the vocabulary unreadable.
52
52
  *
53
53
  * A list sourced from cells carries its formula instead of its values — that IS the answer, and it
54
54
  * is the address to read next.
@@ -0,0 +1,41 @@
1
+ import { IShape, IGroup, IMovable, IMovableCollection } from '@sheetxl/sdk';
2
+ import { MarkdownBuilder } from './MarkdownBuilder';
3
+ /**
4
+ * A shape's text as one quoted row cell.
5
+ *
6
+ * @remarks
7
+ * Quoted, and never paraphrased, so it reads as what it is: content of the workbook, written by
8
+ * whoever could edit the file, not a statement of the report's. Newlines become a visible mark
9
+ * rather than a space because authors break lines on purpose — a callout listing three steps is
10
+ * three lines.
11
+ *
12
+ * @param max The cap, or `null` to print all of it.
13
+ * @param recovery The call that prints the rest; only read when the text is cut.
14
+ */
15
+ export declare const quoteShapeText: (text: string, max: number | null, recovery: string) => string;
16
+ /**
17
+ * The facts of a shape a report states beyond its placement: what it is, what it says, how it is
18
+ * drawn, what it links to and what it is glued to. Each fact only where the shape states it or it
19
+ * is not the default, so a plain rectangle stays a few lines.
20
+ *
21
+ * @remarks
22
+ * Read from the shape's JSON, which is the model: the accessors cover only its type, text and
23
+ * adjust values. A fill or line the shape does not state is named by where it comes from (its
24
+ * theme style) rather than resolved to a color — the theme is the workbook's, and the report says
25
+ * which reference to follow.
26
+ */
27
+ export declare function appendShapeFacts(md: MarkdownBuilder, shape: IShape): void;
28
+ /** `getContent()` as a group, when it is one. */
29
+ export declare const groupOf: (movable: IMovable) => IGroup | null;
30
+ /**
31
+ * A group's members, in z-order, one line each and indented by depth; a nested group's members
32
+ * beneath it. A picture is named by its file, a shape by its preset, and what is written on a
33
+ * member rides its line.
34
+ */
35
+ export declare const appendGroupMembers: (md: MarkdownBuilder, members: IMovableCollection, depth: number) => void;
36
+ /**
37
+ * The facts of a group a report states beyond its placement: what it holds, in z-order, and the
38
+ * fill it gives members that take the group's.
39
+ */
40
+ export declare function appendGroupFacts(md: MarkdownBuilder, group: IGroup): void;
41
+ //# sourceMappingURL=describeShape.d.ts.map
@@ -0,0 +1,15 @@
1
+ import { ICellRange, ISparklineGroup } from '@sheetxl/sdk';
2
+ /**
3
+ * `line of A2:E2 · group F2:F4 · high, low` — one cell's sparkline, as the cell report states it.
4
+ */
5
+ export declare const describeSparkline: (sparkline: ISparklineGroup.ISparkline) => string;
6
+ /**
7
+ * `line · reads A2:E4 · high, low` — the sparklines over `region`, one group's, as a region row
8
+ * states them.
9
+ *
10
+ * @remarks
11
+ * The cells read are spanned from the region's first and last sparkline, so this costs two
12
+ * lookups however many cells the region holds.
13
+ */
14
+ export declare const describeSparklineRegion: (region: ICellRange) => string | null;
15
+ //# sourceMappingURL=describeSparkline.d.ts.map
@@ -1,4 +1,4 @@
1
- import { IColor, IStyle } from '@sheetxl/sdk';
1
+ import { IColor, ICellStyle } from '@sheetxl/sdk';
2
2
  /**
3
3
  * One-line descriptions of a style's authored facets.
4
4
  *
@@ -31,7 +31,7 @@ export declare const describeColor: (color: IColor | null | undefined) => string
31
31
  * paints for `solid` too. The fill's generic `getColor()` returns the *background*, which is
32
32
  * how a yellow cell once reported `pattern #000000 (auto)`.
33
33
  */
34
- export declare const describeFill: (style: IStyle) => string | null;
34
+ export declare const describeFill: (style: ICellStyle) => string | null;
35
35
  /**
36
36
  * Describes borders — the edges that carry a style, each as `edge style color`.
37
37
  *
@@ -42,7 +42,7 @@ export declare const describeFill: (style: IStyle) => string | null;
42
42
  * `vertical` are `null` on a cell-scoped style, which is why the region payload reads through
43
43
  * `getRange()`.
44
44
  */
45
- export declare const describeBorder: (style: IStyle) => string | null;
45
+ export declare const describeBorder: (style: ICellStyle) => string | null;
46
46
  /**
47
47
  * The border as a list of parts, identical edges grouped.
48
48
  *
@@ -54,11 +54,11 @@ export declare const describeBorder: (style: IStyle) => string | null;
54
54
  * genuinely distinct strokes produce distinct parts — which is what makes the multi-line form
55
55
  * (one part per line) worth printing.
56
56
  */
57
- export declare const describeBorderParts: (style: IStyle) => string[];
57
+ export declare const describeBorderParts: (style: ICellStyle) => string[];
58
58
  /** Describes a number format — the format string itself is the payload. */
59
- export declare const describeNumberFormat: (style: IStyle) => string | null;
59
+ export declare const describeNumberFormat: (style: ICellStyle) => string | null;
60
60
  /** Describes alignment — only the parts that differ from `normal`. */
61
- export declare const describeAlignment: (style: IStyle, normal: IStyle) => string | null;
61
+ export declare const describeAlignment: (style: ICellStyle, normal: ICellStyle) => string | null;
62
62
  /** Describes a font — only the parts that differ from `normal`. */
63
- export declare const describeFont: (style: IStyle, normal: IStyle) => string | null;
63
+ export declare const describeFont: (style: ICellStyle, normal: ICellStyle) => string | null;
64
64
  //# sourceMappingURL=describeStyle.d.ts.map
@@ -1,24 +1,17 @@
1
- import { IRange, ISheet } from '@sheetxl/sdk';
1
+ import { IRange, IWorksheet } from '@sheetxl/sdk';
2
2
  /** A label and where it was read from. */
3
3
  export interface FoundLabel {
4
4
  text: string;
5
5
  address: string;
6
6
  }
7
7
  /**
8
- * The text that labels a cell's row (`'row'`) or column (`'column'`).
9
- *
10
- * @remarks
11
- * Deterministic, and the address is always returned so a reader can judge it:
12
- *
13
- * 1. The first cell of the line within the cell's current region (Ctrl+Shift+*), when it is text —
14
- * the row label at the left edge of the block, the header at its top.
15
- * 2. Otherwise the nearest text cell before the cell on that line — leftward for a row, upward for
16
- * a column. Only contentful cells are visited, so the walk costs the populated cells between,
17
- * not the distance; there is no cap, because a cap is only a different arbitrary answer.
8
+ * The text that labels a cell's row (`'row'`) or column (`'column'`): the first text cell at the
9
+ * line's edge of the cell's current region, else the nearest text before it on that line. The
10
+ * SDK's label model, which the anomaly checks read too.
18
11
  *
19
12
  * `null` when the cell is itself the first cell of the line or nothing before it is text.
20
13
  */
21
- export declare function findLabel(sheet: ISheet, cell: IRange.CellCoords, axis: 'row' | 'column'): FoundLabel | null;
14
+ export declare function findLabel(sheet: IWorksheet, cell: IRange.CellCoords, axis: 'row' | 'column'): FoundLabel | null;
22
15
  /** `"JUN" (G4)` — a label as the reports print it. */
23
16
  export declare const describeLabel: (label: FoundLabel | null) => string | null;
24
17
  /** 0-based column index to its A1 letter. */
@@ -2,6 +2,7 @@ export * from './appendDependencies';
2
2
  export * from './appendSections';
3
3
  export * from './describeRegionPayload';
4
4
  export * from './describeRule';
5
+ export * from './describeShape';
5
6
  export * from './describeStyle';
6
7
  export * from './MarkdownBuilder';
7
8
  export * from './parseRenderOptions';
@@ -15,12 +16,13 @@ export * from './renderFormula';
15
16
  export * from './renderModules';
16
17
  export * from './renderMovable';
17
18
  export * from './renderNames';
19
+ export * from './renderPageLayout';
18
20
  export * from './renderProtection';
19
21
  export * from './renderRecords';
20
22
  export * from './renderRanges';
21
23
  export * from './renderRegions';
22
24
  export * from './renderResult';
23
- export * from './renderSheet';
25
+ export * from './renderWorksheet';
24
26
  export * from './renderStats';
25
27
  export * from './renderStyle';
26
28
  export * from './renderTable';
@@ -7,7 +7,7 @@ import { RenderNamesOptions } from './renderNames';
7
7
  import { RenderRecordsOptions } from './renderRecords';
8
8
  import { RenderRangesOptions } from './renderRanges';
9
9
  import { RenderRegionsOptions } from './renderRegions';
10
- import { RenderSheetOptions } from './renderSheet';
10
+ import { RenderWorksheetOptions } from './renderWorksheet';
11
11
  import { RenderValuesOptions } from './renderValues';
12
12
  /**
13
13
  * The renderer registry: one entry per renderable kind.
@@ -18,7 +18,7 @@ import { RenderValuesOptions } from './renderValues';
18
18
  * Renderer.Entry.is}. Both paths land on the same entry, so a kind cannot render differently
19
19
  * depending on how it was reached.
20
20
  *
21
- * Detection uses the SDK's `isI*` runtime brands (`isIWorkbook`, `isISheet`, `isICellRange`,
21
+ * Detection uses the SDK's `isI*` runtime brands (`isIWorkbook`, `isIWorksheet`, `isICellRange`,
22
22
  * …) — the SDK's own convention for runtime type checking. The registry knows the SDK's
23
23
  * interfaces, never its classes, and a brand survives any transport that preserves methods.
24
24
  */
@@ -32,7 +32,7 @@ export declare namespace Renderer {
32
32
  * alternative is making the caller name the kind, which is the dispatch the registry exists
33
33
  * to remove.
34
34
  */
35
- type Options = RenderCellRangeOptions & RenderSheetOptions & RenderRegionsOptions & RenderValuesOptions & RenderFormulaOptions & RenderRecordsOptions & RenderNamesOptions & RenderRangesOptions & RenderModulesOptions & AppendDependencyOptions;
35
+ type Options = RenderCellRangeOptions & RenderWorksheetOptions & RenderRegionsOptions & RenderValuesOptions & RenderFormulaOptions & RenderRecordsOptions & RenderNamesOptions & RenderRangesOptions & RenderModulesOptions & AppendDependencyOptions;
36
36
  /**
37
37
  * One renderable kind.
38
38
  */
@@ -99,6 +99,11 @@ export declare function resolveRenderer(target: unknown): Renderer.Entry | null;
99
99
  * and it is the whole async surface: the renderers themselves are synchronous, and a caller
100
100
  * invoking one directly is responsible for settling first.
101
101
  *
102
+ * A render can itself start calculation: a cell's effective style reads a conditional format
103
+ * whose whole-column answer is evaluated only where it is read, and the read asks for it. When a
104
+ * render leaves the engine calculating, it settles again and renders again, so the report carries
105
+ * what the first read asked for.
106
+ *
102
107
  * @throws If no registered renderer accepts the object.
103
108
  */
104
109
  export declare function renderMarkdown(workbook: IWorkbook | null, target: unknown, options?: Renderer.Options): Promise<string>;
@@ -19,7 +19,8 @@ import { AppendDependencyOptions } from './appendDependencies';
19
19
  * Facets that are not present are omitted rather than reported as absent — merge spans on an
20
20
  * unmerged cell, a spill range on a cell that is not spilled. Zeros that ARE facts are printed:
21
21
  * a formula nothing reads is an output, and `Dependents (0)` is how the report says it. Value text
22
- * goes through {@link encodeCell}, so whatever this prints, grep can find.
22
+ * goes through {@link encodeCell}, so whatever this prints, grep can find: `Display` is grep's
23
+ * `display` field and `Value` — the stored scalar, what `getValue()` returns — is its `value` field.
23
24
  */
24
25
  export declare function renderCell(cell: ICell, options?: AppendDependencyOptions): Promise<string>;
25
26
  //# sourceMappingURL=renderCell.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ICalculation, ISheet } from '@sheetxl/sdk';
1
+ import { ICalculation, IWorksheet } from '@sheetxl/sdk';
2
2
  /**
3
3
  * Options for {@link renderFormula}.
4
4
  */
@@ -20,7 +20,7 @@ export interface RenderFormulaOptions {
20
20
  * from `getReferences()`, and this option covers the case where it is not: a formula whose
21
21
  * references are all names or constants (`=TAX_RATE * 100`) resolves nothing without it.
22
22
  */
23
- context?: ISheet;
23
+ context?: IWorksheet;
24
24
  }
25
25
  /**
26
26
  * Renders a formula's *analysis* report: its text, calculation status, behavioral flags, the
@@ -1,4 +1,4 @@
1
- import { IMovable } from '@sheetxl/sdk';
1
+ import { IMovable, IShape } from '@sheetxl/sdk';
2
2
  import { MarkdownBuilder } from './MarkdownBuilder';
3
3
  /** A shape with something written on it, the text already read. */
4
4
  export interface ShapeTextEntry {
@@ -45,6 +45,8 @@ export declare const describeTypeHeading: (type: string) => string;
45
45
  /**
46
46
  * `movables` by content type, in section order: the known types as {@link TYPE_HEADINGS} lists
47
47
  * them, then any other in the order it first appears. Z-order is kept within a type.
48
+ *
49
+ * A note's box is left out: the note is reported with the comments, and its box says nothing more.
48
50
  */
49
51
  export declare function groupMovables(movables: readonly IMovable[]): Map<string, IMovable[]>;
50
52
  /**
@@ -88,4 +90,15 @@ export declare function appendMovables(md: MarkdownBuilder, movables: readonly I
88
90
  * fact rather than the title.
89
91
  */
90
92
  export declare function renderMovable(movable: IMovable): string;
93
+ /**
94
+ * Renders one shape's report: its placement, as {@link renderMovable} reports it, and everything
95
+ * the shape model states — geometry and adjust values, text and its layout, fill and line, line
96
+ * ends, links, locks, what a connector is glued to, and a group's members.
97
+ *
98
+ * @remarks
99
+ * The same report the shape's movable gives, titled for the object that was asked about: a shape
100
+ * is reached as `movable.getContent()`, and the reader should not have to step back to its movable
101
+ * to learn where it is.
102
+ */
103
+ export declare function renderShape(shape: IShape): string;
91
104
  //# sourceMappingURL=renderMovable.d.ts.map
@@ -0,0 +1,22 @@
1
+ import { IPageLayout, IWorksheet } from '@sheetxl/sdk';
2
+ /**
3
+ * The sheet report's `Print:` line — what differs from Excel's defaults — or `null` when nothing
4
+ * does.
5
+ *
6
+ * @remarks
7
+ * Built from the settings a reader acts on, not from `toJSON()`: a file routinely carries print
8
+ * state nobody chose (the printer's resolution, its opaque settings, the automatic breaks Excel
9
+ * last paginated with), and a sheet whose only print state is that is a default sheet.
10
+ */
11
+ export declare function describePageLayout(sheet: IWorksheet): string | null;
12
+ /**
13
+ * Renders a sheet's print layout — what `getPageLayout()` answers with.
14
+ *
15
+ * @remarks
16
+ * The page-shaping settings (orientation, paper, scale, margins, print area, titles, breaks) are
17
+ * always listed, marked when they are the default, so the report says how the sheet prints and not
18
+ * only how it differs. The rest is listed only when set: a line per default would bury the few that
19
+ * are not.
20
+ */
21
+ export declare function renderPageLayout(layout: IPageLayout): string;
22
+ //# sourceMappingURL=renderPageLayout.d.ts.map
@@ -1,4 +1,4 @@
1
- import { ICellRange, ICell, IProtectedRange, IProtection, ISheet, ISheetProtection, IWorkbookProtection } from '@sheetxl/sdk';
1
+ import { ICellRange, ICell, IProtectedRange, IProtection, IWorksheet, IWorksheetProtection, IWorkbookProtection } from '@sheetxl/sdk';
2
2
  import { MarkdownBuilder } from './MarkdownBuilder';
3
3
  type AnyProtection = IProtection<any, any, any>;
4
4
  /**
@@ -21,7 +21,7 @@ export declare const describeWorkbookProtection: (protection: IWorkbookProtectio
21
21
  *
22
22
  * @returns `null` when the sheet is not protected.
23
23
  */
24
- export declare function summarizeSheetProtection(sheet: ISheet): {
24
+ export declare function summarizeSheetProtection(sheet: IWorksheet): {
25
25
  extent: string;
26
26
  detail: string;
27
27
  } | null;
@@ -38,7 +38,7 @@ export declare function summarizeSheetProtection(sheet: ISheet): {
38
38
  * own: on an unprotected sheet an unlocked cell refuses nothing and says nothing, and on a
39
39
  * protected one it is this section's body.
40
40
  */
41
- export declare function appendSheetProtection(md: MarkdownBuilder, sheet: ISheet): void;
41
+ export declare function appendSheetProtection(md: MarkdownBuilder, sheet: IWorksheet): void;
42
42
  /**
43
43
  * A range report's `Protection:` line — how much of the range a write reaches — or `null` when the
44
44
  * sheet is not locked.
@@ -68,7 +68,7 @@ export declare function protectionPointerFor(error: unknown): string | null;
68
68
  * `sheet.getRegions("unlock")` on their own. An unprotected object still renders — the caller asked
69
69
  * — as the one line that says so, plus the options it keeps for its next lock.
70
70
  */
71
- export declare function renderProtection(protection: ISheetProtection | IWorkbookProtection): string;
71
+ export declare function renderProtection(protection: IWorksheetProtection | IWorkbookProtection): string;
72
72
  /**
73
73
  * Renders one unlocked range — a member of what `sheet.getProtectedRanges()` holds.
74
74
  *
@@ -8,6 +8,14 @@ export interface RenderRecordsOptions {
8
8
  * @defaultValue 1000
9
9
  */
10
10
  maxCells?: number;
11
+ /**
12
+ * The one-line form of a field that is a renderable SDK object, or `null` when it is not one.
13
+ *
14
+ * @remarks
15
+ * Supplied by the registry, which knows what renders; this renderer only knows that a class
16
+ * instance has no business being JSON-dumped. Without it such a field prints its string tag.
17
+ */
18
+ nested?: (value: unknown) => string | null;
11
19
  }
12
20
  /**
13
21
  * Whether a value is a *plain* object — an object literal or a `JSON.parse` result, nothing else.
@@ -50,7 +50,15 @@ export declare function appendRegionList(md: MarkdownBuilder, regions: readonly
50
50
  payload?: RegionPayload;
51
51
  profile?: boolean;
52
52
  series?: boolean;
53
+ collapse?: RegionKey;
53
54
  }): void;
55
+ /** What a region says, as a key two regions saying the same thing share; `null` keeps it on its own. */
56
+ export type RegionKey = (region: ICellRegion) => string | null;
57
+ /**
58
+ * An `anomalies` region's key: its findings, check and evidence, without the rank. Two regions
59
+ * with the same findings are one line of the listing.
60
+ */
61
+ export declare const anomalyRegionKey: RegionKey;
54
62
  /**
55
63
  * Renders a partition — the unit `getRegions` returns, so an agent addresses structure instead
56
64
  * of guessing ranges.
@@ -1,4 +1,4 @@
1
- import { IStyle } from '@sheetxl/sdk';
1
+ import { ICellStyle } from '@sheetxl/sdk';
2
2
  /**
3
3
  * Renders a style report: the named style it derives from, plus its direct overrides.
4
4
  *
@@ -8,5 +8,5 @@ import { IStyle } from '@sheetxl/sdk';
8
8
  * the style model grows. No direct properties means the style is entirely inherited; the
9
9
  * report says so instead of enumerating absence (the closed-world contract).
10
10
  */
11
- export declare function renderStyle(style: IStyle): string;
11
+ export declare function renderStyle(style: ICellStyle): string;
12
12
  //# sourceMappingURL=renderStyle.d.ts.map
@@ -1,5 +1,7 @@
1
- import { ITable } from '@sheetxl/sdk';
1
+ import { ICell, ITable } from '@sheetxl/sdk';
2
2
  import { MarkdownBuilder } from './MarkdownBuilder';
3
+ /** The table a cell is in, or `null`. The sheet's autofilter is not a table. */
4
+ export declare const tableOf: (cell: ICell) => ITable | null;
3
5
  /**
4
6
  * `## Tables (981 cells · 1 table)` over one `B3:J111 109×9 tblNOI` row per table, its facts
5
7
  * indented beneath it.
@@ -21,7 +21,7 @@ export interface RenderWorkbookOptions extends Pick<AppendNamesOptions, 'maxName
21
21
  * regions and distinct formulas say how many ideas the model has, and distinct fonts and formats
22
22
  * say whether the styling is a convention. A layer that is empty has no line. The structure
23
23
  * behind each line is the sheet report's, and the `content` line carries that sheet's call
24
- * (`wb.getSheet("Sales") lists the blocks`): a reader routes by copying an address off the roster,
24
+ * (`wb.getWorksheet("Sales") lists the blocks`): a reader routes by copying an address off the roster,
25
25
  * so the call to the fuller report sits on the line the address is read from. **Twins** — sheets
26
26
  * whose formula partitions are identical, where the audit is the diff between them — are named on
27
27
  * the sheet.