@ex-grid/sheet 0.0.0-stage → 0.2.0-beta.3

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.
@@ -0,0 +1,1637 @@
1
+ /**
2
+ * ExSheet's Script Core (ADR-0370, section 1): a general-purpose Excel-like sheet drawn by ExGrid as that grid's
3
+ * Consumer (ADR-0046), over `@ex-grid/sheet-engine`, free of any UI framework — `createSheet`, and what the Sheet
4
+ * decides beside its engine: the words it shows, by id, in English and Japanese; Format Cells' offer and draft; the
5
+ * Name Box; Excel's keys; where Ctrl+arrow stops; the Selection Summary's cells; what a change widens; and Pointing
6
+ * at a Linked Table's grid. A Framework Adapter mounts it, as `@ex-grid/sheet-react` does.
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+
11
+ import { BorderLine } from '@ex-grid/sheet-engine';
12
+ import { BorderLineStyle } from '@ex-grid/sheet-engine';
13
+ import { CellAddress } from '@ex-grid/sheet-engine';
14
+ import { CellColour } from '@ex-grid/sheet-engine';
15
+ import { CellFill } from '@ex-grid/sheet-engine';
16
+ import { CellFormat } from '@ex-grid/sheet-engine';
17
+ import { CellFormatChange } from '@ex-grid/sheet-engine';
18
+ import { CellRange } from '@ex-grid/sheet-engine';
19
+ import type { CommitRefusalReason } from '@ex-grid/core';
20
+ import type { CopyRefusalReason } from '@ex-grid/core';
21
+ import { Culture } from '@ex-grid/sheet-engine';
22
+ import type { EditDiscardReason } from '@ex-grid/core';
23
+ import { FormulaSyntaxError } from '@ex-grid/sheet-engine';
24
+ import { GridChrome } from '@ex-grid/core';
25
+ import { GridDensity } from '@ex-grid/core';
26
+ import type { GridDirection } from '@ex-grid/core';
27
+ import type { GridExtent } from '@ex-grid/core';
28
+ import type { GridOutlinedColumn } from '@ex-grid/core';
29
+ import type { GridPointArrow } from '@ex-grid/core';
30
+ import type { GridPointDashes } from '@ex-grid/core';
31
+ import { GridPointedAt } from '@ex-grid/core';
32
+ import type { GridPointedPress } from '@ex-grid/core';
33
+ import type { GridPointedPressKind } from '@ex-grid/core';
34
+ import type { GridPointedStep } from '@ex-grid/core';
35
+ import type { GridPointedStepKind } from '@ex-grid/core';
36
+ import type { GridPointState } from '@ex-grid/core';
37
+ import { GridPresentationDefaults } from '@ex-grid/core';
38
+ import { GridSelection } from '@ex-grid/core';
39
+ import type { GridSummaryRequest } from '@ex-grid/core';
40
+ import type { GridSummaryResult } from '@ex-grid/core';
41
+ import { HorizontalAlignment } from '@ex-grid/sheet-engine';
42
+ import type { LinkedTable } from '@ex-grid/sheet-engine';
43
+ import type { LinkedTableColumn } from '@ex-grid/sheet-engine';
44
+ import { NumberFormat } from '@ex-grid/sheet-engine';
45
+ import type { PasteRefusalReason } from '@ex-grid/core';
46
+ import type { PlacementRefusalReason } from '@ex-grid/core';
47
+ import type { PointedAtGrid } from '@ex-grid/core';
48
+ import type { ReferenceColour } from '@ex-grid/core';
49
+ import { SelectionSummary } from '@ex-grid/core';
50
+ import { Sheet } from '@ex-grid/sheet-engine';
51
+ import { SheetChange } from '@ex-grid/sheet-engine';
52
+ import { SheetDay } from '@ex-grid/sheet-engine';
53
+ import { SheetDocument } from '@ex-grid/sheet-engine';
54
+ import { SheetEdit } from '@ex-grid/sheet-engine';
55
+ import { SheetRefusal } from '@ex-grid/sheet-engine';
56
+ import { SheetSize } from '@ex-grid/sheet-engine';
57
+ import { SummaryFigure } from '@ex-grid/core';
58
+ import { Value } from '@ex-grid/sheet-engine';
59
+ import { ViewportSize } from '@ex-grid/core';
60
+ import { Workbook } from '@ex-grid/sheet-engine';
61
+ import { WorkbookDocument } from '@ex-grid/sheet-engine';
62
+
63
+ /** An edge the Border tab sets, relative to each selected range, as Excel's dialog sets it (ADR-0071). The
64
+ * inside edges are Excel's Horizontal and Vertical. */
65
+ export declare type BorderEdge = 'top' | 'insideHorizontal' | 'bottom' | 'left' | 'insideVertical' | 'right';
66
+
67
+ /** The Border tab's presets, as Excel's dialog offers them (the eleventh Windows run, case 22). */
68
+ export declare type BorderPreset = 'none' | 'outline' | 'inside';
69
+
70
+ /** Which colour a More Colours entry is for: the Font's, the Fill, or the Border's line. */
71
+ export declare type ColourTarget = 'font' | 'fill' | 'border';
72
+
73
+ /** Draws a Sheet into `element`, which it owns from now on. */
74
+ export declare function createSheet(element: HTMLElement, options?: SheetOptions): SheetHandle;
75
+
76
+ /** The Currency category's code, with the culture's symbol on the side and at the distance the culture puts it. */
77
+ export declare function currencyCode(places: number, negative: number, culture: Culture): string;
78
+
79
+ /** How many ways a negative amount shows under Currency: with a minus, in red, in red with a minus, in brackets,
80
+ * in red brackets. */
81
+ export declare const currencyNegativeStyles = 5;
82
+
83
+ /** The codes Custom lists to start from. */
84
+ export declare const customTypes: readonly string[];
85
+
86
+ /**
87
+ * The codes Custom lists to start from, as the culture spells them (`NumberFormat.localCode`), each once: under
88
+ * en-GB the built-in short date is listed as `dd/mm/yyyy`, so that the one picked from the list is the built-in,
89
+ * as one typed is.
90
+ */
91
+ export declare function customTypesIn(culture: Culture): readonly string[];
92
+
93
+ /** The Date category's formats: Excel's built-in short date first, shown in the culture's own pattern. */
94
+ export declare const dateTypes: readonly string[];
95
+
96
+ /** The culture's default decimal places for a category, as Excel offers them. */
97
+ export declare function defaultPlaces(category: NumberFormatCategory, culture: Culture): number;
98
+
99
+ /**
100
+ * The categories Format Cells shows disabled, each with its reason: Accounting pads with `*`, Fraction is not
101
+ * among the codes ExSheet reads, and Special's formats depend on the locale (ADR-0071).
102
+ */
103
+ export declare type DisabledNumberFormatCategory = 'accounting' | 'fraction' | 'special';
104
+
105
+ /**
106
+ * The Focus cell's Cell Format, as `SheetHandle.readFocusFormat` read it: a change is made from it away from the Sheet,
107
+ * and set with `SheetHandle.setCellFormatFrom`, which knows what it was read against (ADR-0100).
108
+ */
109
+ export declare interface FocusFormatReading {
110
+ /** The Focus cell's Cell Format as it showed. */
111
+ readonly format: CellFormat;
112
+ }
113
+
114
+ /** The Font tab's styles, as Excel lists them: emphasis as one choice of four. */
115
+ export declare type FontStyle = 'regular' | 'italic' | 'bold' | 'boldItalic';
116
+
117
+ /**
118
+ * What Format Cells opens on, and what the user has touched since (ADR-0071, SH-45).
119
+ *
120
+ * It opens on the Focus cell's Cell Format. A part that differs across the Selection is shown as Excel shows it
121
+ * (the eleventh Windows run, case 24): the Font style empty (`fontStyle` is `undefined`), a Fill as No Colour,
122
+ * and an edge as a grey dotted line (`edgeLine` is `undefined`). Every other part shows the Focus cell's. A
123
+ * range's outer edges show as they are drawn, a neighbour's line where the cell records none (the fourteenth run,
124
+ * case 13); an edge inside a range shows the cells' own sides.
125
+ *
126
+ * `change` names only the parts the user touched, so OK leaves every other part as each cell has it; with
127
+ * nothing touched it is empty, and OK sets nothing. An edge shown from a neighbour and left alone writes nothing;
128
+ * taken away, it is cleared on both sides, as clearing an edge is (SH-45; the seventeenth Windows run, h10). A
129
+ * choice that cannot be set — a Custom code ExSheet does not read, More Colours text that is not a colour — is
130
+ * held as `refusal`, by name, and OK sets nothing until it is put right.
131
+ */
132
+ export declare class FormatCellsDraft {
133
+ #private;
134
+ /** The Focus cell's Cell Format, which Format Cells opens on. */
135
+ readonly opening: CellFormat;
136
+ /** Whether a selected range spans more than one row, so that it has an edge inside it between rows. */
137
+ readonly hasInsideHorizontal: boolean;
138
+ /** Whether a selected range spans more than one column, so that it has an edge inside it between columns. */
139
+ readonly hasInsideVertical: boolean;
140
+ private constructor();
141
+ /**
142
+ * Format Cells' draft over the ranges, opening on the Focus cell (ADR-0071): what differs across the ranges is
143
+ * read from what the Sheet records (`Sheet.getCellFormats`), so a Selection of whole columns opens as quickly
144
+ * as one cell.
145
+ */
146
+ static open(sheet: Sheet, focus: CellAddress, ranges: readonly CellRange[]): FormatCellsDraft;
147
+ /** The Number Format category chosen. */
148
+ get category(): NumberFormatCategory;
149
+ /** The decimal places, under Number, Currency, Percentage and Scientific. */
150
+ get decimalPlaces(): number;
151
+ /** Whether Number groups thousands. */
152
+ get thousandsSeparator(): boolean;
153
+ /** Which of `negativeNumbers` is chosen. */
154
+ get negativeNumber(): number;
155
+ /** The Date or Time format chosen, or the Custom code as typed; empty under any other category. */
156
+ get typeCode(): string;
157
+ /** The ways a negative number shows under the chosen category, each as its code. */
158
+ get negativeNumbers(): readonly string[];
159
+ /** The formats the chosen category lists: Date's, Time's, or the codes Custom starts from. */
160
+ get types(): readonly string[];
161
+ /** The Sheet culture's currency symbol, which Currency writes. */
162
+ get currencySymbol(): string;
163
+ /** Whether the chosen category takes decimal places. */
164
+ get takesDecimalPlaces(): boolean;
165
+ /**
166
+ * The code the Number tab shows now. Under Custom it is the code as typed, which is read as the Sheet's culture
167
+ * spells codes (`NumberFormat.tryParseLocal`): a built-in only where it spells that built-in's code under the
168
+ * culture (the fourteenth Windows run, case 11).
169
+ */
170
+ get numberFormatCode(): string;
171
+ /** Why the Number tab's code cannot be set, or `undefined` when it can. */
172
+ get numberFormatRefusal(): FormatCellsRefusal | undefined;
173
+ /**
174
+ * Chooses a category, with its options as they opened when it is the one the Focus cell's code is, and the
175
+ * category's defaults otherwise. A category shown disabled is refused, with its reason.
176
+ */
177
+ selectCategory(category: NumberFormatCategory): void;
178
+ /** Sets the decimal places, 0 to 30. */
179
+ setDecimalPlaces(places: number): void;
180
+ /** Sets whether Number groups thousands. */
181
+ setThousandsSeparator(separator: boolean): void;
182
+ /** Chooses one of `negativeNumbers`. */
183
+ setNegativeNumber(index: number): void;
184
+ /** Chooses a Date or Time format, or types the Custom code. */
185
+ setType(code: string): void;
186
+ /** The horizontal alignment. */
187
+ get alignment(): HorizontalAlignment;
188
+ /** Sets the horizontal alignment. */
189
+ setAlignment(alignment: HorizontalAlignment): void;
190
+ /** The Font style; `undefined`, shown empty, while bold or italic differs across the Selection. */
191
+ get fontStyle(): FontStyle | undefined;
192
+ /** Whether the text is underlined. */
193
+ get underline(): boolean;
194
+ /** Whether the text is struck through. */
195
+ get strikethrough(): boolean;
196
+ /** The Font's colour; Automatic is the Ink. */
197
+ get fontColour(): CellColour;
198
+ /** Sets the Font style: bold and italic together. */
199
+ setFontStyle(style: FontStyle): void;
200
+ /** Sets the single underline on or off. */
201
+ setUnderline(underline: boolean): void;
202
+ /** Sets strikethrough on or off. */
203
+ setStrikethrough(strikethrough: boolean): void;
204
+ /** Sets the Font's colour: Automatic, or a colour of the palette or More Colours. */
205
+ setFontColour(colour: CellColour): void;
206
+ /**
207
+ * Whether the Font is Excel's Normal font as ExSheet has it — the colour Automatic, and neither bold, italic,
208
+ * underline nor strikethrough — which the Font tab's Normal font box shows checked (ADR-0071, 2026-10-02).
209
+ * False while bold or italic differs across the Selection.
210
+ */
211
+ get isNormalFont(): boolean;
212
+ /**
213
+ * The Font tab's Normal font box, checked (ADR-0071, 2026-10-02): every part of the Font set to its default and
214
+ * touched, so OK records them on each selected cell over a row's or a column's Font, as Excel writes its Normal
215
+ * style's font. ExSheet has no Normal style: a typeface and a size stay out.
216
+ */
217
+ setNormalFont(): void;
218
+ /** The Fill; No Colour while the Fill differs across the Selection. */
219
+ get fill(): CellFill;
220
+ /** Sets the Fill: No Colour, or a colour of the palette or More Colours. */
221
+ setFill(fill: CellFill): void;
222
+ /**
223
+ * The line style an edge or a preset sets. Format Cells opens on the line an outer edge shows, and on Thin
224
+ * where none shows one (`openingPen`).
225
+ */
226
+ get lineStyle(): BorderLineStyle;
227
+ /** The line colour an edge or a preset sets: the colour of the line the style opens on, else Automatic. */
228
+ get lineColour(): CellColour;
229
+ /** Chooses the line style. */
230
+ setLineStyle(style: BorderLineStyle): void;
231
+ /** Chooses the line colour. */
232
+ setLineColour(colour: CellColour): void;
233
+ /** The line on an edge; `undefined`, drawn as a grey dotted line, while it differs across the Selection. */
234
+ edgeLine(edge: BorderEdge): BorderLine | undefined;
235
+ /** Whether an edge can be set: an edge inside the range only where a range has more than one row or column. */
236
+ canSet(edge: BorderEdge): boolean;
237
+ /** Whether a preset is offered: Inside only where a range has an edge inside it. */
238
+ canApply(preset: BorderPreset): boolean;
239
+ /**
240
+ * An edge's button, as Excel's: an edge that shows the chosen line loses it, and any other takes it. A line
241
+ * style of None takes the line away. An edge that cannot be set for this Selection is refused.
242
+ */
243
+ toggleEdge(edge: BorderEdge): void;
244
+ /** A preset: None takes every line of the range away; Outline and Inside set the chosen line there. Inside,
245
+ * where no selected range has an edge inside it, is refused. */
246
+ applyPreset(preset: BorderPreset): void;
247
+ /** The colour a palette shows chosen for a target: the Font's or the Border's, Automatic among them, or the Fill's,
248
+ * `undefined` for No Colour. */
249
+ colourOf(target: ColourTarget): CellColour | undefined;
250
+ /** Chooses a palette's colour for a target: `undefined` is a palette's first choice, Automatic for the Font and the
251
+ * Border, and No Colour for the Fill. */
252
+ setColour(target: ColourTarget, colour: CellColour | undefined): void;
253
+ /** The text typed under More Colours for a colour, or empty. */
254
+ colourText(target: ColourTarget): string;
255
+ /**
256
+ * Reads text typed under More Colours: `#` and six hex digits, such as `#1F4E79`, sets the colour for the
257
+ * target. Any other text stands as a `refusal` until it is corrected, cleared, or a colour is chosen from the
258
+ * palette.
259
+ */
260
+ setColourText(target: ColourTarget, text: string): void;
261
+ /** A colour written `#RRGGBB`, or `RRGGBB`, in either case; `undefined` for any other text. */
262
+ static tryReadHex(text: string): CellColour | undefined;
263
+ /**
264
+ * Why OK cannot set what Format Cells shows, by name, or `undefined` when it can: a Custom code ExSheet does
265
+ * not read, or More Colours text that is not a colour. `SheetWords.formatCellsRefusal` words it.
266
+ */
267
+ get refusal(): FormatCellsRefusal | undefined;
268
+ /** Whether the user has touched anything that OK would set. */
269
+ get isTouched(): boolean;
270
+ /** The parts the user touched, as one change; empty when nothing was. */
271
+ get change(): CellFormatChange;
272
+ }
273
+
274
+ /**
275
+ * A label of Format Cells' own under the built-in Chrome (ADR-0071): its legends, fields and buttons, worded by
276
+ * {@link SheetWords.formatCellsLabel}.
277
+ */
278
+ export declare type FormatCellsLabel = 'tabs' | 'category' | 'generalHint' | 'textHint' | 'decimalPlaces' | 'thousandsSeparator' | 'negativeNumbers' | 'type' | 'codes' | 'horizontal' | 'fontStyle' | 'underline' | 'underlineNone' | 'underlineSingle' | 'strikethrough' | 'normalFont' | 'colour' | 'lineStyle' | 'presets' | 'border' | 'preview' | 'backgroundColour' | 'automatic' | 'noColour' | 'moreColours' | 'ok' | 'cancel';
279
+
280
+ /**
281
+ * A line style's stroke width and dashes, as Format Cells' Border tab pictures it in an SVG (ADR-0071): only a picture
282
+ * of the style, which a Chrome's Format Cells draws too; how a Border is painted on the Sheet is the grid's. `double`
283
+ * is two strokes of the width given, and `none` is none.
284
+ */
285
+ export declare function formatCellsLineStroke(style: BorderLineStyle): {
286
+ readonly width: string;
287
+ readonly dashes: string | undefined;
288
+ };
289
+
290
+ /** What Format Cells offers, in Excel's order (ADR-0071; the eleventh Windows run, cases 22 and 23). */
291
+ export declare const formatCellsOffer: Readonly<{
292
+ /** The tabs, in Excel's order. */
293
+ tabs: readonly FormatCellsTab[];
294
+ /** The Number tab's categories, in Excel's order, each available or disabled. */
295
+ categories: readonly NumberFormatCategoryOffer[];
296
+ /** The Alignment tab's horizontal alignments, as Excel lists them. */
297
+ alignments: readonly HorizontalAlignment[];
298
+ /** The Font tab's styles, as Excel lists them. */
299
+ fontStyles: readonly FontStyle[];
300
+ /**
301
+ * The Border tab's line styles in Excel's two columns, each from the top: None, Hair, Dotted, Dash-dot-dot,
302
+ * Dash-dot, Dashed and Thin; then Medium Dash-dot-dot, Slanted Dash-dot, Medium Dash-dot, Medium Dashed,
303
+ * Medium, Thick and Double (case 22).
304
+ */
305
+ lineStyleColumns: readonly (readonly BorderLineStyle[])[];
306
+ /** The Border tab's presets, in Excel's order. */
307
+ presets: readonly BorderPreset[];
308
+ /** The Border tab's edges, in Excel's order, without its diagonals (ADR-0071). */
309
+ edges: readonly BorderEdge[];
310
+ /**
311
+ * The Office theme's colours (case 23): ten across, in six rows — the theme colours, then five rows of their
312
+ * tints and shades. Each records the RGB value Excel names it with in Format Cells' Fill tab; the two named
313
+ * "Grey" are `#7F7F7F`.
314
+ */
315
+ themeColours: readonly (readonly PaletteSwatch[])[];
316
+ /** Excel's ten standard colours (case 23). */
317
+ standardColours: readonly PaletteSwatch[];
318
+ }>;
319
+
320
+ /** Why Format Cells' OK cannot set what it shows, by name (ADR-0071), worded by {@link SheetWords.formatCellsRefusal}. */
321
+ export declare type FormatCellsRefusal = {
322
+ readonly kind: 'noNumberFormatCode';
323
+ } | {
324
+ readonly kind: 'numberFormatNotRead';
325
+ readonly code: string;
326
+ readonly reason: string;
327
+ } | {
328
+ readonly kind: 'notAColour';
329
+ readonly target: ColourTarget;
330
+ readonly text: string;
331
+ };
332
+
333
+ /** Format Cells' tabs, in Excel's order: five of Excel's six, Protection left out (ADR-0071). */
334
+ export declare type FormatCellsTab = 'number' | 'alignment' | 'font' | 'border' | 'fill';
335
+
336
+ export { GridPointArrow }
337
+
338
+ export { GridPointDashes }
339
+
340
+ export { GridPointedAt }
341
+
342
+ export { GridPointedPress }
343
+
344
+ export { GridPointedPressKind }
345
+
346
+ export { GridPointedStep }
347
+
348
+ export { GridPointedStepKind }
349
+
350
+ /** Whether a category is one Format Cells shows disabled. */
351
+ export declare function isDisabledCategory(category: NumberFormatCategory): category is DisabledNumberFormatCategory;
352
+
353
+ /** A Linked Table column a Formula edited in a Sheet reads, and the colour its References wear (ADR-0057). */
354
+ export declare interface LinkedColumnColour {
355
+ /** The table and column. */
356
+ readonly column: LinkedTableColumn;
357
+ /** The colour. */
358
+ readonly colour: ReferenceColour;
359
+ }
360
+
361
+ /** The most decimal places Excel's spinner offers. */
362
+ export declare const mostDecimalPlaces = 30;
363
+
364
+ /** A place the Name Box reads: a range, and the name of the Sheet it is on when one was typed before it. */
365
+ export declare interface NameBoxPlace {
366
+ /** The Sheet's name as typed, a quoted one unquoted; `undefined` when none was typed, and the range is then
367
+ * on the Sheet shown. */
368
+ readonly sheet: string | undefined;
369
+ /** The range. */
370
+ readonly range: CellRange;
371
+ }
372
+
373
+ /** The Number category's code. */
374
+ export declare function numberCode(places: number, separator: boolean, negative: number): string;
375
+
376
+ /**
377
+ * The Number tab's categories, in Excel's order (ADR-0071; the eleventh Windows run, case 22). Accounting,
378
+ * Fraction and Special are offered disabled ({@link DisabledNumberFormatCategory}).
379
+ */
380
+ export declare type NumberFormatCategory = 'general' | 'number' | 'currency' | 'accounting' | 'date' | 'time' | 'percentage' | 'fraction' | 'scientific' | 'text' | 'special' | 'custom';
381
+
382
+ /** A Number Format category as Format Cells offers it: available, or shown disabled with its reason. */
383
+ export declare interface NumberFormatCategoryOffer {
384
+ /** The category. */
385
+ readonly category: NumberFormatCategory;
386
+ /** Whether it can be chosen; one that cannot is shown with {@link SheetWords.categoryDisabled}'s reason. */
387
+ readonly enabled: boolean;
388
+ }
389
+
390
+ /** How many ways a negative number shows under Number: `-1234.10`, in red, in brackets, in red brackets. */
391
+ export declare const numberNegativeStyles = 4;
392
+
393
+ /** A grid column outlined in a Reference colour while a Formula reads it (ADR-0057): the grid's own
394
+ * `outlinedColumns` entry. */
395
+ export declare type OutlinedColumn = GridOutlinedColumn;
396
+
397
+ /**
398
+ * One colour of the palette, with what Excel names it (ADR-0071; the eleventh Windows run, case 23): a theme
399
+ * colour, with its step for a tint or a shade, or a standard colour. Its words are
400
+ * {@link SheetWords.swatchName}'s.
401
+ */
402
+ export declare interface PaletteSwatch {
403
+ /** The RGB value Excel names it with in Format Cells' Fill tab, not the colour sampled from the screen. */
404
+ readonly colour: CellColour;
405
+ /** The colour's name: a theme colour's column, or a standard colour. */
406
+ readonly name: ThemeColourName | StandardColourName;
407
+ /** The tint or the shade of a theme colour, or `undefined` for the colour itself and a standard colour. */
408
+ readonly step: SwatchStep | undefined;
409
+ }
410
+
411
+ /** The Percentage category's code. */
412
+ export declare function percentageCode(places: number): string;
413
+
414
+ export { PointedAtGrid }
415
+
416
+ /** A press on a grid of a Pointing Scope that wrote nothing, and why (ADR-0058). The text of the Formula being
417
+ * edited is as it was before the press. */
418
+ export declare interface PointingRefusal {
419
+ /** Which refusal. */
420
+ readonly reason: PointingRefusalReason;
421
+ /** The refusal in words, for the user, naming the table and the column where they are known. */
422
+ readonly message: string;
423
+ }
424
+
425
+ /**
426
+ * Why a press on a grid of a Pointing Scope, or an arrow key after one, wrote nothing into the Formula being
427
+ * edited (ADR-0058):
428
+ *
429
+ * - `severalCells`: more than one cell — a Shift+press, a press on a Row Heading or on the corner, a drag that
430
+ * reached another cell, or Shift and an arrow key after a press. A drag takes back what its press wrote.
431
+ * - `severalColumns`: more than one column — a Shift+press on a header, or a drag across headers. A drag takes
432
+ * back what its press wrote.
433
+ * - `headerGroup`: a Header Group's rectangle, which stands over several columns (ADR-0032).
434
+ * - `columnNotInTable`: a column the Linked Table does not have.
435
+ * - `noKey`: a cell of a table declared without a key, whose row no Formula can name.
436
+ * - `blankKey`: a cell whose row has a blank key.
437
+ * - `keyIsAnError`: a cell whose row holds an Error Value as its key, which no lookup finds.
438
+ * - `rowNotArrived`: a cell whose row has not arrived yet; an arrow key that reaches one moves nothing.
439
+ * - `tableNotDeclared`: the Sheet that points declares no Linked Table by the grid's table's name.
440
+ * - `notPointing`: the press arrived after the Sheet stopped pointing.
441
+ * - `dataEdge`: Ctrl+arrow after a press; where the data ends is not known to a grid that holds only the rows
442
+ * near those it shows (ADR-0058, "The keyboard").
443
+ * - `cellNotHeld`: an arrow key after a press, when the grid no longer holds the cell, or shows the column,
444
+ * pointed at.
445
+ */
446
+ export declare type PointingRefusalReason = 'severalCells' | 'severalColumns' | 'headerGroup' | 'columnNotInTable' | 'noKey' | 'blankKey' | 'keyIsAnError' | 'rowNotArrived' | 'tableNotDeclared' | 'notPointing' | 'dataEdge' | 'cellNotHeld';
447
+
448
+ /** Where a refused press on a grid of a Pointing Scope is worded otherwise than by its reason alone: a drag
449
+ * that took back what its press wrote, and a column the grid no longer shows (ADR-0058). */
450
+ export declare type PointingRefusalWordCase = PointingRefusalReason | 'severalCellsTakenBack' | 'severalColumnsTakenBack' | 'columnNotHeld';
451
+
452
+ /**
453
+ * A Pointing Scope (ADR-0058): the Sheets and the grids a Consumer groups so that a Formula edited in one of the
454
+ * Sheets can point at the grids' cells. Pointing at a grid of the Scope writes what reads the pressed cell by its
455
+ * row's key, `XLOOKUP("R-4471", Positions[Id], Positions[PV])`, or the pressed column's structured reference,
456
+ * `Positions[PV]` — never a position, so the Formula reads the same row after the grid is sorted (ADR-0049,
457
+ * rule 2).
458
+ *
459
+ * The Consumer makes one per group and registers each grid that shows a Linked Table with
460
+ * {@link PointingScope.registerGrid}. A Sheet of the Scope joins it, says whether it points, tells the columns
461
+ * its Formula reads and where its edit stands with respect to Point, and hands over its arrow keys; the Scope
462
+ * writes into the Sheet that points, or tells it why a press wrote nothing. Only the Sheet that holds the
463
+ * keyboard points, and a Sheet is never pointed at.
464
+ */
465
+ export declare class PointingScope {
466
+ #private;
467
+ /** A Scope whose refusals are worded by `words`: ExSheet's English unless a Consumer's words are given. */
468
+ constructor(words?: SheetWords);
469
+ /**
470
+ * Registers a grid that shows a Linked Table, and gives back the declaration to pass it (ADR-0058).
471
+ *
472
+ * @param table - The Linked Table's name, as the Sheets declare it; matched without regard to case.
473
+ * @param tableRow - A grid row as the table's row: one Value per declared column, in the declared order, a
474
+ * blank as `undefined`. Asked for a pressed cell's row and, while that cell is dashed, for the rows the grid
475
+ * paints: it must be cheap and must not throw.
476
+ * @param tableColumns - Which table column each grid column is, by the grid column's name, for the grid
477
+ * columns named otherwise than their table column. A grid column with no entry is the table column of its
478
+ * own name, if the table has one.
479
+ * @throws RangeError when the table's name is empty, or an entry of `tableColumns` names no column.
480
+ */
481
+ registerGrid<TRow>(table: string, tableRow: (row: TRow) => TableRow, tableColumns?: Readonly<Record<string, string>>): GridPointedAt<TRow>;
482
+ /** A Sheet given this Scope joins it. */
483
+ join(sheet: PointingSheet): void;
484
+ /** A Sheet no longer given this Scope, or disposed, leaves it; if it pointed, no grid is pointed at. */
485
+ leave(sheet: PointingSheet): void;
486
+ /** A Sheet of the Scope says whether it points: it holds the keyboard, has an edit open, and is in Point. A
487
+ * Sheet that stops pointing after another started changes nothing. */
488
+ points(sheet: PointingSheet, points: boolean): void;
489
+ /** A Sheet of the Scope tells the Linked Table columns the Formula it edits reads, and their colours, or none
490
+ * once the edit ends (ADR-0057); each registered grid outlines those of its table, whether or not the Sheet
491
+ * points. */
492
+ outlineLinkedColumns(sheet: PointingSheet, columns: readonly LinkedColumnColour[]): void;
493
+ /** A Sheet of the Scope tells where its edit stands with respect to Point. Anything but `writtenFromOutside`
494
+ * means Point over what a press wrote has ended, and its dashes go (ADR-0058, "What is drawn"). */
495
+ pointStateChanged(sheet: PointingSheet, state: PointState): void;
496
+ /**
497
+ * An arrow key in a Sheet of the Scope while what a press on a registered grid wrote stands in its edit
498
+ * (ADR-0058, "The keyboard"): the cell or the column that press wrote for moves one step inside that grid,
499
+ * and the text is rewritten for what it reached. At an edge nothing moves; a row that has not arrived, Shift
500
+ * and an arrow, and the Primary Modifier and an arrow write nothing, and the reason is told.
501
+ */
502
+ pointArrow(sheet: PointingSheet, arrow: GridPointArrow): Promise<void>;
503
+ }
504
+
505
+ /** What a Pointing Scope asks of a Sheet in it (ADR-0058): its own declarations, to read a table's columns and
506
+ * key from, and its edit, to write into. */
507
+ export declare interface PointingSheet {
508
+ /** The Linked Tables the Sheet declares, keys included. */
509
+ readonly linkedTables: readonly LinkedTable[];
510
+ /** The id of the root of the Sheet's grid; `undefined` before it is rendered. */
511
+ readonly rootId: string | undefined;
512
+ /** Writes text into the Sheet's open edit where Point writes; false when it is no longer in Point. */
513
+ writePointedText(text: string): Promise<boolean>;
514
+ /** Takes back what the last write put there, while it stands. */
515
+ takeBackPointedText(): Promise<boolean>;
516
+ /** Tells the Sheet's Consumer why a press wrote nothing. */
517
+ tellPointingRefused(refusal: PointingRefusal): Promise<void>;
518
+ }
519
+
520
+ /**
521
+ * Where an open edit stands with respect to Point (ADR-0051, ADR-0058): `none`, no Reference can go at the
522
+ * caret; `inPoint`, one can; `writtenFromOutside`, what stands at the caret was written by a press outside the
523
+ * grid.
524
+ */
525
+ export declare type PointState = GridPointState;
526
+
527
+ /**
528
+ * Reads what was typed as a range, with the name of the Sheet it is on when one is typed before it; `undefined`
529
+ * when it is not a place. A name in quotes doubles a quote inside it, as a Reference writes one.
530
+ */
531
+ export declare function readNameBoxPlace(typed: string): NameBoxPlace | undefined;
532
+
533
+ /** Reads what was typed as a range of the Sheet, or `undefined` when it is not one. */
534
+ export declare function readNameBoxRange(typed: string): CellRange | undefined;
535
+
536
+ /** What a category shows a code as when Format Cells opens on it. */
537
+ export declare interface RecognisedNumberFormat {
538
+ /** The category that writes the code. */
539
+ readonly category: NumberFormatCategory;
540
+ /** Its decimal places, 2 where the category takes none. */
541
+ readonly places: number;
542
+ /** Whether Number groups thousands. */
543
+ readonly separator: boolean;
544
+ /** Which negative style. */
545
+ readonly negative: number;
546
+ /** The code as the category shows it: a Date's or a Time's as listed, a Custom code as the culture spells
547
+ * it, any other as written. */
548
+ readonly type: string;
549
+ }
550
+
551
+ /**
552
+ * The category, and its options, that writes the format's code exactly; Custom when none does, with the code as
553
+ * the culture spells it (`NumberFormat.localCode`), which the Custom box reads back as the same format (the
554
+ * fourteenth Windows run, case 11).
555
+ */
556
+ export declare function recogniseNumberFormat(format: NumberFormat, culture: Culture): RecognisedNumberFormat;
557
+
558
+ export { ReferenceColour }
559
+
560
+ /** The Scientific category's code. */
561
+ export declare function scientificCode(places: number): string;
562
+
563
+ /**
564
+ * The Sheet's Chrome slots (ADR-0390), the C# `ISheetChrome`'s, each a mount function the Sheet calls with the slot's
565
+ * element and what the slot is handed. A slot not given is drawn by the built-in Chrome. As `ISheetChrome` extends
566
+ * `IGridChrome`, the grid's own slots are among them, and the Sheet hands those to its grid: the Cell Editor, the
567
+ * Formula Bar's fields, the completion list, the find panel, the Context Menu, a cell's message and the Selection
568
+ * Summary. The column menu and the filter panel are taken too, and never shown, since a Sheet's columns have no menu.
569
+ */
570
+ export declare interface SheetChrome extends GridChrome<unknown> {
571
+ /** Each Toolbar Item of the Sheet Toolbar (ADR-0100): a mount that answers `undefined` leaves the item to the
572
+ * built-in Chrome, as the C# Chrome's `ToolbarItem` answering null does. */
573
+ readonly toolbarItem?: SheetToolbarItemSlot;
574
+ /** Format Cells' contents (ADR-0071), in the grid's popover frame. */
575
+ readonly formatCells?: SheetFormatCellsSlot;
576
+ /** Each Sheet Tab's face (ADR-0331 §4). */
577
+ readonly sheetTab?: SheetTabSlot;
578
+ /** The face of the button that adds a Sheet (ADR-0331 §4). */
579
+ readonly sheetTabAdd?: SheetTabAddSlot;
580
+ }
581
+
582
+ /** The ids of the commands ExSheet adds to the grid's Context Menu, as C#'s SheetCommandIds spells them. */
583
+ export declare const sheetCommandIds: Readonly<Record<SheetContextCommand, string>>;
584
+
585
+ /** One of ExSheet's own Context Menu commands (ADR-0036). */
586
+ export declare type SheetContextCommand = 'insertRows' | 'deleteRows' | 'insertColumns' | 'deleteColumns' | 'formatCells';
587
+
588
+ /** The index of a Sheet's filled cells, which answers where Ctrl+arrow stops (ADR-0050, item 2). */
589
+ export declare class SheetEdges {
590
+ #private;
591
+ /** The index of every filled cell of the Sheet. */
592
+ static of(sheet: Sheet): SheetEdges;
593
+ /**
594
+ * Brings the index up to date after a change the Sheet reported. Every cell that became filled or blank is
595
+ * among the change's Value changes: a blank cell has no Value and a filled one has one.
596
+ */
597
+ update(sheet: Sheet, change: SheetChange): void;
598
+ /** The cell Ctrl+arrow reaches from `from` in the direction, on a Sheet of `size`, whose edge it stops at (ADR-0460). */
599
+ find(from: CellAddress, direction: GridDirection, size?: SheetSize): CellAddress;
600
+ }
601
+
602
+ /** The ids of the words the Sheet's find panel adds to the grid's, as C#'s SheetFindLabelIds spells them: a
603
+ * Consumer's `commandLabel` answers them as it answers the grid's. */
604
+ export declare const sheetFindLabelIds: Readonly<{
605
+ /** The label of the Within choice. */
606
+ readonly within: 'exsheet.find-within';
607
+ /** Within: the Sheet shown. */
608
+ readonly withinSheet: 'exsheet.find-within-sheet';
609
+ /** Within: the Workbook. */
610
+ readonly withinWorkbook: 'exsheet.find-within-workbook';
611
+ }>;
612
+
613
+ /** Where the Sheet's find panel searches (ADR-0332 §5): the Sheet shown, or every Sheet of the Workbook. */
614
+ export declare type SheetFindWithin = 'sheet' | 'workbook';
615
+
616
+ /** The words the Sheet's find panel adds to the grid's (ADR-0332 §5): the Within choice and its two answers. */
617
+ export declare type SheetFindWithinWord = 'within' | 'withinSheet' | 'withinWorkbook';
618
+
619
+ /**
620
+ * Format Cells' slot (ADR-0390): mounts the contents into `slot`, which stands in the grid's popover frame, and
621
+ * answers the function that takes them away, called however Format Cells closes. Asked once per opening.
622
+ */
623
+ export declare type SheetFormatCellsSlot = (slot: HTMLElement, context: SheetFormatCellsSlotContext) => () => void;
624
+
625
+ /**
626
+ * What Format Cells' contents are handed (ADR-0071, ADR-0390), once per opening. The contents stand in the grid's
627
+ * popover frame, as the built-in Format Cells does: where it stands, Escape, a press elsewhere, Tab wrapping inside
628
+ * it and the keyboard back on the grid as it closes are the grid's (ADR-0050 item 16), so the frame is never the
629
+ * Chrome's own dialog under TypeScript. The contents draw the tabs and their controls from `formatCellsOffer` and
630
+ * `draft`, set every choice through `draft`, and call `ok` or `cancel`.
631
+ */
632
+ export declare interface SheetFormatCellsSlotContext {
633
+ /** What Format Cells opens on, the Focus cell's Cell Format with the parts that differ across the Selection shown
634
+ * as Excel shows them, and what the user has touched. Every control is set through it, so what a choice means is
635
+ * the Sheet's under every Chrome. */
636
+ readonly draft: FormatCellsDraft;
637
+ /** The tab to open on: the one shown last in this Sheet. */
638
+ readonly tab: FormatCellsTab;
639
+ /** Hears each tab the contents show, so the next opening shows it again, as Excel's does. */
640
+ readonly tabShown: (tab: FormatCellsTab) => void;
641
+ /** Sets the parts the user touched on the Selection Format Cells was opened over, as one undo step, and closes it:
642
+ * `true`. `false` while the draft holds a refusal, which the contents show in the Sheet's words
643
+ * (`words.formatCellsRefusal(draft.refusal)`), and Format Cells stays open. */
644
+ readonly ok: () => boolean;
645
+ /** Sets nothing, and closes Format Cells. */
646
+ readonly cancel: () => void;
647
+ /** The Sheet's words, its Japanese or its English and the Consumer's label over either: the tabs' names, the
648
+ * fields' labels, OK and Cancel, a refusal. */
649
+ readonly words: SheetWords;
650
+ /** Gives the keyboard, which the frame holds while the contents are being drawn, to a control they drew: the tab
651
+ * shown, as the opening asks. Granted only while the keyboard is still the grid's, so a press the user made
652
+ * meanwhile keeps it where it put it. */
653
+ readonly takeKeyboard: (control: HTMLElement) => void;
654
+ /** The contents report a popup of their own opening (`true`) and closing (`false`): while one is open, Escape is
655
+ * the popup's, not the frame's (ADR-0039). */
656
+ readonly innerPopupChanged: (open: boolean) => void;
657
+ }
658
+
659
+ /**
660
+ * What a key sets on the Selection, under the Sheet's culture (cases 16 to 20). A toggle's direction is the
661
+ * Focus cell's (case 17): over a Focus that is bold, Ctrl+B takes bold off every cell, and otherwise puts it on
662
+ * every cell. The Number Formats are the ones Excel applied under en-GB, en-US and ja-JP alike, but for two: the
663
+ * time is 12-hour where the culture's own time is (`h:mm AM/PM` under en-US, `h:mm` under en-GB and ja-JP), and
664
+ * the currency is Excel's built-in, shown in the culture's own currency (`NumberFormat.builtInCurrency`). The
665
+ * date and the time are Excel's built-ins 15 and 20 (or the AM/PM one), recorded in their codes and shown in the
666
+ * culture's own form, as Excel shows them (the twelfth run, case 19). A Number Format widens the columns it no
667
+ * longer fits, as every Number Format set on the Selection does (case 17), and so do strikethrough and underline
668
+ * (`widensAsAKeyDoes`). The outline is thin and Automatic on each range's four edges; no borders clears every
669
+ * edge of each range. Ctrl+1 sets nothing, and is refused here.
670
+ */
671
+ export declare function sheetFormatChangeFor(kind: SheetFormatKey, focus: CellFormat, culture: Culture): CellFormatChange;
672
+
673
+ /** What a formatting key does. Ctrl+1 opens Format Cells (ticket 52) and sets nothing itself. */
674
+ export declare type SheetFormatKey = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'general' | 'number' | 'time' | 'date' | 'currency' | 'percent' | 'scientific' | 'outline' | 'noBorders' | 'formatCells';
675
+
676
+ /** What a declared key does; `undefined` for a key that is not one of these. */
677
+ export declare function sheetFormatKeyOf(key: string): SheetFormatKey | undefined;
678
+
679
+ /** The formatting keys ExSheet declares to its grid, in the grid's canonical form. */
680
+ export declare function sheetFormatKeysDeclared(): readonly string[];
681
+
682
+ /** A Sheet drawn into an element, handed back by {@link createSheet}. */
683
+ export declare interface SheetHandle {
684
+ /** The Workbook the Sheet edits. Change it only through the Sheet, or what is shown falls behind it. */
685
+ readonly workbook: Workbook;
686
+ /** Takes the options again, whole. */
687
+ update(options: SheetOptions): void;
688
+ /** Whether there is a step to undo. */
689
+ readonly canUndo: boolean;
690
+ /** Whether there is an undone step to redo. */
691
+ readonly canRedo: boolean;
692
+ /**
693
+ * Whether an edit is open in the grid, from the moment a cell or the Formula Bar is typed in until the edit is
694
+ * committed, cancelled or discarded (ADR-0048). While it is, `do`, `undo`, `redo`, `setCellFormat` and
695
+ * `openFormatCells` are refused with a `SheetRefusedError`; `cellFormatAt` is a read, and answers.
696
+ */
697
+ readonly isEditing: boolean;
698
+ /**
699
+ * A Consumer command: does `edit` as one operation on the user's undo stack (ADR-0048), and raises
700
+ * `onWorkbookChanged`. It names no Sheet, so it is taken only while the Workbook holds one; with several it is
701
+ * refused, and the Sheet is named with the other form (ADR-0331 §6). It does the edit exactly as it is written, and
702
+ * widens no column.
703
+ *
704
+ * @throws SheetRefusedError The Sheet refuses the edit, an edit is open, or the Workbook holds several Sheets;
705
+ * nothing changed.
706
+ * @throws FormulaSyntaxError A typed Formula cannot be read; nothing changed.
707
+ */
708
+ do(edit: SheetEdit): void;
709
+ /**
710
+ * A Consumer command: does `edit` on the Sheet named `sheet`, shown or not, as one operation on the user's undo
711
+ * stack (ADR-0048, ADR-0331 §6). A Sheet operation — `insertSheet`, `rename`, `moveSheet`, `copySheet`,
712
+ * `deleteSheet` — acts on that Sheet and raises `onSheetsChanged`; the Sheet shown stays shown unless it is the one
713
+ * deleted, and then the Sheet that takes its place is.
714
+ *
715
+ * @throws RangeError No Sheet of the Workbook is named `sheet`; nothing changed.
716
+ * @throws SheetRefusedError The Sheet refuses the edit, or an edit is open; nothing changed.
717
+ * @throws FormulaSyntaxError A typed Formula cannot be read; nothing changed.
718
+ */
719
+ do(sheet: string, edit: SheetEdit): void;
720
+ /**
721
+ * Sets the parts of a Cell Format that `change` names on the Selection the grid holds now, as one operation on the
722
+ * undo stack (ADR-0071, ADR-0048): every part it does not name stays as each cell has it. A Selection of whole
723
+ * columns or rows sets it on the columns or rows, and the change's Borders are relative to each range. It widens
724
+ * as the formatting keys do: a Number Format, underline or strikethrough widens each column whose numbers it no
725
+ * longer fits and the user has not sized, in the same operation. Answers false when nothing is selected.
726
+ *
727
+ * @throws RangeError The change sets no part of a Cell Format.
728
+ * @throws SheetRefusedError An edit is open; nothing changed.
729
+ */
730
+ setCellFormat(change: CellFormatChange): boolean;
731
+ /**
732
+ * Sets on the Selection a change made from the Focus cell's Cell Format as it shows now, as a toggle key reads it
733
+ * (ADR-0071, ADR-0100): Bold on over a Focus cell that is not bold, off over one that is. It widens as Excel's Home
734
+ * tab buttons do: as the formatting keys do, and for a Font colour too. Otherwise it acts, refuses and answers as
735
+ * `setCellFormat`; false when nothing is selected, and then `changeOf` is not called.
736
+ *
737
+ * @throws RangeError The change it makes sets no part of a Cell Format.
738
+ * @throws SheetRefusedError An edit is open; nothing changed.
739
+ */
740
+ setCellFormatFromFocus(changeOf: (focus: CellFormat) => CellFormatChange): boolean;
741
+ /**
742
+ * The Focus cell's Cell Format as it shows now, read for a change made from it away from the Sheet, over a round
743
+ * trip, and set with `setCellFormatFrom` (ADR-0100); undefined when nothing is selected. It is read for a change,
744
+ * so it is refused while an edit is open, before the change is made.
745
+ *
746
+ * @throws SheetRefusedError An edit is open.
747
+ */
748
+ readFocusFormat(): FocusFormatReading | undefined;
749
+ /**
750
+ * Sets `change`, made from `reading`, on the Selection, as `setCellFormatFromFocus` sets the change it makes: only
751
+ * while the Selection, the Sheet shown and the Focus cell's Cell Format are what `reading` was read from.
752
+ * Otherwise the change would be set on cells it was not made for, or undo what it was made to do, so it is refused,
753
+ * and the notice says so (ADR-0100, decided 2026-10-28). A reading is taken by its set, whatever comes of it.
754
+ *
755
+ * @throws TypeError `reading` was not read from this Sheet, or was set already.
756
+ * @throws RangeError The change sets no part of a Cell Format.
757
+ * @throws SheetRefusedError An edit is open; the Selection or the Sheet shown moved (`selectionMoved`); the Focus
758
+ * cell's Cell Format changed (`focusFormatChanged`). Nothing changed.
759
+ */
760
+ setCellFormatFrom(reading: FocusFormatReading, change: CellFormatChange): boolean;
761
+ /**
762
+ * Opens Format Cells over the Selection the grid holds now, from the Consumer's own button (ADR-0071): on the Focus
763
+ * cell's Cell Format, and on the tab shown last. OK sets the parts the user touched as one undo step; Cancel or
764
+ * Escape sets nothing. Opening it again while it stands opens it afresh. Answers false when nothing is selected.
765
+ *
766
+ * @throws SheetRefusedError An edit is open; nothing opened.
767
+ */
768
+ openFormatCells(): boolean;
769
+ /**
770
+ * The Cell Format of the cell at `address` as it shows (ADR-0071): each part the cell's own, else its row's, else
771
+ * its column's, else the default. It names no Sheet, so it is read only while the Workbook holds one; with several,
772
+ * name the Sheet with the other form (ADR-0331 §6).
773
+ *
774
+ * @throws SheetRefusedError The Workbook holds several Sheets.
775
+ */
776
+ cellFormatAt(address: CellAddress): CellFormat;
777
+ /**
778
+ * The Cell Format of the cell at `address` on the Sheet named `sheet`, shown or not, as it shows.
779
+ *
780
+ * @throws RangeError No Sheet of the Workbook is named `sheet`.
781
+ */
782
+ cellFormatAt(sheet: string, address: CellAddress): CellFormat;
783
+ /** Undoes the latest operation; false when there is none, which the notice says. */
784
+ undo(): boolean;
785
+ /** Redoes the latest operation undone; false when there is none, which the notice says. */
786
+ redo(): boolean;
787
+ /**
788
+ * Declares a Linked Table Formulas read by name, as `ExSheet.DeclareLinkedTableAsync` does (ADR-0049): its readers
789
+ * show `#GETTING_DATA` until a snapshot is pushed. The declaration is recorded in the document, so
790
+ * `onWorkbookChanged` hears it when it changes what was declared; declaring the same table again changes nothing.
791
+ * It is the Consumer's data, not a user's operation, so it is no step on the undo stack. `key` names the column, or
792
+ * the columns, a row is read by.
793
+ */
794
+ declareLinkedTable(name: string, columns: readonly string[], key?: string | readonly string[]): void;
795
+ /**
796
+ * Replaces a Linked Table's rows with a whole snapshot, in one step, as `ExSheet.PushLinkedTableAsync` does
797
+ * (ADR-0049): only the Formulas that read it, and what depends on them, recalculate, and only the rows whose
798
+ * Values changed repaint. The document never holds a table's rows, so `onWorkbookChanged` hears nothing, and
799
+ * nothing goes on the undo stack. A snapshot of a keyed table in which a key repeats is refused with the engine's
800
+ * `RepeatedKeyError`, after the table's readers show `#GETTING_DATA` again.
801
+ */
802
+ pushLinkedTable(name: string, rows: Iterable<readonly (Value | undefined)[]>): void;
803
+ /**
804
+ * Replaces the Workbook with the Workbook Document `read` answers, taken at this call's place in the Input Order
805
+ * (ADR-0330 §10), as `ExSheet.OpenAsync` does: the inputs made before it are taken against the Workbook they were
806
+ * made on, and those made after it wait until the document arrives and are then taken against the new one, or
807
+ * refused aloud when what they were taken against no longer holds (ADR-0142). Call it from the handler that hears
808
+ * the user's choice of a file, with the read still to do, such as
809
+ * `signal => openXlsxWorkbook(file, 'en-US', { signal }).then(read => read.document)` from `@ex-grid/sheet-xlsx`.
810
+ *
811
+ * In its turn, an edit still open refuses it by name, as a save is refused, and nothing is read: what is being typed
812
+ * would be thrown away. From this call until the opening ends the Sheet's grid names it in its Settled Stamp, and a
813
+ * plain Escape typed in the grid while it is placed aborts `read`'s signal: the Workbook stays as it was, and the
814
+ * notice says so; an opening cancelled before its turn ends cancelled. While the read is under way the notice says
815
+ * so, and the grid is busy and painted as a paste under way is. A read that fails leaves the Workbook as it was too,
816
+ * says so with the failure's message, and the failure is this method's. When the document arrives it replaces the
817
+ * whole Workbook, as a new `document` does (ADR-0048): the undo stack is cleared, the Linked Tables declared are gone
818
+ * with the Workbook that held them, and `onWorkbookChanged` is raised with the Workbook opened. An Escape that comes
819
+ * once it has landed changes nothing, and the Sheet says it came too late; one that finds the opening over otherwise
820
+ * says there was nothing to cancel.
821
+ *
822
+ * Only the grid's inputs wait behind it. A method the Consumer calls meanwhile is not an input and is not held:
823
+ * what it changes is replaced when the file lands. Once the Sheet is destroyed the signal is aborted, and nothing
824
+ * lands.
825
+ *
826
+ * @param read - Reads the document, looking at the signal as it goes; a read that sees it aborted rejects with the
827
+ * signal's reason.
828
+ * @returns True once the document opened; false when Escape cancelled the read, or the Sheet was destroyed first.
829
+ * @throws SheetRefusedError An edit is open in the opening's turn; nothing was read.
830
+ * @throws Error Whatever `read` failed with, such as `XlsxOpenError`, or the engine's refusal of the document;
831
+ * nothing opened. Or whatever `onWorkbookChanged` or `onSheetsChanged` failed with, once the file opened.
832
+ */
833
+ open(read: (signal: AbortSignal) => PromiseLike<WorkbookDocument>): Promise<boolean>;
834
+ /**
835
+ * Saves the Workbook at this call's place in the Input Order (ADR-0330 §10), as `ExSheet.SaveAsync` does: `write` is
836
+ * handed the Workbook as the inputs made before the call left it — every Sheet with its Values, its Cell Formats and
837
+ * widths, and the rows each Linked Table holds — such as `workbook => saveXlsxWorkbook(workbook)` from
838
+ * `@ex-grid/sheet-xlsx`. The Workbook is lent for that call only: read it before the call's first `await`, as
839
+ * `saveXlsxWorkbook` does, and never change it. The inputs made after the save are taken once `write` has returned,
840
+ * not once its promise settles, so a slow write holds nobody up.
841
+ *
842
+ * @returns A promise that settles once `write`'s has.
843
+ * @throws SheetRefusedError An edit is open: the file would quietly lack what is being typed. The Sheet says so, and
844
+ * nothing was written.
845
+ * @throws Error Whatever `write` failed with, such as `XlsxSaveError`.
846
+ */
847
+ save(write: (workbook: Workbook) => void | PromiseLike<void>): Promise<void>;
848
+ /** Hands the keyboard to the Sheet's grid: to the field an open edit is typed in, else to where the grid takes keys
849
+ * (ADR-0080), as the grid's own `focus` does. A Consumer's control beside the Sheet gives the keyboard back with
850
+ * this. Throws once the Sheet is destroyed, as `holdSettled` and `inOrder` do. */
851
+ focus(): void;
852
+ /**
853
+ * Holds the Settled Mark of the Sheet's grid (ADR-0220) until the function it answers is called, as the grid's own
854
+ * `holdSettled` does: for a Framework Adapter whose Chrome's contents arrive after their slot, a round trip later on
855
+ * a circuit (ADR-0410 section 5), so that nothing reads the part before it stands. Each hold is let go once.
856
+ */
857
+ holdSettled(): () => void;
858
+ /**
859
+ * Runs `handling` in its place in the Input Order of the Sheet's grid (ADR-0240 section 6), as the grid's own
860
+ * `inOrder` does: after every input made so far, and before any made after it, which wait until the promise it
861
+ * answers settles. A Sheet destroyed before its turn runs nothing; one already destroyed throws. `handling` is handed
862
+ * its turn, through which a file is opened or saved as part of it, as the grid's turn places work.
863
+ */
864
+ inOrder(handling: (turn: SheetTurn) => void | PromiseLike<void>): Promise<void>;
865
+ /**
866
+ * Says `sentence` in the Sheet's notice, where the Sheet says its own refusals (ADR-0100): for a Framework Adapter
867
+ * whose Consumer's Toolbar button ran a command a round trip later that was refused, as the C# toolbar says one.
868
+ * Throws once the Sheet is destroyed, as `inOrder` does.
869
+ */
870
+ tell(sentence: string): void;
871
+ /** Stops the Sheet and empties its element. */
872
+ destroy(): void;
873
+ }
874
+
875
+ /** Whether there is a step to undo and one to redo, as `onHistoryChanged` hears it. */
876
+ export declare interface SheetHistoryState {
877
+ /** Whether there is a step to undo. */
878
+ readonly canUndo: boolean;
879
+ /** Whether there is an undone step to redo. */
880
+ readonly canRedo: boolean;
881
+ }
882
+
883
+ /**
884
+ * A Consumer's word for an id, or `undefined` to keep ExSheet's own (its Japanese where that was chosen, else
885
+ * its English). `english` is the id's English as a template: where it has `{0}` (and `{1}`, `{2}`), the word
886
+ * answered is a template too, its arguments put in where it names them, so a language that orders them
887
+ * otherwise moves them.
888
+ */
889
+ export declare type SheetLabel = (id: SheetWordId, english: string) => string | undefined;
890
+
891
+ /** What a Sheet is drawn with. */
892
+ export declare interface SheetOptions {
893
+ /** The Workbook or Sheet to open; a new Workbook of one empty Sheet unless given. A new document object opens
894
+ * it in place of what is shown, with nothing to undo, and `undefined` given in place of one opens an empty Sheet
895
+ * in `locale`; one `onWorkbookChanged` handed out, handed back as a controlled component's state is, is the
896
+ * Sheet's own and changes nothing. */
897
+ readonly document?: SheetDocument | WorkbookDocument | undefined;
898
+ /** The culture of a Sheet started empty: how typed constants are read and Values shown (ADR-0048). A document
899
+ * carries its own. The browser's language unless given; one the engine holds no data for is refused by name. */
900
+ readonly locale?: string;
901
+ /** Shows the Formula Bar and its Name Box above the columns (ADR-0051); shown unless `false`. */
902
+ readonly showFormulaBar?: boolean;
903
+ /** How many leading columns are pinned — the Sheet's frozen panes, columns only (ADR-0046). */
904
+ readonly pinnedColumnCount?: number;
905
+ /** Shows the Row Headings, the row numbers, beside the rows (ADR-0050); shown unless `false`. The Sheet still
906
+ * addresses `A1` without them. */
907
+ readonly showRowHeadings?: boolean;
908
+ /** Shows the Column Headings, the column letters, above the rows (ADR-0050); shown unless `false`. The Sheet
909
+ * still addresses `A1` without them. */
910
+ readonly showColumnHeadings?: boolean;
911
+ /** Shows the Sheet Tabs at the Sheet's foot, one per Sheet of the Workbook, as Excel does (ADR-0331); shown unless
912
+ * `false`. Their band, as tall as the Formula Bar, comes off `viewportHeight`. */
913
+ readonly showSheetTabs?: boolean;
914
+ /** Shows the Sheet Toolbar above the Formula Bar (ADR-0100): Excel's Home tab formatting commands, acting on this
915
+ * Sheet's Selection. Off unless `true`. Its band, a row as tall as the Formula Bar, comes off `viewportHeight`. */
916
+ readonly showToolbar?: boolean;
917
+ /**
918
+ * The Sheet Toolbar's rows, top to bottom (ADR-0100). `'default'` is ExSheet's own row, Excel's Home tab's commands,
919
+ * whose KeyTip is H; a row of the Consumer's holds ExSheet's items by their commands, separators and the Consumer's
920
+ * own buttons, in the order given. Without it the toolbar is the default row alone. Every row is as tall as the
921
+ * Formula Bar and comes off `viewportHeight`; what a row holds is fitted to it and clipped. KeyTips that would be
922
+ * taken for one another at one level, two rows' or two items' of one row, are refused.
923
+ */
924
+ readonly toolbar?: readonly (SheetToolbarRowOptions | 'default')[] | undefined;
925
+ /**
926
+ * Hears the other value of `showToolbar` when the user asks to hide or show the Sheet Toolbar with Ctrl+F1, Excel's
927
+ * key for the ribbon (ADR-0100). The Sheet holds nothing: whether the toolbar is shown is View State, the
928
+ * Consumer's, so handing the value back as `showToolbar` is what lets the key work. Without it, Ctrl+F1 is not
929
+ * claimed and stays the browser's.
930
+ */
931
+ readonly onShowToolbarChanged?: (shown: boolean) => void;
932
+ /** The parts of the Sheet a Chrome of the Consumer's, or a Wrapper's, draws in place of the built-in ones (ADR-0390). */
933
+ readonly chrome?: SheetChrome;
934
+ /** ExSheet's Japanese words in place of its English (ADR-0370, section 10), chosen in one line, never by the
935
+ * locale. */
936
+ readonly japanese?: boolean;
937
+ /** The Consumer's word for any id, which wins over ExSheet's own (ADR-0370, section 10). */
938
+ readonly label?: SheetLabel;
939
+ /**
940
+ * The Consumer's word for each of the grid's own ids, its commands and its refusals (ADR-0036, ADR-0203), handed to
941
+ * the Sheet's grid as its `commandLabel`: `undefined` keeps the grid's English, and the empty string silences the
942
+ * announcement of a refusal. The Sheet's own ids are worded through `label`.
943
+ */
944
+ readonly commandLabel?: (id: string) => string | undefined;
945
+ /** Shows the Selection Summary under the Sheet, as Excel's status bar does (ADR-0130); shown unless `false`.
946
+ * `onSelectionSummaryChanged` still hears it while hidden. */
947
+ readonly showSelectionSummary?: boolean;
948
+ /** The Selection Summary's figures, Excel's Average, Count and Sum unless given (ADR-0130). The Sheet holds the
949
+ * choice made in the figures menu from then on, and tells it through `onSummaryFiguresChanged`; figures handed here
950
+ * that differ from the ones given before replace it. */
951
+ readonly summaryFigures?: readonly SummaryFigure[];
952
+ /** Hears the figures the user chose in the figures menu, a right-click on the summary (ADR-0130). The Sheet already
953
+ * shows them. */
954
+ readonly onSummaryFiguresChanged?: (figures: readonly SummaryFigure[]) => void;
955
+ /** Hears the Selection Summary as it now stands (ADR-0130), for an application that shows the figures elsewhere. */
956
+ readonly onSelectionSummaryChanged?: (summary: SelectionSummary) => void;
957
+ /**
958
+ * Offers copy with headers in the Context Menu and by Ctrl+Shift+C, which copies the Values with the column letters
959
+ * as the first row (ADR-0048, ADR-0005). Off unless `true`: a Sheet's column letters are addresses, not headers, and
960
+ * Excel has no such command (ADR-0050 item 13), so the key is left to the page.
961
+ */
962
+ readonly allowCopyWithHeaders?: boolean;
963
+ /**
964
+ * Hears that one of Excel's formatting keys was pressed while an edit is open (ADR-0071): the key changed nothing,
965
+ * and the Sheet's notice says why. In that state Excel formats the selected characters, and a Cell Format is per
966
+ * cell. The key is still claimed, so the browser's own meaning does not run either: Ctrl+U opens no page source.
967
+ */
968
+ readonly onFormatKeyRefused?: (refusal: SheetRefusal) => void;
969
+ /** The grid's density (ADR-0028); a Wrapper's, then `compact`, unless given. Column widths in characters follow it. */
970
+ readonly density?: GridDensity;
971
+ /**
972
+ * A Wrapper's widths and Density (ADR-0030), as the grid takes them: the cells are painted in the Wrapper's font, so
973
+ * the Sheet's columns are measured in its characters, and the Sheet decides what fits by them (ADR-0016, ADR-0071).
974
+ */
975
+ readonly presentationDefaults?: GridPresentationDefaults;
976
+ /** The height of a row in pixels (ADR-0013). */
977
+ readonly rowHeight?: number;
978
+ /**
979
+ * How many rows and columns every Sheet holds (ADR-0460): `{ rows: 10, columns: 10 }` draws `A1:J10` and nothing
980
+ * past it, and `{ rows: 10 }` holds ten rows of Excel's 16,384 columns. Excel's 1,048,576 × 16,384 unless given.
981
+ * Every move stops at the edge, and a paste, a fill or an insertion that would put an Entry past it is refused by
982
+ * name, never cut; a spilled array that would pass it is `#SPILL!`. A Reference past it still reads the empty cell
983
+ * it names, so a Formula means what it means in Excel. A document with an Entry past it is refused when it is
984
+ * opened, and a smaller size handed in later that would leave one outside, or while a cell is being edited, is
985
+ * refused, the Sheet keeping the size it had; a smaller size taken empties the undo stack, whose steps could put an
986
+ * Entry back past it. The size is the screen's, not the document's: it is not saved.
987
+ */
988
+ readonly sheetSize?: SheetSizeOptions;
989
+ /** The grid's width: pixels, or `stretch` to fill the element's box. */
990
+ readonly viewportWidth?: ViewportSize;
991
+ /** The grid's height: pixels, or `stretch` to fill the element's box. */
992
+ readonly viewportHeight?: ViewportSize;
993
+ /** Hears the Workbook as it stands after each operation: an edit, an undo, a redo, a width. */
994
+ readonly onWorkbookChanged?: (document: WorkbookDocument) => void;
995
+ /**
996
+ * Hears a Sheet added, deleted, renamed, moved or copied — by a command, by the user, or by an undo or redo of
997
+ * one — after `onWorkbookChanged`, with the Sheets' names before and after (ADR-0331 §6). Showing another Sheet
998
+ * changes no Sheet, and is not heard; neither is a new document opened.
999
+ */
1000
+ readonly onSheetsChanged?: (change: SheetsChange) => void;
1001
+ /**
1002
+ * Hears whether there is a step to undo and one to redo, each time either changes: as the operation that changed it
1003
+ * ends, before `onWorkbookChanged` hears its document, and when a document opened empties the undo stack (ADR-0048). This is
1004
+ * where an application greys out its own Undo and Redo, as `canUndo` and `canRedo` read the same at any time.
1005
+ */
1006
+ readonly onHistoryChanged?: (history: SheetHistoryState) => void;
1007
+ /**
1008
+ * Hears whether an edit is open, each time that changes: `true` when a cell or the Formula Bar is typed in, or
1009
+ * opened with F2 or a double click, `false` when the edit is committed, cancelled or discarded (ADR-0048). While
1010
+ * one is open the commands that change the Sheet are refused, so this is where an application greys out its own
1011
+ * buttons for them, as Excel greys out its ribbon.
1012
+ */
1013
+ readonly onEditingChanged?: (open: boolean) => void;
1014
+ /**
1015
+ * Hears each Linked Table column the Formula being edited reads, and the colour its References wear in the
1016
+ * editor (ADR-0057, ADR-0049): each column once, in order of first appearance, under the table's and the
1017
+ * column's names as the Consumer declared them. Told once whenever that list changes and never when it does
1018
+ * not, and with an empty list when the edit ends. A table or column not declared names nothing and is not
1019
+ * told. The Sheet does not know where, or whether, the table is on screen, and outlines none of it itself: the
1020
+ * Consumer hands each entry to the grid that shows the table as one of its `outlinedColumns`, the grid column
1021
+ * that shows `column` with the same `colour`, and only it can vouch that that grid shows the rows the Formula
1022
+ * reads.
1023
+ */
1024
+ readonly onLinkedColumnColoursChanged?: (columns: readonly LinkedColumnColour[]) => void;
1025
+ /**
1026
+ * The Pointing Scope this Sheet belongs to (ADR-0058), or none. While this Sheet holds the keyboard, has an edit
1027
+ * open and is in Point, its caret standing where a Reference can go or what Point wrote there still standing, the
1028
+ * grids registered in the Scope are pointed at: a press on a cell writes
1029
+ * `XLOOKUP("R-4471", Positions[Id], Positions[PV])`, reading the cell by its row's key, where Point writes, and a
1030
+ * press on a column header `Positions[PV]`, in the table's column names as this Sheet declares them. A further press, on a registered grid or on this Sheet, replaces what this Point
1031
+ * wrote. A press that stands for anything else writes nothing, and is told through `onPointingRefused`. When the
1032
+ * keyboard leaves this Sheet, no grid is pointed at, and the edit stands.
1033
+ *
1034
+ * After such a press F4 changes nothing, and the arrow keys point inside the grid pressed: ↑ and ↓ one row further
1035
+ * in its current order, ← and → to the next column its table has, rewriting what this Point wrote, and the grid
1036
+ * scrolls the cell into view. After a press on a column header, ↓ points at the column's first row, and ← and → at
1037
+ * the next column its table has, as a column; ↑ moves nothing. The Scope also outlines, in the grids registered
1038
+ * for their table, the Linked Table columns the Formula edited here reads, and dashes the cell or column a press
1039
+ * wrote for until Point over what it wrote ends.
1040
+ */
1041
+ readonly pointingScope?: PointingScope | undefined;
1042
+ /**
1043
+ * Hears that a press on a grid of `pointingScope`, or an arrow key after one, wrote nothing into the Formula being
1044
+ * edited, and why (ADR-0058): more than one cell or column, a Header Group, a column the table does not have, a
1045
+ * table declared without a key, a blank key, a row not yet arrived. A drag that reached another cell took back
1046
+ * what its press wrote. The Formula's text is as it was before the press or the key. The Sheet shows nothing of
1047
+ * it itself: show the refusal's `message` where the page tells its user things.
1048
+ */
1049
+ readonly onPointingRefused?: (refusal: PointingRefusal) => void;
1050
+ /** Hears the grid's Selection each time it changes, as ExGrid reports it (ADR-0011/0014): what a status line
1051
+ * counts. The formatting commands do not wait for it: they act on the Selection the grid holds when they run. */
1052
+ readonly onSelectionChanged?: (selection: GridSelection) => void;
1053
+ /**
1054
+ * A fixed Sheet Seed (ADR-0180): what `RAND()` and `RANDBETWEEN` draw from, with the Sheet, the cell, the call's
1055
+ * place in its Formula and the count of changes since the document was opened — for a sheet that must show the
1056
+ * same draws whenever it is opened, such as a simulation someone else reviews. The draws still change at each
1057
+ * change of the Workbook, and never on the clock. Unless given, the Sheet chooses a seed whenever it opens a
1058
+ * document, so a reopened sheet draws again, as Excel's reopened workbook does. An unsigned 64-bit integer; the
1059
+ * seed is not recorded in the document.
1060
+ */
1061
+ readonly seed?: bigint;
1062
+ /**
1063
+ * A fixed Sheet Day: what `TODAY()` answers whatever the clock says (ADR-0121), for a report that must show the same
1064
+ * day whenever it is opened. It goes before `timeZone`. Unless given, the day is the clock's in the zone, read again
1065
+ * at midnight there, and at least once an hour.
1066
+ */
1067
+ readonly today?: SheetDay | undefined;
1068
+ /**
1069
+ * The IANA time zone whose day `TODAY()` and whose time of day `NOW()` answer (ADR-0121, ADR-0124), such as head
1070
+ * office's for a site that keeps one business day for every user. The browser's zone unless given, as Excel takes the
1071
+ * day on the user's own device; one the browser does not know is refused by name. A fixed `today` goes before it for
1072
+ * `TODAY()`, not for `NOW()`, which moves on as each minute turns.
1073
+ */
1074
+ readonly timeZone?: string | undefined;
1075
+ }
1076
+
1077
+ /** The Sheets' names before and after a change to the Sheets (ADR-0331 §6), in the Workbook's order. */
1078
+ export declare interface SheetsChange {
1079
+ /** The names as they were. */
1080
+ readonly before: readonly string[];
1081
+ /** The names as they are now. */
1082
+ readonly after: readonly string[];
1083
+ /** The name of the Sheet shown after the change. */
1084
+ readonly shown: string;
1085
+ }
1086
+
1087
+ /** How many rows and columns every Sheet holds (ADR-0460), each from 1 to Excel's 1,048,576 rows and 16,384 columns. */
1088
+ export declare interface SheetSizeOptions {
1089
+ /** How many rows, from 1 to 1,048,576; Excel's 1,048,576 unless given, so `{ columns: 10 }` narrows only the
1090
+ * columns. */
1091
+ readonly rows?: number;
1092
+ /** How many columns, from 1 to 16,384 (`A` to `XFD`); Excel's 16,384 unless given, so `{ rows: 10 }` shortens only
1093
+ * the rows. */
1094
+ readonly columns?: number;
1095
+ }
1096
+
1097
+ /**
1098
+ * What the key does to the Selection on a Sheet of the extent: the rows a Selection of whole rows spans, or the
1099
+ * columns a Selection of whole columns spans, inserted above or to the left, or deleted, as the Context Menu's
1100
+ * commands do. `undefined` for every other Selection — several ranges, every cell at once, or a range that is
1101
+ * not whole rows or whole columns — which the key refuses: Excel opens a dialog there that shifts cells, and
1102
+ * ExSheet shifts no cells (ADR-0050 item 14).
1103
+ */
1104
+ export declare function sheetStructureEditFor(kind: SheetStructureKey, selection: GridSelection, extent: GridExtent): SheetEdit | undefined;
1105
+
1106
+ /** What an insert or delete key does. */
1107
+ export declare type SheetStructureKey = 'insert' | 'delete';
1108
+
1109
+ /** What a declared key does; `undefined` for a key that is not one of these. */
1110
+ export declare function sheetStructureKeyOf(key: string): SheetStructureKey | undefined;
1111
+
1112
+ /** The keys ExSheet declares to its grid for inserting and deleting, in the grid's canonical form. */
1113
+ export declare function sheetStructureKeysDeclared(): readonly string[];
1114
+
1115
+ /**
1116
+ * The selected cells of a Sheet as a Selection Summary reads them: the first refused cell in reading order and
1117
+ * what it shows, or the cells sorted by what they are, with the Focus cell whose Number Format the figures are
1118
+ * shown in (Excel's status bar shows them in the active cell's, read in the Windows run of 2026-10-11).
1119
+ */
1120
+ export declare type SheetSummaryCells = {
1121
+ readonly kind: 'refused';
1122
+ readonly at: CellAddress;
1123
+ readonly shown: string;
1124
+ } | {
1125
+ readonly kind: 'cells';
1126
+ /** Each number, a date's serial number among them, in Excel's double. */
1127
+ readonly numbers: readonly number[];
1128
+ /** How many cells hold an Error Value. */
1129
+ readonly errors: number;
1130
+ /** How many cells hold text or a Boolean. */
1131
+ readonly others: number;
1132
+ /** The Focus cell on the Sheet, or `undefined` where the request has none. */
1133
+ readonly focus: CellAddress | undefined;
1134
+ };
1135
+
1136
+ /** The cells a request names over a Sheet, as a Selection Summary reads them (ADR-0130). */
1137
+ export declare function sheetSummaryCells(sheet: Sheet, request: GridSummaryRequest): SheetSummaryCells;
1138
+
1139
+ /** The Selection Summary declined over a refused cell, with the reason in the Sheet's words (2026-10-13,
1140
+ * decided with the user). */
1141
+ export declare function sheetSummaryDeclined(refused: {
1142
+ readonly at: CellAddress;
1143
+ readonly shown: string;
1144
+ }, words: SheetWords): GridSummaryResult;
1145
+
1146
+ /** The face of the button that adds a Sheet (ADR-0331 §4, ADR-0390), inside the button the Sheet keeps, which is
1147
+ * named and hears the press; the face takes no keyboard and hears nothing. Mounted once. */
1148
+ export declare type SheetTabAddSlot = (slot: HTMLElement) => () => void;
1149
+
1150
+ /** One of the commands of a Sheet Tab's menu (ADR-0331 §4), in the order the menu offers them. */
1151
+ export declare type SheetTabCommand = 'rename' | 'delete' | 'moveLeft' | 'moveRight' | 'copy';
1152
+
1153
+ /** Excel's keys for the Sheet Tabs, in the grid's canonical form. */
1154
+ export declare const sheetTabKeys: Readonly<{
1155
+ /** Shows the Sheet before the one shown. */
1156
+ readonly previous: 'Control+PageUp';
1157
+ /** Shows the Sheet after the one shown. */
1158
+ readonly next: 'Control+PageDown';
1159
+ /** Adds a Sheet before the one shown. */
1160
+ readonly insert: 'Shift+F11';
1161
+ }>;
1162
+
1163
+ /** The keys ExSheet declares to its grid for the Sheet Tabs. */
1164
+ export declare function sheetTabKeysDeclared(): readonly string[];
1165
+
1166
+ /**
1167
+ * A Sheet Tab's face (ADR-0331 §4, ADR-0390): mounts what stands inside the tab the Sheet keeps, which takes the
1168
+ * keyboard, is a tab to assistive technology and hears the press. The face takes no keyboard and hears nothing. It is
1169
+ * mounted again, on the same slot, whenever the name or `selected` changes, and answers the function that takes it
1170
+ * away.
1171
+ */
1172
+ export declare type SheetTabSlot = (slot: HTMLElement, context: SheetTabSlotContext) => () => void;
1173
+
1174
+ /** What a Sheet Tab's face shows (ADR-0331 §4): the C# `SheetTabContext`. */
1175
+ export declare interface SheetTabSlotContext {
1176
+ /** The Sheet's name, which the face shows as its only text. */
1177
+ readonly name: string;
1178
+ /** Whether the Sheet is the one shown. */
1179
+ readonly selected: boolean;
1180
+ }
1181
+
1182
+ /** How far the key moves among the Sheets: -1 or 1, or `undefined` for a key that is not one of these. */
1183
+ export declare function sheetTabStepOf(key: string): -1 | 1 | undefined;
1184
+
1185
+ /** A preset of the Sheet Toolbar's Borders list (ADR-0100), in Excel's order. */
1186
+ export declare type SheetToolbarBorder = 'bottom' | 'top' | 'left' | 'right' | 'none' | 'all' | 'outside' | 'thickOutside';
1187
+
1188
+ /**
1189
+ * A Consumer's own action on the Sheet Toolbar (ADR-0100), a Toolbar Item like ExSheet's: it stands in a row of its own
1190
+ * or among the formatting items, and while an edit is open it cannot be pressed. It carries a KeyTip only where one is
1191
+ * given.
1192
+ */
1193
+ export declare interface SheetToolbarButton {
1194
+ /** Its name: the text it shows, its accessible name and its tooltip. */
1195
+ readonly text: string;
1196
+ /** What pressing it does. A press from the keys gives the keyboard back to the Sheet first, so what the press opens
1197
+ * may take it. */
1198
+ readonly onPress: () => void;
1199
+ /** Its KeyTip letters among its row's items. */
1200
+ readonly keyTip?: string | undefined;
1201
+ /** Why it cannot be pressed now, shown in its tooltip; `undefined` where it can. */
1202
+ readonly disabledReason?: string | undefined;
1203
+ /** Its own content, such as an icon, drawn in place of its text, which still names it. Hand the same function on
1204
+ * every update: a new one draws the content again. */
1205
+ readonly content?: SheetToolbarContent | undefined;
1206
+ }
1207
+
1208
+ /** A command of the Sheet Toolbar's default row (ADR-0100), in Excel's Home tab order. */
1209
+ export declare type SheetToolbarCommand = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'fontColour' | 'fill' | 'borders' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'numberFormat' | 'percent' | 'comma' | 'formatCells';
1210
+
1211
+ /**
1212
+ * A Consumer's own content for a Toolbar Item (ADR-0100), such as an icon, drawn in place of its text: mounted into
1213
+ * `element`, it answers the function that takes it away. The item's text still names it, as its accessible name and its
1214
+ * tooltip. The C# `ToolbarButton`'s `ChildContent`.
1215
+ */
1216
+ export declare type SheetToolbarContent = (element: HTMLElement) => () => void;
1217
+
1218
+ /** One element of a Toolbar Row: one of ExSheet's own items, named by its command and carrying Excel's KeyTip; a
1219
+ * separator between groups; or the Consumer's own button. */
1220
+ export declare type SheetToolbarEntry = SheetToolbarCommand | 'separator' | SheetToolbarButton;
1221
+
1222
+ /** A picture the built-in Chrome draws for a Toolbar Item. */
1223
+ export declare type SheetToolbarIcon = 'bold' | 'italic' | 'underline' | 'strikethrough' | 'alignLeft' | 'alignCenter' | 'alignRight' | 'percent' | 'comma' | 'formatCells' | 'fontColour' | 'fill' | 'borders';
1224
+
1225
+ /** One choice of a Toolbar Item's list, as the item's contents are handed it. */
1226
+ export declare interface SheetToolbarItemChoice {
1227
+ /** Its words: a colour's name, a Number Format's category, a border preset's name. */
1228
+ readonly label: string;
1229
+ /** For a colour, the colour as CSS paints it: the label is its name. */
1230
+ readonly swatch: string | undefined;
1231
+ /** Whether it is what the Focus cell has. */
1232
+ readonly selected: boolean;
1233
+ /** Why it cannot be chosen, or `undefined` where it can. */
1234
+ readonly disabledReason: string | undefined;
1235
+ }
1236
+
1237
+ /** What a Toolbar Item is: a split control's face does what it shows and its arrow opens its list; a menu opens its
1238
+ * list. */
1239
+ export declare type SheetToolbarItemKind = 'toggle' | 'button' | 'split' | 'menu';
1240
+
1241
+ /**
1242
+ * A Toolbar Item's slot (ADR-0390): mounts the item's contents in `slot` and answers the function that takes them
1243
+ * away, or answers `undefined` and draws nothing, for the built-in Chrome to draw the item, as the C# Chrome's
1244
+ * `ToolbarItem` answers null. Asked once per item, again only when the item's kind or the slot changes.
1245
+ */
1246
+ export declare type SheetToolbarItemSlot = (slot: HTMLElement, context: SheetToolbarItemSlotContext) => (() => void) | undefined;
1247
+
1248
+ /**
1249
+ * What a Toolbar Item's contents are handed (ADR-0100, ADR-0390), once per mount: what the item is, and how it shows
1250
+ * now through `view` and `subscribe`, as the Cell Editor's slot is. The contents draw a control in the slot that keeps
1251
+ * the keyboard where it is on a pointer press (its `mousedown` default prevented), as the built-in items do. A control
1252
+ * marked `data-ex-claims="click"`, as the built-in items are, has its press wait behind a commit or an opening and taken
1253
+ * in its turn (ADR-0240); the keys typed on the toolbar wait whatever the contents are.
1254
+ */
1255
+ export declare interface SheetToolbarItemSlotContext {
1256
+ /** Stable for the item's place in the toolbar. */
1257
+ readonly id: string;
1258
+ /** What the item is, which decides whether it has a list. */
1259
+ readonly kind: SheetToolbarItemKind;
1260
+ /** What the item shows now. */
1261
+ readonly view: () => SheetToolbarItemView;
1262
+ /** Hears each change to the view; answers the function that stops hearing it. */
1263
+ readonly subscribe: (listener: () => void) => () => void;
1264
+ /** Presses the item as the built-in Chrome's does: a toggle or a button, a split control's face, or a menu's,
1265
+ * which opens the built-in list. An item that cannot be pressed now does nothing. */
1266
+ readonly invoke: () => void;
1267
+ /**
1268
+ * The contents' own list has closed: with the index of the choice made, or `undefined` for none, and whether
1269
+ * Escape closed it. The keyboard goes back to the Sheet, or to the KeyTips where Escape closes a list a KeyTip
1270
+ * opened, and the choice is then made, as the built-in list makes it. A choice that is not the list's, or one that
1271
+ * cannot be chosen, is refused by name.
1272
+ */
1273
+ readonly choicesClosed: (choice: number | undefined, escaped: boolean) => void;
1274
+ }
1275
+
1276
+ /** What a Toolbar Item shows now: read through {@link SheetToolbarItemSlotContext.view}, the same object until
1277
+ * something in it changes. */
1278
+ export declare interface SheetToolbarItemView {
1279
+ /** The item's name, the built-in Chrome's `aria-label`: `Fill Colour`. */
1280
+ readonly name: string;
1281
+ /** The name with its key, for the tooltip: `Bold (Ctrl+B)`. */
1282
+ readonly tooltip: string;
1283
+ /** The built-in Chrome's picture for it, or `undefined` for an item that shows its text. */
1284
+ readonly icon: SheetToolbarIcon | undefined;
1285
+ /** For a menu, the text its face shows: the Number Format's category; for a Consumer's button, its text, unless it
1286
+ * has `content`. */
1287
+ readonly text: string | undefined;
1288
+ /** For a Consumer's button, its own content, drawn in place of its text: the contents mount it into an element of
1289
+ * theirs, and call what it answers when they take that element away. */
1290
+ readonly content: SheetToolbarContent | undefined;
1291
+ /** For a colour control, the colour its face sets, as CSS paints it. */
1292
+ readonly swatch: string | undefined;
1293
+ /** For a split control, its arrow's name: `Borders, more`. */
1294
+ readonly moreName: string | undefined;
1295
+ /** For a toggle: whether the Focus cell has what it sets. */
1296
+ readonly pressed: boolean;
1297
+ /** Why it cannot be pressed now, or `undefined` where it can: while an edit is open, every item says so. */
1298
+ readonly disabledReason: string | undefined;
1299
+ /** Whether the toolbar's keyboard is on it, as the built-in Chrome outlines the item. */
1300
+ readonly active: boolean;
1301
+ /** For a menu or a split control, its list's choices, the Focus cell's marked; none otherwise. */
1302
+ readonly choices: readonly SheetToolbarItemChoice[];
1303
+ /** The count of the toolbar's requests for the list: ↓, Enter or Space on a menu, or a KeyTip. Whenever it
1304
+ * differs from the one the contents last answered, they open their list and give it the keyboard; one they
1305
+ * cannot open is closed at once through `choicesClosed`, choosing nothing. It starts at 0, a request not yet
1306
+ * made. */
1307
+ readonly openRequest: number;
1308
+ /** Set to `openRequest` when the toolbar asks the list to close: it gives the keyboard back while the list it
1309
+ * asked for may still be opening, or what the list was opened over has changed — the Selection moved, another
1310
+ * Sheet shown, an operation run, the toolbar hidden — as each ends the built-in list. Where no request stood, both
1311
+ * move on together, so a list opened by a press closes too. The contents close their list, telling nothing, and
1312
+ * answer no `openRequest` that `closeRequest` has reached. */
1313
+ readonly closeRequest: number;
1314
+ }
1315
+
1316
+ /**
1317
+ * The built-in Chrome's pictures for the Toolbar Items (ADR-0100), the C# Chrome's: each the inside of an SVG of view
1318
+ * box `0 0 16 16`, drawn with `fill="none"` and `stroke="currentColor"`, round caps and joins, so the colour is the
1319
+ * text's. A Chrome without pictures of its own draws these.
1320
+ */
1321
+ export declare const sheetToolbarPictures: Readonly<Record<SheetToolbarIcon, string>>;
1322
+
1323
+ /** A Toolbar Row of the Consumer's (ADR-0100): one band of the Sheet Toolbar, as tall as the Formula Bar. */
1324
+ export declare interface SheetToolbarRowOptions {
1325
+ /** The row's accessible name. */
1326
+ readonly label: string;
1327
+ /** The row's KeyTip letters, as a ribbon tab's; a row without one is reached by Tab and the arrows only. */
1328
+ readonly keyTip?: string | undefined;
1329
+ /** What the row holds, in order. */
1330
+ readonly items: readonly SheetToolbarEntry[];
1331
+ }
1332
+
1333
+ /**
1334
+ * The turn of work the Sheet runs in its Input Order, handed to that work (ADR-0240 section 6). A file opened or saved
1335
+ * through it is opened or saved at once, inside the turn, as `open` and `save` do in their own place: for a Framework
1336
+ * Adapter whose Consumer's handler runs in another runtime while the turn is held, as a Toolbar button's press holds
1337
+ * it, where `open` and `save` would wait for the turn they belong to. The inputs made meanwhile wait behind both. Once
1338
+ * the turn's work has ended, each throws.
1339
+ */
1340
+ export declare interface SheetTurn {
1341
+ /** Opens a file at once, inside this turn, as `SheetHandle.open` does in its place. */
1342
+ open(read: (signal: AbortSignal) => PromiseLike<WorkbookDocument>): Promise<boolean>;
1343
+ /** Saves the Workbook at once, inside this turn, as `SheetHandle.save` does in its place. */
1344
+ save(write: (workbook: Workbook) => void | PromiseLike<void>): Promise<void>;
1345
+ }
1346
+
1347
+ /**
1348
+ * The id of every word ExSheet shows: stable, so a Consumer's label function can answer it. An id with a
1349
+ * reason or a name in it takes the reason or the name as the union beside it spells it.
1350
+ */
1351
+ export declare type SheetWordId = 'formulaUnreadable' | 'addressUnreadable' | 'addressPastEdge' | 'sheetNotNamed' | 'editIsOpen' | 'selectionMoved' | 'focusFormatChanged' | 'saveWhileEditing' | 'opening' | 'openWhileEditing' | 'opened' | 'openingCancelled' | 'openingRefused' | 'openingAlreadyLanded' | 'openingNothingToCancel' | 'editDiscardedByOpening' | 'formatKeyWhileEditing' | 'structureKeyWhileEditing.insert' | 'structureKeyWhileEditing.delete' | 'structureKeyNeedsWholeRowsOrColumns.insert' | 'structureKeyNeedsWholeRowsOrColumns.delete' | 'toolbarName' | 'toolbarWhileEditing' | 'toolbar.row.home' | 'toolbar.withShortcut' | `toolbar.item.${SheetToolbarCommand}` | 'toolbar.more' | 'toolbar.automatic' | 'toolbar.noFill' | `toolbar.border.${SheetToolbarBorder}` | 'toolbar.moreNumberFormats' | 'sheetTabsName' | 'editSheetGone' | 'sheetSwitchWhileEditing' | 'sheetOperationWhileEditing' | 'sheetAdded' | 'sheetRenamed' | 'sheetDeleted' | 'sheetMoved' | 'sheetCopied' | 'sheetNotRenamed' | 'newSheetName' | 'sheetNameField' | 'sheetMenuName' | `tabCommand.${SheetTabCommand}` | 'onlySheet' | 'sheetGone' | 'sheetNotChanged' | 'firstSheet' | 'lastSheet' | 'commaStyleUnread' | 'editDiscardedByNewDocument' | `editDiscarded.${EditDiscardReason}` | 'pasteReadsDifferently' | 'pasteRefusedFormula' | 'summaryRefused' | 'pasteTooNarrowToShow' | `pasteRefused.${PasteRefusalReason}` | `commitRefused.${CommitRefusalReason}` | `placementRefused.${PlacementRefusalReason}` | 'overwritten' | `copyRefused.${CopyRefusalReason}` | `pointingRefused.${PointingRefusalWordCase}` | 'pointingExtendedByKey' | 'nothingToUndo' | 'nothingToRedo' | `command.${SheetContextCommand}` | `find.${SheetFindWithinWord}` | 'formatCellsTitle' | `formatCells.tab.${FormatCellsTab}` | `formatCells.category.${NumberFormatCategory}` | `formatCells.disabled.${DisabledNumberFormatCategory}` | 'formatCells.noNumberFormatCode' | 'formatCells.numberFormatNotRead' | 'formatCells.notAColour' | `formatCells.alignment.${HorizontalAlignment}` | `formatCells.fontStyle.${FontStyle}` | `formatCells.edge.${BorderEdge}` | `formatCells.preset.${BorderPreset}` | `formatCells.lineStyle.${BorderLineStyle}` | `formatCells.colour.${ThemeColourName | StandardColourName}` | 'formatCells.colourDarker' | 'formatCells.colourLighter' | 'formatCells.colourStep' | `formatCells.label.${FormatCellsLabel}` | 'formatCells.symbol';
1352
+
1353
+ /** Every id ExSheet has a word for: what a Consumer replaces to give ExSheet another language. */
1354
+ export declare function sheetWordIdList(): readonly SheetWordId[];
1355
+
1356
+ /**
1357
+ * The words ExSheet shows, each through the Consumer's label function, else ExSheet's own (ADR-0370,
1358
+ * section 10). Its members are named as the C# package's SheetWords names them: a sentence that says something
1359
+ * of the moment is a function of what it names, and its arguments are put into the template its id answers.
1360
+ */
1361
+ export declare class SheetWords {
1362
+ #private;
1363
+ /** The words as `choice` chooses them; none is ExSheet's English throughout. */
1364
+ constructor(choice?: SheetWordsChoice);
1365
+ /** The word for an id: the label's, else ExSheet's own. A template is returned as it is. */
1366
+ word(id: SheetWordId): string;
1367
+ /** A Formula the engine could not read, with where and why: `This Formula cannot be read at character 4: …`. */
1368
+ formulaUnreadable(error: FormulaSyntaxError): string;
1369
+ /** What was typed into the Name Box is not a place on the Sheet (ADR-0051). */
1370
+ addressUnreadable(typed: string): string;
1371
+ /** What was typed into the Name Box is a place past the Sheet Size, whose last cell is `edge` (ADR-0460). */
1372
+ addressPastEdge(typed: string, edge: CellAddress): string;
1373
+ /** A refusal of the engine's, in its own words: the engine's refusals carry no id yet. */
1374
+ refused(refusal: SheetRefusal): string;
1375
+ /** A command over a Workbook of several Sheets that names none (ADR-0331 §6): taken against the Sheet
1376
+ * shown, its outcome would depend on whether a press on a tab reached the instance first. */
1377
+ sheetNotNamed(sheets: number): string;
1378
+ /** A change refused while a cell is being edited. */
1379
+ get editIsOpen(): string;
1380
+ /** A change made from the Focus cell's format away from the Sheet, refused because the Selection moved before it
1381
+ * was set (ADR-0100). */
1382
+ get selectionMoved(): string;
1383
+ /** Such a change, refused because the Focus cell's format changed before it was set (ADR-0100). */
1384
+ get focusFormatChanged(): string;
1385
+ /** A save refused while a cell is being edited (ADR-0330 §10): it would quietly lack what is being typed. */
1386
+ get saveWhileEditing(): string;
1387
+ /** An opening under way, said once as it starts (ADR-0330 §10, ADR-0240 §12). */
1388
+ get opening(): string;
1389
+ /** An opening refused while a cell is being edited (ADR-0330 §10, ADR-0048). */
1390
+ get openWhileEditing(): string;
1391
+ /** A file opened. */
1392
+ get opened(): string;
1393
+ /** An opening cancelled. */
1394
+ get openingCancelled(): string;
1395
+ /** An opening refused, with the reason the file was refused for. */
1396
+ openingRefused(reason: string): string;
1397
+ /** The Escape that found the opening landed (ADR-0240 §12). */
1398
+ get openingAlreadyLanded(): string;
1399
+ /** An Escape that found the opening over, refused or cancelled already: said, never swallowed (ADR-0240 §12). */
1400
+ get openingNothingToCancel(): string;
1401
+ /** What was typed, thrown away by a file opened during the edit. */
1402
+ get editDiscardedByOpening(): string;
1403
+ /** A formatting key while an edit is open (ADR-0071): Excel formats the selected characters there, and a
1404
+ * Cell Format is per cell. */
1405
+ get formatKeyWhileEditing(): string;
1406
+ /** An insert or delete key while an edit is open (ADR-0050 item 14, 2026-10-02). */
1407
+ structureKeyWhileEditing(insert: boolean): string;
1408
+ /** An insert or delete key over a Selection of neither whole rows nor whole columns (ADR-0050 item 14,
1409
+ * 2026-10-02): Excel shifts cells there, and ExSheet shifts none. */
1410
+ structureKeyNeedsWholeRowsOrColumns(insert: boolean): string;
1411
+ /** The Sheet Toolbar's accessible name (ADR-0100). */
1412
+ get toolbarName(): string;
1413
+ /** The Sheet Toolbar's default row, Excel's Home tab (ADR-0100). */
1414
+ get toolbarHomeRow(): string;
1415
+ /** A Toolbar Item's name (ADR-0100): `Bold`. */
1416
+ toolbarItem(command: SheetToolbarCommand): string;
1417
+ /** A Toolbar Item's tooltip, its name with its key (ADR-0100): `Bold (Ctrl+B)`. */
1418
+ toolbarItemWithShortcut(name: string, shortcut: string): string;
1419
+ /** A split control's arrow, which opens its list: `Borders, more`. */
1420
+ toolbarMore(name: string): string;
1421
+ /** The Font Colour list's first choice, which takes the colour away: Excel's Automatic. */
1422
+ get toolbarAutomatic(): string;
1423
+ /** The Fill Colour list's first choice, which takes the fill away: Excel's No Fill. */
1424
+ get toolbarNoFill(): string;
1425
+ /** A preset of the Borders list: `Bottom Border`. */
1426
+ toolbarBorder(preset: SheetToolbarBorder): string;
1427
+ /** The Number Format list's last choice, which opens Format Cells: Excel's More Number Formats…. */
1428
+ get toolbarMoreNumberFormats(): string;
1429
+ /** Why the Sheet Toolbar's items cannot be pressed while an edit is open (ADR-0100). */
1430
+ get toolbarWhileEditing(): string;
1431
+ /** The Sheet Tabs' accessible name (ADR-0331). */
1432
+ get sheetTabsName(): string;
1433
+ /** An edit whose Sheet left the Workbook before it was committed. */
1434
+ get editSheetGone(): string;
1435
+ /** Another Sheet not shown while a constant is being edited; a Formula shows one to point at its cells
1436
+ * (ADR-0331 §5). */
1437
+ get sheetSwitchWhileEditing(): string;
1438
+ /** A Sheet Tab operation refused while an edit is open (ADR-0331 §4). */
1439
+ get sheetOperationWhileEditing(): string;
1440
+ /** A Sheet added, said in the Sheet's live region (ADR-0331 §4). */
1441
+ sheetAdded(name: string): string;
1442
+ /** A Sheet renamed. */
1443
+ sheetRenamed(from: string, to: string): string;
1444
+ /** A Sheet deleted, and how to give it back. */
1445
+ sheetDeleted(name: string): string;
1446
+ /** A Sheet moved to `position`, from 1, of `count` Sheets. */
1447
+ sheetMoved(name: string, position: number, count: number): string;
1448
+ /** A Sheet copied, and the copy's name. */
1449
+ sheetCopied(name: string, copy: string): string;
1450
+ /** A rename refused, with the reason. */
1451
+ sheetNotRenamed(reason: string): string;
1452
+ /** The name a Sheet added is offered under, before it is numbered. */
1453
+ get newSheetName(): string;
1454
+ /** The accessible name of the field a Sheet is renamed in. */
1455
+ get sheetNameField(): string;
1456
+ /** The accessible name of a Sheet Tab's menu. */
1457
+ sheetMenuName(sheet: string): string;
1458
+ /** Why the only Sheet cannot be deleted. */
1459
+ get onlySheet(): string;
1460
+ /** A Sheet that left the Workbook. */
1461
+ get sheetGone(): string;
1462
+ /** A Sheet Tab operation refused, with the reason. */
1463
+ sheetNotChanged(reason: string): string;
1464
+ /** Why the first Sheet does not move before itself. */
1465
+ get firstSheet(): string;
1466
+ /** Why the last Sheet does not move after itself. */
1467
+ get lastSheet(): string;
1468
+ /** Why the Sheet Toolbar has no Comma Style (ADR-0100): it pads with `*`, as Accounting does. */
1469
+ get commaStyleUnread(): string;
1470
+ /** What was typed, thrown away by another Sheet Document opened during the edit. */
1471
+ get editDiscardedByNewDocument(): string;
1472
+ /** What was typed, thrown away by the grid, and why (ADR-0142). */
1473
+ editDiscarded(reason: EditDiscardReason): string;
1474
+ /** A pasted field that came as an invariant value and would read differently typed under the Sheet's
1475
+ * culture, which the sentence names. */
1476
+ pasteReadsDifferently(field: string, culture: Culture): string;
1477
+ /**
1478
+ * A paste of a Sheet's copy that holds a cell ExSheet refused, other than this Sheet's own copy of one range
1479
+ * (ADR-0047; 2026-10-12, decided with the user: a refusal is never caught, anywhere): pasted as a value, the
1480
+ * refusal would become an Error Value a Formula can catch. `refused` is the cell it was copied from.
1481
+ */
1482
+ pasteRefusedFormula(refused: CellAddress): string;
1483
+ /**
1484
+ * Why the Selection Summary shows no figure over a refused cell (2026-10-13, decided with the user): the
1485
+ * first refused cell in reading order, and what it shows, `#VALUE!` or `#NAME?`.
1486
+ */
1487
+ summaryRefused(refused: CellAddress, shown: string): string;
1488
+ /** A pasted field that is how its source shows a value too wide for its column (`####`). */
1489
+ pasteTooNarrowToShow(field: string, at: CellAddress): string;
1490
+ /** A paste, a fill or an entry the grid refused, in the Sheet's terms; `edge` is the Sheet's last cell, which a
1491
+ * block refused for running past it names: `XFD1048576` unless a Sheet Size is smaller (ADR-0460). */
1492
+ pasteRefused(reason: PasteRefusalReason, edge?: CellAddress): string;
1493
+ /** A commit refused because the row it was opened on can no longer be found (ADR-0142, LV-20): the editor
1494
+ * stands with the typing, and only Escape leaves it. */
1495
+ commitRefused(address: string, reason: CommitRefusalReason): string;
1496
+ /** A selection the Consumer asked the grid to place, refused because the rows or columns it was taken
1497
+ * against have moved since (ADR-0005): the Selection stands where it was. */
1498
+ placementRefused(reason: PlacementRefusalReason): string;
1499
+ /** A commit that landed over a cell changed while it was being edited (ADR-0142, LV-11): what it showed when
1500
+ * editing began, and just before. */
1501
+ overwritten(address: string, seen: string, replaced: string): string;
1502
+ /** A copy the grid refused, in the Sheet's terms. */
1503
+ copyRefused(reason: CopyRefusalReason): string;
1504
+ /** What the Context Menu calls one of ExSheet's own commands (ADR-0036). */
1505
+ command(command: SheetContextCommand): string;
1506
+ /** What a Sheet Tab's menu calls one of its commands (ADR-0331 §4). */
1507
+ tabCommand(command: SheetTabCommand): string;
1508
+ /** What the find panel calls Within and its two choices (ADR-0332 §5). */
1509
+ findWithin(word: SheetFindWithinWord): string;
1510
+ /** Format Cells' title. */
1511
+ get formatCellsTitle(): string;
1512
+ /**
1513
+ * What a press on a grid of a Pointing Scope, or an arrow key after one, that wrote nothing tells (ADR-0058):
1514
+ * the table, the column where one is named, and whether a drag took back what its press wrote.
1515
+ */
1516
+ pointingRefused(reason: PointingRefusalReason, table: string, column: string | undefined, tookBack: boolean): string;
1517
+ /** What Shift and an arrow key tell after a press on a grid of a Pointing Scope (ADR-0058): refused as a
1518
+ * range is. */
1519
+ pointingExtendedByKey(table: string): string;
1520
+ /** Ctrl+Z with nothing to undo. */
1521
+ get nothingToUndo(): string;
1522
+ /** Ctrl+Y with nothing to redo. */
1523
+ get nothingToRedo(): string;
1524
+ /** A Format Cells tab's name. */
1525
+ tabName(tab: FormatCellsTab): string;
1526
+ /** A Number Format category's name. */
1527
+ categoryName(category: NumberFormatCategory): string;
1528
+ /** Why a category is shown disabled (ADR-0071). */
1529
+ categoryDisabled(category: DisabledNumberFormatCategory): string;
1530
+ /** A horizontal alignment's name, as the Alignment tab lists it. */
1531
+ alignmentName(alignment: HorizontalAlignment): string;
1532
+ /** A font style's name, as the Font tab lists it. */
1533
+ fontStyleName(style: FontStyle): string;
1534
+ /** An edge's name, as the Border tab's buttons are named. */
1535
+ edgeName(edge: BorderEdge): string;
1536
+ /** A preset's name, as the Border tab lists it. */
1537
+ presetName(preset: BorderPreset): string;
1538
+ /** A line style's name. */
1539
+ lineStyleName(style: BorderLineStyle): string;
1540
+ /** A palette colour's name, as Excel's tooltip gives it: `Dark Blue, Text 2, Lighter 90%`. */
1541
+ swatchName(swatch: PaletteSwatch): string;
1542
+ /** A label of Format Cells' own under the built-in Chrome: a legend, a field or a button (ADR-0071). */
1543
+ formatCellsLabel(label: FormatCellsLabel): string;
1544
+ /** The Currency category's symbol, as the Number tab shows it: `Symbol: $`. */
1545
+ currencySymbolShown(symbol: string): string;
1546
+ /** Why Format Cells' OK cannot set what it shows (ADR-0071). */
1547
+ formatCellsRefusal(refusal: FormatCellsRefusal): string;
1548
+ /** ExSheet's English, through no label. */
1549
+ static readonly english: SheetWords;
1550
+ /** ExSheet's English for the Selection Summary's refusal, a template: `{0}` the cell, `{1}` what it shows. */
1551
+ static readonly summaryRefusedEnglish: string;
1552
+ }
1553
+
1554
+ /** A Sheet's words, chosen once: ExSheet's English, or its Japanese, with the Consumer's label over either
1555
+ * (ADR-0370, section 10). */
1556
+ export declare function sheetWords(choice?: SheetWordsChoice): SheetWords;
1557
+
1558
+ /** How a Sheet's words are chosen (ADR-0370, section 10): ExSheet's English, or its Japanese in one line, and
1559
+ * the Consumer's label over either. */
1560
+ export declare interface SheetWordsChoice {
1561
+ /** ExSheet's Japanese in place of its English: Excel Japanese edition's words where Excel shows the same
1562
+ * thing (`セルの書式設定`, `表示形式`, `ユーザー定義`), and the family's own elsewhere. Never chosen by the
1563
+ * locale or the browser's language. */
1564
+ readonly japanese?: boolean | undefined;
1565
+ /** The Consumer's word for any id, which wins over ExSheet's. */
1566
+ readonly label?: SheetLabel | undefined;
1567
+ }
1568
+
1569
+ /** Excel's ten standard colours (case 23), by name. */
1570
+ export declare type StandardColourName = 'darkRed' | 'red' | 'orange' | 'yellow' | 'lightGreen' | 'green' | 'lightBlue' | 'blue' | 'darkBlue' | 'purple';
1571
+
1572
+ /** A tint or a shade of a theme colour, as Excel's tooltip names it: `Darker 5%`, `Lighter 80%`. */
1573
+ export declare interface SwatchStep {
1574
+ /** Whether the theme colour is darkened or lightened. */
1575
+ readonly shade: 'darker' | 'lighter';
1576
+ /** By how much, in percent. */
1577
+ readonly percent: number;
1578
+ }
1579
+
1580
+ /** A row of a registered grid read as the table's row: one Value per declared column, `undefined` for a blank. */
1581
+ export declare type TableRow = readonly (Value | undefined)[];
1582
+
1583
+ /** The Office theme's ten colours (case 23), by the name of their column. */
1584
+ export declare type ThemeColourName = 'background1' | 'text1' | 'background2' | 'text2' | 'accent1' | 'accent2' | 'accent3' | 'accent4' | 'accent5' | 'accent6';
1585
+
1586
+ /** The Time category's formats. */
1587
+ export declare const timeTypes: readonly string[];
1588
+
1589
+ /** The index the list's `key` moves the keyboard to from the choice at `at` (-1 for none), or `undefined` where it
1590
+ * stays. */
1591
+ export declare function toolbarChoiceMovedTo(key: string, at: number, choices: readonly SheetToolbarItemChoice[]): number | undefined;
1592
+
1593
+ /** One row of a list, in the Sheet's order: the index of a choice drawn on a row of its own, or the indices of the
1594
+ * swatches drawn together, ten across, as the list's keys move among them. */
1595
+ export declare type ToolbarChoiceRow = number | readonly number[];
1596
+
1597
+ /** The list's rows: a run of swatches is cut ten across, and every other choice stands on a row of its own. */
1598
+ export declare function toolbarChoiceRows(choices: readonly SheetToolbarItemChoice[]): readonly ToolbarChoiceRow[];
1599
+
1600
+ /** The choice the list's keyboard starts on: the one the Focus cell has, else the first that can be made. */
1601
+ export declare function toolbarChoiceStart(choices: readonly SheetToolbarItemChoice[]): number | undefined;
1602
+
1603
+ /** Swatches to a row, as Excel's palette lays them out and as the built-in list moves among them. */
1604
+ export declare const toolbarSwatchesAcross = 10;
1605
+
1606
+ /**
1607
+ * Whether a change a Sheet Toolbar item sets widens the columns whose numbers no longer fit, as Excel's Home tab
1608
+ * buttons do (ADR-0071, ADR-0100): as a key does, and for a Font colour too. Excel's Bold and Italic buttons did
1609
+ * not widen and its Underline button did (R6, case (3)); its Fill Color button did not (the fourteenth Windows
1610
+ * run, case 7); and its Font Color button widened, where `Font.Color` set through COM did not (run 18a, widening
1611
+ * case 5; decided with the user, 2026-10-14).
1612
+ */
1613
+ export declare function widensAsAHomeTabButtonDoes(change: CellFormatChange): boolean;
1614
+
1615
+ /**
1616
+ * Whether a change a formatting key sets widens the columns whose numbers no longer fit (ADR-0071; ticket 58's
1617
+ * rule): a Number Format key widens (case 17), and so do Ctrl+5 and Ctrl+U, setting strikethrough or underline
1618
+ * or taking it off, though they set no Number Format. Excel's Ctrl+5 widened column A for `1234567.50` (the
1619
+ * fourteenth Windows run, case 7) and from 8.09 to 11.73 for `123456789.12` in `0.00` (the seventeenth's h8),
1620
+ * and Ctrl+U the same column the same way (h7). Ctrl+B and the Fill did not (case 7), nor did Ctrl+I (h7). That
1621
+ * Ctrl+4 widens as Ctrl+U does, that the Border keys widen nothing, and that taking strikethrough or underline
1622
+ * off widens are readings. `SetCellFormatAsync` widens by this rule too (decided 2026-10-12), as Excel's
1623
+ * `Range.Font` set through COM did (the readings of 2026-10-12 (R6), case (5); of 2026-10-14, run 18a, widening
1624
+ * cases 2 and 6).
1625
+ */
1626
+ export declare function widensAsAKeyDoes(change: CellFormatChange): boolean;
1627
+
1628
+ /**
1629
+ * Whether a change Format Cells' OK sets widens the columns whose numbers no longer fit, in OK's one undo step
1630
+ * (ADR-0071; decided 2026-10-12): one that sets a Number Format (case 17; the fourteenth Windows run, case 8),
1631
+ * and one that sets any part of the Font, though Ctrl+B and Ctrl+I widen nothing (the seventeenth run, h7; R6,
1632
+ * case (1)). A Fill, Borders or an alignment widens nothing (R6, case (2); case 9); Borders over #### and the
1633
+ * horizontal alignment are readings.
1634
+ */
1635
+ export declare function widensAsFormatCellsOkDoes(change: CellFormatChange): boolean;
1636
+
1637
+ export { }