@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,16 @@
|
|
|
1
|
+
import { Tool } from '../Tool';
|
|
2
|
+
import { GrepArgs, GrepResult } from './GrepTypes';
|
|
3
|
+
/**
|
|
4
|
+
* The `grep` capability, as both surfaces see it.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* Named `grep` rather than `find` on Unix semantics: `find` searches by name and attributes,
|
|
8
|
+
* `grep` searches contents by pattern. Selection by attribute is the regions read.
|
|
9
|
+
*
|
|
10
|
+
* No `sdk:` line, deliberately. `ICellRange.find` cannot reproduce grep — it takes
|
|
11
|
+
* `ICell.Content` fields (a different vocabulary), defaults to formulas only, and bypasses the
|
|
12
|
+
* shared encoder — so the line would graduate an agent into a macro that returns different
|
|
13
|
+
* answers. It returns when an SDK search with grep's contract lands.
|
|
14
|
+
*/
|
|
15
|
+
export declare const grepTool: Tool.Descriptor<GrepArgs, GrepResult>;
|
|
16
|
+
//# sourceMappingURL=grepTool.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"grepTool.d.ts","sourceRoot":"","sources":["../../../../src/grep/grepTool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAEpC,OAAO,EAAE,KAAK,QAAQ,EAAE,KAAK,UAAU,EAAoC,MAAM,aAAa,CAAC;AAI/F;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,EAAE,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAqG1D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/grep/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC;AACvB,cAAc,cAAc,CAAC;AAC7B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { GrepResult } from './GrepTypes';
|
|
2
|
+
/**
|
|
3
|
+
* Renders a {@link GrepResult} as an aligned listing.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Aligned listing rather than a markdown table: the result is heterogeneous sections, not a grid,
|
|
7
|
+
* and terminal output (`ls -l`, `git status`) is enormously represented in training data while
|
|
8
|
+
* costing no pipe characters.
|
|
9
|
+
*
|
|
10
|
+
* Header carries scope, footer carries what is next — the footer is last because that is where
|
|
11
|
+
* the next-action decision happens. Both are one line and phrased identically every time, so a
|
|
12
|
+
* stable footer is skimmed in a couple of tokens once it has been seen twice.
|
|
13
|
+
*
|
|
14
|
+
* With context on, matches are grouped under the block they sit in — `rg --heading` groups
|
|
15
|
+
* hits under their file; the enclosing region is the grid's file. Twelve hits in one table
|
|
16
|
+
* cost one block line plus twelve short rows, not twelve fully-qualified addresses.
|
|
17
|
+
*/
|
|
18
|
+
export declare function renderGrep(result: GrepResult): string;
|
|
19
|
+
//# sourceMappingURL=renderGrep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderGrep.d.ts","sourceRoot":"","sources":["../../../../src/grep/renderGrep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AA0B9D;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CA8ErD"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Tool } from './Tool';
|
|
2
|
+
export * from './Tool';
|
|
3
|
+
export * from './encode';
|
|
4
|
+
export * from './grep';
|
|
5
|
+
export * from './markdown';
|
|
6
|
+
/**
|
|
7
|
+
* The read surface, defined once.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* Every host surface generates its registrations from this list. A capability that appears on
|
|
11
|
+
* one surface and not another is a bug, not a decision — affordances are expected to differ,
|
|
12
|
+
* capabilities are not.
|
|
13
|
+
*
|
|
14
|
+
* Structural reads are deliberately NOT tools: `run -e "<expression>" --md` renders any SDK
|
|
15
|
+
* object through the renderer registry, so a `describe` verb would be a second copy of what
|
|
16
|
+
* code already expresses (a `describe` tool was built and removed 2026-07-30 for exactly this
|
|
17
|
+
* reason). A capability joins this list only when it is not a one-line run idiom.
|
|
18
|
+
*/
|
|
19
|
+
export declare const TOOLS: readonly Tool.Descriptor[];
|
|
20
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,YAAY,CAAC;AAE3B,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAGnC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,KAAK,EAAE,SAAS,IAAI,CAAC,UAAU,EAE3C,CAAC"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import { ITextFrame } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* One cell of a markdown table: its rendered text and horizontal alignment.
|
|
4
|
+
*/
|
|
5
|
+
export type TableCellDetails = {
|
|
6
|
+
text: string;
|
|
7
|
+
alignment: 'left' | 'right' | 'center';
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Line-buffer markdown builder.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* Deliberately small — headings, text, bullets, inline decorations and tables; the vocabulary the
|
|
14
|
+
* agent-facing reports actually use, nothing speculative. Renderers compose reports from this so
|
|
15
|
+
* table layout (column widths, alignment padding) is written once.
|
|
16
|
+
*/
|
|
17
|
+
export declare class MarkdownBuilder {
|
|
18
|
+
private readonly _lines;
|
|
19
|
+
private _headingOffset;
|
|
20
|
+
/**
|
|
21
|
+
* Shifts every subsequent heading down by `offset` levels — how one report embeds another
|
|
22
|
+
* report's sections. The section functions stay written against their own altitude (`h2` for a
|
|
23
|
+
* sheet's `Type`), and the embedding report decides where that altitude sits.
|
|
24
|
+
*/
|
|
25
|
+
setHeadingOffset(offset: number): this;
|
|
26
|
+
private _heading;
|
|
27
|
+
h1(s: string): this;
|
|
28
|
+
h2(s: string): this;
|
|
29
|
+
h3(s: string): this;
|
|
30
|
+
text(s: string): this;
|
|
31
|
+
blank(): this;
|
|
32
|
+
bullet(s: string | string[]): this;
|
|
33
|
+
/**
|
|
34
|
+
* A `Key: value` fact line, two-space indented.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* The reports' body convention — the same indent the address listings use, so every section
|
|
38
|
+
* body starts at the same column in raw text. Not a markdown bullet on purpose: renderers
|
|
39
|
+
* restyle bullets (markers, extra indent, list spacing), and these reports are read raw at
|
|
40
|
+
* least as often as rendered.
|
|
41
|
+
*/
|
|
42
|
+
fact(s: string | string[]): this;
|
|
43
|
+
bold(s: string): string;
|
|
44
|
+
codespan(s: string): string;
|
|
45
|
+
code(s: string, lang?: string): string;
|
|
46
|
+
beginFrame(headers: string[]): MarkdownFrameSection;
|
|
47
|
+
/** @internal */
|
|
48
|
+
_addLines(lines: string[]): void;
|
|
49
|
+
toLines(): string[];
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* A dataframe-style grid: an index column, column labels, minimal padding, no rules.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* The form a values grid actually wants, and the reason it is not a GFM pipe table. Three things
|
|
56
|
+
* follow from the task the grid exists for — scanning a column for the value that does not match
|
|
57
|
+
* its neighbors:
|
|
58
|
+
*
|
|
59
|
+
* - **No box characters.** Pipes and the `|---|` rule are per-row overhead that carry no
|
|
60
|
+
* information, and on a narrow screen they are what forces the wrap that breaks the column.
|
|
61
|
+
* - **Real A1 labels as index and header.** A1 addressing IS the coordinate system, and an index
|
|
62
|
+
* plus `A B C D` columns preserves it natively — which is exactly what a CSV or a `1..n` index
|
|
63
|
+
* would throw away.
|
|
64
|
+
* - **Per-cell alignment, one width per column.** A ragged column defeats the scan. Numbers
|
|
65
|
+
* right and strings left is what makes the stray text in a numeric column visible at a glance,
|
|
66
|
+
* so alignment is carried per cell and the header follows the column's dominant one.
|
|
67
|
+
*/
|
|
68
|
+
export declare class MarkdownFrameSection {
|
|
69
|
+
private readonly _parent;
|
|
70
|
+
private readonly _headers;
|
|
71
|
+
private readonly _colWidths;
|
|
72
|
+
private _indexWidth;
|
|
73
|
+
private readonly _rows;
|
|
74
|
+
constructor(_parent: MarkdownBuilder, _headers: string[]);
|
|
75
|
+
addRow(cells: (string | {
|
|
76
|
+
text: string;
|
|
77
|
+
alignment?: ITextFrame.HorizontalAlignment;
|
|
78
|
+
})[], index?: string): this;
|
|
79
|
+
endFrame(): MarkdownBuilder;
|
|
80
|
+
/** The alignment most of a column's cells use — what its header follows. */
|
|
81
|
+
private _columnAlignment;
|
|
82
|
+
private _renderLines;
|
|
83
|
+
}
|
|
84
|
+
//# sourceMappingURL=MarkdownBuilder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MarkdownBuilder.d.ts","sourceRoot":"","sources":["../../../../src/markdown/MarkdownBuilder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAE/C;;GAEG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;CACxC,CAAC;AAEF;;;;;;;GAOG;AACH,qBA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AAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,UAAU,CAAC,mBAAmB,CAAA;KAAE,CAAC,EAAE,EAChF,KAAK,CAAC,EAAE,MAAM,GACb,IAAI;IAUP,QAAQ,IAAI,eAAe;IAK3B,4EAA4E;IAC5E,OAAO,CAAC,gBAAgB;IAYxB,OAAO,CAAC,YAAY;CAsBrB"}
|
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
import { ICellRange, IAnchored, ICellRanges, INamed } from '@sheetxl/sdk';
|
|
2
|
+
import { MarkdownBuilder } from './MarkdownBuilder';
|
|
3
|
+
/**
|
|
4
|
+
* Options for the feature sections.
|
|
5
|
+
*/
|
|
6
|
+
export interface AppendFeatureOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Narrows `Counts` and the feature partition sections to these features.
|
|
9
|
+
*
|
|
10
|
+
* @defaultValue every public feature
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* A **reporting** filter, not a query one. Partitioning by feature is what
|
|
14
|
+
* {@link ICellRange.getRegions} is for and this does not duplicate it — it decides which of
|
|
15
|
+
* those partitions a report bothers to print, which is why it lives on the renderer and not on
|
|
16
|
+
* the range. `--features fill,border` on a sheet with forty formatted regions is the
|
|
17
|
+
* difference between an answer and a haystack.
|
|
18
|
+
*
|
|
19
|
+
* The scalar kinds are accepted and reach `Counts`; they have no partition to list, so they
|
|
20
|
+
* never produce a section.
|
|
21
|
+
*/
|
|
22
|
+
features?: ICellRange.Feature | readonly ICellRange.Feature[];
|
|
23
|
+
/**
|
|
24
|
+
* Cap on regions listed per feature; the report notes truncation when exceeded.
|
|
25
|
+
*
|
|
26
|
+
* @defaultValue 200 — deferred to {@link appendRegionList}, the one place the default lives.
|
|
27
|
+
*/
|
|
28
|
+
maxRegions?: number;
|
|
29
|
+
/**
|
|
30
|
+
* Profile the `Contentful` section's regions, as a standalone partition report does.
|
|
31
|
+
*
|
|
32
|
+
* @defaultValue false
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* **This adds depth, never breadth.** Profiling describes the regions a partition already
|
|
36
|
+
* returned — it cannot produce more of them, so it is not the fragmentation that combining
|
|
37
|
+
* features causes. What it costs is report LENGTH: one line per series inside each profiled
|
|
38
|
+
* block, bounded by {@link maxProfiled} and by `ProfileRegionOptions.maxSeries`.
|
|
39
|
+
*
|
|
40
|
+
* Off by default because the two callers want different budgets, not because the answer is
|
|
41
|
+
* unwanted: a sheet report was directly asked about one sheet and can afford the depth, while
|
|
42
|
+
* a workbook report is routing across up to eight of them and profiles a few per sheet.
|
|
43
|
+
*/
|
|
44
|
+
profile?: boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Cap on regions profiled in the `Contentful` section — the rest list address and size only,
|
|
47
|
+
* and the listing says how many went undescribed.
|
|
48
|
+
*
|
|
49
|
+
* @defaultValue 12 — deferred to {@link appendRegionList}.
|
|
50
|
+
*/
|
|
51
|
+
maxProfiled?: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Reporting order for the feature partitions: where the content is, then what was authored over
|
|
55
|
+
* it.
|
|
56
|
+
*
|
|
57
|
+
* @remarks
|
|
58
|
+
* Order only — **not a grouping.** Each feature is its own section headed by its own name,
|
|
59
|
+
* because a region *is* a feature partition and there is no category above it. A "Regions"
|
|
60
|
+
* heading over these would assert a thing that does not exist, and its empty case would read as
|
|
61
|
+
* "this sheet has no regions" — which cannot be true of any sheet with content.
|
|
62
|
+
*
|
|
63
|
+
* The formatting half is a set of authored layers, kept apart: direct style
|
|
64
|
+
* (`Fill`/`Border`/`NumberFormat`/`Alignment`/`Font`), conditional formatting and data validation
|
|
65
|
+
* are separate partitions and are never composed into a per-cell "what won" answer. Composition
|
|
66
|
+
* is both an expansion — a color scale produces one distinct range per cell — and lossy exactly
|
|
67
|
+
* where it matters, since a deliberately colored cell and one colored by an inherited band become
|
|
68
|
+
* indistinguishable.
|
|
69
|
+
*/
|
|
70
|
+
export declare const REPORTED_FEATURES: readonly ICellRange.Feature[];
|
|
71
|
+
/**
|
|
72
|
+
* Parses a comma-separated feature list — the `--features fill,border` flag's value.
|
|
73
|
+
*
|
|
74
|
+
* @remarks
|
|
75
|
+
* Matching is case-insensitive against the enum's values, so `Fill`, `fill` and `numberFormat`
|
|
76
|
+
* all resolve; the enum's own spelling is what comes back. An unknown name **throws with the
|
|
77
|
+
* whole vocabulary** rather than being skipped — a silently dropped feature reads as "this
|
|
78
|
+
* sheet has no fills", which is the wrong answer rather than a short one.
|
|
79
|
+
*/
|
|
80
|
+
export declare function parseFeatures(value: string): ICellRange.Feature[];
|
|
81
|
+
/** `A1:F11, 11×6` — the address plus its shape, in the same rows×columns form every region row uses. */
|
|
82
|
+
export declare const describeExtent: (range: ICellRange) => string;
|
|
83
|
+
/**
|
|
84
|
+
* The sheet name as a REFERENCE — quoted (`'My Sheet'`) exactly when a formula would need the
|
|
85
|
+
* quotes, unquoted (`Sheet1`) otherwise.
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* Every place a report prints a sheet name prints it through this, so the name on a title or a
|
|
89
|
+
* roster row is directly usable in the next call's address argument. The SDK's own quoting rule
|
|
90
|
+
* (`AddressUtils.sheetNameToString`) decides, so the reports can never disagree with the formula
|
|
91
|
+
* language about which names need quoting.
|
|
92
|
+
*/
|
|
93
|
+
export declare const describeSheetName: (name: string | null | undefined) => string;
|
|
94
|
+
/**
|
|
95
|
+
* `wb.getSheet("My Sheet")` — the range's sheet as a callable expression.
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* Not {@link describeSheetName}: that quotes for the *formula* language (`'My Sheet'!A1`), and a
|
|
99
|
+
* name needing no formula quotes comes back bare — which is a syntax error the moment it is an
|
|
100
|
+
* argument. This quotes for the expression language a recovery hint is pasted into, so every
|
|
101
|
+
* name round-trips, apostrophes included.
|
|
102
|
+
*/
|
|
103
|
+
export declare const describeSheetCall: (range: ICellRange) => string;
|
|
104
|
+
/** `A1:D10,F1:F20` — every range an item is anchored to, as one address. */
|
|
105
|
+
export declare const describeRanges: (ranges: ICellRanges) => string;
|
|
106
|
+
/**
|
|
107
|
+
* `Sheet1!A1:D10,F1:F20` — a ranged item's whole anchor, sheet-qualified.
|
|
108
|
+
*
|
|
109
|
+
* @remarks
|
|
110
|
+
* A conditional format, a data validation or any other {@link IAnchored} is anchored to a SET of
|
|
111
|
+
* ranges, which its own report leads with. Qualified for the same reason a title always is: the
|
|
112
|
+
* first line of a report is the next call's argument.
|
|
113
|
+
*/
|
|
114
|
+
export declare const describeQualifiedRanges: (ranges: ICellRanges) => string;
|
|
115
|
+
/** `'My Sheet'!A1:F11, 11×6` — the extent, sheet-qualified the way a title carries it. */
|
|
116
|
+
export declare const describeQualifiedExtent: (range: ICellRange) => string;
|
|
117
|
+
/**
|
|
118
|
+
* Appends the `Kind` section — what the contentful cells ARE, kind by kind.
|
|
119
|
+
*
|
|
120
|
+
* @remarks
|
|
121
|
+
* The heading carries the contentful count; the fact lines are the scalar kinds. This replaced
|
|
122
|
+
* the old `Counts` section, which mixed two vocabularies: the kinds (which have no partition to
|
|
123
|
+
* list) and the features (which do, and now carry their cell counts on their own section
|
|
124
|
+
* headings). What remains here is exactly the value-shape question — "5 cells: 3 strings, 2
|
|
125
|
+
* numbers".
|
|
126
|
+
*
|
|
127
|
+
* Read off `range.getStats().getTypedCounts()` — the same single value-scan `renderStats` and
|
|
128
|
+
* `profileKinds` already read — rather than `getCounts()`: `getCounts([Feature.Number, ...])` is a
|
|
129
|
+
* SECOND, independent value-scan inside the engine (`Sheet._featureCounts`'s own comment says so
|
|
130
|
+
* — "the scalar kinds ... count from values in one pass"), answering the identical question. One
|
|
131
|
+
* scan, one source of truth, and `RichData` is no longer a silent zero — it falls out of the same
|
|
132
|
+
* typed counts for free, where the old `Feature`-keyed list had nowhere to carry it (`Feature` has
|
|
133
|
+
* no `RichData` member).
|
|
134
|
+
*
|
|
135
|
+
* `Date` is the one line still read through a dedicated pass — `countDates`, a value scan via
|
|
136
|
+
* `getInteropType()`. It is not a `ScalarType` at all — it is numeric value ∩ date-category
|
|
137
|
+
* format — and `Feature.DateFormat` alone would overcount (a blank or text cell carrying that
|
|
138
|
+
* format is not a date). A date cell counts as both `Number` and `Date`, so the lines need not
|
|
139
|
+
* sum to the heading. Zero kinds are elided, and blanks appear nowhere — empty is not a kind of
|
|
140
|
+
* content.
|
|
141
|
+
*/
|
|
142
|
+
export declare function appendKinds(md: MarkdownBuilder, range: ICellRange): void;
|
|
143
|
+
/**
|
|
144
|
+
* Appends one section per feature partition, headed by the feature's own name.
|
|
145
|
+
*
|
|
146
|
+
* @remarks
|
|
147
|
+
* **A region is a feature partition, so the feature is the heading.** There is no umbrella
|
|
148
|
+
* section above these and deliberately so: a heading like `Regions` would name a category that
|
|
149
|
+
* does not exist, and its empty case — "Regions: None" — would assert something that cannot be
|
|
150
|
+
* true of a sheet holding content. What can be empty is one partition, and that is said by the
|
|
151
|
+
* section simply not being there.
|
|
152
|
+
*
|
|
153
|
+
* A feature with no regions is therefore elided; its absence needs no line. The addresses here
|
|
154
|
+
* are what a values read consumes, so the structural map and the follow-up call share one
|
|
155
|
+
* vocabulary.
|
|
156
|
+
*
|
|
157
|
+
* **Each heading carries both counts** — `Formula (401 cells · 2 regions)`. Cells is the
|
|
158
|
+
* decide-number (how much of this is here) and leads, everywhere; regions is the locate-number
|
|
159
|
+
* (how fragmented) — D6's line, on one heading. The ratio between them is the fragmentation
|
|
160
|
+
* signal: 401 cells in 2 regions is a model, 401 cells in 300 regions is noise, and the reader
|
|
161
|
+
* sees which before paying for a drill.
|
|
162
|
+
*/
|
|
163
|
+
export declare function appendRegions(md: MarkdownBuilder, range: ICellRange, options?: AppendFeatureOptions): void;
|
|
164
|
+
/**
|
|
165
|
+
* Options for {@link appendNames}.
|
|
166
|
+
*/
|
|
167
|
+
export interface AppendNamesOptions {
|
|
168
|
+
/**
|
|
169
|
+
* Cap on listed names; the section notes truncation when exceeded.
|
|
170
|
+
*
|
|
171
|
+
* @defaultValue 200 — the standalone name manager's. The workbook report passes a tighter one.
|
|
172
|
+
*/
|
|
173
|
+
maxNames?: number;
|
|
174
|
+
/**
|
|
175
|
+
* The section heading, without its count.
|
|
176
|
+
*
|
|
177
|
+
* @defaultValue `Names`
|
|
178
|
+
*/
|
|
179
|
+
heading?: string;
|
|
180
|
+
/**
|
|
181
|
+
* How to recover the rows the cap ate — appended to the overflow line.
|
|
182
|
+
*
|
|
183
|
+
* @defaultValue a pointer at `getByName`
|
|
184
|
+
*/
|
|
185
|
+
recovery?: string;
|
|
186
|
+
/**
|
|
187
|
+
* The full symbol table that identifier checks resolve against, when `names` is a subset.
|
|
188
|
+
*
|
|
189
|
+
* @defaultValue the `names` argument itself
|
|
190
|
+
*
|
|
191
|
+
* @remarks
|
|
192
|
+
* The roster often renders a FILTERED view — one kind's group, one sheet's intersecting names —
|
|
193
|
+
* and an identifier must not be reported missing merely because its target fell outside the
|
|
194
|
+
* filter. A caller rendering a subset passes the unfiltered collection here; tables included,
|
|
195
|
+
* since a bare `Sales` in an expression is a `named` token that resolves to a table.
|
|
196
|
+
*/
|
|
197
|
+
symbols?: readonly INamed[];
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* A name's spelling as a formula would write it — qualified when it is scoped to one sheet.
|
|
201
|
+
*
|
|
202
|
+
* @remarks
|
|
203
|
+
* Decision over a `Scope` column: `'EU Ops'!Rate` is compact, distinguishes two names that differ
|
|
204
|
+
* only by scope without a second column to cross-read, and is exactly the text the next call takes
|
|
205
|
+
* as an argument. A blank scope column on every global name would cost more and say less.
|
|
206
|
+
*/
|
|
207
|
+
export declare const describeQualifiedName: (named: INamed) => string;
|
|
208
|
+
/**
|
|
209
|
+
* Appends the defined-name roster — one row per name, sorted for triage.
|
|
210
|
+
*
|
|
211
|
+
* @remarks
|
|
212
|
+
* **The symbol table, at one altitude.** `=Revenue*(1+TaxRate)` is unreadable without it, and a
|
|
213
|
+
* name broken by a sheet delete is a root cause that produces no cell error until something
|
|
214
|
+
* references it. Names are bounded (tens of rows, a handful of tokens each), so they are shown in
|
|
215
|
+
* full by default; the cap is a guard against books that accumulated hundreds of junk names
|
|
216
|
+
* through sheet copying, not a budget.
|
|
217
|
+
*
|
|
218
|
+
* **One section, never split by kind.** A named formula and a named range are not separate
|
|
219
|
+
* listings: splitting them would defeat the sort below, letting a broken named formula sort under
|
|
220
|
+
* a healthy named range purely because of which section it landed in. Every question the
|
|
221
|
+
* distinction answers is already a mark on the row — whether `Refers To` is navigable
|
|
222
|
+
* (`=Sales!$B$2:$B$100` versus `=0.21`), `(volatile)`, `(does not resolve)`.
|
|
223
|
+
*
|
|
224
|
+
* **Broken names are their own block**, directly under the heading — `N do not resolve:` and a
|
|
225
|
+
* table whose `Error` column carries the cause (`#REF!`, `#NAME?: Gone`). A trailing
|
|
226
|
+
* `(does not resolve)` inside `Refers To` was the least findable place for the one fact that must
|
|
227
|
+
* be found: it landed at a varying x-position at the end of the widest column. The block's mere
|
|
228
|
+
* EXISTENCE is the alarm, its heading carries the count, and the `Error` column is populated on
|
|
229
|
+
* every row it prints — where the same column in one shared table would be blank padding on every
|
|
230
|
+
* healthy row. A healthy book pays nothing: no broken names, no block, exactly as `Hidden` and
|
|
231
|
+
* `Comment` only exist when some row has one.
|
|
232
|
+
*
|
|
233
|
+
* **Then the main table, sorted by dependents descending, alphabetical on ties.** A reader's
|
|
234
|
+
* order — load-bearing symbols, then trivia — and it makes the cap safe by construction, since
|
|
235
|
+
* truncation can only eat the tail. It needs no special case for zeros: they sink on their own,
|
|
236
|
+
* which is how hidden junk like `_FilterDatabase` disappears without being filtered.
|
|
237
|
+
*
|
|
238
|
+
* **Dependents counts cells AND names** — see {@link describeDependents}. A name referenced only
|
|
239
|
+
* by other names is load-bearing, and counting cells alone reported it as `unused` and sorted it
|
|
240
|
+
* to the bottom with the junk. A global name that is unused while a sheet-scoped twin wins the
|
|
241
|
+
* binding says `unused · shadowed` — the word alone reads as safe-to-delete, and the shadow is
|
|
242
|
+
* often exactly why nothing reaches it. There is deliberately no `Value` column: a name with relative
|
|
243
|
+
* references or implicit intersection evaluates PER CALLING CELL, so a single value is not well
|
|
244
|
+
* defined, and for a reference name the value is grid data — which structure reports never carry.
|
|
245
|
+
*
|
|
246
|
+
* `Hidden` and `Comment` appear only when some row has one — per block. `false` on every visible
|
|
247
|
+
* row is token noise, and blank-means-normal is how these reports already speak.
|
|
248
|
+
*/
|
|
249
|
+
export declare function appendNames(md: MarkdownBuilder, names: readonly INamed[], options?: AppendNamesOptions): void;
|
|
250
|
+
/**
|
|
251
|
+
* Options for the dependency trees.
|
|
252
|
+
*/
|
|
253
|
+
export interface AppendDependencyOptions {
|
|
254
|
+
/**
|
|
255
|
+
* How many hops from the subject to walk.
|
|
256
|
+
*
|
|
257
|
+
* @defaultValue 3
|
|
258
|
+
*/
|
|
259
|
+
maxDepth?: number;
|
|
260
|
+
/**
|
|
261
|
+
* Cap on nodes per tree; the tree notes truncation when exceeded.
|
|
262
|
+
*
|
|
263
|
+
* @defaultValue 50
|
|
264
|
+
*/
|
|
265
|
+
maxNodes?: number;
|
|
266
|
+
}
|
|
267
|
+
/** The calculation-graph surface shared by {@link ICell} and {@link ICellRange}. */
|
|
268
|
+
export interface DependencySource {
|
|
269
|
+
getDirectPrecedents(): ICellRanges | null;
|
|
270
|
+
getPrecedents(): ICellRanges | null;
|
|
271
|
+
getDirectDependents(): ICellRanges | null;
|
|
272
|
+
getDependents(): ICellRanges | null;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Appends the `Precedents` and `Dependents` trees for anything that exposes the calculation
|
|
276
|
+
* graph — a cell or a range, which answer the same questions with the same shape.
|
|
277
|
+
*
|
|
278
|
+
* @remarks
|
|
279
|
+
* **A tree, walked one hop at a time, rather than a `direct`/`all` pair.** The flat form gives
|
|
280
|
+
* the two ends of the chain and throws away everything between them: `D6` reading `B2:D4`
|
|
281
|
+
* "eventually" does not say whether that is one indirection or nine, and the shape is the thing a
|
|
282
|
+
* reader is actually trying to see. Repeated `getDirect*` calls cost the same as one `getAll*`
|
|
283
|
+
* — the graph is indexed either way — so the tree is strictly more answer for the same work.
|
|
284
|
+
*
|
|
285
|
+
* Each node carries its **payload at the right altitude**: a single cell shows its value, a
|
|
286
|
+
* multi-cell range shows its size. A range node is not expanded into cells; that is the same
|
|
287
|
+
* expansion the region rules exist to prevent.
|
|
288
|
+
*
|
|
289
|
+
* Bounded three ways, each stated in the output rather than applied silently — depth, node count,
|
|
290
|
+
* and revisits.
|
|
291
|
+
*
|
|
292
|
+
* **The two kinds of revisit get different marks, and that distinction is the point.** A node
|
|
293
|
+
* reached twice by different branches is a re-convergence: completely normal in any model, and
|
|
294
|
+
* marked `↑ shown above`. A node reached again while it is still on the current path is a
|
|
295
|
+
* genuine cycle — a defect, or a deliberate iterative calculation — and is marked `↺ circular`.
|
|
296
|
+
* One glyph for both would bury the second inside a busy tree, and it is the one finding here
|
|
297
|
+
* that cannot afford to be missed.
|
|
298
|
+
*/
|
|
299
|
+
export declare function appendDependencies(md: MarkdownBuilder, target: DependencySource, options?: AppendDependencyOptions): void;
|
|
300
|
+
/**
|
|
301
|
+
* How a graph member LABELS itself: its address, the sheet it lives on, and whether it is a name.
|
|
302
|
+
*
|
|
303
|
+
* @remarks
|
|
304
|
+
* Shared by the tree and the flat {@link ICellRanges} listing, so the two cannot label the same
|
|
305
|
+
* member differently — the flat list is the tree's rows without the hop structure, and a reader
|
|
306
|
+
* comparing them is comparing the same text.
|
|
307
|
+
*
|
|
308
|
+
* A name member leads with its NAME: its address is only an anchor, and two names authored from
|
|
309
|
+
* the same cell would otherwise print as identical, anonymous cells.
|
|
310
|
+
*
|
|
311
|
+
* The address comes back **unqualified**. A listing standing on one sheet says so once, in its
|
|
312
|
+
* heading; a qualifier goes back on every row only when the collection spans sheets, which is the
|
|
313
|
+
* caller's decision because only the caller has seen every member. A trailing `!` is `#REF!`, not
|
|
314
|
+
* a qualifier, so it is left whole.
|
|
315
|
+
*/
|
|
316
|
+
export declare function describeNodeLabel(range: ICellRange): {
|
|
317
|
+
address: string;
|
|
318
|
+
sheet: string;
|
|
319
|
+
isName: boolean;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* A node's payload: the value for a single cell, the size for a range.
|
|
323
|
+
*
|
|
324
|
+
* @remarks
|
|
325
|
+
* The whole point of walking as a tree rather than listing addresses — `1,204,880` beside
|
|
326
|
+
* `Model!O30` is what makes the chain readable as a model rather than as a set of coordinates.
|
|
327
|
+
* A formula node shows its expression too, because at that point the node explains itself.
|
|
328
|
+
*
|
|
329
|
+
* Shared with the flat {@link ICellRanges} listing (`renderRanges`) for the same reason
|
|
330
|
+
* {@link describeNodeLabel} is: the flat list is these rows without the hop structure, so the two
|
|
331
|
+
* shapes cannot be allowed to drift into describing one member two ways.
|
|
332
|
+
*/
|
|
333
|
+
export declare function describeNode(range: ICellRange): string;
|
|
334
|
+
/**
|
|
335
|
+
* One rule listing — `## Conditional Formats (2)` over ` A1:D10 > 100 → fill #FFFF00` rows.
|
|
336
|
+
*
|
|
337
|
+
* @remarks
|
|
338
|
+
* **Anchored by ranges, so the row leads with them rather than with a cell address.** These are
|
|
339
|
+
* the ranged items' own extents, which is the fact a region listing cannot give: a partition says
|
|
340
|
+
* which CELLS a rule reaches inside the report's scope, and this says what the rule itself covers —
|
|
341
|
+
* `A1:D10` even when the report is about `B2`. The two together are how a reader tells a rule that
|
|
342
|
+
* happens to clip this range from one written for it.
|
|
343
|
+
*
|
|
344
|
+
* The rules are listed in evaluation order, which is the order the collection holds them in: for
|
|
345
|
+
* conditional formats that order decides which of two rules paints a cell, so re-sorting the
|
|
346
|
+
* listing would hide the very relationship `stop if true` is read against.
|
|
347
|
+
*/
|
|
348
|
+
export declare function appendRules<T extends IAnchored>(md: MarkdownBuilder, heading: string, items: readonly T[], describe: (item: T) => string): void;
|
|
349
|
+
/**
|
|
350
|
+
* Appends the sheet-level objects that intersect `range`: named ranges, hidden headers, tables,
|
|
351
|
+
* conditional formats and data validations.
|
|
352
|
+
*
|
|
353
|
+
* @remarks
|
|
354
|
+
* Scoped, not sheet-wide — a report about `A1:D4` that lists a table over `H40:M90` is
|
|
355
|
+
* answering a question nobody asked. The sheet report passes the used range, so at that scope
|
|
356
|
+
* the filter is a no-op and the two reports stay one code path.
|
|
357
|
+
*
|
|
358
|
+
* **A section with nothing in it is not printed.** Most sheets have no named ranges, no hidden
|
|
359
|
+
* headers and no tables, so the alternative is four headings of `None` on every report — pure
|
|
360
|
+
* token cost on the common path, and it buries the sections that do carry something. Absence is
|
|
361
|
+
* already how these reports say "not here".
|
|
362
|
+
*/
|
|
363
|
+
export declare function appendSheetObjects(md: MarkdownBuilder, range: ICellRange): void;
|
|
364
|
+
//# sourceMappingURL=appendSections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appendSections.d.ts","sourceRoot":"","sources":["../../../../src/markdown/appendSections.ts"],"names":[],"mappings":"AAAA,OAAO,EACuB,UAAU,EAAc,KAAK,SAAS,EAC3C,KAAK,WAAW,EAAoB,KAAK,MAAM,EAEvE,MAAM,cAAc,CAAC;AAMtB,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAoBzD;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC,OAAO,GAAG,SAAS,UAAU,CAAC,OAAO,EAAE,CAAC;IAC9D;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;;;;;;;;;;;OAcG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,eAAO,MAAM,iBAAiB,EAAE,SAAS,UAAU,CAAC,OAAO,EAuB1D,CAAC;AAgBF;;;;;;;;GAQG;AACH,wBAAgB,aAAa,CAAC,KAAK,E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CAAC,EAAE,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,GAAG,IAAI,CA6E/E"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a listing stops.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Every capped section answers the same question — *print the next row, or print the notice that
|
|
6
|
+
* says I am not going to?* — and near the end of a list the notice is the worse answer.
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* How many of `total` to print, given a page size.
|
|
10
|
+
*
|
|
11
|
+
* @param total How many there are.
|
|
12
|
+
* @param pageSize The page — a caller's cap where they named one, otherwise the section's default.
|
|
13
|
+
*
|
|
14
|
+
* @returns `total` when the remainder is too short to be worth a truncation notice, else `pageSize`.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* Applied the same way whoever chose the page size, because it is a property of paging and not of
|
|
18
|
+
* provenance: a reader who asks for thirty and has thirty-two wants the thirty-two just as much as
|
|
19
|
+
* a reader who asked for nothing. What it needs is `total` up front, so it belongs to listings over
|
|
20
|
+
* something already counted — a name roster, a materialized partition — not to a streaming scan
|
|
21
|
+
* that would have to read further to find out.
|
|
22
|
+
*/
|
|
23
|
+
export declare const pageWithLookahead: (total: number, pageSize: number) => number;
|
|
24
|
+
//# sourceMappingURL=caps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"caps.d.ts","sourceRoot":"","sources":["../../../../src/markdown/caps.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoBH;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,EAAE,UAAU,MAAM,KAAG,MAClB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { ICellRange, ICellRegion, IStyle } from '@sheetxl/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* Describes one region's payload — the anchor cell's read for the feature that produced it.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* A region is uniform by construction, so a single line of payload describes every cell in it.
|
|
7
|
+
* Returning `null` means "this feature has nothing to say per region" (the address *is* the
|
|
8
|
+
* fact) and the listing prints the address alone.
|
|
9
|
+
*/
|
|
10
|
+
export interface RegionPayload {
|
|
11
|
+
(region: ICellRegion): string | null;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* The payload describer for one feature, or `undefined` when the address is the whole fact.
|
|
15
|
+
*
|
|
16
|
+
* @remarks
|
|
17
|
+
* A region is uniform by construction, so the anchor cell's read describes every cell in it —
|
|
18
|
+
* that is what makes a payload one line rather than a column of repeats. It is also why the
|
|
19
|
+
* formula payload is honest for a block: `getRegions` groups formulas by canonical R1C1, so
|
|
20
|
+
* `D2:D4` really is one authored `=B2*C2`.
|
|
21
|
+
*
|
|
22
|
+
* **A payload is never a computed value.** `=B2*C2` is authored content, the same kind of fact
|
|
23
|
+
* as a fill color; `2398.8` is data, and data is a values read. This is the line that keeps the
|
|
24
|
+
* sheet report bounded.
|
|
25
|
+
*
|
|
26
|
+
* **A feature with no describer here prints its address alone**, which for most of them is a
|
|
27
|
+
* lie of omission rather than a fact — see the TODOs below. The goal is that every partition
|
|
28
|
+
* says something useful about what it found.
|
|
29
|
+
*/
|
|
30
|
+
export declare function regionPayload(feature: ICellRange.Feature, normal: IStyle | null): RegionPayload | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* One payload describer covering **every** feature a partition was built from.
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* A refined partition is asked for precisely when the *relationship between* features is the
|
|
36
|
+
* question — `['formula', 'font']` pairs what each cell computes with the color a human sees, and
|
|
37
|
+
* a listing that showed only one half answered half of it. Each feature contributes its own
|
|
38
|
+
* payload and they join in the order the caller named them, so the row reads as the tuple the
|
|
39
|
+
* partition actually splits on.
|
|
40
|
+
*
|
|
41
|
+
* Features with nothing to say per region (`AutoTable`, `Unlock`) contribute nothing rather than
|
|
42
|
+
* an empty column, and a partition where none of them do returns `undefined` so the listing stays
|
|
43
|
+
* addresses-only.
|
|
44
|
+
*/
|
|
45
|
+
export declare function regionPayloads(features: readonly ICellRange.Feature[], normal: IStyle | null): RegionPayload | undefined;
|
|
46
|
+
//# sourceMappingURL=describeRegionPayload.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"describeRegionPayload.d.ts","sourceRoot":"","sources":["../../../../src/markdown/describeRegionPayload.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,KAAK,WAAW,EAAE,KAAK,MAAM,EAAE,MAAM,cAAc,CAAC;AAczE;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC5B,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,GAAG,IAAI,CAAC;CACtC;AAsBD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,UAAU,CAAC,OAAO,EAC3B,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,aAAa,GAAG,SAAS,CAoF3B;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,SAAS,UAAU,CAAC,OAAO,EAAE,EACvC,MAAM,EAAE,MAAM,GAAG,IAAI,GACpB,aAAa,GAAG,SAAS,CAU3B"}
|