@aiquants/spreadsheet 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/CHANGELOG.md +1103 -0
  2. package/LICENSE.md +155 -0
  3. package/README.md +817 -0
  4. package/dist/index.cjs +21 -0
  5. package/dist/index.d.cts +1960 -0
  6. package/dist/index.d.ts +1960 -0
  7. package/dist/index.js +7711 -0
  8. package/dist/styles/spreadsheet.css +2 -0
  9. package/dist/styles/spreadsheet.standalone.css +3 -0
  10. package/package.json +94 -0
  11. package/src/Spreadsheet.tsx +2313 -0
  12. package/src/clipboard/clipPayload.ts +1242 -0
  13. package/src/clipboard/fixtures/excel.fixture.ts +301 -0
  14. package/src/clipboard/fixtures/html.fixture.ts +90 -0
  15. package/src/clipboard/fixtures/sheets.fixture.ts +83 -0
  16. package/src/clipboard/htmlInterop.ts +1694 -0
  17. package/src/clipboard/numberFormatCodec.ts +870 -0
  18. package/src/clipboard/pasteSpecial.ts +608 -0
  19. package/src/clipboard/tiling.ts +370 -0
  20. package/src/clipboard/tsv.ts +186 -0
  21. package/src/clipboard/useClipboard.ts +1154 -0
  22. package/src/commands/selfCalc.ts +279 -0
  23. package/src/commands/useCommands.ts +946 -0
  24. package/src/editor/useCellEditor.ts +708 -0
  25. package/src/grid/CellView.tsx +51 -0
  26. package/src/grid/GridBody.tsx +489 -0
  27. package/src/header/ColumnHeader.tsx +167 -0
  28. package/src/header/RowHeader.tsx +144 -0
  29. package/src/header/columnName.ts +31 -0
  30. package/src/header/resizeGates.ts +146 -0
  31. package/src/header/resizeStrips.ts +79 -0
  32. package/src/header/useHeaderResize.ts +598 -0
  33. package/src/header/useHeaderSelection.ts +454 -0
  34. package/src/index.ts +122 -0
  35. package/src/keyboard/compositionGuard.ts +53 -0
  36. package/src/keyboard/ensureCellVisible.ts +77 -0
  37. package/src/keyboard/shortcuts.ts +718 -0
  38. package/src/keyboard/useGridKeyboard.ts +940 -0
  39. package/src/model/axisModel.ts +186 -0
  40. package/src/model/cellAnnotations.ts +92 -0
  41. package/src/model/cellCoord.ts +114 -0
  42. package/src/model/cellFormat.ts +562 -0
  43. package/src/model/cellPaint.ts +537 -0
  44. package/src/model/conditionalFormat.ts +805 -0
  45. package/src/model/dataAdapter.ts +478 -0
  46. package/src/model/dataValidation.ts +542 -0
  47. package/src/model/formulaRefs.ts +984 -0
  48. package/src/model/frozenPartition.ts +100 -0
  49. package/src/model/labels.ts +228 -0
  50. package/src/model/viewStore.ts +124 -0
  51. package/src/overlay/SelectionOverlay.tsx +1425 -0
  52. package/src/overlay/useFillHandle.ts +432 -0
  53. package/src/popover/CommentPopover.tsx +109 -0
  54. package/src/popover/LinkPopover.tsx +108 -0
  55. package/src/popover/ListPopover.tsx +161 -0
  56. package/src/popover/MessagePopover.tsx +36 -0
  57. package/src/popover/NotePopover.tsx +106 -0
  58. package/src/popover/NoteTip.tsx +26 -0
  59. package/src/popover/PopoverLayer.tsx +210 -0
  60. package/src/popover/placement.ts +138 -0
  61. package/src/popover/usePopovers.ts +642 -0
  62. package/src/selection/selectionState.ts +239 -0
  63. package/src/selection/useAutoScroller.ts +226 -0
  64. package/src/selection/usePointDrag.ts +273 -0
  65. package/src/selection/useSelectionEngine.ts +687 -0
  66. package/src/styles/components.entry.css +10 -0
  67. package/src/styles/spreadsheet.css +1029 -0
  68. package/src/styles/standalone.entry.css +9 -0
