@xlcalc/vue 0.0.0-stage → 0.21.2

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 (125) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/LICENSE +21 -0
  3. package/README.md +75 -2
  4. package/dist/abort.d.ts +6 -0
  5. package/dist/components/CellDraft.vue.d.ts +7 -0
  6. package/dist/components/CellEditor.vue.d.ts +3 -0
  7. package/dist/components/ColourSwatches.vue.d.ts +13 -0
  8. package/dist/components/DialogShell.vue.d.ts +37 -0
  9. package/dist/components/ExplainPanel.vue.d.ts +3 -0
  10. package/dist/components/FilterPopover.vue.d.ts +3 -0
  11. package/dist/components/FindBar.vue.d.ts +3 -0
  12. package/dist/components/FormatBorders.vue.d.ts +14 -0
  13. package/dist/components/FormatColour.vue.d.ts +19 -0
  14. package/dist/components/FormatDialog.vue.d.ts +24 -0
  15. package/dist/components/FormulaBar.vue.d.ts +3 -0
  16. package/dist/components/FunctionList.vue.d.ts +28 -0
  17. package/dist/components/FunctionTip.vue.d.ts +14 -0
  18. package/dist/components/InsertFunction.vue.d.ts +9 -0
  19. package/dist/components/OutlineCell.vue.d.ts +8 -0
  20. package/dist/components/OutlineLevels.vue.d.ts +7 -0
  21. package/dist/components/SheetGrid.vue.d.ts +3 -0
  22. package/dist/components/SheetMarks.vue.d.ts +3 -0
  23. package/dist/components/SheetMenu.vue.d.ts +3 -0
  24. package/dist/components/SheetRow.vue.d.ts +18 -0
  25. package/dist/components/SheetTabs.vue.d.ts +3 -0
  26. package/dist/components/SheetToolbar.vue.d.ts +43 -0
  27. package/dist/components/SheetView.vue.d.ts +56 -0
  28. package/dist/components/ValidationAlert.vue.d.ts +16 -0
  29. package/dist/components/ValidationDropdown.vue.d.ts +33 -0
  30. package/dist/components/ValidationPrompt.vue.d.ts +16 -0
  31. package/dist/components/cf-icons.d.ts +6 -0
  32. package/dist/components/context.d.ts +4 -0
  33. package/dist/components/dom.d.ts +7 -0
  34. package/dist/components/icons.d.ts +33 -0
  35. package/dist/components/popup.d.ts +29 -0
  36. package/dist/components/toolbar-icons.d.ts +24 -0
  37. package/dist/contract/memory.d.ts +108 -0
  38. package/dist/contract/messages.d.ts +260 -0
  39. package/dist/contract/source.d.ts +433 -0
  40. package/dist/contract/view.d.ts +108 -0
  41. package/dist/contract.d.ts +9 -0
  42. package/dist/core/ask.d.ts +2 -0
  43. package/dist/core/autocomplete.d.ts +28 -0
  44. package/dist/core/cell-style.d.ts +33 -0
  45. package/dist/core/cell-view.d.ts +104 -0
  46. package/dist/core/clip.d.ts +43 -0
  47. package/dist/core/commands.d.ts +47 -0
  48. package/dist/core/conditional.d.ts +16 -0
  49. package/dist/core/editing.d.ts +85 -0
  50. package/dist/core/explain.d.ts +36 -0
  51. package/dist/core/fill.d.ts +42 -0
  52. package/dist/core/filter.d.ts +72 -0
  53. package/dist/core/find.d.ts +53 -0
  54. package/dist/core/formula.d.ts +41 -0
  55. package/dist/core/function-tip.d.ts +34 -0
  56. package/dist/core/geometry.d.ts +55 -0
  57. package/dist/core/keys.d.ts +8 -0
  58. package/dist/core/list-keys.d.ts +4 -0
  59. package/dist/core/list.d.ts +17 -0
  60. package/dist/core/menu.d.ts +155 -0
  61. package/dist/core/merge.d.ts +19 -0
  62. package/dist/core/navigation.d.ts +72 -0
  63. package/dist/core/outline.d.ts +34 -0
  64. package/dist/core/point.d.ts +34 -0
  65. package/dist/core/ref-paint.d.ts +21 -0
  66. package/dist/core/selection.d.ts +45 -0
  67. package/dist/core/sheet.d.ts +774 -0
  68. package/dist/core/state.d.ts +107 -0
  69. package/dist/core/storage.d.ts +6 -0
  70. package/dist/core/totals.d.ts +16 -0
  71. package/dist/core/validation.d.ts +95 -0
  72. package/dist/core/viewport.d.ts +83 -0
  73. package/dist/core/windows.d.ts +102 -0
  74. package/dist/entry.d.ts +3 -0
  75. package/dist/failure.d.ts +5 -0
  76. package/dist/filter-key.d.ts +3 -0
  77. package/dist/find-match.d.ts +24 -0
  78. package/dist/format-cells.d.ts +85 -0
  79. package/dist/frame.d.ts +5 -0
  80. package/dist/grid-ref.d.ts +3 -0
  81. package/dist/index.d.ts +6 -0
  82. package/dist/index.js +12767 -0
  83. package/dist/lines.d.ts +16 -0
  84. package/dist/local/find.d.ts +15 -0
  85. package/dist/local/index.d.ts +3 -0
  86. package/dist/local/locale.d.ts +5 -0
  87. package/dist/local/outcome.d.ts +21 -0
  88. package/dist/local/query.d.ts +23 -0
  89. package/dist/local/source.d.ts +4 -0
  90. package/dist/local/types.d.ts +37 -0
  91. package/dist/local/validation.d.ts +8 -0
  92. package/dist/local/window.d.ts +16 -0
  93. package/dist/local/xlsx.d.ts +23 -0
  94. package/dist/local.js +1025 -0
  95. package/dist/locale-ref.d.ts +7 -0
  96. package/dist/locales.d.ts +3 -0
  97. package/dist/memory-outline.d.ts +31 -0
  98. package/dist/memory-query.d.ts +26 -0
  99. package/dist/memory-source.d.ts +3 -0
  100. package/dist/memory-validation.d.ts +17 -0
  101. package/dist/messages.d.ts +6 -0
  102. package/dist/number-formats.d.ts +13 -0
  103. package/dist/rect.d.ts +9 -0
  104. package/dist/ru-RU-BVeg6JGM.js +931 -0
  105. package/dist/sheet-query.d.ts +22 -0
  106. package/dist/stats.d.ts +8 -0
  107. package/dist/style.css +2 -0
  108. package/dist/toolbar.d.ts +39 -0
  109. package/dist/typed-entry-2l9Ay-hV.js +4559 -0
  110. package/dist/window-size.d.ts +4 -0
  111. package/docs/api.md +520 -0
  112. package/docs/autocomplete.md +60 -0
  113. package/docs/checks.md +40 -0
  114. package/docs/clipboard.md +48 -0
  115. package/docs/editing.md +97 -0
  116. package/docs/example-app.md +26 -0
  117. package/docs/find-replace.md +26 -0
  118. package/docs/list-mode.md +86 -0
  119. package/docs/local.md +94 -0
  120. package/docs/quick-start.md +221 -0
  121. package/docs/sheets.md +61 -0
  122. package/docs/toolbar.md +72 -0
  123. package/docs/validation.md +41 -0
  124. package/docs/view.md +50 -0
  125. package/package.json +92 -4
