@sheetxl/query 0.7.23-beta.1
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/LICENSE.md +11 -0
- package/README.md +69 -0
- package/browser/cjs/index.cjs +26 -0
- package/browser/esm/index.mjs +1994 -0
- package/licenses/dependencies.txt +1 -0
- package/node/esm/index.mjs +2024 -0
- package/package.json +52 -0
- package/types/index.d.ts +2 -0
- package/types/src/Tool.d.ts +108 -0
- package/types/src/Tool.d.ts.map +1 -0
- package/types/src/encode/encodeCell.d.ts +149 -0
- package/types/src/encode/encodeCell.d.ts.map +1 -0
- package/types/src/encode/index.d.ts +2 -0
- package/types/src/encode/index.d.ts.map +1 -0
- package/types/src/grep/GrepTypes.d.ts +308 -0
- package/types/src/grep/GrepTypes.d.ts.map +1 -0
- package/types/src/grep/grep.d.ts +15 -0
- package/types/src/grep/grep.d.ts.map +1 -0
- package/types/src/grep/grepTool.d.ts +16 -0
- package/types/src/grep/grepTool.d.ts.map +1 -0
- package/types/src/grep/index.d.ts +5 -0
- package/types/src/grep/index.d.ts.map +1 -0
- package/types/src/grep/renderGrep.d.ts +19 -0
- package/types/src/grep/renderGrep.d.ts.map +1 -0
- package/types/src/index.d.ts +20 -0
- package/types/src/index.d.ts.map +1 -0
- package/types/src/markdown/MarkdownBuilder.d.ts +84 -0
- package/types/src/markdown/MarkdownBuilder.d.ts.map +1 -0
- package/types/src/markdown/appendSections.d.ts +364 -0
- package/types/src/markdown/appendSections.d.ts.map +1 -0
- package/types/src/markdown/caps.d.ts +24 -0
- package/types/src/markdown/caps.d.ts.map +1 -0
- package/types/src/markdown/describeRegionPayload.d.ts +46 -0
- package/types/src/markdown/describeRegionPayload.d.ts.map +1 -0
- package/types/src/markdown/describeRule.d.ts +66 -0
- package/types/src/markdown/describeRule.d.ts.map +1 -0
- package/types/src/markdown/describeStyle.d.ts +64 -0
- package/types/src/markdown/describeStyle.d.ts.map +1 -0
- package/types/src/markdown/index.d.ts +27 -0
- package/types/src/markdown/index.d.ts.map +1 -0
- package/types/src/markdown/parseRenderOptions.d.ts +16 -0
- package/types/src/markdown/parseRenderOptions.d.ts.map +1 -0
- package/types/src/markdown/profileRegion.d.ts +121 -0
- package/types/src/markdown/profileRegion.d.ts.map +1 -0
- package/types/src/markdown/registry.d.ts +96 -0
- package/types/src/markdown/registry.d.ts.map +1 -0
- package/types/src/markdown/renderCell.d.ts +23 -0
- package/types/src/markdown/renderCell.d.ts.map +1 -0
- package/types/src/markdown/renderCellRange.d.ts +61 -0
- package/types/src/markdown/renderCellRange.d.ts.map +1 -0
- package/types/src/markdown/renderConditionalFormat.d.ts +15 -0
- package/types/src/markdown/renderConditionalFormat.d.ts.map +1 -0
- package/types/src/markdown/renderCounts.d.ts +11 -0
- package/types/src/markdown/renderCounts.d.ts.map +1 -0
- package/types/src/markdown/renderDataValidation.d.ts +15 -0
- package/types/src/markdown/renderDataValidation.d.ts.map +1 -0
- package/types/src/markdown/renderFormula.d.ts +63 -0
- package/types/src/markdown/renderFormula.d.ts.map +1 -0
- package/types/src/markdown/renderMovable.d.ts +35 -0
- package/types/src/markdown/renderMovable.d.ts.map +1 -0
- package/types/src/markdown/renderNames.d.ts +32 -0
- package/types/src/markdown/renderNames.d.ts.map +1 -0
- package/types/src/markdown/renderRanges.d.ts +33 -0
- package/types/src/markdown/renderRanges.d.ts.map +1 -0
- package/types/src/markdown/renderRecords.d.ts +39 -0
- package/types/src/markdown/renderRecords.d.ts.map +1 -0
- package/types/src/markdown/renderRegions.d.ts +70 -0
- package/types/src/markdown/renderRegions.d.ts.map +1 -0
- package/types/src/markdown/renderResult.d.ts +35 -0
- package/types/src/markdown/renderResult.d.ts.map +1 -0
- package/types/src/markdown/renderSheet.d.ts +29 -0
- package/types/src/markdown/renderSheet.d.ts.map +1 -0
- package/types/src/markdown/renderStats.d.ts +18 -0
- package/types/src/markdown/renderStats.d.ts.map +1 -0
- package/types/src/markdown/renderStyle.d.ts +12 -0
- package/types/src/markdown/renderStyle.d.ts.map +1 -0
- package/types/src/markdown/renderTable.d.ts +12 -0
- package/types/src/markdown/renderTable.d.ts.map +1 -0
- package/types/src/markdown/renderValues.d.ts +28 -0
- package/types/src/markdown/renderValues.d.ts.map +1 -0
- package/types/src/markdown/renderWorkbook.d.ts +50 -0
- package/types/src/markdown/renderWorkbook.d.ts.map +1 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IMovable } from '@sheetxl/sdk';
|
|
2
|
+
import { MarkdownBuilder } from './MarkdownBuilder';
|
|
3
|
+
/**
|
|
4
|
+
* `## Movables (3)` over ` C3:F12 chart Chart 1 — column` rows — the pictures, charts, shapes
|
|
5
|
+
* and slicers floating over the report's range.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* **The one class of sheet content that appears in no other section.** Everything else these
|
|
9
|
+
* reports describe lives in cells and is reachable by address; a movable floats over the grid and
|
|
10
|
+
* is invisible to every values, region and rule listing — so without this section a report about
|
|
11
|
+
* a dashboard sheet says the sheet is nearly empty, which is true of its cells and false of what
|
|
12
|
+
* anyone looking at it sees.
|
|
13
|
+
*
|
|
14
|
+
* Rows are `anchor · type · prose`, and both leading columns are arguments rather than labels: the
|
|
15
|
+
* address is what `getRange()` takes, and the type is exactly what `getMovables({ type })` filters
|
|
16
|
+
* on — the filter compares this same string.
|
|
17
|
+
*
|
|
18
|
+
* Listed in z-order, which is the order the collection returns them in and the order they paint,
|
|
19
|
+
* so where two movables overlap the later row is the one on top. Hidden movables are listed and
|
|
20
|
+
* marked; they are the ones a reader cannot otherwise learn about.
|
|
21
|
+
*/
|
|
22
|
+
export declare function appendMovables(md: MarkdownBuilder, movables: readonly IMovable[]): void;
|
|
23
|
+
/**
|
|
24
|
+
* Renders one movable's report — what it is, where it is anchored, and whether anyone can see it.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* The listing carries the identity; this adds what does not fit on a row: the pixel bounds, the
|
|
28
|
+
* anchor behavior that decides what an insert does to this object, and the display note in full.
|
|
29
|
+
*
|
|
30
|
+
* **A movable has no name-based lookup**, so unlike a table this report leads with the anchor —
|
|
31
|
+
* the address is how a reader gets back to it (`range.getMovables()`), and the name is the first
|
|
32
|
+
* fact rather than the title.
|
|
33
|
+
*/
|
|
34
|
+
export declare function renderMovable(movable: IMovable): string;
|
|
35
|
+
//# sourceMappingURL=renderMovable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderMovable.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderMovable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAGxD,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAsIpD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,eAAe,EAAE,QAAQ,EAAE,SAAS,QAAQ,EAAE,GAAG,IAAI,CA4BvF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,QAAQ,GAAG,MAAM,CAiCvD"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { INamedCollection } from '@sheetxl/sdk';
|
|
2
|
+
import { AppendNamesOptions } from './appendSections';
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link renderNames}.
|
|
5
|
+
*/
|
|
6
|
+
export interface RenderNamesOptions extends AppendNamesOptions {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders the name manager — every named item in the collection, grouped by kind.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* **The standalone form of the roster, and the one place grouping by kind is right.** The workbook
|
|
13
|
+
* report carries a single defined-name section, deliberately unsplit: its job is triage, and a
|
|
14
|
+
* triage sort is only worth anything as one ordered reading. This report has the opposite job —
|
|
15
|
+
* "what exists, and what is it" — and a reader here has already chosen to look at names rather
|
|
16
|
+
* than at the book. So the split lands here and nowhere else.
|
|
17
|
+
*
|
|
18
|
+
* **What it holds is decided by where the collection came from.** `wb.getNames()` is every named
|
|
19
|
+
* item at any scope; `sheet.getNames()` is what is visible FROM that sheet, with shadowing already
|
|
20
|
+
* resolved. Both render through this entry unchanged — the scope question was answered by the call
|
|
21
|
+
* that produced the collection, which is exactly why there is no scope option here to get wrong.
|
|
22
|
+
*
|
|
23
|
+
* Hidden names are included. Existing never hides (the same house rule that puts hidden sheets in
|
|
24
|
+
* the workbook roster), and this is the report that has to be complete: a hidden broken name with
|
|
25
|
+
* dependents is precisely the row a debugging agent must see, and the triage sort surfaces it.
|
|
26
|
+
*
|
|
27
|
+
* Synchronous, like every renderer: the dependents column is read off COMPILED formulas, so the
|
|
28
|
+
* caller settles the engine first — `renderMarkdown` settles its workbook argument before
|
|
29
|
+
* dispatching here.
|
|
30
|
+
*/
|
|
31
|
+
export declare function renderNames(names: INamedCollection, options?: RenderNamesOptions): string;
|
|
32
|
+
//# sourceMappingURL=renderNames.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderNames.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderNames.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAE7D,OAAO,EAAe,KAAK,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAGxE;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,kBAAkB;CAAG;AAmBjE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,WAAW,CACzB,KAAK,EAAE,gBAAgB,EACvB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,MAAM,CA8BR"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ICellRanges } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Options for {@link renderRanges}.
|
|
4
|
+
*/
|
|
5
|
+
export interface RenderRangesOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Cap on listed ranges; the report notes truncation when exceeded.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue 100
|
|
10
|
+
*/
|
|
11
|
+
maxRanges?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders an {@link ICellRanges} — the discontiguous collection the calculation graph answers with.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* **The flat half of the dependency graph.** `getPrecedents()` / `getDependents()` and their
|
|
18
|
+
* `getDirect*` twins all return this, on cells, ranges and defined names alike, and the flat list is
|
|
19
|
+
* what a tree branch cut at the depth bound is recovered with. So it prints the tree's rows without
|
|
20
|
+
* the hop structure — same label, same payload, through {@link describeNodeLabel} and
|
|
21
|
+
* {@link describeNode} — and a reader comparing the two shapes is comparing the same text.
|
|
22
|
+
*
|
|
23
|
+
* **Qualification is the tree's rule.** A collection standing on one sheet names it once, in the
|
|
24
|
+
* heading, and leaves its rows bare; one that spans sheets qualifies every row instead, because an
|
|
25
|
+
* unqualified address below a crossing reads as the sheet the report is about. Name members carry a
|
|
26
|
+
* name rather than an address, so they are never qualified and never the reason the rest is.
|
|
27
|
+
*
|
|
28
|
+
* **An empty collection renders as `(0)` and `none`.** The graph calls return `null` rather than an
|
|
29
|
+
* empty collection, which the run layer already summarizes — but a producer that hands back an empty
|
|
30
|
+
* one must not fall through to "no renderer", which reads as a broken report rather than an answer.
|
|
31
|
+
*/
|
|
32
|
+
export declare function renderRanges(ranges: ICellRanges, options?: RenderRangesOptions): string;
|
|
33
|
+
//# sourceMappingURL=renderRanges.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderRanges.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderRanges.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAMhD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,EAAE,mBAAmB,GAAG,MAAM,CA0CvF"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Options for {@link renderRecords}.
|
|
3
|
+
*/
|
|
4
|
+
export interface RenderRecordsOptions {
|
|
5
|
+
/**
|
|
6
|
+
* Cap on rendered cells; the report notes truncation when exceeded.
|
|
7
|
+
*
|
|
8
|
+
* @defaultValue 1000
|
|
9
|
+
*/
|
|
10
|
+
maxCells?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Whether a value is a *plain* object — an object literal or a `JSON.parse` result, nothing else.
|
|
14
|
+
*
|
|
15
|
+
* @remarks
|
|
16
|
+
* The prototype test is what keeps this renderer away from everything it has no business rendering.
|
|
17
|
+
* Every SDK object is a class instance, so its prototype is never `Object.prototype`; it therefore
|
|
18
|
+
* cannot match here even if its brand were somehow missing, and it keeps the one-line summary that
|
|
19
|
+
* an opaque object deserves. What is left is exactly the data a script *built* — which is the case
|
|
20
|
+
* this renderer exists for.
|
|
21
|
+
*/
|
|
22
|
+
export declare const isPlainRecord: (target: unknown) => target is Record<string, unknown>;
|
|
23
|
+
/**
|
|
24
|
+
* Renders plain records — an array of object literals, or a single one — as a table.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* An array of records is the shape a script *builds*: `sheets.map(s => ({ name: …, rows: … }))`.
|
|
28
|
+
* It is data the author composed deliberately, not an SDK object's internals, so the reasoning that
|
|
29
|
+
* makes a one-line summary right for an opaque object is exactly backwards here — the structure IS
|
|
30
|
+
* the answer, and the reader asked for it. Rendered as a table rather than dumped as JSON because
|
|
31
|
+
* uniform keys are columns, and a column is what makes a set of records scannable.
|
|
32
|
+
*
|
|
33
|
+
* Columns are the union of every shown record's keys in first-seen order, so a ragged set still
|
|
34
|
+
* renders: a record missing a key gets a blank, which reads as absent rather than as a shape the
|
|
35
|
+
* data does not have. A nested value falls back to compact JSON — one level of structure is worth
|
|
36
|
+
* showing inline, a whole object graph is not.
|
|
37
|
+
*/
|
|
38
|
+
export declare function renderRecords(records: Record<string, unknown> | readonly Record<string, unknown>[], options?: RenderRecordsOptions): string;
|
|
39
|
+
//# sourceMappingURL=renderRecords.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderRecords.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderRecords.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAKD;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,OAAO,KAAG,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAI/E,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EACrE,OAAO,CAAC,EAAE,oBAAoB,GAC7B,MAAM,CAuDR"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { ICellRegion, ICellRegions } from '@sheetxl/sdk';
|
|
2
|
+
import { RegionPayload } from './describeRegionPayload';
|
|
3
|
+
import { MarkdownBuilder } from './MarkdownBuilder';
|
|
4
|
+
import { ProfileRegionOptions } from './profileRegion';
|
|
5
|
+
/**
|
|
6
|
+
* Options for {@link renderRegions}.
|
|
7
|
+
*/
|
|
8
|
+
export interface RenderRegionsOptions extends ProfileRegionOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Cap on listed regions; the report notes truncation when exceeded.
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue 200
|
|
13
|
+
*/
|
|
14
|
+
maxRegions?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Cap on regions **profiled** in a `Contentful` listing — the rest list address and size only.
|
|
17
|
+
*
|
|
18
|
+
* @remarks
|
|
19
|
+
* Lower than {@link maxRegions} on purpose: listing a region is one line and one lookup, while
|
|
20
|
+
* profiling it scans its cells. A sheet with 400 stray labels should still list all 400 without
|
|
21
|
+
* paying 400 scans, and the listing says plainly which ones went undescribed so the reader can
|
|
22
|
+
* ask for the rest rather than assume there was nothing to say.
|
|
23
|
+
*
|
|
24
|
+
* @defaultValue 12
|
|
25
|
+
*/
|
|
26
|
+
maxProfiled?: number;
|
|
27
|
+
/**
|
|
28
|
+
* How to recover the regions the cap ate — appended to the overflow line.
|
|
29
|
+
*
|
|
30
|
+
* @remarks
|
|
31
|
+
* A cap is a report-length decision, and "raise it" is the one recovery that does not scale:
|
|
32
|
+
* the reader who needs all 400 regions needs them in a loop, not in a longer listing. Sections
|
|
33
|
+
* that know the query behind the listing — a sheet report's feature partition knows its sheet
|
|
34
|
+
* and its feature — pass the call that returns the whole set, so the next step is an SDK query
|
|
35
|
+
* rather than a knob.
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue a pointer at narrowing the range
|
|
38
|
+
*/
|
|
39
|
+
recovery?: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Appends an aligned region listing — shared by the standalone regions report and the sheet
|
|
43
|
+
* report's per-feature sections, so the two can never list regions differently.
|
|
44
|
+
*
|
|
45
|
+
* @remarks
|
|
46
|
+
* Aligned listing rather than a pipe table (grep's rationale): rows are addresses, and the
|
|
47
|
+
* follow-up call — a `values`/`stats` read of one region — consumes the address directly.
|
|
48
|
+
*/
|
|
49
|
+
export declare function appendRegionList(md: MarkdownBuilder, regions: readonly ICellRegion[], options?: RenderRegionsOptions & {
|
|
50
|
+
payload?: RegionPayload;
|
|
51
|
+
profile?: boolean;
|
|
52
|
+
}): void;
|
|
53
|
+
/**
|
|
54
|
+
* Renders a partition — the unit `getRegions` returns, so an agent addresses structure instead
|
|
55
|
+
* of guessing ranges.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* **The heading names the features**, because the partition carries them: a region is uniform
|
|
59
|
+
* *with respect to those*, and a listing that does not say which ones is a column of addresses
|
|
60
|
+
* whose meaning the reader has to already know. It goes in the heading rather than per row
|
|
61
|
+
* because it is the same answer on every row — that is what a partition IS.
|
|
62
|
+
*
|
|
63
|
+
* **Each row carries its payload**, through the same describers a sheet report's feature sections
|
|
64
|
+
* use — so `getRegions('formula')` answers with the authored formulas rather than with a column of
|
|
65
|
+
* addresses the reader then has to go and read one by one. The two paths into a partition listing
|
|
66
|
+
* cannot describe it differently, and a refined partition joins one payload per requested feature,
|
|
67
|
+
* which is the tuple such a call was made to see.
|
|
68
|
+
*/
|
|
69
|
+
export declare function renderRegions(regions: ICellRegions, options?: RenderRegionsOptions): string;
|
|
70
|
+
//# sourceMappingURL=renderRegions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderRegions.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderRegions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAE,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAO,EAAkB,KAAK,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAiB,KAAK,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AAE3E;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,oBAAoB;IAChE;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;;;;;;;;OAWG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAC9B,EAAE,EAAE,eAAe,EACnB,OAAO,EAAE,SAAS,WAAW,EAAE,EAC/B,OAAO,CAAC,EAAE,oBAAoB,GAAG;IAAE,OAAO,CAAC,EAAE,aAAa,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAC9E,IAAI,CAmDN;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,YAAY,EACrB,OAAO,CAAC,EAAE,oBAAoB,GAC7B,MAAM,CAwBR"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { IWorkbook } from '@sheetxl/sdk';
|
|
2
|
+
import { Renderer } from './registry';
|
|
3
|
+
/**
|
|
4
|
+
* A run result rendered for the reader.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* `rendered: false` marks the last-resort branch — a value nothing renders, summarized in one
|
|
8
|
+
* line — so a host can append its own escape-hatch hint (the CLI points at `--json`).
|
|
9
|
+
*/
|
|
10
|
+
export interface RenderedResult {
|
|
11
|
+
/** The markdown (or one-line summary) — `undefined` only for an `undefined` result (void run). */
|
|
12
|
+
text?: string;
|
|
13
|
+
/** False when the value hit the "no renderer" summary rather than a real rendering. */
|
|
14
|
+
rendered: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Renders a run's result value — the final expression of a snippet, or a script's return value.
|
|
18
|
+
*
|
|
19
|
+
* @param workbook The workbook the run executed against — settled before rendering, exactly as
|
|
20
|
+
* {@link renderMarkdown} requires.
|
|
21
|
+
*
|
|
22
|
+
* @remarks
|
|
23
|
+
* The registry pass-through IS the default — `run -e "wb"` answers with the workbook report,
|
|
24
|
+
* which is the whole reason a separate `describe` verb is unnecessary. Strings pass through as
|
|
25
|
+
* markdown (a script that formatted its own answer), any renderable SDK object dispatches through
|
|
26
|
+
* the renderer registry, and plain data (a `getValues()` array) renders as a bare value grid.
|
|
27
|
+
* Anything with no renderer gets a ONE-LINE summary — never a structure dump, which is what a
|
|
28
|
+
* host's raw/JSON affordance is for. Only an `undefined` result is silent.
|
|
29
|
+
*
|
|
30
|
+
* Shared by every transport that returns a result: the CLI's `run` printout, the MCP `run` tool,
|
|
31
|
+
* and the webview executing against an attended session — one ladder, so the same expression answers
|
|
32
|
+
* identically everywhere.
|
|
33
|
+
*/
|
|
34
|
+
export declare function renderResult(workbook: IWorkbook | null, result: unknown, options?: Renderer.Options): Promise<RenderedResult>;
|
|
35
|
+
//# sourceMappingURL=renderResult.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderResult.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAU,MAAM,cAAc,CAAC;AAGtD,OAAO,EAAmC,KAAK,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE5E;;;;;;GAMG;AACH,MAAM,WAAW,cAAc;IAC7B,kGAAkG;IAClG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,uFAAuF;IACvF,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,YAAY,CAChC,QAAQ,EAAE,SAAS,GAAG,IAAI,EAC1B,MAAM,EAAE,OAAO,EACf,OAAO,CAAC,EAAE,QAAQ,CAAC,OAAO,GACzB,OAAO,CAAC,cAAc,CAAC,CAgBzB"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { ISheet } from '@sheetxl/sdk';
|
|
2
|
+
import { AppendFeatureOptions } from './appendSections';
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link renderSheet}.
|
|
5
|
+
*/
|
|
6
|
+
export interface RenderSheetOptions extends AppendFeatureOptions {
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Renders a markdown report of a sheet: counts, one section per feature partition, and the
|
|
10
|
+
* sheet-level objects (named ranges, hidden headers, tables).
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* **No `Values` section** — that one belongs to {@link renderCellRange}, where the caller named
|
|
14
|
+
* bounds, and it is the only output in these reports that scales with the number of cells.
|
|
15
|
+
*
|
|
16
|
+
* Everything here is bounded by the sheet's structure instead: one section per feature
|
|
17
|
+
* partition, and a profile per contentful block that reports computed shape (types, bounds,
|
|
18
|
+
* aggregates, distinct counts) plus the text that names a block — a 1×1 prints its value, a
|
|
19
|
+
* table its header labels. Blocks × series, both capped, so this report cannot grow with the
|
|
20
|
+
* data. Altitude governs content: this one says where things are and what each block is; the
|
|
21
|
+
* range report reads one.
|
|
22
|
+
*
|
|
23
|
+
* This is the whole-sheet form of the same stats a cell range reports — which is exactly why
|
|
24
|
+
* {@link renderCellRange} does not list the partitions again. The addresses here are what it is
|
|
25
|
+
* then asked for, so the two calls compose into the whole read: this one to find the blocks,
|
|
26
|
+
* that one to read one.
|
|
27
|
+
*/
|
|
28
|
+
export declare function renderSheet(sheet: ISheet, options?: RenderSheetOptions): string;
|
|
29
|
+
//# sourceMappingURL=renderSheet.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderSheet.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderSheet.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAEtC,OAAO,EAEL,KAAK,oBAAoB,EAC1B,MAAM,kBAAkB,CAAC;AAI1B;;GAEG;AACH,MAAM,WAAW,kBAAmB,SAAQ,oBAAoB;CAAG;AAEnE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAmC/E"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IRangeStats } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a stats report — occupancy, numeric aggregates, and the type breakdown.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* `getCounts` answers "how much of each feature"; this answers "what are the values like".
|
|
7
|
+
* Null aggregates (no numbers in the range) are elided rather than printed as null.
|
|
8
|
+
*
|
|
9
|
+
* Errors are population for a report, never faults: aggregates are taken over the numeric
|
|
10
|
+
* cells (`onError: 'ignore'` — the stats object's own default policy is `'throw'`, which
|
|
11
|
+
* would make the range that most needs a stats report the one that returns nothing), and the
|
|
12
|
+
* error count is its own line item so nothing degrades silently.
|
|
13
|
+
*
|
|
14
|
+
* Aggregates print through {@link encodeNumber} — a derived mean carries no number format, so
|
|
15
|
+
* without the display cap an `Average` publishes the full 17-digit float of its own division.
|
|
16
|
+
*/
|
|
17
|
+
export declare function renderStats(stats: IRangeStats): string;
|
|
18
|
+
//# sourceMappingURL=renderStats.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderStats.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderStats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,KAAK,WAAW,EAAE,MAAM,cAAc,CAAC;AAe5D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAgCtD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { IStyle } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a style report: the named style it derives from, plus its direct overrides.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* The property listing comes from `toJSON()` — the style's own serialization of what is
|
|
7
|
+
* directly set — rather than walking each sub-object's API, so the report stays complete as
|
|
8
|
+
* the style model grows. No direct properties means the style is entirely inherited; the
|
|
9
|
+
* report says so instead of enumerating absence (the closed-world contract).
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderStyle(style: IStyle): string;
|
|
12
|
+
//# sourceMappingURL=renderStyle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderStyle.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderStyle.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAI3C;;;;;;;;GAQG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAiBjD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ITable } from '@sheetxl/sdk';
|
|
2
|
+
import { MarkdownBuilder } from './MarkdownBuilder';
|
|
3
|
+
/**
|
|
4
|
+
* Appends one table's details — shared by the sheet report's Tables section and the standalone
|
|
5
|
+
* table report, so the two can never describe a table differently.
|
|
6
|
+
*/
|
|
7
|
+
export declare function appendTableDetails(md: MarkdownBuilder, table: ITable): void;
|
|
8
|
+
/**
|
|
9
|
+
* Renders a table report.
|
|
10
|
+
*/
|
|
11
|
+
export declare function renderTable(table: ITable): string;
|
|
12
|
+
//# sourceMappingURL=renderTable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderTable.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderTable.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAG3C,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAY3E;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CASjD"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { IRange, Scalar } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Options for {@link renderValues}.
|
|
4
|
+
*/
|
|
5
|
+
export interface RenderValuesOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Cap on rendered values; the report notes truncation when exceeded.
|
|
8
|
+
*
|
|
9
|
+
* @defaultValue 1000
|
|
10
|
+
*/
|
|
11
|
+
maxCells?: number;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Renders a pure value grid — an {@link IRange} or a raw `Scalar[][]`.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* **No row or column labels.** `IRange` is SheetXL's stateless value layer and `Scalar[][]` is a
|
|
18
|
+
* plain array; neither knows a sheet, so neither has an address. Printing `A`/`1` labels over
|
|
19
|
+
* them would assert a position that is not part of the data — the values may have come from
|
|
20
|
+
* `D7:F9`, from a transposed copy, or from a function that never touched a sheet. Row/column
|
|
21
|
+
* labels are exactly what a *cell* range has and these do not, which is why they are a separate
|
|
22
|
+
* renderer rather than an option on one.
|
|
23
|
+
*
|
|
24
|
+
* The `'` string prefix is kept, so the encoding is the same one every other read uses: a bare
|
|
25
|
+
* `10/23/95` is a formatted number, `'10/23/95` is text.
|
|
26
|
+
*/
|
|
27
|
+
export declare function renderValues(values: IRange | readonly (readonly Scalar[])[], options?: RenderValuesOptions): string;
|
|
28
|
+
//# sourceMappingURL=renderValues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderValues.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderValues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAMnD;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,SAAS,MAAM,EAAE,CAAC,EAAE,EAC/C,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CAoCR"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { IWorkbook } from '@sheetxl/sdk';
|
|
2
|
+
import { AppendFeatureOptions, AppendNamesOptions } from './appendSections';
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link renderWorkbook}.
|
|
5
|
+
*/
|
|
6
|
+
export interface RenderWorkbookOptions extends AppendFeatureOptions, Pick<AppendNamesOptions, 'maxNames'> {
|
|
7
|
+
/**
|
|
8
|
+
* Cap on sheets expanded into per-sheet sections below the roster; the rest stay roster-only
|
|
9
|
+
* and the report says how to render one in full.
|
|
10
|
+
*
|
|
11
|
+
* @defaultValue 8
|
|
12
|
+
*/
|
|
13
|
+
maxSheets?: number;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Renders a markdown summary of a workbook: identity, the sheet roster, what is broken, and each
|
|
17
|
+
* sheet's structure.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* **The workbook report's job is routing** — *which sheet do I go to, and is anything broken?*
|
|
21
|
+
* Every line earns its place against that, which is why the roster is a table of routing facts
|
|
22
|
+
* (used range, cell/formula/error counts) rather than a list of names, and why errors get a
|
|
23
|
+
* section at this altitude: a broken book must not read clean.
|
|
24
|
+
*
|
|
25
|
+
* **Below the roster, each sheet's own sections render inline** — the same `Type`/partition/
|
|
26
|
+
* object sections a sheet report carries, one heading level down, through the same functions so
|
|
27
|
+
* the two can never disagree. One shape at every size; scale is absorbed by caps, not by a mode
|
|
28
|
+
* switch: on a small book the first call answers structure outright, on a large one every capped
|
|
29
|
+
* list states its overflow and the recovery (`maxSheets` sheets expanded, {@link
|
|
30
|
+
* MAX_REGIONS_PER_SHEET} regions per feature and {@link MAX_PROFILED_PER_SHEET} profiled —
|
|
31
|
+
* tighter than a sheet report's own defaults, because here they share the budget with the whole
|
|
32
|
+
* book). Like the sheet report, the expansion carries no `Values` section — that one is
|
|
33
|
+
* {@link renderCellRange}'s. A contentful profile is computed shape, bounded by blocks × series
|
|
34
|
+
* rather than by cells.
|
|
35
|
+
*
|
|
36
|
+
* Two kinds of broken, kept apart deliberately: an **error** is a successfully calculated error
|
|
37
|
+
* VALUE (`#DIV/0!` from `=1/0` — the `Error` kind), a **calc failure** is the engine failing to
|
|
38
|
+
* evaluate at all (mostly circular references — `CalcError`). A book with zero of one and three
|
|
39
|
+
* of the other is still badly broken, so each gets its own section and neither hides the other.
|
|
40
|
+
*
|
|
41
|
+
* Sheet ids are a session concept, not a document concept, and are not stable across runs — they
|
|
42
|
+
* do not appear here. Hidden sheets are marked inline where they exist rather than summarized in
|
|
43
|
+
* an always-zero count line: a hidden sheet with data is a classic miss, and the mark is what
|
|
44
|
+
* surfaces it.
|
|
45
|
+
*
|
|
46
|
+
* Pure rendering — the agent-priming preamble the pre-migration SDK report carried
|
|
47
|
+
* (`PROMPT_STRING`) belongs to the host that primes the agent, not to the report.
|
|
48
|
+
*/
|
|
49
|
+
export declare function renderWorkbook(workbook: IWorkbook, options?: RenderWorkbookOptions): string;
|
|
50
|
+
//# sourceMappingURL=renderWorkbook.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderWorkbook.d.ts","sourceRoot":"","sources":["../../../../src/markdown/renderWorkbook.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwC,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpF,OAAO,EAEL,KAAK,oBAAoB,EAAE,KAAK,kBAAkB,EACnD,MAAM,kBAAkB,CAAC;AAkB1B;;GAEG;AACH,MAAM,WAAW,qBAAsB,SAAQ,oBAAoB,EACjE,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC;IACpC;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAwBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,SAAS,EACnB,OAAO,CAAC,EAAE,qBAAqB,GAC9B,MAAM,CA0IR"}
|