@@ -0,0 +1,1960 @@
1
+ import { ForwardRefExoticComponent } from 'react';
2
+ import { ProfilerOnRenderCallback } from 'react';
3
+ import { ReactNode } from 'react';
4
+ import { RefAttributes } from 'react';
5
+
6
+ /** Border colour when `CellBorder.color` is absent (a stated default, not a fallback). / 罫線色の宣言済み既定 (fallback ではなく仕様上の既定)。 */
7
+ export declare const BORDER_DEFAULT_COLOR = "#000000";
8
+
9
+ /** Border preset vocabulary of `setBorders` (v0.8 §1.10). / setBorders のプリセット語彙 (v0.8 §1.10)。 */
10
+ export declare type BorderPreset = "outer" | "all" | "clear" | "top" | "right" | "bottom" | "left";
11
+
12
+ /**
13
+ * Structural normal form of a format, or undefined when nothing survives: `undefined` keys and
14
+ * `false` booleans are dropped (absent = default), border sides whose value is undefined are
15
+ * dropped and an empty `borders` disappears, unknown keys are dropped, nested objects (value /
16
+ * borders / each side) are rebuilt with undefined keys removed, and every object is emitted with
17
+ * its keys in SORTED order so `JSON.stringify` of the result is a deterministic interning key
18
+ * (copy dictionary, command memo). Values are NOT validated — an unparseable colour or a
19
+ * non-positive font size is kept verbatim and ignored fail-soft by the paint engine:
20
+ * canonicalization is about structure, not meaning. Always returns a fresh object (the input is
21
+ * never mutated) and is idempotent.
22
+ * 書式の構造的正準形 (何も残らなければ undefined)。undefined キーと false 真偽値は落とす (不在 =
23
+ * 既定)、値 undefined の辺は落とし空の borders は消え、未知キーは落ち、入れ子 (value / borders /
24
+ * 各辺) は undefined キーを除いて再構築、全 object をキー辞書順で出力するため `JSON.stringify`
25
+ * がそのまま決定的 intern キー (copy 辞書・コマンド memo)。値の検証はしない — 解釈不能な色や
26
+ * 非正のフォントサイズはそのまま残し塗りエンジンが fail-soft に無視: 正準化は意味でなく構造の話。
27
+ * 常に新規 object を返し (入力は不変)、冪等。
28
+ */
29
+ export declare const canonicalizeFormat: (format: CellFormat) => CellFormat | undefined;
30
+
31
+ /**
32
+ * @fileoverview Built-in cell display formatting (v0.7 — the getCellFormat capability). Pure,
33
+ * React-free value→string engine + horizontal-alignment resolver. The consumer declares a
34
+ * per-cell CellFormat via the optional adapter capability getCellFormat(row, col); the grid
35
+ * applies the value format to the DISPLAY string (editing / copy / TSV keep the raw
36
+ * getCellText) and the alignment to the flex cell's justify-content.
37
+ *
38
+ * Engine contract (each clause is load-bearing and mutation-gated — spec 07 §5.8):
39
+ * - EXACT decimal rendering: the validated raw string is handed to Intl.NumberFormat AS A
40
+ * STRING (NumberFormat v3 mathematical values), never converted through a binary double —
41
+ * so "1.45" with {type:"percent", scale:false, decimals:1} renders "1.5%" (not the drifted
42
+ * "1.4%") and integers beyond 2^53 keep every digit. percent scale:false divides by 100 as
43
+ * a pure string exponent shift, again without touching floating point. Literal exponents
44
+ * are grammar-bounded to 4 digits (±9999) — past ICU's own limits, inputs stay raw.
45
+ * - INTERNED formatters: Intl.NumberFormat instances are cached per exact option tuple
46
+ * (construction FAILURES are interned too) behind an identity WeakMap tier keyed on the
47
+ * value-format object (an identity-stable adapter answer skips even the key build), so
48
+ * per-cell rendering and autofit measurement never re-pay the ~40µs construction cost — nor
49
+ * the per-cell key-build cost — per cell per slice.
50
+ * - Negative-zero suppression via signDisplay:"negative" (a value that rounds to zero never
51
+ * shows a minus sign) — locale-proof, including non-ASCII numbering systems.
52
+ * - TOTAL fail-soft: a non-numeric string in a numeric format, an invalid date, or an
53
+ * out-of-range Intl option (bad decimals / currency / locale) renders the raw text
54
+ * unchanged — a header/label never breaks.
55
+ * - TRULY timezone-free dates: parsing/validation/rendering is pure integer calendar math
56
+ * (leap-year aware) — no Date object is ever constructed, so host TZ, DST gaps, and the
57
+ * two-digit-year remapping cannot affect which dates format or how.
58
+ * - Alignment "unset" is AUTO by the VALUE, not the declared format: text that actually
59
+ * parses under the cell's numeric/date format (or as a strict decimal with no format)
60
+ * resolves right, labels resolve left — the Excel / Google Sheets render-time default.
61
+ *
62
+ * 組み込みセル表示形式 (v0.7 — getCellFormat 能力)。純関数・React 非依存の値→文字列エンジン +
63
+ * 水平揃え解決。エンジン契約 (全て変異検証で封印 — spec 07 §5.8):
64
+ * 正確十進 (検証済み素文字列を Intl へ**文字列のまま**渡し二進浮動小数を経由しない —
65
+ * percent scale:false の ÷100 も文字列指数シフト)、interned フォーマッタ (構築失敗も
66
+ * インターンし、値書式 object キーの identity WeakMap 層でキー構築も省き、セル毎の Intl 構築
67
+ * コストを排除)、signDisplay:"negative" による負ゼロ抑止
68
+ * (非 ASCII 数字体系でも成立)、全経路 fail-soft (非数値 / 無効日付 / 範囲外オプションは素の
69
+ * text)、Date 非依存の純整数暦検証 (ホスト TZ / DST / 2 桁年写像の影響が構造的にゼロ)、
70
+ * align 未指定は**値による自動** — 実際に解釈できる値だけ右、ラベルは左 (Excel / Sheets の描画時既定)。
71
+ *
72
+ * v0.8 (rich cells) widens CellFormat to the full declarative cell format — vertical alignment,
73
+ * wrap, background / text colour, bold / italic / underline / strikethrough, font family / size
74
+ * (pt) and per-side borders — and adds the pure FORMAT ALGEBRA the commands and the clipboard
75
+ * share: canonicalizeFormat (the structural normal form — false booleans / undefined keys /
76
+ * empty borders dropped, every object emitted with SORTED keys so JSON.stringify of a canonical
77
+ * form is a deterministic interning key), mergeFormat (patch application with null = clear,
78
+ * identity-preserving when nothing changes so an unchanged cell emits no edit) and
79
+ * formatEquals (structural equality on canonical forms, key-order independent). Painting
80
+ * (CSS / attributes) lives in cellPaint.ts; this module stays a value model.
81
+ *
82
+ * v0.8 (リッチセル) は CellFormat を宣言的セル書式の全体 (縦揃え・折返し・背景 / 文字色・太字 /
83
+ * 斜体 / 下線 / 取消線・フォント族 / サイズ (pt)・辺毎の罫線) へ拡張し、コマンドとクリップボード
84
+ * が共有する純関数の書式代数を追加: canonicalizeFormat (構造的正準形 — false 真偽値 / undefined
85
+ * キー / 空 borders を落とし、全 object をキー辞書順で出力するため JSON.stringify がそのまま
86
+ * 決定的 intern キー)、mergeFormat (null = 消去のパッチ適用、無変化なら base を identity で返し
87
+ * 無変化セルは edit を出さない)、formatEquals (正準形の構造等価・キー順非依存)。塗り (CSS /
88
+ * 属性) は cellPaint.ts、本モジュールは値モデルに留まる。
89
+ */
90
+ /** Horizontal cell alignment. / セルの水平揃え。 */
91
+ export declare type CellAlign = "left" | "center" | "right";
92
+
93
+ /** One border side: line style plus an optional colour (absent = BORDER_DEFAULT_COLOR). / 罫線 1 辺: 線種 + 任意の色 (省略 = BORDER_DEFAULT_COLOR)。 */
94
+ export declare type CellBorder = {
95
+ style: CellBorderStyle;
96
+ color?: string;
97
+ };
98
+
99
+ /** Per-side borders of a cell (absent side = no border). / セルの辺毎の罫線 (辺の省略 = 罫線なし)。 */
100
+ export declare type CellBorders = {
101
+ top?: CellBorder;
102
+ right?: CellBorder;
103
+ bottom?: CellBorder;
104
+ left?: CellBorder;
105
+ };
106
+
107
+ /** Border line style vocabulary (Excel / Sheets subset). / 罫線種の語彙 (Excel / Sheets 部分集合)。 */
108
+ export declare type CellBorderStyle = "thin" | "medium" | "thick" | "dashed" | "dotted" | "double" | "hair";
109
+
110
+ /**
111
+ * One comment as the consumer stores it (read side of `getCellComments`): every field is
112
+ * present because the consumer stamped it when the comment was created.
113
+ * consumer が保持するコメント 1 件 (getCellComments の読み側): 作成時に consumer が刻印するため
114
+ * 全フィールドが揃う。
115
+ */
116
+ export declare type CellComment = {
117
+ id: string;
118
+ author: string;
119
+ text: string;
120
+ createdAt: string;
121
+ };
122
+
123
+ /**
124
+ * One comment as written through `CellPatch.comments` (the WHOLE thread travels): `id` present
125
+ * = keep that existing comment verbatim; `id` absent = a new comment whose id / author /
126
+ * createdAt the consumer mints (`author` / `createdAt` are carried only when a paste re-plays a
127
+ * foreign thread). A `CellComment` is assignable to this type as is, so a thread can be spread
128
+ * into a reply unchanged.
129
+ * CellPatch.comments で書かれるコメント 1 件 (スレッド全体を運ぶ): `id` あり = その既存コメントを
130
+ * verbatim に保持、`id` なし = 新規 (id / author / createdAt は consumer が採番 — author /
131
+ * createdAt は paste が外来スレッドを再生するときだけ載る)。`CellComment` はそのまま代入可能で、
132
+ * 既存スレッドを返信へ無変更で展開できる。
133
+ */
134
+ export declare type CellCommentInput = {
135
+ id?: string;
136
+ text: string;
137
+ author?: string;
138
+ createdAt?: string;
139
+ };
140
+
141
+ /**
142
+ * @fileoverview Coordinate / range / operation vocabulary shared across the whole grid:
143
+ * cell-coordinate and range pure functions plus the public named unions (SpreadsheetDirection,
144
+ * SpreadsheetOperation). Every range in the system is a normalized rectangle built via
145
+ * makeRange.
146
+ *
147
+ * 座標・レンジ・操作の語彙: セル座標とレンジの純関数群 + 公開の名前つき union
148
+ * (SpreadsheetDirection / SpreadsheetOperation)。システム内の全レンジは makeRange で構築
149
+ * された正規化矩形。
150
+ */
151
+ /** A single cell position (0-based). / 単一セル位置 (0 始まり)。 */
152
+ export declare type CellCoord = {
153
+ row: number;
154
+ col: number;
155
+ };
156
+
157
+ /**
158
+ * One cell write: a coordinate plus a {@link CellPatch}. A v0.7 text edit `{ row, col, text }`
159
+ * is still a CellEdit; a format-only edit omits `text` entirely.
160
+ * セル書込 1 件: 座標 + {@link CellPatch}。v0.7 のテキスト編集 `{ row, col, text }` もそのまま
161
+ * CellEdit であり、書式だけの編集は `text` を持たない。
162
+ */
163
+ export declare type CellEdit = {
164
+ row: number;
165
+ col: number;
166
+ } & CellPatch;
167
+
168
+ /**
169
+ * A cell's declared display format, returned per-cell by the adapter's getCellFormat capability
170
+ * (v0.8 — the full rich-cell vocabulary): value format (undefined = raw text), horizontal
171
+ * alignment (undefined = auto by the value), vertical alignment (undefined = middle), wrap,
172
+ * background / text colour (any CSS colour text — normalised by the paint engine, unparseable =
173
+ * ignored), bold / italic / underline / strikethrough (absent = false), font family, font size
174
+ * in POINTS (painted as pt × 4 / 3 px) and per-side borders. Every key is optional; the
175
+ * canonical form (canonicalizeFormat) is what the package writes back through CellEdit.format.
176
+ * セルの宣言済み表示形式 — アダプタの getCellFormat 能力がセル毎に返す (v0.8 — リッチセルの
177
+ * 全語彙): 値書式 (undefined = 素の文字列)・水平揃え (undefined = 値による自動)・垂直揃え
178
+ * (undefined = 中央)・折返し・背景 / 文字色 (任意の CSS 色文字列 — 塗りエンジンが正規化、解釈
179
+ * 不能は無視)・太字 / 斜体 / 下線 / 取消線 (不在 = false)・フォント族・フォントサイズ (pt 単位、
180
+ * pt × 4 / 3 px で描画)・辺毎の罫線。全キー任意。パッケージが CellEdit.format で書き戻すのは
181
+ * 正準形 (canonicalizeFormat)。
182
+ */
183
+ export declare type CellFormat = {
184
+ value?: CellValueFormat;
185
+ align?: CellAlign;
186
+ verticalAlign?: CellVerticalAlign;
187
+ wrap?: boolean;
188
+ background?: string;
189
+ color?: string;
190
+ bold?: boolean;
191
+ italic?: boolean;
192
+ underline?: boolean;
193
+ strikethrough?: boolean;
194
+ fontFamily?: string;
195
+ fontSize?: number;
196
+ borders?: CellBorders;
197
+ };
198
+
199
+ /**
200
+ * Command / handle input ONLY — never crosses the adapter. A key set to `null` CLEARS it, an
201
+ * omitted / undefined key leaves the base value untouched, any other value replaces it (borders
202
+ * are replaced as a whole set — callers spread the base sides to change one side).
203
+ * コマンド / handle 入力専用 — アダプタを跨がない。`null` のキーは消去、省略 / undefined は
204
+ * base の値を保持、それ以外は置換 (borders は辺の集合ごと置換 — 1 辺だけ変えるときは呼び手が
205
+ * base の辺を展開する)。
206
+ */
207
+ export declare type CellFormatPatch = {
208
+ readonly [K in keyof CellFormat]?: CellFormat[K] | null;
209
+ };
210
+
211
+ /**
212
+ * One per-cell PATCH (ADR-16): an ABSENT key leaves that aspect untouched, `null` CLEARS it, a
213
+ * value replaces it whole. `text` is the canonical string (a cleared cell is `text: ""` — text
214
+ * has no `null`); `format` is the complete CANONICAL CellFormat of the cell after the gesture
215
+ * (the command runner merges its patch with the base format BEFORE the adapter sees it — a
216
+ * CellFormatPatch never crosses this boundary; `null` removes every format key); `note` is the
217
+ * note text; `comments` carries the WHOLE thread: an input WITH `id` is an existing comment the
218
+ * consumer keeps verbatim, an input WITHOUT `id` is a new comment the consumer stamps with
219
+ * id / author / createdAt (the package never mints an id; `author` / `createdAt` travel only when a
220
+ * paste replays a foreign thread), `null` clears the thread; `hyperlink` is the normalized URL
221
+ * (normalizeHyperlink — one of http / https / mailto / tel); `validation` is the rule object.
222
+ * セル 1 件のパッチ (ADR-16): **未指定**キーはその側面を触らず、`null` は消去、値は丸ごと置換。
223
+ * `text` は正準文字列 (消去は `text: ""` — text に `null` は無い)。`format` はジェスチャ後のセルの
224
+ * **完全な正準** CellFormat (コマンド実行器はアダプタに渡す前に base 書式とパッチを合成する —
225
+ * CellFormatPatch はこの境界を跨がない。`null` は全書式キーの除去)。`note` はノート本文。
226
+ * `comments` は**スレッド全体**: `id` つき入力は consumer が verbatim に保持する既存コメント、`id`
227
+ * なし入力は consumer が id / author / createdAt を刻印する新規コメント (パッケージは採番しない。
228
+ * `author` / `createdAt` は paste が外部スレッドを再生するときだけ運ぶ)、`null` はスレッド消去。
229
+ * `hyperlink` は正規化済み URL (normalizeHyperlink — http / https / mailto / tel のいずれか)、
230
+ * `validation` は規則 object。
231
+ */
232
+ export declare type CellPatch = {
233
+ text?: string;
234
+ format?: CellFormat | null;
235
+ note?: string | null;
236
+ comments?: readonly CellCommentInput[] | null;
237
+ hyperlink?: string | null;
238
+ validation?: DataValidationRule | null;
239
+ };
240
+
241
+ /**
242
+ * A normalized rectangular range (startRow <= endRow, startCol <= endCol). Construct ONLY via
243
+ * {@link makeRange}. / 正規化済み矩形レンジ。必ず {@link makeRange} で構築。
244
+ */
245
+ export declare type CellRange = {
246
+ startRow: number;
247
+ startCol: number;
248
+ endRow: number;
249
+ endCol: number;
250
+ };
251
+
252
+ /** Numeric comparison when the text and the used bounds are strict decimals, else string comparison. / text と使う境界が厳密 10 進なら数値比較、他は文字列比較。 */
253
+ export declare type CellValueCondition = {
254
+ type: "cellValue";
255
+ op: CompareOp;
256
+ a: string;
257
+ b?: string;
258
+ };
259
+
260
+ /**
261
+ * A value display format (type-based — "simple formats"). All fields optional beyond `type`,
262
+ * except `currency.currency` which is REQUIRED (a currency is meaningless without its code —
263
+ * the package stays host-agnostic and never assumes a region default).
264
+ * 値の表示形式 (型ベース・簡易形式)。`type` 以外は基本任意だが `currency.currency` のみ必須
265
+ * (通貨コードなしの通貨書式は無意味・パッケージは地域既定を仮定しないホスト非依存設計)。
266
+ */
267
+ export declare type CellValueFormat = {
268
+ type: "number";
269
+ decimals?: number;
270
+ grouping?: boolean;
271
+ locale?: string;
272
+ } | {
273
+ type: "percent";
274
+ decimals?: number;
275
+ scale?: boolean;
276
+ locale?: string;
277
+ } | {
278
+ type: "currency";
279
+ currency: string;
280
+ decimals?: number;
281
+ locale?: string;
282
+ } | {
283
+ type: "scientific";
284
+ decimals?: number;
285
+ locale?: string;
286
+ } | {
287
+ type: "date";
288
+ pattern?: string;
289
+ } | {
290
+ type: "text";
291
+ };
292
+
293
+ /** Vertical cell alignment (undefined = middle, the cell's flex centring). / セルの垂直揃え (undefined = 中央 = セルの flex 中央)。 */
294
+ export declare type CellVerticalAlign = "top" | "middle" | "bottom";
295
+
296
+ /** The condition vocabulary (six members). / 条件の語彙 (6 メンバー)。 */
297
+ export declare type CfCondition = CellValueCondition | TextCondition | EmptyCondition | NotEmptyCondition | ColorScaleCondition | CustomFormulaCondition;
298
+
299
+ /** Needle vocabulary of the `text` condition (exact, case-sensitive). / text 条件の needle 語彙 (完全一致・大文字小文字区別)。 */
300
+ export declare type CfTextOp = "contains" | "notContains" | "startsWith" | "endsWith";
301
+
302
+ /** The text must equal `checked` or `unchecked` (declared defaults "TRUE" / "FALSE"). / text が checked か unchecked と一致 (宣言済み既定は "TRUE" / "FALSE")。 */
303
+ export declare type CheckboxValidationRule = {
304
+ type: "checkbox";
305
+ checked?: string;
306
+ unchecked?: string;
307
+ };
308
+
309
+ /**
310
+ * One cell on the wire: `t` raw text, `f` the formula in origin-relative R1C1 (`=` leading),
311
+ * `fmt` / `val` indexes into the payload dictionaries, `note`, the id-less `comments` thread and
312
+ * the hyperlink `link`. Absent keys are absent aspects.
313
+ * wire 上のセル 1 つ: `t` 素の文字列、`f` 原点相対 R1C1 の数式 (`=` 始まり)、`fmt` / `val` は
314
+ * payload 辞書への索引、`note`、id を剥がした `comments` スレッド、リンク `link`。不在キー =
315
+ * 不在側面。
316
+ */
317
+ export declare type ClipCell = {
318
+ t: string;
319
+ f?: string;
320
+ fmt?: number;
321
+ val?: number;
322
+ note?: string;
323
+ comments?: readonly ClipComment[];
324
+ link?: string;
325
+ };
326
+
327
+ /** The channel a paste arrives on: the paste event (custom MIME available) or the async clipboard menu path. / 貼り付けの経路: paste イベント (カスタム MIME あり) か非同期クリップボードのメニュー経路。 */
328
+ export declare type ClipChannel = "event" | "menu";
329
+
330
+ /** A comment on the wire — the consumer's `id` is stripped (every pasted comment is new). / wire 上のコメント — consumer の `id` は剥がされる (貼り付けられたコメントは全件新規)。 */
331
+ export declare type ClipComment = {
332
+ text: string;
333
+ author: string;
334
+ createdAt: string;
335
+ };
336
+
337
+ /**
338
+ * The common input of both channels: the available flavour types and a reader for one type.
339
+ * `getData` is called only for a type present in `types` and only when detection needs it —
340
+ * callers should memoise it per gesture when the read is expensive (a paste event's `getData`
341
+ * re-materialises the string on every call).
342
+ * 両経路の共通入力: 利用可能なフレーバー種別と 1 種別の読み手。`getData` は `types` に在る種別に
343
+ * だけ、検出が要するときにだけ呼ばれる — 読みが高価なとき (paste イベントの `getData` は呼ぶ度に
344
+ * 文字列を再実体化する) は呼び手がジェスチャ毎に memo する。
345
+ */
346
+ export declare type ClipFlavours = {
347
+ types: readonly string[];
348
+ getData: (type: string) => string;
349
+ };
350
+
351
+ /** The armed clip surface a consumer sees (`onClipChange` / `getClip`): `foreign` = the record belongs to another adapter (sheet switch kept a cut). / consumer が見る装填クリップ (`onClipChange` / `getClip`): `foreign` = 記録が別アダプタのもの (シート切替が cut を保持)。 */
352
+ export declare type ClipInfo = {
353
+ kind: "copy" | "cut";
354
+ range: CellRange;
355
+ foreign: boolean;
356
+ };
357
+
358
+ /**
359
+ * The lossless clip payload (wire format v1). The four leading keys are fixed in this order;
360
+ * `cells` is exactly `rows × cols`; `colWidths` / `rowHeights` travel only when the copy source
361
+ * was whole columns / whole rows; conditional-format inputs are origin-relative and clipped to
362
+ * the copied rectangle.
363
+ * lossless クリップ payload (wire format v1)。先頭 4 キーは固定順、`cells` は rows × cols ちょうど、
364
+ * `colWidths` / `rowHeights` は全列 / 全行 copy のときだけ、条件付き書式入力は原点相対でコピー
365
+ * 矩形に切り詰め済み。
366
+ */
367
+ export declare type ClipPayload = {
368
+ v: 1;
369
+ rows: number;
370
+ cols: number;
371
+ clipId: string;
372
+ formats: readonly CellFormat[];
373
+ validations: readonly DataValidationRule[];
374
+ cells: readonly (readonly ClipCell[])[];
375
+ colWidths?: readonly number[];
376
+ rowHeights?: readonly number[];
377
+ wholeRows: boolean;
378
+ wholeCols: boolean;
379
+ conditionalFormats: readonly ConditionalFormatRuleInput[];
380
+ };
381
+
382
+ /** The detected clipboard source kind (ADR-14). / 検出されたクリップボードソース種別 (ADR-14)。 */
383
+ export declare type ClipSource = "aqsp" | "sheets" | "excel" | "html" | "tsv" | "none";
384
+
385
+ /** sRGB interpolation between two or three points over the numeric value; non-numeric text does not apply. / 数値に対する 2 点または 3 点の sRGB 補間。非数値 text は不適用。 */
386
+ export declare type ColorScaleCondition = {
387
+ type: "colorScale";
388
+ min: ScalePoint;
389
+ mid?: ScalePoint;
390
+ max: ScalePoint;
391
+ };
392
+
393
+ /** Column index (0-based) to Excel-style name (0 → A, 26 → AA, 16383 → XFD). / 列 index → 列名。 */
394
+ export declare const columnIndexToName: (index: number) => string;
395
+
396
+ /** Excel-style name to column index (inverse). / 列名 → 列 index (逆変換)。 */
397
+ export declare const columnNameToIndex: (name: string) => number;
398
+
399
+ /**
400
+ * Renders the comment thread and the reply form for one cell.
401
+ * 1 セルのコメントスレッドと返信フォームを描画する。
402
+ */
403
+ export declare const CommentPopover: ({ ctx, labels }: CommentPopoverProps) => ReactNode;
404
+
405
+ /** Comment thread context: the reply UI commits `[...current (with ids), { text }]`; `null` clears the thread. / コメントスレッド文脈: 返信 UI は `[...current (id つき), { text }]` を commit、null はスレッド消去。 */
406
+ export declare type CommentPopoverContext = {
407
+ kind: "comment";
408
+ cell: CellCoord;
409
+ anchorRect: PopoverRect;
410
+ current: readonly CellComment[];
411
+ commit: (next: readonly CellCommentInput[] | null) => void;
412
+ close: () => void;
413
+ rejected: boolean;
414
+ };
415
+
416
+ export declare type CommentPopoverProps = {
417
+ ctx: CommentPopoverContext;
418
+ labels: SpreadsheetLabels;
419
+ };
420
+
421
+ /** Ordered comparison vocabulary of `cellValue` (the same eight words as the validation engine); between / notBetween include both bounds. / cellValue の比較語彙 (検証エンジンと同じ 8 語)。between / notBetween は両端含み。 */
422
+ export declare type CompareOp = "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "between" | "notBetween";
423
+
424
+ /** One rule as the consumer stores it: consumer-scoped `id`, the ranges it applies to, its condition, the style it paints, and whether a match ends the walk. / consumer が保持する規則 1 件: consumer スコープの id、適用レンジ、条件、塗る style、真で打ち切るか。 */
425
+ export declare type ConditionalFormatRule = {
426
+ id: string;
427
+ ranges: readonly CellRange[];
428
+ condition: CfCondition;
429
+ style: ConditionalFormatStyle;
430
+ stopIfTrue?: boolean;
431
+ };
432
+
433
+ /** One rule as a paste hands it to the consumer (`PasteEditContext.conditionalFormats`): the source rule's id travels as `sourceRuleId`, the consumer mints the new id. / paste が consumer へ渡す規則 1 件: 元規則の id は sourceRuleId、新 id は consumer が採番。 */
434
+ export declare type ConditionalFormatRuleInput = {
435
+ sourceRuleId: string;
436
+ ranges: readonly CellRange[];
437
+ condition: CfCondition;
438
+ style: ConditionalFormatStyle;
439
+ stopIfTrue?: boolean;
440
+ };
441
+
442
+ /** The Sheets subset a rule may paint: background / colour / four text traits. Borders, alignment and number formats are out of scope (deviation row). / 規則が塗れる Sheets 部分集合: 背景 / 文字色 / 4 つの文字特性。罫線・揃え・数値書式は範囲外 (逸脱行)。 */
443
+ export declare type ConditionalFormatStyle = {
444
+ background?: string;
445
+ color?: string;
446
+ bold?: boolean;
447
+ italic?: boolean;
448
+ underline?: boolean;
449
+ strikethrough?: boolean;
450
+ };
451
+
452
+ /** `adapter.evaluateFormula(formula, cell)` verbatim; truth = `true` or a finite non-zero number. / evaluateFormula(formula, cell) を原文のまま。真 = true か有限非 0 数。 */
453
+ export declare type CustomFormulaCondition = {
454
+ type: "customFormula";
455
+ formula: string;
456
+ };
457
+
458
+ /** The consumer's formula decides; evaluated only when the caller supplies `evaluate` (commit time). / consumer の数式が判定。呼び手が evaluate を渡すとき (確定時) だけ評価。 */
459
+ export declare type CustomValidationRule = {
460
+ type: "custom";
461
+ formula: string;
462
+ };
463
+
464
+ /** A per-cell data-validation rule: the shared options intersected with one of the seven typed members (§1.2). / セル毎のデータ検証規則。共通オプションと 7 種の型付きメンバーの交差 (§1.2)。 */
465
+ export declare type DataValidationRule = ValidationRuleBase & (ListValidationRule | NumberValidationRule | TextLengthValidationRule | DateValidationRule | TextValidationRule | CheckboxValidationRule | CustomValidationRule);
466
+
467
+ /** The text must be a pure-calendar date satisfying `op` against the date-string bounds `a` (and `b`). / text が純暦日付で、日付文字列の境界 a (と b) に対し op を満たす。 */
468
+ export declare type DateValidationRule = {
469
+ type: "date";
470
+ op: ValidationCompareOp;
471
+ a: string;
472
+ b?: string;
473
+ };
474
+
475
+ /** Default custom colour slots (v0.8 §1.9) for `fillColorCustom1..5` / `fontColorCustom1..5`. / カスタム色 5 スロットの既定 (v0.8 §1.9)。 */
476
+ export declare const DEFAULT_CUSTOM_COLORS: readonly string[];
477
+
478
+ /** Default band palette (plan §1.9) — the same values the `.aqsp-root` CSS variables fall back to. / 既定の帯パレット (計画 §1.9) — `.aqsp-root` の CSS 変数既定と同値。 */
479
+ export declare const DEFAULT_HIGHLIGHT_COLORS: HighlightColors;
480
+
481
+ /**
482
+ * English defaults for every key. `sinkAriaLabel` / `rootAriaLabel` are byte-identical to the
483
+ * v0.7 prop defaults (the fold is DOM-identical); `noteEscapeHint` = "Escape saves and closes";
484
+ * `commentCount` and `listMore` pluralise ("1 comment" / "n comments", "1 more value" / "n more values"). Frozen.
485
+ * 全キーの英語既定。`sinkAriaLabel` / `rootAriaLabel` は v0.7 の prop 既定と byte 同一 (畳込みは
486
+ * DOM 恒等)、`noteEscapeHint` = "Escape saves and closes"、`commentCount` / `listMore` は単複を区別。凍結済み。
487
+ */
488
+ export declare const DEFAULT_LABELS: SpreadsheetLabels;
489
+
490
+ /**
491
+ * Default chords per command, derived from the `command === K` rows of BUILTIN_ROWS in table
492
+ * order (`[]` = unbound by default: hideColumns and every extension command). Validates under
493
+ * validateShortcuts(undefined) — pinned by the spec.
494
+ * コマンド毎の既定チョード — BUILTIN_ROWS の `command === K` 行から表順で導出 (`[]` = 既定未束縛:
495
+ * hideColumns と拡張コマンド全件)。validateShortcuts(undefined) を通ることを spec が固定。
496
+ */
497
+ export declare const DEFAULT_SHORTCUTS: ShortcutMap;
498
+
499
+ /**
500
+ * Detects the ONE source a paste reads (ADR-14, design v5): event channel — `types` contains
501
+ * the custom MIME ⇒ `aqsp` (nothing else is read); then, on both channels, the first
502
+ * CLIP_DETECT_PREFIX_BYTES of `text/html` are scanned for markers (`aqsp` → `sheets` → `excel`)
503
+ * and the FULL text is tested for `<table` — a marker refines the kind, `<table` alone is
504
+ * `html`, and an HTML flavour without any table is not a table source at all; then a non-empty
505
+ * `text/plain` ⇒ `tsv`; else `none`. Never tries a reader; `getData` is called only for the
506
+ * flavours the decision needs and never for a type absent from `types`.
507
+ * 貼り付けが読む唯一のソースを検出 (ADR-14、設計 v5): event 経路 — `types` にカスタム MIME が
508
+ * 在れば `aqsp` (他は読まない)。次に両経路で `text/html` の先頭 CLIP_DETECT_PREFIX_BYTES を
509
+ * マーカー走査 (`aqsp` → `sheets` → `excel`) し全文を `<table` で判定 — マーカーは種別を精密化、
510
+ * `<table` だけなら `html`、表の無い HTML フレーバーは表ソースにならない。次に非空 `text/plain` ⇒
511
+ * `tsv`、他は `none`。reader は試行しない。`getData` は判定が要するフレーバーにだけ、`types` に
512
+ * 無い種別には決して呼ばない。
513
+ */
514
+ export declare const detectClipSource: (flavours: ClipFlavours, channel: ClipChannel) => ClipSource;
515
+
516
+ /**
517
+ * The write context of applyEdits — a discriminated union on `source`: exactly the paste arm
518
+ * carries `sameSheet` / `conditionalFormats`. An EMPTY transaction (no edits and no conditional
519
+ * formats) never reaches the adapter.
520
+ * applyEdits の書込文脈 — `source` で判別する union: paste 枝だけが `sameSheet` /
521
+ * `conditionalFormats` を持つ。**空**トランザクション (edits も条件付き書式も無し) はアダプタへ
522
+ * 届かない。
523
+ */
524
+ export declare type EditContext = PlainEditContext | PasteEditContext;
525
+
526
+ /**
527
+ * Context of a rejected applyEdits (delivered with the thrown error by onEditRejected). The
528
+ * write path that was refused — the editor commit ("edit") or one of the SpreadsheetOperation
529
+ * WRITE vocabulary ("paste" / "fill" / "delete" / "format" / "calc" / "annotate", the same
530
+ * names onOperationRejected uses for the same gestures: a cut-move is the Ctrl+V gesture and is
531
+ * "paste" in both callbacks, because Ctrl+X only serializes — "cut" and "copy" never write,
532
+ * "resize" is geometry) — and, for an in-cell editing commit, the FATE of the session, so a
533
+ * consumer can tell the user the truth: "kept" (an in-grid commit: Enter / Tab / click — the
534
+ * session stays open with the typed value and focus, Escape cancels it, or the value can be
535
+ * fixed) versus "discarded" (a grid-exit focusout: the grid discards the session as this
536
+ * rejection completes — once the callback returns the typed value is dropped and the sink
537
+ * re-armed WITHOUT moving focus: it stays on the element the user chose, or on the hidden input
538
+ * after a window blur (alt-tab — a null relatedTarget takes the same path) — advising "press
539
+ * Escape" here would be wrong, and an idle Escape would hand focus out of the grid per WCAG
540
+ * 2.1.2). Non-editing writes carry no session. A discriminated union: impossible combinations
541
+ * do not type-check.
542
+ * applyEdits 拒否の文脈 (onEditRejected が throw されたエラーと共に届ける)。拒否された書込経路
543
+ * (エディタ確定の "edit"、または onOperationRejected が同じジェスチャに使うのと同じ
544
+ * SpreadsheetOperation の**書込**語彙 "paste" / "fill" / "delete" / "format" / "calc" /
545
+ * "annotate" — cut-move は Ctrl+V のジェスチャで両コールバックとも "paste"。Ctrl+X は直列化のみで
546
+ * "cut" と "copy" は書かず、"resize" は幾何) と、セル内編集の確定なら**セッションの行方** —
547
+ * "kept" (グリッド内確定: Enter / Tab / クリック — 入力値とフォーカスごとセッション維持、Escape で
548
+ * 取消か修正可能) と "discarded" (グリッド外 focusout: この拒否の完了と同時にグリッドが
549
+ * セッションを破棄する — コールバックが返った時点で入力値は消え、シンクはフォーカスを動かさずに
550
+ * 再武装される: フォーカスはユーザーが選んだ要素、またはウィンドウ blur (alt-tab — relatedTarget
551
+ * null も同じ経路) なら隠し入力のまま。ここで「Escape を押せ」と案内するのは誤りで、待機中の
552
+ * Escape は WCAG 2.1.2 のフォーカス脱出になる) を消費者が区別できる。非編集の書込はセッションを
553
+ * 持たない。判別可能 union — あり得ない組合せは型が拒む。
554
+ */
555
+ export declare type EditRejection = {
556
+ source: "edit";
557
+ editSession: "kept" | "discarded";
558
+ } | {
559
+ source: "paste" | "fill" | "delete" | "format" | "calc" | "annotate";
560
+ };
561
+
562
+ /**
563
+ * Every write path of the grid (the union of the two EditContext arms' `source`; equal to
564
+ * `EditRejection["source"]`, sealed in dataAdapter.spec.ts): the editor commit ("edit" — also
565
+ * the idle insertDate / insertTime write), the ADR-12 write gestures ("paste" / "fill" /
566
+ * "delete") and the v0.8 command families ("format" = format commands / handle writes, "calc"
567
+ * = multiply / divide / sign-reversal self-calculation, "annotate" = note / comment / hyperlink /
568
+ * validation writes). A cut-move is the Ctrl+V gesture and is "paste" (Ctrl+X only serializes).
569
+ * グリッドの全書込経路 (EditContext 2 枝の `source` の和 = `EditRejection["source"]`、
570
+ * dataAdapter.spec.ts が封印): エディタ確定 ("edit" — 待機中の insertDate / insertTime 書込も)、
571
+ * ADR-12 の書込ジェスチャ ("paste" / "fill" / "delete")、v0.8 のコマンド族 ("format" = 書式
572
+ * コマンド / handle 書込、"calc" = 乗除 / 符号反転の自己計算、"annotate" = ノート / コメント /
573
+ * リンク / 検証の書込)。cut-move は Ctrl+V のジェスチャで "paste" (Ctrl+X は直列化のみ)。
574
+ */
575
+ export declare type EditSource = "edit" | "paste" | "fill" | "delete" | "format" | "calc" | "annotate";
576
+
577
+ /** The text is the empty string. / text が空文字。 */
578
+ export declare type EmptyCondition = {
579
+ type: "empty";
580
+ };
581
+
582
+ /**
583
+ * Enumerates the union of ranges exactly once per cell (row-major).
584
+ * レンジ群の和集合をセル単位で**重複なく**行優先順に列挙する単一シーム。Delete のような
585
+ * 「レンジ列挙由来」の編集で同一セルの無意味な二重編集を作らないためのもの (cut → paste が
586
+ * **意図的に**積む重複 (後勝ち) とは別問題 — そちらは applyEdits の順序契約が扱う)。
587
+ */
588
+ export declare const enumerateRangeCells: (ranges: readonly CellRange[], visit: (cell: CellCoord) => void) => void;
589
+
590
+ /** Paste cell count WITHOUT materializing (ADR-12 pre-check). / 展開せず貼り付け対象セル数を見積もる (ADR-12 の事前検査)。 */
591
+ export declare const estimatePasteCellCount: (source: readonly (readonly string[])[], target: CellRange) => number;
592
+
593
+ /**
594
+ * Expands a paste into cell edits per the §6.5.3 table (copy path — silent grid-edge clip).
595
+ * Delegates to `tileCells` (v0.8) — output identical to the v0.7 flat loop.
596
+ * §6.5.3 の表どおり貼り付けを CellEdit 列へ展開 (copy 経路 — グリッド外は静かに切り捨て)。
597
+ * `tileCells` へ委譲 (v0.8) — 出力は v0.7 のフラットループと同一。
598
+ */
599
+ export declare const expandPaste: (source: readonly (readonly string[])[], target: CellRange, active: CellCoord, rowCount: number, colCount: number) => CellEdit[];
600
+
601
+ /**
602
+ * Formats the raw canonical text for DISPLAY per a value format. undefined / {type:"text"} /
603
+ * empty text pass through unchanged; a non-numeric string in a numeric format, an invalid date,
604
+ * or an out-of-range Intl option fails soft to the raw text. The validated decimal STRING is
605
+ * handed to Intl (exact — no double conversion), and percent scale:false pre-divides by 100 via
606
+ * a string exponent shift. Editing / copy never call this (they use the raw text).
607
+ * 素の正準文字列を値書式に従い表示用へ整形。undefined / {type:"text"} / 空文字は無変更で素通し。
608
+ * 数値書式の非数値・無効日付・範囲外 Intl オプションは素の text へ fail-soft。検証済み 10 進は
609
+ * **文字列のまま** Intl へ (double 変換なしの正確十進)、percent scale:false は文字列指数シフトで
610
+ * ÷100。編集 / コピーは呼ばない (素の値)。
611
+ */
612
+ export declare const formatCellValue: (text: string, value: CellValueFormat | undefined) => string;
613
+
614
+ /**
615
+ * Structural equality of two formats on their canonical forms — key order, undefined keys,
616
+ * false booleans and empty borders never matter; every value (including each border side and
617
+ * the nested value format) must match. `undefined` equals any format whose canonical form is
618
+ * empty.
619
+ * 正準形上の構造等価 — キー順・undefined キー・false 真偽値・空 borders は無関係、全値 (罫線の
620
+ * 各辺・入れ子の値書式を含む) が一致すること。`undefined` は正準形が空の書式と等しい。
621
+ */
622
+ export declare const formatEquals: (a: CellFormat | undefined, b: CellFormat | undefined) => boolean;
623
+
624
+ /** What `evaluateFormula` may answer. / evaluateFormula が返し得る値。 */
625
+ export declare type FormulaValue = string | number | boolean | null;
626
+
627
+ /**
628
+ * Resolves an R1C1 formula to A1 at `origin` — the paste side of {@link toR1C1}. A relative
629
+ * offset landing below row / column 0 becomes `#REF!` (behind its verbatim sheet part); text
630
+ * the R1C1 grammar rejects (`R0C1`, `R[+1]`, `R[1`) stays verbatim. Parsed forms are memoised
631
+ * per distinct string, so a 100k-cell paste of ≤ 100 distinct formulas parses ≤ 100 times.
632
+ * Non-formula text returns the same string instance; an invalid origin is a RangeError.
633
+ * R1C1 数式を `origin` で A1 へ解決 — {@link toR1C1} の貼り付け側。行 / 列 0 未満へ落ちる相対
634
+ * 差分は (原文シート部つきの) `#REF!`、R1C1 文法が拒む文字列 (`R0C1` / `R[+1]` / `R[1`) は
635
+ * 原文のまま。解析形は相異なる文字列毎にメモされ、≤ 100 種の数式の 10 万セル貼り付けは解析
636
+ * ≤ 100 回。非数式は同一文字列インスタンス、不正な原点は RangeError。
637
+ */
638
+ export declare const fromR1C1: (r1c1: string, origin: CellCoord) => string;
639
+
640
+ /** Band colours + shared opacity, written to `--aqsp-band-*` by ONE layout effect (never per frame). / 帯の色 + 共通不透明度 (`--aqsp-band-*` へ layout effect が 1 回書く — 毎フレームは書かない)。 */
641
+ export declare type HighlightColors = {
642
+ row: string;
643
+ column: string;
644
+ intersection: string;
645
+ opacity: number;
646
+ };
647
+
648
+ /** Row / column / intersection highlight switches (v0.8 §2.4 — default all off = zero band nodes). / 行 / 列 / 交点強調のスイッチ (v0.8 §2.4 — 既定全 off = 帯ノード 0)。 */
649
+ export declare type HighlightState = {
650
+ row: boolean;
651
+ column: boolean;
652
+ intersection: boolean;
653
+ };
654
+
655
+ /** The table kinds the reader accepts — the marker-detected `ClipSource` values that are HTML tables. / reader が受ける表の種別 — HTML 表であるマーカー検出済み `ClipSource` 値。 */
656
+ export declare type HtmlTableKind = "sheets" | "excel" | "html";
657
+
658
+ /**
659
+ * The outcome of `parseHtmlTable`: the payload of the first table; `limit` when the table would
660
+ * materialise more than the caller's `maxCells` (`cells` = the lower bound of `rows × cols` at
661
+ * which the reader stopped — already above the cap); `none` when there is no table, no row or no
662
+ * cell column.
663
+ * `parseHtmlTable` の結果: 最初の表の payload。`limit` は表が呼び手の `maxCells` を超えて実体化する
664
+ * とき (`cells` = reader が止まった時点の `rows × cols` の下界 — 既に上限超)。`none` は表 / 行 /
665
+ * セル列が無いとき。
666
+ */
667
+ export declare type HtmlTableResult = {
668
+ readonly outcome: "payload";
669
+ readonly payload: ClipPayload;
670
+ } | {
671
+ readonly outcome: "limit";
672
+ readonly cells: number;
673
+ } | {
674
+ readonly outcome: "none";
675
+ };
676
+
677
+ /**
678
+ * Renders the hyperlink editor for one cell.
679
+ * 1 セルのハイパーリンクエディタを描画する。
680
+ */
681
+ export declare const LinkPopover: ({ ctx, labels }: LinkPopoverProps) => ReactNode;
682
+
683
+ /** Hyperlink editor context: `url` on commit is a normalised href or null (clear); `canOpen` = onHyperlinkOpen declared. / ハイパーリンクエディタ文脈: commit の url は正規化済み href か null (消去)、canOpen = onHyperlinkOpen 宣言。 */
684
+ export declare type LinkPopoverContext = {
685
+ kind: "link";
686
+ cell: CellCoord;
687
+ anchorRect: PopoverRect;
688
+ current: {
689
+ text: string;
690
+ url: string | undefined;
691
+ };
692
+ commit: (next: {
693
+ text: string;
694
+ url: string | null;
695
+ }) => void;
696
+ close: () => void;
697
+ canOpen: boolean;
698
+ open: () => void;
699
+ rejected: boolean;
700
+ };
701
+
702
+ export declare type LinkPopoverProps = {
703
+ ctx: LinkPopoverContext;
704
+ labels: SpreadsheetLabels;
705
+ };
706
+
707
+ /**
708
+ * Renders the list picker for one cell.
709
+ * 1 セルのリスト選択を描画する。
710
+ */
711
+ export declare const ListPopover: ({ ctx, labels }: ListPopoverProps) => ReactNode;
712
+
713
+ /** Validation list picker context: `current` = the list rule's values, `typed` = the prefix that opened it. / 検証リスト文脈: current = list 規則の値、typed = 開いたときの入力プレフィックス。 */
714
+ export declare type ListPopoverContext = {
715
+ kind: "list";
716
+ cell: CellCoord;
717
+ anchorRect: PopoverRect;
718
+ current: readonly string[];
719
+ typed: string;
720
+ commit: (value: string) => void;
721
+ close: () => void;
722
+ };
723
+
724
+ export declare type ListPopoverProps = {
725
+ ctx: ListPopoverContext;
726
+ labels: SpreadsheetLabels;
727
+ };
728
+
729
+ /** The text must equal one of `values` exactly; `showDropdown` is a UI hint only. / text が values のいずれかと完全一致。showDropdown は UI ヒントのみ。 */
730
+ export declare type ListValidationRule = {
731
+ type: "list";
732
+ values: readonly string[];
733
+ showDropdown?: boolean;
734
+ };
735
+
736
+ /** Builds a normalized range from two corners. / 2 隅から正規化レンジを構築。 */
737
+ export declare const makeRange: (a: CellCoord, b: CellCoord) => CellRange;
738
+
739
+ /**
740
+ * Applies a patch to a base format: `null` clears a key, `undefined` (or an omitted key) keeps
741
+ * the base value, anything else replaces it (borders as a whole set). Returns the CANONICAL
742
+ * merged format — or `base` BY IDENTITY when the result is structurally unchanged (so callers
743
+ * skip the edit for an unchanged cell), or `undefined` when everything has been cleared. The
744
+ * base is never mutated.
745
+ * base 書式へパッチを適用: `null` はキー消去、`undefined` (省略) は base の値を保持、それ以外は
746
+ * 置換 (borders は集合ごと)。戻り値は**正準**の合成書式 — 構造的に無変化なら `base` を
747
+ * **identity で**返し (無変化セルの edit を呼び手が省ける)、全て消えれば `undefined`。base は
748
+ * 変更しない。
749
+ */
750
+ export declare const mergeFormat: (base: CellFormat | undefined, patch: CellFormatPatch) => CellFormat | undefined;
751
+
752
+ /**
753
+ * Renders the validation message.
754
+ * 検証メッセージを描画する。
755
+ */
756
+ export declare const MessagePopover: ({ ctx, labels }: MessagePopoverProps) => ReactNode;
757
+
758
+ /** Validation message context (input message or a strict rejection). / 検証メッセージ文脈 (入力メッセージまたは strict 拒否)。 */
759
+ export declare type MessagePopoverContext = {
760
+ kind: "message";
761
+ cell: CellCoord;
762
+ anchorRect: PopoverRect;
763
+ current: {
764
+ title: string;
765
+ message: string;
766
+ rejected: boolean;
767
+ };
768
+ close: () => void;
769
+ };
770
+
771
+ export declare type MessagePopoverProps = {
772
+ ctx: MessagePopoverContext;
773
+ labels: SpreadsheetLabels;
774
+ };
775
+
776
+ /**
777
+ * Normalises a hyperlink candidate: trims, parses it with the WHATWG URL parser (no base URL —
778
+ * a relative path, a bare host or an empty string is not a link), keeps only the allow-listed
779
+ * schemes and returns the parser's serialisation (`href`: scheme and host lower-cased, an
780
+ * `http(s)` origin gets its `/` path). Anything else is null — dropped at parse time, never
781
+ * navigated, never substituted.
782
+ * リンク候補の正規化: トリム → WHATWG URL 解析 (基点 URL なし — 相対パス・裸のホスト・空文字は
783
+ * リンクでない) → 許可スキームのみ → パーサの直列化 (`href`: スキームとホストは小文字、http(s) の
784
+ * origin には `/` パスが付く)。他は null — 解析時に落とし、航行も代替もしない。
785
+ */
786
+ export declare const normalizeHyperlink: (text: string) => string | null;
787
+
788
+ /** The text is not the empty string. / text が空文字でない。 */
789
+ export declare type NotEmptyCondition = {
790
+ type: "notEmpty";
791
+ };
792
+
793
+ /**
794
+ * Renders the note editor for one cell.
795
+ * 1 セルの note エディタを描画する。
796
+ */
797
+ export declare const NotePopover: ({ ctx, labels }: NotePopoverProps) => ReactNode;
798
+
799
+ /** Note editor context (v0.8 §1.8). `current` undefined = no note yet; `commit(null)` clears. / note エディタ文脈。current undefined = ノートなし、commit(null) は消去。 */
800
+ export declare type NotePopoverContext = {
801
+ kind: "note";
802
+ cell: CellCoord;
803
+ anchorRect: PopoverRect;
804
+ current: string | undefined;
805
+ commit: (next: string | null) => void;
806
+ close: () => void;
807
+ rejected: boolean;
808
+ };
809
+
810
+ export declare type NotePopoverProps = {
811
+ ctx: NotePopoverContext;
812
+ labels: SpreadsheetLabels;
813
+ };
814
+
815
+ /**
816
+ * Renders the note tip text.
817
+ * note tip の本文を描画する。
818
+ */
819
+ export declare const NoteTip: ({ ctx }: NoteTipProps) => ReactNode;
820
+
821
+ /** Hover note tip context (read-only). / ホバー note tip 文脈 (読み取り専用)。 */
822
+ export declare type NoteTipContext = {
823
+ kind: "note-tip";
824
+ cell: CellCoord;
825
+ anchorRect: PopoverRect;
826
+ current: string;
827
+ close: () => void;
828
+ };
829
+
830
+ export declare type NoteTipProps = {
831
+ ctx: NoteTipContext;
832
+ labels: SpreadsheetLabels;
833
+ };
834
+
835
+ /**
836
+ * Host declarations consulted while decoding: `currency` = the code a BARE currency symbol
837
+ * denotes (undeclared ⇒ such patterns are dropped), `locale` = the rendering locale stamped on
838
+ * decoded numeric formats (an LCID-tagged currency carries its own locale instead).
839
+ * 復号時に参照するホスト宣言: `currency` = 裸の通貨記号が指す通貨コード (未宣言なら該当パターンは
840
+ * 省略)、`locale` = 復号した数値書式へ刻む描画 locale (LCID 付き通貨は自身の locale を持つ)。
841
+ */
842
+ export declare type NumberFormatDecodeOptions = {
843
+ readonly currency?: string;
844
+ readonly locale?: string;
845
+ };
846
+
847
+ /** The text must be a strict decimal satisfying `op` against the decimal-string bounds `a` (and `b` for between / notBetween). / text が厳密 10 進で、10 進文字列の境界 a (between 系は b も) に対し op を満たす。 */
848
+ export declare type NumberValidationRule = {
849
+ type: "number";
850
+ op: ValidationCompareOp;
851
+ a: string;
852
+ b?: string;
853
+ };
854
+
855
+ /**
856
+ * Parses a chord in canonical spelling ONLY — `[Ctrl+][Alt+][Shift+]KEY`, this order, each
857
+ * modifier at most once, KEY a canonical token. Anything else (lowercase, `Cmd`, a reordered or
858
+ * repeated modifier, a produced character, a trailing `+`, whitespace) is a RangeError: the
859
+ * grammar has exactly one spelling per chord so table keys compare as strings. A bare KEY is
860
+ * accepted here (built-in rows such as `F2` are modifier-less); the consumer-facing modifier
861
+ * requirement lives in validateShortcuts.
862
+ * 正準綴りのみのチョード解析 — `[Ctrl+][Alt+][Shift+]KEY` (この順・各修飾は高々 1 回・KEY は正準
863
+ * トークン)。それ以外 (小文字・`Cmd`・順序違い / 重複修飾・生成文字・末尾 `+`・空白) は RangeError:
864
+ * 文法はチョード 1 つに綴り 1 つで、表のキーが文字列比較で済む。素の KEY はここでは受理 (`F2`
865
+ * 等の組込み行は修飾なし) — consumer 向けの修飾必須は validateShortcuts が持つ。
866
+ */
867
+ export declare const parseChord: (chord: string) => ParsedChord;
868
+
869
+ /**
870
+ * Parses a wire-format string with TOTAL validation (fileoverview): null on any malformed input,
871
+ * never a partial payload, never a substituted value.
872
+ * wire format 文字列を全域検証つきで parse (fileoverview): 不正入力は全て null、部分 payload も
873
+ * 値の代替も無し。
874
+ */
875
+ export declare const parseClipPayload: (json: string) => ClipPayload | null;
876
+
877
+ /** A canonical chord decomposed: modifier flags + KEY token (`"A".."Z"` or a code name). / 正準チョードの分解形: 修飾フラグ + KEY トークン (`"A".."Z"` または code 名)。 */
878
+ export declare type ParsedChord = {
879
+ ctrl: boolean;
880
+ alt: boolean;
881
+ shift: boolean;
882
+ key: string;
883
+ };
884
+
885
+ /**
886
+ * Parses an Excel / Sheets / generic HTML clipboard string into a ClipPayload (the fileoverview
887
+ * reader contract). `kind` is the marker-detected source (`detectClipSource`), `options` the host's
888
+ * declared currency / locale for number-format decoding, `maxCells` the ADR-12 cap the reader
889
+ * itself enforces (a positive integer — anything else is a RangeError, an API surface, thrown
890
+ * before the DOMParser is built). TOTAL fail-soft on the markup: any string yields `payload`,
891
+ * `limit` or `none` — a blow-up of the ENVIRONMENT's own parser (an engine recursion limit on
892
+ * pathologically deep nesting) resolves `none` too; a payload is always valid for
893
+ * `serializeClipPayload`. Callers build the
894
+ * DOMParser only under the ADR-12 estimate and re-gate the payload's `rows × cols` with their
895
+ * tiling.
896
+ * Excel / Sheets / 汎用 HTML のクリップボード文字列を ClipPayload へ解析 (fileoverview の reader 契約)。
897
+ * `kind` はマーカー検出済みソース (`detectClipSource`)、`options` は数値書式復号用のホスト宣言
898
+ * (通貨 / locale)、`maxCells` は reader 自身が守る ADR-12 上限 (正整数 — 他は DOMParser 構築前に
899
+ * RangeError、API 面)。マークアップに対しては全域 fail-soft: 任意の文字列に `payload` / `limit` /
900
+ * `none` — 環境の parser 自身の破綻 (病的な入れ子深さでのエンジン再帰限界) も `none` に畳む。payload は
901
+ * 常に `serializeClipPayload` に有効。呼び手は ADR-12 見積もり下でだけ DOMParser
902
+ * を作り、payload の `rows × cols` をタイル込みで再ゲートする。
903
+ */
904
+ export declare const parseHtmlTable: (html: string, kind: HtmlTableKind, options: NumberFormatDecodeOptions, maxCells: number) => HtmlTableResult;
905
+
906
+ /**
907
+ * Parses Excel-behavior TSV into a rectangular matrix (ragged rows are right-padded).
908
+ * Excel 実挙動 TSV を矩形行列へ解析 (ギザギザ行は右パディング)。
909
+ */
910
+ export declare const parseTsv: (text: string) => string[][];
911
+
912
+ /**
913
+ * Write context of a paste (incl. a cut-move, which is the Ctrl+V gesture): `sameSheet` is
914
+ * true when the clip was copied from THIS adapter and false for a cross-sheet paste — and for
915
+ * the source-side clear of a cross-sheet cut, which the grid delivers to the SOURCE adapter with
916
+ * the same transaction id and `conditionalFormats: []` (a cut never moves or removes conditional
917
+ * formats from the source sheet — deviation row). `conditionalFormats` are the rules pasted with
918
+ * the cells, translated to the target ranges (`[]` when none; a CF-only paste has `edits: []`
919
+ * and a non-empty list); the consumer mints each new rule's id — `sourceRuleId` is the id on the
920
+ * source sheet.
921
+ * 貼り付け (Ctrl+V のジェスチャである cut-move を含む) の書込文脈: `sameSheet` はクリップが
922
+ * **この**アダプタからコピーされたとき true、跨ぎ貼り付けは false — 跨ぎ cut の元シート側の消去
923
+ * も false で、グリッドは**元**アダプタへ同じ transaction id と `conditionalFormats: []` で届ける
924
+ * (cut は元シートの条件付き書式を移動も削除もしない — 逸脱行)。`conditionalFormats` はセルと共に
925
+ * 貼り付けた規則を対象レンジへ平行移動したもの (規則なしは `[]`。CF だけの貼り付けは `edits: []`
926
+ * + 非空リスト)。新規則の id は consumer が採番 — `sourceRuleId` は元シートでの id。
927
+ */
928
+ export declare type PasteEditContext = {
929
+ transaction: number;
930
+ source: "paste";
931
+ sameSheet: boolean;
932
+ conditionalFormats: readonly ConditionalFormatRuleInput[];
933
+ };
934
+
935
+ /** The paste-special modes (Excel Paste Special ∪ Sheets Paste special, §1.7). / 貼り付けスペシャルのモード (§1.7)。 */
936
+ export declare type PasteMode = "all" | "values" | "formats" | "formulas" | "noBorders" | "columnWidths" | "validation" | "conditionalFormats" | "commentsAndNotes";
937
+
938
+ /** Excel's Paste Special operation — the copied value is the RIGHT operand. / Excel の演算 — コピー値が右オペランド。 */
939
+ export declare type PasteOperation = "add" | "subtract" | "multiply" | "divide";
940
+
941
+ /**
942
+ * One paste gesture's options (§1.7): the mode, an optional arithmetic operation on the text
943
+ * aspect, skip-blanks, transpose and the inject-into-empty format option.
944
+ * 1 回の貼り付けのオプション (§1.7): モード、text 側面への任意の演算、空白スキップ、転置、
945
+ * 空セルへの書式注入。
946
+ */
947
+ export declare type PasteOptions = {
948
+ mode: PasteMode;
949
+ operation?: PasteOperation;
950
+ skipBlanks?: boolean;
951
+ transpose?: boolean;
952
+ injectIntoEmpty?: boolean;
953
+ };
954
+
955
+ /** One paste's outcome: the adapter was called / nothing was written / refused (§1.10 `paste`). / 1 回の貼り付けの結果: アダプタが呼ばれた / 何も書かなかった / 拒否 (§1.10 `paste`)。 */
956
+ export declare type PasteOutcome = "applied" | "empty" | "rejected";
957
+
958
+ /**
959
+ * Write context of every non-paste applyEdits: `transaction` is the id the grid allocated for
960
+ * this gesture (strictly increasing per grid instance, one id per applyEdits call — the
961
+ * consumer's undo groups by it) and `source` names the write path. Spelled as an explicit
962
+ * literal union (api-extractor cannot roll up `Exclude<EditSource, "paste">`); its agreement
963
+ * with EditSource is sealed by the type-parity guard in dataAdapter.spec.ts.
964
+ * paste 以外の全 applyEdits の書込文脈: `transaction` はグリッドがこのジェスチャに採番した id
965
+ * (グリッド実体毎に厳密増加、applyEdits 呼び出し 1 回につき 1 id — consumer の Undo はこれで
966
+ * 束ねる)、`source` は書込経路。明示リテラル union で綴る (api-extractor は
967
+ * `Exclude<EditSource, "paste">` を d.ts ロールアップできない)。EditSource との一致は
968
+ * dataAdapter.spec.ts の型パリティガードが封印する。
969
+ */
970
+ export declare type PlainEditContext = {
971
+ transaction: number;
972
+ source: "edit" | "fill" | "delete" | "format" | "calc" | "annotate";
973
+ };
974
+
975
+ /** The discriminated popover context handed to `renderPopover` / the default components (v0.8 §1.8). / renderPopover / 既定コンポーネントへ渡す判別文脈 (v0.8 §1.8)。 */
976
+ export declare type PopoverContext = NotePopoverContext | NoteTipContext | CommentPopoverContext | LinkPopoverContext | ListPopoverContext | MessagePopoverContext;
977
+
978
+ /** The six popover kinds (v0.8 §1.8). / 6 種のポップオーバー (v0.8 §1.8)。 */
979
+ export declare type PopoverKind = "note" | "note-tip" | "comment" | "link" | "list" | "message";
980
+
981
+ /** The `popovers` prop: `false` disables a kind (its commands pass through, `openPopover` throws). / `popovers` prop: `false` はその kind を無効化 (コマンドは素通し、`openPopover` は RangeError)。 */
982
+ export declare type PopoverOverrides = {
983
+ readonly [K in PopoverKind]?: boolean;
984
+ };
985
+
986
+ /** A rectangle in the popover layer's coordinate space (logical viewport px). / ポップオーバー層座標系 (論理 viewport px) の矩形。 */
987
+ export declare type PopoverRect = {
988
+ top: number;
989
+ left: number;
990
+ width: number;
991
+ height: number;
992
+ };
993
+
994
+ /** Whether the range contains the cell. / レンジがセルを含むか。 */
995
+ export declare const rangeContains: (range: CellRange, cell: CellCoord) => boolean;
996
+
997
+ /** Numeric extrema of a range (the `getRangeExtrema` answer). / レンジの数値極値 (getRangeExtrema の答え)。 */
998
+ export declare type RangeExtrema = {
999
+ min: number;
1000
+ max: number;
1001
+ };
1002
+
1003
+ /** Row/column extents of a range. / レンジの行数・列数。 */
1004
+ export declare const rangeSize: (range: CellRange) => {
1005
+ rows: number;
1006
+ cols: number;
1007
+ };
1008
+
1009
+ /** Public custom cell renderer context (ADR-8). / 公開セルレンダラーの ctx (ADR-8)。 */
1010
+ export declare type RenderCellContext = {
1011
+ row: number;
1012
+ col: number;
1013
+ text: string;
1014
+ };
1015
+
1016
+ /**
1017
+ * The single read point: resolves one label to its display string. A function-valued label is
1018
+ * called with `n` (a missing `n` is a caller bug ⇒ RangeError — no silent 0); a string label is
1019
+ * returned as-is and ignores `n`.
1020
+ * 唯一の読み出し点: ラベル 1 件を表示文字列へ解決。関数値は n で呼ぶ (n 省略は呼び手バグとして
1021
+ * RangeError — 黙って 0 にしない)、文字列値はそのまま (n は無視)。
1022
+ */
1023
+ export declare const resolveLabel: (labels: SpreadsheetLabels, key: keyof SpreadsheetLabels, n?: number) => string;
1024
+
1025
+ /** One colour-scale point; `value` omitted = the range extremum from `getRangeExtrema` (min / max) or the arithmetic midpoint (mid). / 色スケールの 1 点。value 省略 = getRangeExtrema のレンジ極値 (min / max) か算術中点 (mid)。 */
1026
+ export declare type ScalePoint = {
1027
+ color: string;
1028
+ value?: number;
1029
+ };
1030
+
1031
+ /**
1032
+ * Options for the programmatic {@link SpreadsheetHandle.scrollToCell} jump — the render-surface
1033
+ * pass-through of the engine's cell-targeted scroll (alignX uses start/end/center, alignY uses
1034
+ * top/bottom/center; a frozen column/row target is a no-op on that axis). Selection is NOT
1035
+ * changed — this is a pure viewport jump.
1036
+ * 命令的セルジャンプ ({@link SpreadsheetHandle.scrollToCell}) のオプション (エンジンのセル狙い
1037
+ * スクロールの素通し)。alignX は start / end / center、alignY は top / bottom / center。凍結列 /
1038
+ * 行狙いは当該軸で no-op。選択は変えない純粋な viewport ジャンプ。
1039
+ * 明示構造型で宣言する (api-extractor は NonNullable<Parameters<...>> 派生を d.ts ロールアップ
1040
+ * できず build が落ちる) — エンジン型との双方向一致は Spreadsheet.spec.tsx の型パリティガードが
1041
+ * tsc で機械封印する (ズレたら型検査が即赤)。
1042
+ */
1043
+ export declare type ScrollToCellOptions = {
1044
+ alignY?: "top" | "bottom" | "center";
1045
+ alignX?: "start" | "end" | "center";
1046
+ offsetX?: number;
1047
+ offsetY?: number;
1048
+ };
1049
+
1050
+ /** Selection state (tail of ranges = the "current range"). / 選択状態 (末尾が現在レンジ)。 */
1051
+ export declare type SelectionState = {
1052
+ /** Non-contiguous range list; the tail is the "current range". / 非連続選択のレンジ列 (末尾が現在レンジ)。 */
1053
+ ranges: readonly CellRange[];
1054
+ /** Drag / Shift-extend origin. / ドラッグ / Shift 拡張の起点。 */
1055
+ anchor: CellCoord;
1056
+ /** Active cell; never moved by extend operations (Excel semantics). / アクティブセル (拡張で不動)。 */
1057
+ active: CellCoord;
1058
+ };
1059
+
1060
+ /**
1061
+ * Serialises a payload with the FIXED leading key order `{"v":1,"rows":R,"cols":C,"clipId":"…",…}`
1062
+ * and a deterministic key order everywhere below (fileoverview). A structurally malformed
1063
+ * payload (the parser's validation contract) is a RangeError — the serialiser never emits a
1064
+ * string `parseClipPayload` would reject.
1065
+ * 固定先頭キー順 `{"v":1,"rows":R,"cols":C,"clipId":"…",…}` と以下全階層の決定的キー順で直列化
1066
+ * (fileoverview)。構造的に不正な payload (parser の検証契約) は RangeError — `parseClipPayload`
1067
+ * が拒む文字列を直列化器は決して出さない。
1068
+ */
1069
+ export declare const serializeClipPayload: (payload: ClipPayload) => string;
1070
+
1071
+ /**
1072
+ * Serializes a clip payload to the interop HTML table (see the fileoverview writer contract).
1073
+ * `clipJson` is the payload's `serializeClipPayload` string (the caller already holds it for the
1074
+ * custom MIME flavour) and becomes the FIRST attribute of `<table>`. A payload whose `cells`
1075
+ * matrix is not `rows × cols` is a RangeError (consumer input on an API surface).
1076
+ * クリップ payload を相互運用 HTML 表へ直列化 (fileoverview の writer 契約)。`clipJson` は payload の
1077
+ * `serializeClipPayload` 文字列 (呼び手はカスタム MIME 用に既に持つ) で `<table>` の先頭属性になる。
1078
+ * `cells` が `rows × cols` でない payload は RangeError (API 面の消費者入力)。
1079
+ */
1080
+ export declare const serializeHtmlTable: (payload: ClipPayload, clipJson: string) => string;
1081
+
1082
+ /**
1083
+ * Serializes a matrix to Excel-behavior TSV with a trailing CRLF.
1084
+ * 行列を終端 CRLF つきの Excel 実挙動 TSV へ直列化。
1085
+ */
1086
+ export declare const serializeTsv: (matrix: readonly (readonly string[])[]) => string;
1087
+
1088
+ /**
1089
+ * Shifts the relative parts of every reference by (dRow, dCol) — the paste-offset transform.
1090
+ * Absolute (`$`) parts stay; a reference shifted below row / column 0 becomes `#REF!` (behind
1091
+ * its verbatim sheet part). Non-formula text and reference-free formulas return the same
1092
+ * string instance. Non-integer deltas are a RangeError.
1093
+ * 全参照の相対部を (dRow, dCol) だけシフト — 貼り付けオフセット変換。絶対 (`$`) 部は不変、
1094
+ * 行 / 列 0 未満へ出た参照は (原文シート部つきの) `#REF!`。非数式・参照なし数式は同一文字列
1095
+ * インスタンス。非整数の差分は RangeError。
1096
+ */
1097
+ export declare const shiftFormula: (formula: string, dRow: number, dCol: number) => string;
1098
+
1099
+ /** Command → canonical chords (empty = unbound; several chords allowed). / コマンド → 正準チョード群 (空 = 未束縛、複数可)。 */
1100
+ export declare type ShortcutMap = {
1101
+ readonly [K in SpreadsheetCommand]: readonly string[];
1102
+ };
1103
+
1104
+ /**
1105
+ * Consumer overrides: an array REPLACES the command's default list, `null` unbinds it, an absent
1106
+ * key keeps the default. A single string is a RangeError (never silently wrapped).
1107
+ * consumer の上書き: 配列はそのコマンドの既定一覧を置換、`null` は未束縛、キー不在は既定維持。
1108
+ * 単一 string は RangeError (黙って 1 要素配列に包まない)。
1109
+ */
1110
+ export declare type ShortcutOverrides = {
1111
+ readonly [K in SpreadsheetCommand]?: readonly string[] | null;
1112
+ };
1113
+
1114
+ /**
1115
+ * The spreadsheet root component (wiring only).
1116
+ * スプレッドシート統合ルート (結線のみ)。
1117
+ */
1118
+ export declare const Spreadsheet: ForwardRefExoticComponent<SpreadsheetProps & SpreadsheetTestProps & RefAttributes<SpreadsheetHandle>>;
1119
+
1120
+ /**
1121
+ * Reserved chords for EVERY command: the exact chords of `rebindable: false` rows consulted in
1122
+ * the idle column (`"idle" | "both"` — every command is consulted there). Editing-only rows
1123
+ * (`Alt+Enter`, `F4`) are not in this list: they bind only EDITING_COLUMN_COMMANDS, which
1124
+ * validateShortcuts checks column-aware. Families are NOT reserved — `Alt+ArrowDown`, `Alt+Enter`
1125
+ * (idle), `Ctrl+Enter` and `Shift+F2` are valid defaults.
1126
+ * 全コマンドに対する予約チョード: idle 列で参照される `rebindable: false` 行 (`"idle" | "both"` —
1127
+ * 全コマンドが idle 列で参照される) の正確なチョード。編集列限定行 (`Alt+Enter`、`F4`) は含まない
1128
+ * — EDITING_COLUMN_COMMANDS にだけ効き、validateShortcuts が列を見て検査する。族は予約しない —
1129
+ * `Alt+ArrowDown` / `Alt+Enter` (idle) / `Ctrl+Enter` / `Shift+F2` は正当な既定。
1130
+ */
1131
+ export declare const SPREADSHEET_RESERVED_SHORTCUTS: readonly string[];
1132
+
1133
+ /**
1134
+ * @fileoverview Rebindable command table (v0.8 ADR-17 — plan §1.5 / §2.6 / §4.1.11). Pure,
1135
+ * React-free: the SpreadsheetCommand vocabulary, the canonical chord grammar
1136
+ * (`Ctrl+Alt+Shift+KEY` — used modifiers only, fixed order, Cmd = Ctrl), the ONE table of exact
1137
+ * built-in rows (BUILTIN_ROWS — every non-rebindable row of spec 04 §3.2 plus every rebindable
1138
+ * command default row), the constants derived from that table (DEFAULT_SHORTCUTS,
1139
+ * SPREADSHEET_RESERVED_SHORTCUTS, EDITING_COLUMN_COMMANDS), the VK rule that maps a keydown to a
1140
+ * KEY token independently of the keyboard layout (letters by `event.key` when it is a single
1141
+ * Latin letter, otherwise by the `event.code` letter; digits / punctuation / function keys always
1142
+ * by code), strict chord matching with the AltGraph refusal (a row containing Alt is never
1143
+ * claimed by a real AltGr press), the column-aware consumer validation (merge = REPLACE per
1144
+ * command; every invalid input is a RangeError — fail-fast on the API surface) and the O(1)
1145
+ * runtime resolution of one keydown to a command.
1146
+ *
1147
+ * 再バインド可能コマンド表 (v0.8 ADR-17 — 計画 §1.5 / §2.6 / §4.1.11)。純関数・React 非依存:
1148
+ * SpreadsheetCommand の語彙、正準チョード文法 (`Ctrl+Alt+Shift+KEY` — 使う修飾だけ・順序固定・
1149
+ * Cmd = Ctrl)、正確な組込み行の単一表 (BUILTIN_ROWS — spec 04 §3.2 の非再バインド行全件 +
1150
+ * 再バインド可コマンドの既定行全件)、そこから導出する定数 (DEFAULT_SHORTCUTS /
1151
+ * SPREADSHEET_RESERVED_SHORTCUTS / EDITING_COLUMN_COMMANDS)、keydown をレイアウト非依存の KEY
1152
+ * トークンへ写す VK 規則 (文字は `event.key` が単一ラテン文字ならそれ、そうでなければ
1153
+ * `event.code` の文字。数字 / 記号 / 機能キーは常に code)、AltGraph 拒否つきの厳密チョード照合
1154
+ * (Alt を含む行は実 AltGr 押下で決して成立しない)、列を意識した consumer 検証 (merge = コマンド毎
1155
+ * REPLACE。無効入力は全て RangeError — API 面での fail-fast)、keydown 1 件の O(1) コマンド解決。
1156
+ */
1157
+ /**
1158
+ * Every rebindable command of the grid (camelCase — the exact plan §1.5 list). The first block
1159
+ * carries Google-Sheets-parity defaults; the extension block is unbound by default (`[]`) and
1160
+ * exists so a consumer can bind it through `shortcuts`.
1161
+ * グリッドの再バインド可能コマンド全件 (camelCase — 計画 §1.5 の正確な一覧)。前半は Google Sheets
1162
+ * 同等の既定束縛、拡張ブロックは既定未束縛 (`[]`) で consumer が `shortcuts` で束縛するための存在。
1163
+ */
1164
+ export declare type SpreadsheetCommand = "bold" | "italic" | "underline" | "strikethrough" | "clearFormatting" | "alignLeft" | "alignCenter" | "alignRight" | "formatNumber" | "formatTime" | "formatDate" | "formatCurrency" | "formatPercent" | "formatScientific" | "bordersOuter" | "bordersClear" | "borderTop" | "borderRight" | "borderBottom" | "borderLeft" | "insertLink" | "insertNote" | "insertComment" | "openHyperlink" | "openValidationList" | "pasteSpecial" | "fillDown" | "fillRight" | "fillSelection" | "insertDate" | "insertTime" | "hideRows" | "hideColumns" | "unhideRows" | "unhideColumns" | "formatGeneral" | "bordersAll" | "pasteFormats" | "pasteFormulas" | "pasteAdd" | "pasteSubtract" | "pasteMultiply" | "pasteDivide" | "multiplyBy100" | "multiplyBy1000" | "divideBy100" | "divideBy1000" | "signReversal" | "fillColorYellow" | "fillColorBlue" | "fillColorGreen" | "fillColorRed" | "fillColorCustom1" | "fillColorCustom2" | "fillColorCustom3" | "fillColorCustom4" | "fillColorCustom5" | "fontColorYellow" | "fontColorBlue" | "fontColorGreen" | "fontColorRed" | "fontColorCustom1" | "fontColorCustom2" | "fontColorCustom3" | "fontColorCustom4" | "fontColorCustom5" | "toggleRowHighlight" | "toggleColumnHighlight" | "toggleBothHighlight" | "toggleIntersectionHighlight";
1165
+
1166
+ /**
1167
+ * The single data boundary between the grid and the consumer. Reads via getCellText (renderCell
1168
+ * — a SpreadsheetProps prop, not an adapter member — customizes only the presentation of that
1169
+ * text) plus the optional capability reads, writes via applyEdits as ONE transaction per
1170
+ * gesture (editor commit / Delete / paste / cut-clear / fill / format / calc / annotate). This
1171
+ * seam is where the consumer implements undo (inverse patches grouped by `transaction`). Every
1172
+ * optional member is a CAPABILITY DECLARATION ("what cannot be read cannot be written"): the
1173
+ * grid enables a feature only when the read it depends on is declared, and an undeclared
1174
+ * capability reproduces the v0.7 behaviour exactly (never a value fallback). Declaring
1175
+ * getConditionalFormats without getCellFormat is a RangeError at mount (a painted format is
1176
+ * base ⊕ CF and there is no base without getCellFormat).
1177
+ * グリッドと consumer の唯一のデータ境界。読みは getCellText (renderCell は SpreadsheetProps の
1178
+ * prop であってアダプタメンバーではない — その文字列の表現のみを差し替える) と任意の能力読み、
1179
+ * 書きは applyEdits のジェスチャ毎 1 トランザクション (編集確定 / Delete / 貼り付け / 切り取り
1180
+ * 清算 / フィル / 書式 / 自己計算 / 注釈)。consumer の Undo 実装点 (`transaction` で束ねる逆
1181
+ * パッチ)。任意メンバーは全て**能力宣言** (「読めないものは書けない」): グリッドは依存する読みが
1182
+ * 宣言されたときだけ機能を有効化し、未宣言能力は v0.7 の振る舞いを厳密に再現する (値フォール
1183
+ * バックではない)。getCellFormat なしの getConditionalFormats 宣言はマウント時 RangeError
1184
+ * (塗り書式は base ⊕ CF で、getCellFormat なしに base は無い)。
1185
+ */
1186
+ export declare type SpreadsheetDataAdapter = {
1187
+ rowCount: number;
1188
+ colCount: number;
1189
+ /** Canonical string used for TSV copy and the editor initial value. / コピーとエディタ初期値の正準文字列。 */
1190
+ getCellText: (row: number, col: number) => string;
1191
+ /**
1192
+ * Applies ONE transaction of per-cell patches. String-to-value interpretation is the
1193
+ * consumer's job. Rejection = throw (grid state is preserved and onEditRejected fires with
1194
+ * the {@link EditRejection} context). `context` carries the transaction id and the write path
1195
+ * ({@link EditContext}); a paste additionally says whether the clip came from this adapter and
1196
+ * which conditional formats travel with it. An empty transaction never arrives.
1197
+ * セル単位パッチの 1 トランザクションを適用する。文字列→値の解釈は consumer の責務。拒否は
1198
+ * throw (グリッド状態は保たれ、onEditRejected が {@link EditRejection} 文脈つきで通知される)。
1199
+ * `context` はトランザクション id と書込経路 ({@link EditContext}) を運び、貼り付けはさらに
1200
+ * クリップがこのアダプタ由来かと同伴する条件付き書式を伝える。空トランザクションは届かない。
1201
+ * ❗ 契約: edits は**配列順に適用し、同一セルへの重複はキー単位で後勝ち (last-wins)** — 後の edit が
1202
+ * 持つキーは前の edit の同じキーを上書きし、後の edit が持たないキーは前の edit の値のまま残る。
1203
+ * cut の移動 (clear → 貼り付けの重ね積み) がこの順序意味論に依存する。逆パッチで Undo を実装する
1204
+ * consumer は「最初に現れた edit の適用前値」を inverse として記録すること (参照実装は demo/edit)。
1205
+ */
1206
+ applyEdits: (edits: readonly CellEdit[], context: EditContext) => void;
1207
+ /**
1208
+ * OPTIONAL capability: computes the Excel Ctrl+Arrow jump target from `from` in
1209
+ * `direction`. Absence = the grid keeps its v0.1 grid-edge jump (a capability declaration,
1210
+ * NOT a value fallback). The consumer implements Excel semantics (non-empty cell with a
1211
+ * non-empty neighbor: the end of the contiguous non-empty run; otherwise: the next
1212
+ * non-empty cell in the direction; none: the grid edge) because only the store can jump
1213
+ * data-aware in O(occupied) instead of O(cells). The grid validates the return fully
1214
+ * fail-fast BEFORE dispatch (non-integer / out-of-axis / orthogonal drift on the reset
1215
+ * path all throw RangeError, propagated uncaught — reference implementation: demo/edit).
1216
+ * 任意能力: Excel の Ctrl+Arrow ジャンプ先を計算する。未宣言 = v0.1 のグリッド端ジャンプ
1217
+ * 維持 (能力宣言であり値フォールバックではない)。Excel 意味論 (非空 + 隣接非空 → 連続
1218
+ * 非空の末端 / それ以外 → 方向の次の非空セル / 無ければグリッド端) は consumer 責務 —
1219
+ * データを知るストアだけが O(占有セル) で跳べる。戻り値はディスパッチ前に完全 fail-fast
1220
+ * 検証 (非整数 / 軸域外 / reset 経路の直交ドリフトは RangeError を未捕捉で伝播)。
1221
+ */
1222
+ findDataEdge?: (from: CellCoord, direction: SpreadsheetDirection) => CellCoord;
1223
+ /**
1224
+ * OPTIONAL capability (v0.7, widened in v0.8): the cell's BASE display format — value
1225
+ * format (undefined = raw text), horizontal alignment (undefined = auto BY THE ACTUAL VALUE:
1226
+ * text that parses under the cell's numeric/date format — or as a strict decimal with no
1227
+ * format — resolves right, labels resolve left), vertical alignment, wrap, colours, font
1228
+ * traits, font family / size and per-side borders. Absence = the v0.1 plain-text,
1229
+ * left-aligned rendering with no format command, no format paste aspect and no handle
1230
+ * format write (a capability declaration, NOT a value fallback). The grid paints the
1231
+ * PAINTED format (this base ⊕ conditional formats); the value format applies to the DISPLAY
1232
+ * string only — editing keeps the raw getCellText (Excel semantics) and copy/TSV carry the raw
1233
+ * value too (a DELIBERATE deviation from Excel, which copies the display — raw preserves the
1234
+ * numeric round-trip). Autofit measures the FORMATTED display, and screen-reader
1235
+ * announcements receive both the raw text and the display string. `renderCell` (a prop)
1236
+ * takes precedence over the built-in VALUE format (raw text flows to the custom renderer),
1237
+ * but the resolved ALIGNMENT and paint are cell properties that still apply under
1238
+ * renderCell. Every format is fail-soft: a non-numeric value in a numeric format, an
1239
+ * invalid date, an out-of-range Intl option or an unparseable colour renders / paints
1240
+ * nothing for that key. Return a shared/interned CellFormat per column (or per cell object)
1241
+ * to avoid per-cell allocation and to keep the paint intern stable; because return values
1242
+ * (like getCellText) are only re-read on a re-slice, publish a live format change by bumping
1243
+ * dataVersion (or swapping the adapter).
1244
+ * 任意能力 (v0.7、v0.8 で拡張): セルの **base** 表示形式 — 値書式 (undefined = 素の文字列)・
1245
+ * 水平揃え (undefined = **実際の値**による自動: 数値 / 日付書式の下で実際に解釈できる文字列と、
1246
+ * 書式なしの厳密 10 進だけ右、ラベルは左)・垂直揃え・折返し・色・字体・フォント族 / サイズ・
1247
+ * 辺毎の罫線。未宣言 = v0.1 の素テキスト左寄せ描画で、書式コマンドも書式の貼り付け側面も
1248
+ * handle の書式書込も無い (能力宣言であり値フォールバックではない)。グリッドが塗るのは
1249
+ * **塗り書式** (この base ⊕ 条件付き書式)。値書式は表示文字列にのみ適用し、編集は素の
1250
+ * getCellText (Excel 意味論)、コピー / TSV も素の値を運ぶ (Excel は表示を写すため**意図的な
1251
+ * 逸脱** — 素値は数値の往復を保つ)。autofit は**整形後の表示**を計測し、読み上げには素の
1252
+ * text と表示文字列の両方を渡す。`renderCell` (prop) は組み込み「値書式」に優先する (素の
1253
+ * text がカスタムレンダラーへ) が、解決済み「揃え」と塗りはセル固有属性として renderCell 下
1254
+ * でも効く。全書式は fail-soft — 数値書式の非数値・無効な日付・範囲外 Intl オプション・解釈
1255
+ * 不能な色はそのキーだけ何も描かない。列毎 (またはセル object 毎) に共有 CellFormat を返すと
1256
+ * セル毎の確保を避け塗りの intern も安定する。戻り値は (getCellText 同様) 再スライス時のみ
1257
+ * 再読込されるため、書式変更の反映は dataVersion 増分 (またはアダプタ差替) で行う。
1258
+ */
1259
+ getCellFormat?: (row: number, col: number) => CellFormat | undefined;
1260
+ /**
1261
+ * OPTIONAL capability (v0.8): the cell's formula SOURCE — a string that MUST start with
1262
+ * "=" (anything else is a RangeError raised by resolveEditText before dispatch, the
1263
+ * findDataEdge precedent); undefined = the cell holds a plain value. Declared, the editor
1264
+ * seeds with the formula instead of getCellText, copy serializes formulas as R1C1 so a
1265
+ * paste re-anchors them, the self-calculation commands wrap formula cells, and the
1266
+ * formula-reference pointing gestures (click / Arrow / drag while typing after "=") exist.
1267
+ * Absence = none of that: "=" is ordinary text and Arrow keys commit exactly as v0.7.
1268
+ * 任意能力 (v0.8): セルの数式**ソース** — 必ず "=" で始まる文字列 (それ以外は resolveEditText が
1269
+ * ディスパッチ前に RangeError — findDataEdge の前例)。undefined = 素の値のセル。宣言時、エディタ
1270
+ * は getCellText でなく数式で初期化し、コピーは数式を R1C1 で直列化して貼り付けが再アンカー
1271
+ * し、自己計算コマンドは数式セルをラップし、数式参照ポインティング ("=" 後のクリック / Arrow /
1272
+ * ドラッグ) が存在する。未宣言 = いずれも無し: "=" は普通の文字で、Arrow は v0.7 どおり確定。
1273
+ */
1274
+ getCellFormula?: (row: number, col: number) => string | undefined;
1275
+ /**
1276
+ * OPTIONAL capability (v0.8): the cell's note text; undefined = no note. Declared, cells
1277
+ * with a note carry the `data-aqsp-note` marker, the hover note tip and the note popover
1278
+ * (Shift+F2) exist, and the note aspect of copy / paste / fill travels. Absence = no marker,
1279
+ * no popover, the chord passes through, the aspect is stripped before tiling.
1280
+ * 任意能力 (v0.8): セルのノート本文。undefined = ノート無し。宣言時、ノートつきセルは
1281
+ * `data-aqsp-note` マーカーを持ち、ホバーの note tip と note ポップオーバー (Shift+F2) が存在し、
1282
+ * コピー / 貼り付け / フィルの note 側面が運ばれる。未宣言 = マーカーもポップオーバーも無く、
1283
+ * チョードは素通し、側面は tiling 前に除去。
1284
+ */
1285
+ getCellNote?: (row: number, col: number) => string | undefined;
1286
+ /**
1287
+ * OPTIONAL capability (v0.8): the cell's comment thread on the READ side — every field
1288
+ * stamped by the consumer (id / author / createdAt / text); undefined or an empty array = no
1289
+ * thread. Declared, threaded cells carry `data-aqsp-comment`, the comment popover
1290
+ * (Ctrl+Alt+M) exists and a reply writes the whole thread back through CellPatch.comments
1291
+ * (existing ids kept, the new input id-less). Absence = no marker / popover, the chord passes
1292
+ * through, the aspect is stripped before tiling (fill never copies comments).
1293
+ * 任意能力 (v0.8): セルのコメントスレッド (**読み側** — id / author / createdAt / text は全て
1294
+ * consumer が刻印済み)。undefined または空配列 = スレッド無し。宣言時、スレッドつきセルは
1295
+ * `data-aqsp-comment` を持ち、コメントポップオーバー (Ctrl+Alt+M) が存在し、返信は
1296
+ * CellPatch.comments でスレッド全体を書き戻す (既存 id 保持、新規入力は id なし)。未宣言 =
1297
+ * マーカー / ポップオーバー無し、チョード素通し、側面は tiling 前に除去 (フィルはコメントを写さない)。
1298
+ */
1299
+ getCellComments?: (row: number, col: number) => readonly CellComment[] | undefined;
1300
+ /**
1301
+ * OPTIONAL capability (v0.8): the cell's hyperlink URL; undefined = none. Every read is the
1302
+ * trust boundary (ADR-10): the raw URL goes through `normalizeAdapterHyperlink`, so a URL
1303
+ * outside the allowlist (http / https / mailto / tel) is treated as link-less at every seam —
1304
+ * never navigated, never exported into a clip flavour, never re-committed through
1305
+ * `CellPatch.hyperlink`. Declared, linked cells carry `data-aqsp-link`, Alt+Enter opens the
1306
+ * link (onHyperlinkOpen or the link popover), Ctrl / Meta+click opens it too when
1307
+ * onHyperlinkOpen is declared (spec 08 §11 D-53 — the selection stays frozen), Ctrl+K edits
1308
+ * it, Delete clears the link together with the text (`hyperlink: null`), and the link aspect
1309
+ * of copy / paste / fill travels. Absence = plain cells, the chords pass through, Delete
1310
+ * writes text only.
1311
+ * 任意能力 (v0.8): セルのハイパーリンク URL。undefined = 無し。全読み口が信頼境界 (ADR-10):
1312
+ * 生 URL は `normalizeAdapterHyperlink` を通り、許可リスト外 (http / https / mailto / tel 以外)
1313
+ * の URL は全シームでリンク無し扱い — 航行せず、クリップフレーバーへ書き出さず、
1314
+ * `CellPatch.hyperlink` へ再確定しない。宣言時、リンクつきセルは `data-aqsp-link` を持ち、
1315
+ * Alt+Enter がリンクを開き (onHyperlinkOpen または link ポップオーバー)、onHyperlinkOpen 宣言時は
1316
+ * Ctrl / Meta+クリックでも開き (分冊 08 §11 D-53 — 選択は凍結)、Ctrl+K が編集し、Delete は
1317
+ * テキストと共にリンクを消し (`hyperlink: null`)、コピー / 貼り付け / フィルの link 側面が
1318
+ * 運ばれる。未宣言 = 素のセル、チョード素通し、Delete はテキストだけ書く。
1319
+ */
1320
+ getCellHyperlink?: (row: number, col: number) => string | undefined;
1321
+ /**
1322
+ * OPTIONAL capability (v0.8): the cell's data-validation rule; undefined = none. Declared,
1323
+ * an editor commit is validated (strict rules reject and fire onValidationRejected,
1324
+ * non-strict rules only notify), visibly invalid cells carry `data-aqsp-invalid` (custom
1325
+ * formulas are never evaluated at paint), list rules get the dropdown (Alt+ArrowDown) and
1326
+ * the validation aspect of copy / paste / fill travels. Return a STABLE rule object per cell
1327
+ * (identity) so the list-value intern hits. Absence = every commit passes as v0.7.
1328
+ * 任意能力 (v0.8): セルのデータ検証規則。undefined = 無し。宣言時、エディタ確定は検証され
1329
+ * (strict は拒否して onValidationRejected、非 strict は通知のみ)、目に見えて無効なセルは
1330
+ * `data-aqsp-invalid` を持ち (custom 数式は描画時に評価しない)、list 規則はドロップダウン
1331
+ * (Alt+ArrowDown) を持ち、コピー / 貼り付け / フィルの validation 側面が運ばれる。セル毎に
1332
+ * **安定した**規則 object (identity) を返すと list 値の intern が当たる。未宣言 = 全確定が
1333
+ * v0.7 どおり通る。
1334
+ */
1335
+ getCellValidation?: (row: number, col: number) => DataValidationRule | undefined;
1336
+ /**
1337
+ * OPTIONAL capability (v0.8): the sheet-level conditional-format rules in PRIORITY order
1338
+ * (array order = evaluation order; an earlier true rule wins per property, `stopIfTrue` ends
1339
+ * the walk). Requires getCellFormat (declared alone ⇒ RangeError at mount). Return a stable
1340
+ * array identity — the grid rebuilds its bucket index per (rules identity, renderVersion), so
1341
+ * publish a rule change by bumping dataVersion. Declared, the CF aspect of copy / paste
1342
+ * travels (pasted rules arrive as PasteEditContext.conditionalFormats). Absence = base
1343
+ * formats paint as-is.
1344
+ * 任意能力 (v0.8): シート水準の条件付き書式規則を**優先順** (配列順 = 評価順。先の真規則が
1345
+ * プロパティ毎に勝ち、`stopIfTrue` で打ち切り) で返す。getCellFormat を要する (単独宣言は
1346
+ * マウント時 RangeError)。配列 identity を安定させること — グリッドは (規則 identity,
1347
+ * renderVersion) 毎にバケット索引を再構築するため、規則変更は dataVersion 増分で公開する。
1348
+ * 宣言時、コピー / 貼り付けの CF 側面が運ばれる (貼り付けた規則は
1349
+ * PasteEditContext.conditionalFormats で届く)。未宣言 = base 書式をそのまま塗る。
1350
+ */
1351
+ getConditionalFormats?: () => readonly ConditionalFormatRule[];
1352
+ /**
1353
+ * OPTIONAL capability (v0.8): the numeric minimum / maximum over a range, for colorScale
1354
+ * rules whose end points omit `value`; null = the range holds no numeric value. Memoised by
1355
+ * the grid per (rule id, renderVersion). Absence = such rules are skipped whole (rules with
1356
+ * explicit values still paint).
1357
+ * 任意能力 (v0.8): レンジ内の数値の最小 / 最大 — `value` 省略の端点を持つ colorScale 規則用。
1358
+ * null = 数値が無い。グリッドが (規則 id, renderVersion) 毎に memo する。未宣言 = そのような
1359
+ * 規則は丸ごとスキップ (値明示の規則は塗る)。
1360
+ */
1361
+ getRangeExtrema?: (range: CellRange) => {
1362
+ min: number;
1363
+ max: number;
1364
+ } | null;
1365
+ /**
1366
+ * OPTIONAL capability (v0.8): evaluates a formula string (passed VERBATIM, "=" included) in
1367
+ * the context of `cell`; truth for a customFormula rule / custom validation = `true` or a
1368
+ * finite non-zero number. Memoised by the grid per (rule id, row, col, renderVersion) for
1369
+ * conditional formats; custom validation calls it at commit only (never at paint). Absence =
1370
+ * customFormula rules are skipped and custom validation accepts.
1371
+ * 任意能力 (v0.8): 数式文字列 ("=" を含め**そのまま**渡す) を `cell` の文脈で評価する。
1372
+ * customFormula 規則 / custom 検証の真 = `true` または有限非 0 数。条件付き書式ではグリッドが
1373
+ * (規則 id, row, col, renderVersion) 毎に memo し、custom 検証は確定時だけ呼ぶ (描画時は呼ばない)。
1374
+ * 未宣言 = customFormula 規則はスキップ、custom 検証は通す。
1375
+ */
1376
+ evaluateFormula?: (formula: string, cell: CellCoord) => string | number | boolean | null;
1377
+ };
1378
+
1379
+ /**
1380
+ * Grid navigation direction (public vocabulary). Package-prefixed: a bare `Direction` would
1381
+ * clash with consumer-side types of the same name.
1382
+ * グリッド航行方向 (公開語彙)。素の `Direction` は consumer 側の同名型と衝突しやすいため
1383
+ * パッケージ接頭辞つき。
1384
+ */
1385
+ export declare type SpreadsheetDirection = "up" | "down" | "left" | "right";
1386
+
1387
+ /** Imperative surface (§6.9-8). / 命令 API (§6.9-8)。 */
1388
+ export declare type SpreadsheetHandle = {
1389
+ /** Row-height pair seam (§6.9-8). / 行高変更の対シーム。 */
1390
+ resizeRow: (row: number, heightPx: number) => void;
1391
+ /** Column-width resize (§6.9-8). / 列幅変更。 */
1392
+ resizeColumn: (col: number, widthPx: number) => void;
1393
+ /**
1394
+ * Programmatic viewport jump to a cell (delegates to the engine's scrollToCell — the
1395
+ * floor-and-pin jump API). Selection is unchanged; the deep grid stays reachable at any
1396
+ * scale (10^9 px). No-op when the grid is unmounted; an out-of-range coordinate is clamped
1397
+ * to the grid edge by the engine (a frozen-axis target is a no-op on that axis).
1398
+ * セルへの命令的 viewport ジャンプ (エンジン scrollToCell へ委譲 — floor + アンカー張りの
1399
+ * ジャンプ API)。選択は不変で、どの尺度 (10^9 px) でも深部到達性を保つ。グリッド未マウント時は
1400
+ * no-op、軸域外の座標はエンジンがグリッド端へクランプ (凍結軸狙いは当該軸で no-op)。
1401
+ */
1402
+ scrollToCell: (cell: CellCoord, options?: ScrollToCellOptions) => void;
1403
+ /** Focuses the sink (`preventScroll` honoured) and re-arms the idle waiting protocol when no session is open (v0.8 §1.10). / シンクへフォーカス (preventScroll 尊重) + 非編集なら再武装 (v0.8 §1.10)。 */
1404
+ focus: (options?: {
1405
+ preventScroll?: boolean;
1406
+ }) => void;
1407
+ /** Runs a command exactly as its chord would (v0.8 §1.10); false = unavailable / gate or adapter rejection / commit-gate refusal. / コマンドをチョードと同じ経路で実行 (false = 不可 / 拒否)。 */
1408
+ executeCommand: (command: SpreadsheetCommand) => boolean;
1409
+ /** Applies a format patch to every selected cell (source "format"); RangeError when getCellFormat is undeclared. / 選択全レンジへ書式パッチ (source "format")。getCellFormat 未宣言は RangeError。 */
1410
+ applyFormat: (patch: CellFormatPatch) => boolean;
1411
+ /** Border preset over the selection (default border thin / BORDER_DEFAULT_COLOR). / 選択への罫線プリセット。 */
1412
+ setBorders: (preset: BorderPreset, border?: CellBorder) => boolean;
1413
+ /** Writes the ACTIVE cell's hyperlink (normalised; null clears; source "annotate"). / active セルのリンク書込 (正規化、null で消去)。 */
1414
+ setHyperlink: (url: string | null) => boolean;
1415
+ /** Writes the ACTIVE cell's note (null clears; source "annotate"). / active セルのノート書込。 */
1416
+ setNote: (text: string | null) => boolean;
1417
+ /** Appends a comment to the ACTIVE cell's thread (existing ids kept + the id-less input, one `comments` patch). / active セルのスレッドへ 1 件追加 (既存 id 保持)。 */
1418
+ addComment: (input: CellCommentInput) => boolean;
1419
+ /** Sets (or clears) the validation rule of every selected cell (source "annotate"). / 選択全セルの検証規則の設定 / 消去。 */
1420
+ setValidation: (rule: DataValidationRule | null) => boolean;
1421
+ /** Menu-path paste (`navigator.clipboard.read`): "applied" = the adapter was called, "empty" = nothing written, "rejected" = refused (always when onClipboardUnavailable fired). / メニュー経路の貼り付け。 */
1422
+ paste: (options: PasteOptions) => Promise<PasteOutcome>;
1423
+ /** The confirmed selection (imperative read). / 確定選択の命令読み。 */
1424
+ getSelection: () => SelectionState;
1425
+ /** The adapter's BASE format of a cell (toolbar state) — the getCellFormat capability branch. / セルの base 書式 (getCellFormat の能力分岐)。 */
1426
+ getBaseFormat: (cell: CellCoord) => CellFormat | undefined;
1427
+ /** base ⊕ conditional formats of a cell (the paint the user sees). / base ⊕ 条件付き書式 (描画される書式)。 */
1428
+ getPaintedFormat: (cell: CellCoord) => CellFormat | undefined;
1429
+ /** Opens the in-place editor on the active cell WITHOUT the virtual-keyboard invitation. / active セルの編集開始 (仮想キーボード招待は上げない)。 */
1430
+ startEdit: (mode: "edit" | "replace") => void;
1431
+ /** Opens a popover on the active cell; RangeError when `popovers[kind] === false` or the capability is undeclared. / active セルへポップオーバーを開く (無効 kind は RangeError)。 */
1432
+ openPopover: (kind: PopoverKind) => void;
1433
+ };
1434
+
1435
+ /**
1436
+ * The `labels` prop shape: any subset of SpreadsheetLabels (an omitted or `undefined` key keeps
1437
+ * the default). Keys are closed to SpreadsheetLabels.
1438
+ * `labels` prop の形: SpreadsheetLabels の任意の部分集合 (省略 / undefined は既定のまま)。キーは
1439
+ * SpreadsheetLabels に閉じる。
1440
+ */
1441
+ export declare type SpreadsheetLabelOverrides = {
1442
+ readonly [K in keyof SpreadsheetLabels]?: SpreadsheetLabels[K];
1443
+ };
1444
+
1445
+ /**
1446
+ * @fileoverview UI label vocabulary (v0.8 §1.6 / §4.1.17) — the ONE label bag of the package.
1447
+ * The v0.7 `sinkAriaLabel` / `rootAriaLabel` props are folded into it (clean cut-over: no alias
1448
+ * props remain), joined by the popover / indicator strings of the rich-cell UI. Pure, React-free.
1449
+ *
1450
+ * Contract (each clause is pinned by labels.spec.ts):
1451
+ * - `SpreadsheetLabels` is the closed key set; `DEFAULT_LABELS` supplies an English default for
1452
+ * every key. Count-aware keys are typed `string | ((n: number) => string)`.
1453
+ * - `resolveLabels(overrides)` is the single fold point: a key takes its override when the
1454
+ * override is not `undefined` and the default otherwise (exactly the destructuring-default
1455
+ * semantics the two folded props had in v0.7), then `assertLabels` runs on the result.
1456
+ * `undefined` overrides resolve to `DEFAULT_LABELS` by identity.
1457
+ * - `assertLabels`: `sinkAriaLabel` MUST be a string mentioning "Escape" (WCAG 2.1.2 escape-method
1458
+ * advisement, spec 00 §10-4) — otherwise a RangeError, thrown at mount by the root.
1459
+ * - `resolveLabel(labels, key, n)` is the single read point: a function-valued label receives `n`
1460
+ * (omitting `n` for a function value is a RangeError — never a silent 0), a string is returned
1461
+ * as-is (`n` ignored, so a consumer may override a count key with a plain string).
1462
+ *
1463
+ * UI ラベル語彙 (v0.8 §1.6 / §4.1.17) — パッケージ唯一のラベル集合。v0.7 の `sinkAriaLabel` /
1464
+ * `rootAriaLabel` prop を畳み込み (クリーンカットオーバー: 別名 prop は残さない)、リッチセル UI の
1465
+ * ポップオーバー / インジケータ文言を加える。純関数・React 非依存。
1466
+ * 契約: `SpreadsheetLabels` は閉じたキー集合、`DEFAULT_LABELS` は全キーの英語既定、件数キーは
1467
+ * `string | ((n: number) => string)`。`resolveLabels` が唯一の畳込み点 (undefined でない override を
1468
+ * 採用、それ以外は既定 — 畳み込んだ 2 prop が v0.7 で持っていた分割代入既定と同じ意味論。
1469
+ * override 未指定は `DEFAULT_LABELS` を identity で返却) で、続けて `assertLabels`
1470
+ * (`sinkAriaLabel` は "Escape" を含む文字列であること — spec 00 §10-4、違反はマウント時 RangeError)。
1471
+ * `resolveLabel` が唯一の読み出し点 (関数値は n 必須 — 省略は RangeError、文字列はそのまま)。
1472
+ */
1473
+ /**
1474
+ * The closed label vocabulary. Every key has a default in DEFAULT_LABELS; consumers override any
1475
+ * subset through the `labels` prop (SpreadsheetLabelOverrides).
1476
+ * 閉じたラベル語彙。全キーが DEFAULT_LABELS に既定を持ち、消費者は `labels` prop で任意の部分集合を上書き。
1477
+ */
1478
+ export declare type SpreadsheetLabels = {
1479
+ /** Accessible name of the sink (grid input receptor); MUST mention "Escape" (spec 00 §10-4). / シンクのアクセシブルネーム ("Escape" 必須)。 */
1480
+ sinkAriaLabel: string;
1481
+ /** Accessible name of the root role="group" landing point. / root 着地点のアクセシブルネーム。 */
1482
+ rootAriaLabel: string;
1483
+ /** Note popover heading. / ノートポップオーバーの見出し。 */
1484
+ noteTitle: string;
1485
+ /** Note popover save button. / ノートの保存ボタン。 */
1486
+ noteSave: string;
1487
+ /** Note popover hint in the normal state (Escape saves and closes). / 通常状態のノートヒント。 */
1488
+ noteEscapeHint: string;
1489
+ /** Note popover hint in the rejected state (Ctrl+Enter retries, Escape closes without saving). / 拒否状態のノートヒント。 */
1490
+ noteRejectedHint: string;
1491
+ /** Comment popover heading. / コメントポップオーバーの見出し。 */
1492
+ commentTitle: string;
1493
+ /** Comment reply field label. / 返信入力欄のラベル。 */
1494
+ commentReply: string;
1495
+ /** Comment post button. / コメント投稿ボタン。 */
1496
+ commentPost: string;
1497
+ /** Comment count text; a function receives the thread length. / コメント件数 (関数はスレッド長を受け取る)。 */
1498
+ commentCount: string | ((n: number) => string);
1499
+ /** Link popover heading. / リンクポップオーバーの見出し。 */
1500
+ linkTitle: string;
1501
+ /** Link popover display-text field label. / リンク表示文字列の入力欄ラベル。 */
1502
+ linkTextField: string;
1503
+ /** Link popover URL field label. / リンク URL の入力欄ラベル。 */
1504
+ linkUrlField: string;
1505
+ /** Link popover open button (only when onHyperlinkOpen is declared). / リンクを開くボタン。 */
1506
+ linkOpen: string;
1507
+ /** Link popover save button. / リンクの保存ボタン。 */
1508
+ linkSave: string;
1509
+ /** Validation-list popover heading. / 検証リストポップオーバーの見出し。 */
1510
+ listTitle: string;
1511
+ /** Validation-list popover text when no option matches. / 候補なしの表示。 */
1512
+ listEmpty: string;
1513
+ /** Validation-list popover overflow row (options beyond the render cap); a function receives the hidden-option count. / 検証リストの上限超過行 (描画上限を超えた候補) — 関数は非表示件数を受け取る。 */
1514
+ listMore: string | ((n: number) => string);
1515
+ /** Message popover heading. / メッセージポップオーバーの見出し。 */
1516
+ messageTitle: string;
1517
+ /** Message shown when a strict validation rule rejects the typed value. / 厳格検証で拒否されたときの文言。 */
1518
+ validationRejected: string;
1519
+ /** Close button of every popover. / ポップオーバー共通の閉じるボタン。 */
1520
+ popoverClose: string;
1521
+ /** Accessible label of the note indicator on a cell. / ノートインジケータのラベル。 */
1522
+ indicatorNote: string;
1523
+ /** Accessible label of the comment indicator on a cell. / コメントインジケータのラベル。 */
1524
+ indicatorComment: string;
1525
+ /** Accessible label of the invalid-value indicator on a cell. / 無効値インジケータのラベル。 */
1526
+ indicatorInvalid: string;
1527
+ };
1528
+
1529
+ /**
1530
+ * Bulk-operation kind for the ADR-12 rejection channel (public vocabulary). Serialize-only
1531
+ * gestures ("copy" / "cut"), grid geometry ("resize") and the WRITE gestures ("delete" /
1532
+ * "paste" / "fill" and, since v0.8, the format commands "format", the self-calculation
1533
+ * commands "calc" and the note / comment / hyperlink / validation writes "annotate"). The write
1534
+ * subset is exactly the non-edit `EditRejection.source` vocabulary (sealed by the type-parity
1535
+ * guard in dataAdapter.spec.ts). Each widening (v0.2 "fill" / "resize", v0.8 the three
1536
+ * command kinds) is a 0.x breaking change for consumers who annotated the callback parameter
1537
+ * with the old inline union — contravariant position.
1538
+ * ADR-12 拒否チャネルの一括操作種別 (公開語彙)。直列化のみのジェスチャ ("copy" / "cut")・
1539
+ * グリッド幾何 ("resize")・**書込**ジェスチャ ("delete" / "paste" / "fill" と、v0.8 からの書式
1540
+ * コマンド "format"・自己計算コマンド "calc"・ノート / コメント / リンク / 検証の書込
1541
+ * "annotate")。書込部分集合は非 edit の `EditRejection.source` 語彙と過不足なく一致
1542
+ * (dataAdapter.spec.ts の型パリティガードが封印)。各拡張 (v0.2 の "fill" / "resize"、v0.8 の
1543
+ * コマンド 3 種) は旧インライン union を明示注釈していた consumer に対する 0.x の破壊枠
1544
+ * (コールバック引数 = 反変位置)。
1545
+ */
1546
+ export declare type SpreadsheetOperation = "copy" | "cut" | "delete" | "paste" | "fill" | "resize" | "format" | "calc" | "annotate";
1547
+
1548
+ /** Public props (v0.1.0 contract — §6.9). / 公開 props (v0.1.0 契約 — §6.9)。 */
1549
+ export declare type SpreadsheetProps = {
1550
+ /**
1551
+ * Identity-stable contract: replacing the adapter object means "sheet switch" and re-slices
1552
+ * every visible cell. Do NOT recreate it per render.
1553
+ * identity 安定契約 — 差し替えは「シート切替」(全再スライス)。毎レンダー生成は禁止。
1554
+ */
1555
+ adapter: SpreadsheetDataAdapter;
1556
+ defaultRowHeight?: number;
1557
+ /** Default column width (also the grid's Fenwick baseValue — behaviorOptions.defaultColWidth §7-8). Per-column widths are set via resizeColumn (the v0.3 initialColumnWidth eager initializer is retired). / 既定列幅 (グリッドの Fenwick baseValue も兼ねる §7-8)。列別幅は resizeColumn で設定 (v0.3 の initialColumnWidth eager 初期化は廃止)。 */
1558
+ defaultColumnWidth?: number;
1559
+ /**
1560
+ * Freezes the first N columns at the left edge (v0.5 — the VirtualGrid frozenLeadingCols
1561
+ * pass-through; LIVE prop). Validation is the engine's fail-fast contract (integer in
1562
+ * [0, 128] — RangeError otherwise; values beyond colCount freeze every column). Frozen
1563
+ * columns stay visible at any horizontal scroll; scrollToCell / keyboard ensure-visible
1564
+ * treat them as always-visible (horizontal no-op). A mid-flight change cancels every
1565
+ * in-flight drag gesture without restore (R2 fix — press-time anchors belong to the OLD
1566
+ * coordinate partition; mixing them with fresh post-change hit tests can commit fill
1567
+ * writes into cells the user never targeted). Selection and the editing session survive.
1568
+ * 先頭 N 列の左端凍結 (v0.5 — VirtualGrid frozenLeadingCols の素通し。ライブ prop)。検証は
1569
+ * エンジンの fail-fast 契約 ([0, 128] 整数、colCount 超過は全列凍結)。凍結列は横スクロール
1570
+ * 位置に依らず常時可視で、scrollToCell / キーボード可視化の横成分は no-op。飛行中の変更は
1571
+ * 全ドラッグジェスチャを復元なしで取り消す (R2 是正 — 押下時アンカーは旧パーティション
1572
+ * 座標系。変更後の鮮度ヒットテストと混ざると狙っていないセルへの fill 確定になる)。選択と
1573
+ * 編集セッションは保持。
1574
+ */
1575
+ frozenColumns?: number;
1576
+ /**
1577
+ * Freezes the first N rows at the top (v0.6 — the VirtualGrid frozenLeadingRows pass-through;
1578
+ * LIVE prop). Same engine fail-fast contract ([0, 128] integer; > rowCount freezes all).
1579
+ * Frozen rows stay visible at any vertical scroll; scrollToCell / ensure-visible treat them
1580
+ * as always-visible (vertical no-op). A mid-flight change cancels every in-flight drag.
1581
+ * 先頭 N 行の上端凍結 (v0.6 — VirtualGrid frozenLeadingRows の素通し。ライブ prop)。エンジンの
1582
+ * fail-fast 契約 ([0, 128] 整数、rowCount 超過は全行凍結) は列と同文。凍結行は縦スクロール
1583
+ * 位置に依らず常時可視で、可視化の縦成分は no-op。飛行中の変更は全ドラッグを取り消す。
1584
+ */
1585
+ frozenRows?: number;
1586
+ /**
1587
+ * Identity-stable contract (same as adapter): an inline arrow here defeats the CellView memo
1588
+ * and turns every host re-render into a full visible re-slice (~800 cells at 16k columns).
1589
+ * identity 安定契約 — インライン関数は memo を無効化し毎レンダー全再スライスになる。
1590
+ */
1591
+ renderCell?: (ctx: RenderCellContext) => ReactNode;
1592
+ /**
1593
+ * Fires on every confirmed SelectionState change (press replace, extend confirm, cycling,
1594
+ * paste replace, Ctrl+A, ...). Never during a drag (state frozen — one fire at pointerup),
1595
+ * with ONE documented in-drag firing point: the header subtract reservation converts to a
1596
+ * real press on the first movement, firing the deferred press replace mid-drag (total fire
1597
+ * count matches v0.1 — conversion 1 + up 1). Never for the initial A1 mount. Independent
1598
+ * of the live region's 200ms debounce (firing point: the §6.9-1 setSelection wrapper).
1599
+ * 確定 SelectionState が変わるたびに発火。ドラッグ中と初期マウントでは発火しない。明文の
1600
+ * ドラッグ中発火点が 1 つ: ヘッダー減算予約の実 press 変換 (初動 move) は遅延 press 置換を
1601
+ * ドラッグ中に発火する (発火総数は v0.1 と同一 — 変換 1 + up 1)。
1602
+ */
1603
+ onSelectionChange?: (selection: SelectionState) => void;
1604
+ /** Consumer context menu (§6.4.3-4 / §6.6.1 Shift+F10); keyboard origin carries the active cell viewport rect. / consumer コンテキストメニュー。 */
1605
+ onCellContextMenu?: (cell: CellCoord, origin: {
1606
+ kind: "pointer";
1607
+ event: MouseEvent;
1608
+ } | {
1609
+ kind: "keyboard";
1610
+ cellRect: {
1611
+ top: number;
1612
+ left: number;
1613
+ width: number;
1614
+ height: number;
1615
+ };
1616
+ }) => void;
1617
+ /** Undo request relay (history lives in the consumer — ADR-6). / Undo 要求の中継。 */
1618
+ onUndoRequest?: () => void;
1619
+ /** Redo request relay. / Redo 要求の中継。 */
1620
+ onRedoRequest?: () => void;
1621
+ /** Multi-range copy notice: copy/cut acts on the tail range only and fires this (documented deviation — Excel rejects non-aligned multi-range copy; aligned concat-copy is unsupported). / 複数レンジコピー通知 (末尾レンジのみ実行 + 通知の明示逸脱)。 */
1622
+ onCopyMultiRange?: () => void;
1623
+ /** Rejection notice with reason: "limit" = maxOperationCells exceeded (ADR-12; resize row fan-out gates at maxOperationCells / 10 and autofit at / 4 — §13 design returns), "bounds" = cut-move clipped at the grid edge (§6.5.4-4) OR a row resize that would push the axis-wide hidden-row total past 1,000 (§5.4(b)). 3-arg from v0.1.0 (adding later is breaking). / 拒否理由つき通知 ("bounds" は cut-move の格子端クリップと行非表示軸総数ゲートの 2 系統)。 */
1624
+ onOperationRejected?: (op: SpreadsheetOperation, cellCount: number, reason: "limit" | "bounds") => void;
1625
+ /**
1626
+ * Edit rejection notice — fires once per rejected applyEdits with the thrown error and the
1627
+ * {@link EditRejection} context: which write path was refused (edit / paste / fill / delete —
1628
+ * a cut-move is the Ctrl+V gesture and reports "paste", the same name onOperationRejected
1629
+ * uses for it) and, for an in-cell commit, whether the editing session is KEPT (in-grid commit —
1630
+ * it stays open with the typed value and focus; Escape cancels, or the value can be fixed)
1631
+ * or DISCARDED (grid-exit focusout — the grid closes it as this rejection completes: once
1632
+ * the callback returns the typed value is gone and the sink re-armed WITHOUT moving focus,
1633
+ * which stays wherever the focusout left it — on the element the user chose, or still on the
1634
+ * hidden input after a window blur). Consumers should word their notice from that context; telling the user to
1635
+ * "press Escape" after a discarded session is wrong (an idle Escape hands focus out of the
1636
+ * grid — WCAG 2.1.2).
1637
+ * 編集拒否通知 — 拒否された applyEdits ごとに 1 回、throw されたエラーと
1638
+ * {@link EditRejection} 文脈 (拒否経路 edit / paste / fill / delete — cut-move は Ctrl+V の
1639
+ * ジェスチャで onOperationRejected と同じ "paste" — と、セル内確定なら
1640
+ * セッションが**維持** (グリッド内確定 — 入力値とフォーカスごと開いたまま。Escape で取消 /
1641
+ * 修正可) か**破棄** (グリッド外 focusout — この拒否の完了と同時にグリッドが閉じる:
1642
+ * コールバックが返った時点で入力値は消え、シンクはフォーカスを動かさずに再武装 — フォーカスは
1643
+ * focusout が残した場所 (ユーザーが選んだ要素、ウィンドウ blur なら隠し入力のまま) にある) か)
1644
+ * を届ける。消費者は文脈に沿って文言を組む — 破棄済みで「Escape を押せ」は誤案内 (待機中の
1645
+ * Escape は WCAG 2.1.2 のフォーカス脱出)。
1646
+ */
1647
+ onEditRejected?: (error: unknown, rejection: EditRejection) => void;
1648
+ /** Change notice for out-of-package writes (undo / collaboration); each increment repaints visible cells (§6.9-2). / パッケージ外経路のデータ変更通知。 */
1649
+ dataVersion?: number;
1650
+ /** Operation cell-count ceiling, default 100,000 (ADR-12). / 操作セル数上限。 */
1651
+ maxOperationCells?: number;
1652
+ /**
1653
+ * §11 opt-out (default true): false suppresses the fill-handle node AND inerts its
1654
+ * machine. Fill is a WRITE operation (applyEdits) — read-only adapters opt out to avoid
1655
+ * the onEditRejected UX on every fill attempt.
1656
+ * §11 の opt-out (既定 true)。false はハンドルノードごと非表示 + 機械不活性。fill は書込系
1657
+ * (applyEdits) — 読み取り専用 adapter は毎回の onEditRejected UX を避けるため false にする。
1658
+ */
1659
+ enableFillHandle?: boolean;
1660
+ /**
1661
+ * §11 opt-out (default true): false suppresses the resize strip / unhide marker DOM
1662
+ * entirely (track children, not resident nodes) and inerts the band listeners. NOTE:
1663
+ * false also removes the unhide markers — a consumer with hidden tracks loses the
1664
+ * in-package restore affordance (imperative resize API only).
1665
+ * §11 の opt-out (既定 true)。false はストリップ / マーカーの DOM 生成ごと抑止 + 帯リスナー
1666
+ * 不活性。注意: unhide マーカーも消える — 非表示トラックを持つ consumer はパッケージ内の
1667
+ * 復元手段を失う (命令 API のみ)。
1668
+ */
1669
+ enableResizeUI?: boolean;
1670
+ /**
1671
+ * AT announcement text for the active cell; omit for silence (no built-in strings). `text`
1672
+ * is the RAW canonical getCellText; `displayText` is what a sighted user sees (the
1673
+ * getCellFormat-formatted string — equals `text` when the cell has no format), so AT can
1674
+ * hear "87.0%" for a cell whose raw value is "0.87".
1675
+ * AT 向け読み上げ文言 (省略で無音)。`text` は素の正準 getCellText、`displayText` は目視と同じ
1676
+ * 表示文字列 (getCellFormat 整形後 — 書式なしセルでは text と同値)。素値 "0.87" の表示
1677
+ * "87.0%" をそのまま読み上げられる。
1678
+ */
1679
+ formatCellAnnouncement?: (ctx: {
1680
+ row: number;
1681
+ col: number;
1682
+ text: string;
1683
+ displayText: string;
1684
+ columnName: string;
1685
+ }) => string;
1686
+ /** AT announcement for the selection extent ("A1 to C3, 3 rows 3 cols"); omit for silence. / AT 向け選択範囲読み上げ。 */
1687
+ formatSelectionAnnouncement?: (ctx: {
1688
+ range: CellRange;
1689
+ anchor: CellCoord;
1690
+ active: CellCoord;
1691
+ rangeRowCount: number;
1692
+ rangeColCount: number;
1693
+ rangeCount: number;
1694
+ }) => string;
1695
+ /**
1696
+ * Opt-in AT feedback for commands (v0.8 §1.9): `state` is the toggle's post-state, `null`
1697
+ * for non-toggle commands; the text goes to the live region like the other announcements.
1698
+ * コマンドの AT 通知 (opt-in、v0.8 §1.9)。`state` はトグル後状態 (非トグルは null)。live region へ。
1699
+ */
1700
+ formatCommandAnnouncement?: (ctx: {
1701
+ command: SpreadsheetCommand;
1702
+ state: boolean | null;
1703
+ }) => string;
1704
+ /**
1705
+ * UI label vocabulary (v0.8 §1.6) — folds the former `sinkAriaLabel` / `rootAriaLabel` props
1706
+ * (clean cut-over). An omitted or explicitly `undefined` key keeps the English default. The
1707
+ * resolved `sinkAriaLabel` MUST mention "Escape" (WCAG 2.1.2 escape advisement, §10-4) — a
1708
+ * RangeError is thrown during render otherwise.
1709
+ * UI ラベル語彙 (v0.8 §1.6) — 旧 sinkAriaLabel / rootAriaLabel prop を畳込み (クリーンカットオーバー)。
1710
+ * 省略 / 明示 undefined は英語既定。解決後の sinkAriaLabel は "Escape" を含むこと (違反は render 中
1711
+ * RangeError — §10-4)。
1712
+ */
1713
+ labels?: SpreadsheetLabelOverrides;
1714
+ /**
1715
+ * Rebindable command chords (v0.8 §1.9 / ADR-17): an array REPLACES that command's default
1716
+ * list, `null` unbinds it. Validated at prop time — a non-canonical chord, a modifier-less
1717
+ * chord, a single string, an override of a non-rebindable row (`pasteSpecial`), a clash with
1718
+ * a non-rebindable built-in row in the command's column, or one chord bound to two commands
1719
+ * throws a RangeError during render (`clampZoom` precedent). Consulted through a ref.
1720
+ * 再バインド可能なコマンドチョード (v0.8 §1.9 / ADR-17)。配列は既定一覧の置換、null は未束縛。
1721
+ * prop 時検証 (非正準 / 修飾なし / 単一 string / 非再バインド行の上書き / 列内予約行との一致 /
1722
+ * 二重束縛は render 中 RangeError)。ref 経由で参照。
1723
+ */
1724
+ shortcuts?: ShortcutOverrides;
1725
+ /**
1726
+ * Custom colour slots for `fillColorCustom1..5` / `fontColorCustom1..5`: each axis is exactly
1727
+ * 5 `#rrggbb` strings (a different length or a non-hex entry throws a RangeError at prop
1728
+ * time); an omitted axis uses DEFAULT_CUSTOM_COLORS.
1729
+ * 塗り / 文字色のカスタム 5 スロット (各軸ちょうど 5 本の `#rrggbb` — 本数違い / 非 hex は prop 時
1730
+ * RangeError。省略軸は DEFAULT_CUSTOM_COLORS)。
1731
+ */
1732
+ colors?: {
1733
+ readonly fill?: readonly string[];
1734
+ readonly font?: readonly string[];
1735
+ };
1736
+ /**
1737
+ * Host currency / locale for `formatCurrency` and for bare currency symbols in pasted HTML;
1738
+ * undeclared ⇒ the `formatCurrency` row passes through and bare symbols are not recovered.
1739
+ * `formatCurrency` と貼り付け HTML の裸通貨記号復元に使う通貨 / locale。未宣言なら `formatCurrency`
1740
+ * 行は素通しで、裸記号は復元しない。
1741
+ */
1742
+ formats?: {
1743
+ readonly currency: string;
1744
+ readonly locale?: string;
1745
+ };
1746
+ /**
1747
+ * Highlight bands of the selection (v0.8 §2.4): controlled value — the same two-phase
1748
+ * contract as `zoom`. Default (both props omitted) is all off ⇒ zero band nodes (v0.7 DOM
1749
+ * identity). Repainted imperatively on change.
1750
+ * 選択の強調帯 (v0.8 §2.4) の制御値 (zoom と同型の二相契約)。両 prop 省略時は全 off = 帯ノード 0
1751
+ * (v0.7 DOM 恒等)。変更は命令再描画。
1752
+ */
1753
+ highlight?: HighlightState;
1754
+ /** Initial highlight state for the uncontrolled mode. / 非制御モードの初期強調状態。 */
1755
+ defaultHighlight?: HighlightState;
1756
+ /** Fires when a highlight toggle command requests a new state (a controlled consumer applies it). / 強調トグルコマンドの変更要求通知 (制御 consumer が反映)。 */
1757
+ onHighlightChange?: (highlight: HighlightState) => void;
1758
+ /**
1759
+ * Band colours + opacity — identity-stable; written to `--aqsp-band-row / -column /
1760
+ * -intersection / -opacity` on the overlay in a layout effect. Each colour must parse
1761
+ * (`normalizeColor`) and `opacity` must be a finite number in [0, 1] — RangeError at prop time
1762
+ * otherwise. Undeclared ⇒ nothing is written while every band is off (the overlay's style
1763
+ * attribute stays byte-identical to v0.7) and DEFAULT_HIGHLIGHT_COLORS (`#0084FF` / `#42FF4F` /
1764
+ * `#E1FF00` / 0.2) is written once a band turns on.
1765
+ * 帯の色 3 種 + 不透明度 (identity 安定、layout effect で `--aqsp-band-*` へ)。解釈不能な色 /
1766
+ * [0, 1] 外の不透明度は prop 時 RangeError。未宣言なら全 off の間は何も書かず (overlay の style は
1767
+ * v0.7 と byte 同一)、帯が on になった時点で DEFAULT_HIGHLIGHT_COLORS を書く。
1768
+ */
1769
+ highlightColors?: HighlightColors;
1770
+ /** Per-kind popover opt-out (v0.8 §1.8): `false` ⇒ that kind's commands pass through and `openPopover(kind)` throws a RangeError. / kind 別ポップオーバー opt-out (false は素通し + openPopover は RangeError)。 */
1771
+ popovers?: PopoverOverrides;
1772
+ /** Replaces the default popover components (receives the kind-discriminated context). / 既定ポップオーバーの差替え (kind 判別文脈を受ける)。 */
1773
+ renderPopover?: (ctx: PopoverContext) => ReactNode;
1774
+ /** Clip state notice: armed (`foreign: false`), discarded (`null`), or a cut kept across a sheet switch (`foreign: true`). / クリップ状態通知 (武装 / 破棄 / シート切替を跨いだ cut は foreign)。 */
1775
+ onClipChange?: (clip: ClipInfo | null) => void;
1776
+ /** Hyperlink navigation seam (Alt+Enter, the link popover's Open button, and Ctrl / Meta+click on a link cell — spec 08 §11 D-53) — undeclared ⇒ no navigation, no Open button, no pointer gesture. / ハイパーリンク遷移シーム (Alt+Enter / Open ボタン / リンクセルへの Ctrl / Meta+クリック — 分冊 08 §11 D-53)。未宣言 = 遷移なし・Open ボタンなし・ポインタジェスチャなし。 */
1777
+ onHyperlinkOpen?: (url: string, cell: CellCoord) => void;
1778
+ /** Strict validation rejection notice (v0.8 §1.9) — the commit never reaches the adapter; the message popover shows the rejection. / strict 検証拒否の通知 (commit はアダプタへ届かず、message ポップオーバーが拒否を示す)。 */
1779
+ onValidationRejected?: (ctx: {
1780
+ cell: CellCoord;
1781
+ rule: DataValidationRule;
1782
+ text: string;
1783
+ message: string;
1784
+ }) => void;
1785
+ /** Ctrl+Alt+V request with the active cell's viewport rect (visual px, keyboard-origin shape of onCellContextMenu); undeclared ⇒ `paste({ mode: "formats" })`. / Ctrl+Alt+V の要求通知 (未宣言なら書式のみ貼り付け)。 */
1786
+ onPasteSpecialRequest?: (origin: {
1787
+ kind: "keyboard";
1788
+ cellRect: {
1789
+ top: number;
1790
+ left: number;
1791
+ width: number;
1792
+ height: number;
1793
+ };
1794
+ }) => void;
1795
+ /** Menu-path clipboard refusal channel; whenever it fires `paste()` resolves "rejected". / メニュー経路の拒否通知 (発火時 `paste()` は必ず "rejected")。 */
1796
+ onClipboardUnavailable?: (cause: "insecure-origin" | "permission-denied" | "empty" | "unreadable") => void;
1797
+ /** Clock seam for `insertDate` / `insertTime` (declared default: Date.now). / insertDate / insertTime の時計シーム (宣言済み既定 Date.now)。 */
1798
+ now?: () => number;
1799
+ /**
1800
+ * Package-level zoom (v0.3): controlled value, clamped to [0.25, 4]. The grid scales
1801
+ * visually (transform) while ALL logic stays in logical px; both scrollbars compensate
1802
+ * ancestor scale natively. Omit for the uncontrolled mode (defaultZoom + gestures).
1803
+ * パッケージズーム (v0.3)。制御値 ([0.25, 4] clamp)。視覚は transform スケール、論理は
1804
+ * 論理 px のまま (両スクロールバーは祖先スケール補正内蔵)。省略時は非制御 (defaultZoom +
1805
+ * ジェスチャ)。
1806
+ */
1807
+ zoom?: number;
1808
+ /** Initial zoom for the uncontrolled mode (default 1). / 非制御時の初期ズーム (既定 1)。 */
1809
+ defaultZoom?: number;
1810
+ /**
1811
+ * Fires when a zoom gesture (Alt+Wheel / Ctrl+Alt+= / Ctrl+Alt++ / Ctrl+Alt+- / Ctrl+Alt+0) requests a
1812
+ * new zoom — in the controlled mode the consumer applies it (the gesture alone does not
1813
+ * change the view). All four keys match on the PRODUCED character (event.key) regardless
1814
+ * of Shift, so layouts that need Shift to type them work as-is (JIS `=` = Shift+`-`,
1815
+ * US `+` = Shift+`=`, AZERTY `0` = Shift+`à`); mismatching shifted characters (US `_`, `)`)
1816
+ * pass through. Chords carrying the AltGraph modifier state are never claimed (defense in
1817
+ * depth: evergreen browsers deliver real AltGr characters WITHOUT ctrl+alt, so typing e.g.
1818
+ * Latvian AltGr+F `=` never hits this handler; the guard shields legacy AltGr-emulation
1819
+ * shapes only). Gestures are IGNORED while any drag is in
1820
+ * flight (press-time rect caches would skew); a controlled consumer changing `zoom`
1821
+ * mid-drag inherits that skew. Ctrl+Wheel is deliberately NOT bound (the browser owns it).
1822
+ * ズームジェスチャ (Alt+ホイール / Ctrl+Alt+= / + / − / 0 — 4 キーとも Shift 非依存で生成
1823
+ * 文字 event.key を信頼、AltGraph 修飾状態つきは非請求の多層防御 — 実 AltGr 印字は
1824
+ * 修飾なしで届き本ガード非依存) の変更要求通知 — 制御モードでは
1825
+ * consumer が反映する (ジェスチャ単独では変わらない)。飛行中ドラッグの間は要求を無視
1826
+ * (押下時 rect キャッシュが歪むため。制御 consumer がドラッグ中に zoom prop を変えた場合は
1827
+ * 同じ歪みを負う)。Ctrl+ホイールは意図的に非束縛 (ブラウザ所有)。
1828
+ */
1829
+ onZoomChange?: (zoom: number) => void;
1830
+ testId?: string;
1831
+ className?: string;
1832
+ };
1833
+
1834
+ /**
1835
+ * Test-only seam props (NOT part of the public v0.1.0 contract — §8.2 counter injection).
1836
+ * テスト専用シーム props (公開 v0.1.0 契約外 — §8.2 カウンタ注入)。
1837
+ */
1838
+ declare type SpreadsheetTestProps = {
1839
+ /** Test-only CellView re-render counter; never passed in production. / テスト専用カウンタ。 */
1840
+ __onCellRender?: ProfilerOnRenderCallback;
1841
+ };
1842
+
1843
+ /** Case-sensitive needle test on the raw text. / 素の text に対する大文字小文字区別の needle 判定。 */
1844
+ export declare type TextCondition = {
1845
+ type: "text";
1846
+ op: CfTextOp;
1847
+ value: string;
1848
+ };
1849
+
1850
+ /** The code-point length of the text must satisfy `op` against the finite numeric bounds `a` (and `b`). / text のコードポイント数が有限数の境界 a (と b) に対し op を満たす。 */
1851
+ export declare type TextLengthValidationRule = {
1852
+ type: "textLength";
1853
+ op: ValidationCompareOp;
1854
+ a: number;
1855
+ b?: number;
1856
+ };
1857
+
1858
+ /** Substring / shape checks on the text; `value` is the needle for the four needle ops and ignored by isEmail / isUrl. / text の部分文字列 / 形式検査。value は needle 系 4 op の探索文字列で isEmail / isUrl では無視。 */
1859
+ export declare type TextValidationRule = {
1860
+ type: "text";
1861
+ op: ValidationTextOp;
1862
+ value?: string;
1863
+ };
1864
+
1865
+ /**
1866
+ * Converts a formula to R1C1 relative to `origin` (Google Sheets spelling) — the form the clip
1867
+ * payload carries so a paste at any target resolves with {@link fromR1C1}. Non-formula text
1868
+ * and reference-free formulas return the same string instance; an invalid origin is a
1869
+ * RangeError.
1870
+ * 数式を `origin` 基準の R1C1 (Google Sheets 綴り) へ変換 — クリップが運び、任意の貼り付け先で
1871
+ * {@link fromR1C1} が解決する形。非数式・参照なし数式は同一文字列インスタンス、不正な原点は
1872
+ * RangeError。
1873
+ */
1874
+ export declare const toR1C1: (formula: string, origin: CellCoord) => string;
1875
+
1876
+ /**
1877
+ * Validates committed text against a rule. Blank always passes; `custom` is evaluated only when
1878
+ * the caller passes `evaluate` (commit time — paint omits it); an incomplete rule (unparseable
1879
+ * bound, missing `b` / `value`) is inert; a rule outside the vocabulary throws RangeError.
1880
+ * Message = `rule.errorMessage` when set, else a built-in English summary of the rule.
1881
+ * 確定テキストの規則検証。空文字は常に合格、custom は呼び手が evaluate を渡すとき (確定時 — 描画は
1882
+ * 渡さない) だけ評価、不完全な規則 (解釈不能な境界・b / value 欠落) は不活性、語彙外の規則は
1883
+ * RangeError。メッセージは errorMessage があればそれ、無ければ組込みの英語要約。
1884
+ */
1885
+ export declare const validateCellText: (rule: DataValidationRule, text: string, evaluate?: ValidationEvaluate) => ValidationVerdict;
1886
+
1887
+ /**
1888
+ * @fileoverview Data-validation rule vocabulary and the pure verdict engine (v0.8 — the
1889
+ * getCellValidation capability, ADR-13). The consumer declares a per-cell DataValidationRule
1890
+ * via the optional adapter capability getCellValidation(row, col); the editor asks
1891
+ * validateCellText at COMMIT (passing the adapter's formula evaluator for `custom` rules) and
1892
+ * the grid asks isVisiblyInvalid at PAINT (never evaluating a formula) to draw the invalid
1893
+ * indicator. React-free and total.
1894
+ *
1895
+ * Engine contract (each clause is load-bearing and mutation-gated — spec 01 §8.3):
1896
+ * - BLANK IS ALWAYS VALID: the empty string satisfies every rule (Excel "ignore blank"), so a
1897
+ * validated cell can always be cleared; `custom` is not even evaluated for a blank.
1898
+ * - EXACT decimal comparison for `number` rules: the cell text and both bounds are parsed with
1899
+ * the SAME strict-decimal grammar as cellFormat.ts (`[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d{1,4})?`,
1900
+ * trimmed, no hex / grouping / ±Infinity) and compared as normalised sign / significant-digit /
1901
+ * point-position triples — never through a binary double — so "9007199254740993" is greater
1902
+ * than "9007199254740992" and "0.30000000000000004" is not equal to "0.3".
1903
+ * - TIMEZONE-FREE dates for `date` rules: the pure-calendar grammar of cellFormat.ts
1904
+ * ("YYYY-MM-DD[ T HH:mm[:ss]]" or "/" separated, leap-aware ranges, no Date object), compared
1905
+ * as (year, month, day, hour, minute, second) tuples; `between` / `notBetween` are inclusive.
1906
+ * - INERT INCOMPLETE RULES: a bound that does not parse (`a` / `b` for number / date, a
1907
+ * non-finite `a` / `b` for textLength, a missing `b` for between / notBetween, a missing `value`
1908
+ * for the needle text ops) makes the rule accept everything — a half-written rule never locks a
1909
+ * cell. Bounds are never swapped: `between 10 and 5` accepts nothing but blank.
1910
+ * - FAIL-FAST on a rule OUTSIDE the vocabulary: an unknown `type` or `op` is a consumer bug and
1911
+ * throws RangeError regardless of the text (fail-soft would silently disable validation).
1912
+ * - INTERNED list Sets per rule object (WeakMap identity), so the paint-time `list` check is O(1)
1913
+ * even for a 10k-item list; a fresh rule object interns a fresh Set.
1914
+ * - MESSAGE resolution: `errorMessage` when the consumer set it (an empty string is honoured as
1915
+ * is), else a built-in English summary of the rule.
1916
+ * - `custom` needs the caller's `evaluate`; without it the rule is not evaluated (verdict ok), and
1917
+ * truth = `true` or a finite non-zero number (the conditionalFormat customFormula convention).
1918
+ * - Matching is exact (case-sensitive, untrimmed) for `list` / `text` / `checkbox`; textLength
1919
+ * counts Unicode code points. `isEmail` is the WHATWG valid-e-mail grammar with a mandatory
1920
+ * dotted domain; `isUrl` is a WHATWG-parsable absolute http(s) URL.
1921
+ *
1922
+ * データ検証の規則語彙と純関数の判定エンジン (v0.8 — getCellValidation 能力、ADR-13)。
1923
+ * consumer が任意能力 getCellValidation(row, col) で規則を宣言し、エディタが確定時に
1924
+ * validateCellText (custom 規則にはアダプタの数式評価器を渡す)、グリッドが描画時に
1925
+ * isVisiblyInvalid (数式は決して評価しない) を呼んで不正インジケータを描く。React 非依存・全域関数。
1926
+ * エンジン契約 (全て変異検証で封印 — spec 01 §8.3): 空文字は常に有効 (Excel の「空白を無視」—
1927
+ * 検証セルは必ず消去できる、custom も評価しない)、number は cellFormat.ts と同じ厳密 10 進文法で
1928
+ * 符号 / 有効数字 / 小数点位置の正規形として正確比較 (double 非経由)、date は Date 非依存の純暦文法を
1929
+ * タプル比較 (between は両端含み)、不完全な規則 (解釈不能な境界・between の b 欠落・needle 欠落) は
1930
+ * 不活性 = 全受理 (書きかけの規則でセルを閉じ込めない、境界の入替もしない)、語彙外の type / op は
1931
+ * consumer バグとして text に依らず RangeError、list の Set は規則 object 毎に WeakMap intern、
1932
+ * メッセージは errorMessage (空文字も尊重) が無ければ組込みの英語要約、custom は evaluate 無しなら
1933
+ * 未評価 (ok)・真 = true か有限非 0 数、照合は完全一致 (大文字小文字区別・trim 無し)、textLength は
1934
+ * コードポイント数、isEmail は WHATWG 文法 + ドット付きドメイン必須、isUrl は WHATWG 絶対 http(s) URL。
1935
+ */
1936
+ /** Ordered comparison vocabulary shared by number / textLength / date rules; between / notBetween include both bounds. / number / textLength / date 規則が共有する比較語彙。between / notBetween は両端含み。 */
1937
+ export declare type ValidationCompareOp = "gt" | "gte" | "lt" | "lte" | "eq" | "neq" | "between" | "notBetween";
1938
+
1939
+ /** A consumer-side formula evaluator handed to validateCellText for `custom` rules. / custom 規則のために validateCellText へ渡す consumer 側の数式評価器。 */
1940
+ export declare type ValidationEvaluate = (formula: string) => string | number | boolean | null;
1941
+
1942
+ /** Options shared by every rule: `strict` rejects the commit (else warn only), `inputMessage` shows on the active cell, `errorMessage` replaces the built-in verdict message. / 全規則共通のオプション。strict は確定拒否 (無指定は警告のみ)、inputMessage は active セルの案内、errorMessage は組込みメッセージの置換。 */
1943
+ export declare type ValidationRuleBase = {
1944
+ strict?: boolean;
1945
+ inputMessage?: string;
1946
+ errorMessage?: string;
1947
+ };
1948
+
1949
+ /** Text-rule vocabulary: four needle ops (need `value`) and two shape checks (ignore `value`). / text 規則の語彙。needle 系 4 つ (value 必須) と形式検査 2 つ (value 無視)。 */
1950
+ export declare type ValidationTextOp = "contains" | "notContains" | "startsWith" | "endsWith" | "isEmail" | "isUrl";
1951
+
1952
+ /** The outcome of validateCellText: ok, or rejected with the resolved message. / validateCellText の結果。ok か、解決済みメッセージ付きの拒否。 */
1953
+ export declare type ValidationVerdict = {
1954
+ ok: true;
1955
+ } | {
1956
+ ok: false;
1957
+ message: string;
1958
+ };
1959
+
1960
+ export { }