@@ -0,0 +1,17 @@
1
+ import type { SheetEmit } from './sheet.js';
2
+ import type { SheetState } from './state.js';
3
+ import type { Windows } from './windows.js';
4
+ import type { ListSort } from '../contract/view.js';
5
+ export declare function useList(s: SheetState, w: Windows, emit: SheetEmit, props: {
6
+ sort?: ListSort | null;
7
+ openRows?: boolean;
8
+ }): {
9
+ sortable: (c: number) => boolean;
10
+ sortOf: (c: number) => ListSort["dir"] | null;
11
+ toggleSort: (c: number) => void;
12
+ alignOf: (c: number) => "left" | "right" | "center" | undefined;
13
+ click: (r: number, c: number) => boolean;
14
+ key: (e: KeyboardEvent) => boolean;
15
+ totals: import("vue").ComputedRef<(string | null)[] | null>;
16
+ };
17
+ export type List = ReturnType<typeof useList>;
@@ -0,0 +1,155 @@
1
+ import type { CellRect } from 'xlcalc/contract';
2
+ import type { SheetInfo } from '../contract/source.js';
3
+ import type { Clip } from './clip.js';
4
+ import type { Commands } from './commands.js';
5
+ import type { Explain } from './explain.js';
6
+ import type { Filter } from './filter.js';
7
+ import type { Outline, OutlineAxis, OutlineOp } from './outline.js';
8
+ import type { Selection } from './selection.js';
9
+ import type { SheetState } from './state.js';
10
+ export type MenuKind = 'rows' | 'columns' | 'sheet' | 'cells';
11
+ export interface MenuItem {
12
+ id: string;
13
+ label: string;
14
+ run: () => void;
15
+ disabled?: boolean;
16
+ /** A separator above it, between groups. */
17
+ group?: boolean;
18
+ }
19
+ /** The open menu: where it is and what it acts on (the selected rows or columns, a sheet by its index; the cell menu acts on the selection). */
20
+ export interface OpenMenu {
21
+ kind: MenuKind;
22
+ x: number;
23
+ y: number;
24
+ first: number;
25
+ last: number;
26
+ }
27
+ /** A small dialog over the sheet: a size in Excel's units, the confirmation before a sheet with data is deleted, the hidden sheets, rows or columns to group. */
28
+ export type MenuDialog = {
29
+ kind: 'size';
30
+ axis: 'columns' | 'rows';
31
+ first: number;
32
+ last: number;
33
+ draft: string;
34
+ error: string;
35
+ } | {
36
+ kind: 'deleteSheet';
37
+ sheet: string;
38
+ } | {
39
+ kind: 'unhide';
40
+ sheets: string[];
41
+ } | {
42
+ kind: 'outline';
43
+ op: OutlineOp;
44
+ axis: OutlineAxis;
45
+ rect: CellRect;
46
+ };
47
+ export interface MenuDeps {
48
+ pickSheet: (index: number) => Promise<void>;
49
+ tabs: () => {
50
+ sheet: SheetInfo;
51
+ i: number;
52
+ }[];
53
+ outline: Outline;
54
+ clip: Clip;
55
+ filter: Filter;
56
+ explain: Explain;
57
+ /** Whether the workbook freezes panes on the displayed sheet: the first freeze item is then Unfreeze Panes, as in Excel. */
58
+ frozen: () => boolean;
59
+ }
60
+ export declare function useMenu(s: SheetState, sel: Selection, cmd: Commands, deps: MenuDeps): {
61
+ open: import("vue").ShallowRef<OpenMenu | null, OpenMenu | null>;
62
+ items: import("vue").ComputedRef<MenuItem[]>;
63
+ caption: import("vue").ComputedRef<string>;
64
+ dialog: import("vue").Ref<{
65
+ kind: "size";
66
+ axis: "columns" | "rows";
67
+ first: number;
68
+ last: number;
69
+ draft: string;
70
+ error: string;
71
+ } | {
72
+ kind: "deleteSheet";
73
+ sheet: string;
74
+ } | {
75
+ kind: "unhide";
76
+ sheets: string[];
77
+ } | {
78
+ kind: "outline";
79
+ op: OutlineOp;
80
+ axis: OutlineAxis;
81
+ rect: {
82
+ top: number;
83
+ left: number;
84
+ bottom: number;
85
+ right: number;
86
+ };
87
+ } | null, MenuDialog | {
88
+ kind: "size";
89
+ axis: "columns" | "rows";
90
+ first: number;
91
+ last: number;
92
+ draft: string;
93
+ error: string;
94
+ } | {
95
+ kind: "deleteSheet";
96
+ sheet: string;
97
+ } | {
98
+ kind: "unhide";
99
+ sheets: string[];
100
+ } | {
101
+ kind: "outline";
102
+ op: OutlineOp;
103
+ axis: OutlineAxis;
104
+ rect: {
105
+ top: number;
106
+ left: number;
107
+ bottom: number;
108
+ right: number;
109
+ };
110
+ } | null>;
111
+ renaming: import("vue").Ref<{
112
+ index: number;
113
+ draft: string;
114
+ } | null, {
115
+ index: number;
116
+ draft: string;
117
+ } | {
118
+ index: number;
119
+ draft: string;
120
+ } | null>;
121
+ renameInput: import("vue").Ref<HTMLInputElement | null, HTMLInputElement | null>;
122
+ close: () => null;
123
+ choose: (item: MenuItem) => void;
124
+ openLines: (kind: "rows" | "columns", line: number, x: number, y: number) => boolean;
125
+ openSheet: (index: number, x: number, y: number) => Promise<boolean>;
126
+ openCells: (row: number, col: number, x: number, y: number) => void;
127
+ linesAvailable: import("vue").ComputedRef<boolean>;
128
+ applySize: () => void;
129
+ askOutline: (op: OutlineOp) => void;
130
+ applyOutline: () => void;
131
+ addSheet: () => Promise<import("../index.js").EditOutcome | null>;
132
+ confirmDelete: () => void;
133
+ unhide: (name: string) => void;
134
+ startRename: (index: number) => void;
135
+ commitRename: (left?: boolean) => Promise<void>;
136
+ cancelRename: () => null;
137
+ press: {
138
+ start: (e: PointerEvent, open: (x: number, y: number) => void) => void;
139
+ move: (e: PointerEvent) => void;
140
+ cancel: () => void;
141
+ after: () => boolean;
142
+ pressing: () => boolean;
143
+ context: (e: MouseEvent) => boolean;
144
+ };
145
+ };
146
+ export type Menu = ReturnType<typeof useMenu>;
147
+ /** A long press on a touch screen: held still for `LONG_PRESS_MS`, it opens what `start` was given; moved beyond the slop, it scrolls instead. */
148
+ export declare function useLongPress(): {
149
+ start: (e: PointerEvent, open: (x: number, y: number) => void) => void;
150
+ move: (e: PointerEvent) => void;
151
+ cancel: () => void;
152
+ after: () => boolean;
153
+ pressing: () => boolean;
154
+ context: (e: MouseEvent) => boolean;
155
+ };
@@ -0,0 +1,19 @@
1
+ import type { CellRect } from 'xlcalc/contract';
2
+ import type { EditOutcome } from '../contract/source.js';
3
+ import type { Commands } from './commands.js';
4
+ import type { Selection } from './selection.js';
5
+ import { type SheetState } from './state.js';
6
+ import type { AlertAnswer, SheetAlert } from './validation.js';
7
+ import type { Windows } from './windows.js';
8
+ import type { MergeCommand } from '../contract/view.js';
9
+ interface MergeDeps {
10
+ /** Shows an alert and waits for the answer. */
11
+ ask: (alert: SheetAlert) => Promise<AlertAnswer>;
12
+ }
13
+ export declare function useMerge(s: SheetState, w: Windows, sel: Selection, cmd: Commands, deps: MergeDeps): {
14
+ available: import("vue").ComputedRef<boolean>;
15
+ area: import("vue").ComputedRef<CellRect | null>;
16
+ run: (command: MergeCommand) => Promise<EditOutcome | null>;
17
+ };
18
+ export type Merge = ReturnType<typeof useMerge>;
19
+ export {};
@@ -0,0 +1,72 @@
1
+ import type { CellRect, GridReference } from 'xlcalc/contract';
2
+ import type { Formula } from './formula.js';
3
+ import type { Selection } from './selection.js';
4
+ import type { SheetState } from './state.js';
5
+ /** A location to return to: sheet, selection and scroll. */
6
+ export interface Place {
7
+ sheet: number;
8
+ selected: SheetState['selected']['value'];
9
+ extent: SheetState['extent']['value'];
10
+ scrollTop: number;
11
+ scrollLeft: number;
12
+ }
13
+ export interface NavigationDeps {
14
+ pickSheet: (index: number) => Promise<void>;
15
+ notify: (text: string) => void;
16
+ }
17
+ export declare function useNavigation(s: SheetState, sel: Selection, f: Formula, deps: NavigationDeps): {
18
+ history: import("vue").Ref<{
19
+ sheet: number;
20
+ selected: {
21
+ row: number;
22
+ col: number;
23
+ } | null;
24
+ extent: {
25
+ row: number;
26
+ col: number;
27
+ } | null;
28
+ scrollTop: number;
29
+ scrollLeft: number;
30
+ }[], Place[] | {
31
+ sheet: number;
32
+ selected: {
33
+ row: number;
34
+ col: number;
35
+ } | null;
36
+ extent: {
37
+ row: number;
38
+ col: number;
39
+ } | null;
40
+ scrollTop: number;
41
+ scrollLeft: number;
42
+ }[]>;
43
+ flash: import("vue").Ref<{
44
+ sheet: string;
45
+ rect: {
46
+ top: number;
47
+ left: number;
48
+ bottom: number;
49
+ right: number;
50
+ };
51
+ } | null, {
52
+ sheet: string;
53
+ rect: CellRect;
54
+ } | {
55
+ sheet: string;
56
+ rect: {
57
+ top: number;
58
+ left: number;
59
+ bottom: number;
60
+ right: number;
61
+ };
62
+ } | null>;
63
+ goBack: () => Promise<void>;
64
+ goPlace: (text: string) => Promise<boolean>;
65
+ goRef: (r: GridReference) => Promise<void>;
66
+ addressDraft: import("vue").Ref<string, string>;
67
+ addressFocused: import("vue").Ref<boolean, boolean>;
68
+ goAddress: () => Promise<boolean>;
69
+ takePendingFocus: () => string | null;
70
+ copyCellLink: () => Promise<void>;
71
+ };
72
+ export type Navigation = ReturnType<typeof useNavigation>;
@@ -0,0 +1,34 @@
1
+ import type { OutlineGroup } from '../contract/source.js';
2
+ import type { Commands } from './commands.js';
3
+ import type { Selection } from './selection.js';
4
+ import type { SheetState } from './state.js';
5
+ import type { Viewport } from './viewport.js';
6
+ export type OutlineAxis = 'rows' | 'columns';
7
+ export type OutlineOp = 'group' | 'ungroup';
8
+ /** What a row or column shows in one level's slot: a piece of a group's bracket, or the button of a group whose summary it is. */
9
+ export interface OutlineMark {
10
+ /** The slot, from 1 (the outer groups) at the bar's outer edge. */
11
+ level: number;
12
+ /** The bracket runs along the row or column; `start` is its end away from the summary, with a tick toward the headers. */
13
+ bracket?: 'line' | 'start';
14
+ /** The group whose button the row or column holds, with the bracket's end toward the group while it is expanded. */
15
+ button?: OutlineGroup;
16
+ }
17
+ interface OutlineDeps {
18
+ notify: (text: string) => void;
19
+ /** Asks whether a cell range groups its rows or its columns, as Excel's dialog does. */
20
+ ask: (op: OutlineOp) => void;
21
+ }
22
+ export declare function useOutline(s: SheetState, v: Viewport, sel: Selection, cmd: Commands, deps: OutlineDeps): {
23
+ outline: import("vue").ComputedRef<import("../index.js").SheetOutline | null>;
24
+ can: import("vue").ComputedRef<boolean>;
25
+ marks: (axis: OutlineAxis, line: number) => OutlineMark[];
26
+ at: (level: number) => number;
27
+ toggle: (axis: OutlineAxis, g: OutlineGroup) => void;
28
+ showLevel: (axis: OutlineAxis, level: number) => void;
29
+ lines: (op: OutlineOp, axis: OutlineAxis, first: number, last: number) => void;
30
+ key: (e: KeyboardEvent) => boolean;
31
+ tap: (e: MouseEvent) => void;
32
+ };
33
+ export type Outline = ReturnType<typeof useOutline>;
34
+ export {};
@@ -0,0 +1,34 @@
1
+ import type { Ref } from 'vue';
2
+ import type { ScanOptions } from 'xlcalc/contract';
3
+ import type { EditorState } from './editing.js';
4
+ import type { Selection } from './selection.js';
5
+ import type { SheetState } from './state.js';
6
+ import type { Viewport } from './viewport.js';
7
+ /** What a press points at: cells, entire columns (a letter) or entire rows (a number). */
8
+ export type PointKind = 'cells' | 'columns' | 'rows';
9
+ interface PointDeps {
10
+ /** The open editor's element. */
11
+ input: () => HTMLTextAreaElement | null;
12
+ /** Shows the draft's new text with its caret in the editor. */
13
+ show: () => void;
14
+ /** Closes the function list. */
15
+ closeList: () => void;
16
+ /** How the workbook's formula text is parsed (its locale); null while the locale loads. */
17
+ scan: () => ScanOptions | null;
18
+ /** Enters the draft and moves the selection in the arrow's direction. */
19
+ commit: (dr: -1 | 0 | 1, dc: -1 | 0 | 1) => void;
20
+ }
21
+ export declare function usePoint(s: SheetState, sel: Selection, v: Viewport, editor: Ref<EditorState | null>, deps: PointDeps): {
22
+ down: (e: PointerEvent, at: {
23
+ kind: PointKind;
24
+ row: number;
25
+ col: number;
26
+ } | null) => boolean;
27
+ move: (e: PointerEvent) => void;
28
+ up: () => void;
29
+ key: (e: KeyboardEvent) => boolean;
30
+ onMouseDown: (e: MouseEvent) => void;
31
+ took: () => boolean;
32
+ };
33
+ export type Point = ReturnType<typeof usePoint>;
34
+ export {};
@@ -0,0 +1,21 @@
1
+ /** A piece of a text node to color: its offsets and color, underlined while a held Ctrl or Cmd would navigate to it. */
2
+ export interface RefPaint {
3
+ from: number;
4
+ to: number;
5
+ color: string;
6
+ underline?: boolean;
7
+ }
8
+ /** Painted ranges, each with its highlight's name, to remove on the next paint. */
9
+ export type Painted = [name: string, range: Range][];
10
+ /** Whether the browser paints highlights; otherwise the layer colors references with spans. */
11
+ export declare const canPaint: () => boolean;
12
+ /** Colors `pieces` of `node` in place of what `before` painted; null only removes the old paint. */
13
+ export declare function paintRefs(node: Text | null, pieces: RefPaint[], before: Painted): Painted;
14
+ /**
15
+ * The piece of `layer`'s text under a point (of the mouse or a finger), by the boxes its characters are drawn in, its line's
16
+ * height around them and `slop` pixels to either side; -1 when off all of them. Beyond a line's end or between lines there is none.
17
+ */
18
+ export declare function pieceAtPoint(layer: HTMLElement, pieces: {
19
+ from: number;
20
+ to: number;
21
+ }[], x: number, y: number, slop?: number): number;
@@ -0,0 +1,45 @@
1
+ import type { CellPosition, CellRect } from 'xlcalc/contract';
2
+ import { type Geometry } from './geometry.js';
3
+ import type { SheetState } from './state.js';
4
+ import type { Viewport } from './viewport.js';
5
+ /** A drawn cell's position from its `data-cell` (`row:col`); null for anything else. */
6
+ export declare function cellOfData(data: string | null | undefined): CellPosition | null;
7
+ export declare function useSelection(s: SheetState, geo: Geometry, v: Viewport): {
8
+ fullRect: import("vue").ComputedRef<CellRect | null>;
9
+ selRect: import("vue").ComputedRef<CellRect | null>;
10
+ wholeColumns: import("vue").ComputedRef<{
11
+ first: number;
12
+ last: number;
13
+ } | null>;
14
+ wholeRows: import("vue").ComputedRef<{
15
+ first: number;
16
+ last: number;
17
+ } | null>;
18
+ linesOf: (whole: {
19
+ first: number;
20
+ last: number;
21
+ } | null, line: number) => {
22
+ first: number;
23
+ last: number;
24
+ };
25
+ multi: import("vue").ComputedRef<boolean>;
26
+ selectionRef: import("vue").ComputedRef<string>;
27
+ gridRef: import("vue").ComputedRef<string>;
28
+ isActive: (row: number, col: number) => boolean;
29
+ pickCell: (row: number, col: number, extend?: boolean) => void;
30
+ pickColumn: (col: number, extend?: boolean) => void;
31
+ pickRow: (row: number, extend?: boolean) => void;
32
+ selectAll: () => void;
33
+ stretchTo: (r: CellRect) => void;
34
+ selectRect: (r: CellRect) => void;
35
+ onCellDown: (e: PointerEvent, row: number, col: number) => void;
36
+ onCellTap: (e: MouseEvent, row: number, col: number) => boolean;
37
+ onGridMove: (e: PointerEvent) => void;
38
+ onGridUp: () => void;
39
+ revealCell: (row: number, col: number) => void;
40
+ measure: () => void;
41
+ navKey: (e: KeyboardEvent) => boolean;
42
+ keyTarget: (a: CellPosition, e: KeyboardEvent) => CellPosition | Promise<CellPosition | null> | null;
43
+ step: (dr: -1 | 0 | 1, dc: -1 | 0 | 1) => void;
44
+ };
45
+ export type Selection = ReturnType<typeof useSelection>;