@sheetxl/query 0.8.0-beta.6 → 0.8.0-beta.9

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sheetxl/query",
3
3
  "description": "SheetXL - Workbook read surface and renderers (grep, reports) — capabilities declared once, adapted by any host surface",
4
- "version": "0.8.0-beta.6",
4
+ "version": "0.8.0-beta.9",
5
5
  "license": "SEE LICENSE IN <LICENSE>",
6
6
  "type": "module",
7
7
  "exports": {
@@ -43,8 +43,8 @@
43
43
  "query"
44
44
  ],
45
45
  "dependencies": {
46
- "@sheetxl/primitives": "^0.8.0-beta.6",
47
- "@sheetxl/sdk": "^0.8.0-beta.6"
46
+ "@sheetxl/primitives": "^0.8.0-beta.9",
47
+ "@sheetxl/sdk": "^0.8.0-beta.9"
48
48
  },
49
49
  "devDependencies": {
50
50
  "@types/node": "^26.1.2"
@@ -15,7 +15,7 @@ import { ICell, Scalar } from '@sheetxl/sdk';
15
15
  *
16
16
  * ---
17
17
  *
18
- * **Quarantine note.** `ICell.getText()` is the only SDK call this module makes, and it is on its
18
+ * **Quarantine note.** `ICell.getText()` is the only SDK text call this module makes, and it is on its
19
19
  * way out — its contract fuses formatting, localization, csv escaping and this encoding into one
20
20
  * method with no clear answer for large values. It is isolated to this file deliberately: when
21
21
  * the SDK splits pure number formatting away from the encoding, exactly one file changes and no
@@ -35,12 +35,14 @@ export declare namespace CellEncoding {
35
35
  */
36
36
  readonly Display: "display";
37
37
  /**
38
- * The cell as the formula bar shows it — full precision, number formatting stripped.
38
+ * The stored scalar — what `getValue()` returns, with no number format applied.
39
39
  *
40
40
  * @remarks
41
- * `1234.5678` where {@link Mode.Display | display} shows `$1,234.57`. Dates stay dates
42
- * rather than decaying to serials, so the result is still searchable rather than merely
43
- * lossless.
41
+ * `1234.5678` where {@link Mode.Display | display} shows `$1,234.57`, `0.04` where it shows
42
+ * `4%`, and a date as its serial. A reader wants one of two things: what the grid shows, or
43
+ * what a formula computes with. There is deliberately no layer in between — the formula
44
+ * bar's text (`4%` at full precision, dates kept) is the stored scalar restyled by the
45
+ * format's category, and both of those are already reported.
44
46
  */
45
47
  readonly Value: "value";
46
48
  };
@@ -137,8 +139,8 @@ export declare function encodeCell(cell: ICell, mode: CellEncoding.Mode): CellEn
137
139
  * The counterpart to {@link encodeCell} for the stateless value layer (`IRange`, `Scalar[][]`),
138
140
  * where there is no cell to ask for text and therefore **no number format to apply**. That is
139
141
  * the whole difference: `0.04` encodes as `0.04` here and as `4%` through a cell that formats
140
- * it. There is consequently no `mode` — the two modes differ only by how much formatting they
141
- * apply, and here there is none to strip.
142
+ * it. There is consequently no `mode` — this is what {@link CellEncoding.Mode.Value} produces
143
+ * for a cell, and the only form a bare value has.
142
144
  *
143
145
  * Everything above formatting is identical, because it is the same contract: the `'` prefix on
144
146
  * strings, `TRUE`/`FALSE`, error labels, blank elision.
@@ -8,7 +8,7 @@
8
8
  * The rule, which predicts any future member:
9
9
  * **a grep field is a layer whose text was authored by a person or is read by one.**
10
10
  *
11
- * `display`, `value` and `raw` are read; `formula`, `hyperlink` and `numberFormat` are authored.
11
+ * `display` and `value` are read; `formula`, `hyperlink` and `numberFormat` are authored.
12
12
  * A layer that fails the rule fails it because its payload has no canonical text — a fill's
13
13
  * "red" may be stored as `FF0000`, a theme slot, or an indexed palette entry, so any pattern
14
14
  * against it silently matches less than it claims: a confident wrong answer, which is worse
@@ -40,28 +40,18 @@ export type GrepField =
40
40
  */
41
41
  'display'
42
42
  /**
43
- * The cell as the formula bar shows it — most formatting stripped, **category kept**.
43
+ * The stored scalar — what `getValue()` returns, with no number format applied.
44
44
  *
45
- * `1234.5678` where {@link GrepField | display} shows `$1,234.57` — but `40%` stays `40%`
46
- * and dates stay dates, because the formula bar keeps minimal formatting for percents,
47
- * dates and times (Excel's behavior, faithfully). This is *not* the underlying scalar:
48
- * a percent cell storing `0.4` reads `40%` here. The stored scalar is
49
- * {@link GrepField | raw}.
45
+ * `1234.5678` where {@link GrepField | display} shows `$1,234.57`, `0.4` where it shows `40%`,
46
+ * dates as serial numbers. This is the layer a cell report's `Value` line and the `IRange` /
47
+ * stats reads print, so it is the field that makes *those* printed values greppable — the
48
+ * round-trip that `display` provides for formatted reads. Not a default: serials and
49
+ * unrounded floats are noise until they are the question.
50
50
  *
51
51
  * Identical to `display` for every cell whose format only decorates (`General`, plain
52
- * text) — the default search dedupes that case per cell rather than reporting both.
52
+ * text) — a search of both dedupes that case per cell rather than reporting it twice.
53
53
  */
54
54
  | 'value'
55
- /**
56
- * The stored scalar, encoded bare — what the stateless value layer prints.
57
- *
58
- * `0.4` where {@link GrepField | value} shows `40%`; dates as serial numbers. This is the
59
- * layer `IRange` / stats reads print (they have no cell to format through), so it is the
60
- * field that makes *those* printed values greppable — the round-trip that `display`
61
- * provides for formatted reads. Not a default: serials and unrounded floats are noise
62
- * until they are the question.
63
- */
64
- | 'raw'
65
55
  /** Formula text, A1 style (`=SUM(A1:A10)`). Cells without a formula contribute nothing. */
66
56
  | 'formula'
67
57
  /** Hyperlink target — the address, not the display text (which is already `display`). */
@@ -109,7 +99,6 @@ export type GrepField =
109
99
  export declare const GrepField: {
110
100
  readonly Display: "display";
111
101
  readonly Value: "value";
112
- readonly Raw: "raw";
113
102
  readonly Formula: "formula";
114
103
  readonly Hyperlink: "hyperlink";
115
104
  readonly NumberFormat: "numberFormat";
@@ -124,16 +113,15 @@ export declare const GREP_FIELDS: readonly GrepField[];
124
113
  * The default field set.
125
114
  *
126
115
  * @remarks
127
- * What you can see, what the formula bar shows, and what is structurally behind both.
128
- * `value` is a default *because* the search dedupes it: for the majority of cells it is
129
- * byte-identical to `display` and is suppressed per cell, so it only surfaces where it
130
- * carries new information — `1234.5678` behind `$1,234.57`. A duplicate hit costs an agent
131
- * a second look for no new information; a missing layer costs a silent zero-hit miss on
132
- * full-precision searches, which is worse.
116
+ * What you can see and what is structurally behind it. `value` is opt-in: a search is almost
117
+ * always for text as the grid shows it, and the stored scalar in a default search makes every
118
+ * numeric pattern hit date serials and unrounded floats nobody was looking at. The search that
119
+ * wants it — a full-precision number copied from a stats read or a cell report's `Value` line —
120
+ * knows it does, and asks with `fields: ['value']`.
133
121
  *
134
- * The layers off the grid are defaults by the same argument. A caller who has to ask for
135
- * `shape` already knows the callout is there; the search that needs it is the one that does
136
- * not. They cost one pass over a sheet's objects, not over its cells.
122
+ * The layers off the grid are defaults. A caller who has to ask for `shape` already knows the
123
+ * callout is there; the search that needs it is the one that does not. They cost one pass over a
124
+ * sheet's objects, not over its cells.
137
125
  */
138
126
  export declare const GREP_FIELDS_DEFAULT: readonly GrepField[];
139
127
  /** What a grep result should carry. */
@@ -178,7 +166,7 @@ export interface GrepArgs {
178
166
  * Which layers to search.
179
167
  *
180
168
  * @defaultValue {@link GREP_FIELDS_DEFAULT} —
181
- * `['display', 'value', 'formula', 'comment', 'shape', 'chart', 'name']`
169
+ * `['display', 'formula', 'comment', 'shape', 'chart', 'name']`
182
170
  */
183
171
  fields?: readonly GrepField[];
184
172
  /**
@@ -1,4 +1,4 @@
1
- import { ICellRange, IAnchored, ICellRanges, ICellRegion, INamed } from '@sheetxl/sdk';
1
+ import { ICellRange, IAnchored, ICellRanges, ICellRegion, INamed, ISheet } from '@sheetxl/sdk';
2
2
  import { MarkdownBuilder } from './MarkdownBuilder';
3
3
  /**
4
4
  * Options for the feature sections.
@@ -248,6 +248,15 @@ export declare const describeQualifiedName: (named: INamed) => string;
248
248
  * row is token noise, and blank-means-normal is how these reports already speak.
249
249
  */
250
250
  export declare function appendNames(md: MarkdownBuilder, names: readonly INamed[], options?: AppendNamesOptions): Promise<void>;
251
+ /**
252
+ * The outline in a line — `rows 2 levels, 3 groups (1 collapsed) · columns 1 level, 1 group` —
253
+ * or `null` when nothing is grouped.
254
+ *
255
+ * @remarks
256
+ * Counts only: the groups themselves (level, span, summary, collapsed) are `IOutline.getGroups`,
257
+ * which is also what a script reads, so the report routes there instead of listing them.
258
+ */
259
+ export declare function describeOutline(sheet: ISheet): string | null;
251
260
  /**
252
261
  * One rule listing — `## Conditional Formats (2)` over ` A1:D10 > 100 → fill #FFFF00` rows.
253
262
  *
@@ -0,0 +1,30 @@
1
+ import { IShape } 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
+ /** The content rotation a shape read from a file states, for a movable that has none of its own. */
29
+ export declare const shapeRotation: (shape: IShape) => number;
30
+ //# sourceMappingURL=describeShape.d.ts.map
@@ -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';
@@ -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 { 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 {
@@ -90,4 +90,15 @@ export declare function appendMovables(md: MarkdownBuilder, movables: readonly I
90
90
  * fact rather than the title.
91
91
  */
92
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;
93
104
  //# sourceMappingURL=renderMovable.d.ts.map