foldkit-data-grid 0.6.0 → 0.7.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.
package/dist/grid.d.ts CHANGED
@@ -4,6 +4,7 @@ import { RowModel } from "./rows.js";
4
4
  import { Bundle } from "foldkit-bundle";
5
5
  import { GridProjection } from "./projection.js";
6
6
  import { ColumnState } from "./columnState.js";
7
+ import { FilterChange, FilterOf, FilterValue, FilterableId, Filters } from "./filter.js";
7
8
  import { GridWindow, Viewport } from "./virtual.js";
8
9
  /**
9
10
  * One grid's interaction state: focus, the viewport and the column state, as
@@ -23,6 +24,11 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
23
24
  readonly cellSelection?: boolean;
24
25
  }) => {
25
26
  id: string;
27
+ filterFor: (column: keyof Specs & string) => Option.Option<CellEditor>;
28
+ Filters: Schema.Codec<Filters<Specs>, unknown, never, never>;
29
+ noFilters: Filters<Specs>;
30
+ setFilter: (filters: Filters<Specs>, change: FilterChange<Specs>) => Filters<Specs>;
31
+ keeps: (filters: Filters<Specs>, read: { readonly [K in FilterableId<Specs>]: (row: Row) => FilterValue<FilterOf<Specs[K]>>; }) => ((row: Row) => boolean);
26
32
  matchEdit: <const Handlers extends { readonly [K in EditableId<Specs>]: (edited: {
27
33
  readonly row: string;
28
34
  readonly value: EditValue<Specs[K]>;
@@ -59,6 +65,15 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
59
65
  readonly _tag: "Show";
60
66
  readonly column: keyof Specs & string;
61
67
  }>;
68
+ Toggle: import("foldkit/schema").TaggedUnion<{
69
+ readonly Press: {};
70
+ readonly Key: {
71
+ drawn: Schema.OptionFromNullOr<Schema.Struct<{
72
+ readonly row: Schema.String;
73
+ readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
74
+ }>>;
75
+ };
76
+ }>;
62
77
  columns: Columns<Row, Specs>;
63
78
  rowSelection: "multiple" | "single" | undefined;
64
79
  cellSelection: boolean;
@@ -276,6 +291,37 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
276
291
  readonly draft: string;
277
292
  readonly error: Option.Option<string>;
278
293
  }>;
294
+ readonly filtering: Option.Option<{
295
+ readonly column: keyof Specs & string;
296
+ readonly form: {
297
+ readonly text: string;
298
+ readonly min: string;
299
+ readonly max: string;
300
+ readonly options: readonly string[];
301
+ readonly checked: "any" | "false" | "true";
302
+ readonly from: string;
303
+ readonly to: string;
304
+ };
305
+ readonly reported: Option.Option<{
306
+ readonly _tag: "Contains";
307
+ readonly text: string;
308
+ } | {
309
+ readonly _tag: "Between";
310
+ readonly from: Option.Option<string>;
311
+ readonly to: Option.Option<string>;
312
+ } | {
313
+ readonly _tag: "Is";
314
+ readonly checked: boolean;
315
+ } | {
316
+ readonly _tag: "OneOf";
317
+ readonly options: readonly string[];
318
+ } | {
319
+ readonly _tag: "Range";
320
+ readonly min: Option.Option<number>;
321
+ readonly max: Option.Option<number>;
322
+ }>;
323
+ readonly generation: number;
324
+ }>;
279
325
  }, request: {
280
326
  readonly from: string;
281
327
  readonly to: string;
@@ -360,19 +406,50 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
360
406
  readonly draft: string;
361
407
  readonly error: Option.Option<string>;
362
408
  }>;
409
+ readonly filtering: Option.Option<{
410
+ readonly column: keyof Specs & string;
411
+ readonly form: {
412
+ readonly text: string;
413
+ readonly min: string;
414
+ readonly max: string;
415
+ readonly options: readonly string[];
416
+ readonly checked: "any" | "false" | "true";
417
+ readonly from: string;
418
+ readonly to: string;
419
+ };
420
+ readonly reported: Option.Option<{
421
+ readonly _tag: "Contains";
422
+ readonly text: string;
423
+ } | {
424
+ readonly _tag: "Between";
425
+ readonly from: Option.Option<string>;
426
+ readonly to: Option.Option<string>;
427
+ } | {
428
+ readonly _tag: "Is";
429
+ readonly checked: boolean;
430
+ } | {
431
+ readonly _tag: "OneOf";
432
+ readonly options: readonly string[];
433
+ } | {
434
+ readonly _tag: "Range";
435
+ readonly min: Option.Option<number>;
436
+ readonly max: Option.Option<number>;
437
+ }>;
438
+ readonly generation: number;
439
+ }>;
363
440
  };
364
441
  draftOf: (projection: GridProjection<Row, keyof Specs & string>, address: {
365
442
  readonly row: string;
366
443
  readonly column: keyof Specs & string;
367
444
  }) => string;
368
- Out: import("foldkit/schema").TaggedUnion<{
369
- readonly Edited: {
445
+ Out: [FilterableId<Specs>] extends [never] ? import("foldkit/schema").TaggedUnion<{
446
+ Edited: {
370
447
  row: Schema.String;
371
448
  column: Schema.Literals<readonly (keyof Specs & string)[]>;
372
449
  text: Schema.String;
373
450
  };
374
451
  /** The cells their columns accepted, and those they refused, with why. */
375
- readonly Pasted: {
452
+ Pasted: {
376
453
  accepted: Schema.$Array<Schema.Struct<{
377
454
  readonly row: Schema.String;
378
455
  readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
@@ -385,13 +462,13 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
385
462
  readonly error: Schema.String;
386
463
  }>>;
387
464
  };
388
- readonly UndoRequested: {};
389
- readonly RedoRequested: {};
465
+ UndoRequested: {};
466
+ RedoRequested: {};
390
467
  /**
391
468
  * A fill: carry `source` on to `to`. What it writes is worked out from the
392
469
  * rows by `fill`, which the application holds.
393
470
  */
394
- readonly Filled: {
471
+ Filled: {
395
472
  readonly source: Schema.Struct<{
396
473
  readonly anchor: Schema.Struct<{
397
474
  readonly row: Schema.String;
@@ -412,10 +489,58 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
412
489
  * rows lie between is worked out from the rows by `extendRows`, which the
413
490
  * application holds.
414
491
  */
492
+ RowsRequested: {
493
+ from: Schema.String;
494
+ to: Schema.String;
495
+ };
496
+ }> : import("foldkit/schema").TaggedUnion<{
497
+ readonly Edited: {
498
+ row: Schema.String;
499
+ column: Schema.Literals<readonly (keyof Specs & string)[]>;
500
+ text: Schema.String;
501
+ };
502
+ readonly Pasted: {
503
+ accepted: Schema.$Array<Schema.Struct<{
504
+ readonly row: Schema.String;
505
+ readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
506
+ readonly text: Schema.String;
507
+ }>>;
508
+ refused: Schema.$Array<Schema.Struct<{
509
+ readonly row: Schema.String;
510
+ readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
511
+ readonly text: Schema.String;
512
+ readonly error: Schema.String;
513
+ }>>;
514
+ };
515
+ readonly UndoRequested: {};
516
+ readonly RedoRequested: {};
517
+ readonly Filled: {
518
+ readonly source: Schema.Struct<{
519
+ readonly anchor: Schema.Struct<{
520
+ readonly row: Schema.String;
521
+ readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
522
+ }>;
523
+ readonly focus: Schema.Struct<{
524
+ readonly row: Schema.String;
525
+ readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
526
+ }>;
527
+ }>;
528
+ readonly to: Schema.Struct<{
529
+ readonly row: Schema.String;
530
+ readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
531
+ }>;
532
+ };
415
533
  readonly RowsRequested: {
416
534
  from: Schema.String;
417
535
  to: Schema.String;
418
536
  };
537
+ /**
538
+ * A column's filter changed, or is none: the application's to store
539
+ * (`setFilter`) and apply (`keeps`, or a query's input).
540
+ */
541
+ readonly Filtered: {
542
+ change: Schema.Codec<FilterChange<Specs>, unknown, never, never>;
543
+ };
419
544
  }>;
420
545
  Model: Schema.Struct<{
421
546
  readonly focus: Schema.Struct<{
@@ -515,6 +640,48 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
515
640
  readonly draft: Schema.String;
516
641
  readonly error: Schema.OptionFromNullOr<Schema.String>;
517
642
  }>>;
643
+ /**
644
+ * The column whose filter form is open, the form as typed, and the filter
645
+ * last reported (or the application's, when the form opened): a change is
646
+ * reported when the form reads as a valid filter other than this one.
647
+ */
648
+ readonly filtering: Schema.OptionFromNullOr<Schema.Struct<{
649
+ readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
650
+ readonly form: Schema.Struct<{
651
+ readonly text: Schema.String;
652
+ readonly min: Schema.String;
653
+ readonly max: Schema.String;
654
+ readonly options: Schema.$Array<Schema.String>;
655
+ readonly checked: Schema.Literals<readonly ["any", "true", "false"]>;
656
+ readonly from: Schema.String;
657
+ readonly to: Schema.String;
658
+ }>;
659
+ readonly reported: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
660
+ readonly Contains: {
661
+ text: Schema.String;
662
+ };
663
+ readonly Range: {
664
+ min: Schema.OptionFromNullOr<Schema.Finite>;
665
+ max: Schema.OptionFromNullOr<Schema.Finite>;
666
+ };
667
+ readonly OneOf: {
668
+ options: Schema.$Array<Schema.String>;
669
+ };
670
+ readonly Is: {
671
+ checked: Schema.Boolean;
672
+ };
673
+ readonly Between: {
674
+ from: Schema.OptionFromNullOr<Schema.String>;
675
+ to: Schema.OptionFromNullOr<Schema.String>;
676
+ };
677
+ }>>;
678
+ /**
679
+ * Counts the form's reports and reseeds: a stale frame's change reseeds
680
+ * only while it is the one the frame was drawn at, so a second change
681
+ * from that frame adds to the first.
682
+ */
683
+ readonly generation: Schema.Number;
684
+ }>>;
518
685
  }>;
519
686
  Message: import("foldkit/message").MessageUnion<{
520
687
  /** The pointer or the browser focused a cell. */
@@ -681,7 +848,33 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
681
848
  * test resolves them with a Message the runtime sends too.
682
849
  */
683
850
  readonly MountStarted: {};
684
- /** An edit began on an editable cell, with the text it starts from. */
851
+ /**
852
+ * The checkbox in the cell whose DOM id is `cell`, drawn `checked`, was
853
+ * pressed (`Toggle.Press`), or Space or Enter was pressed on the cell a
854
+ * frame drew as the tab stop (`Toggle.Key`, with the focus that frame was
855
+ * drawn from): the column's text for the other value is committed at once
856
+ * and reported as `Out.Edited`, with no draft. The id comes from the page,
857
+ * so a cell that is not a checkbox of this grid, or a toggle while an edit
858
+ * is open, changes nothing; nor does a key whose frame was drawn before
859
+ * focus moved, which would toggle the cell focus left.
860
+ */
861
+ readonly EditToggled: {
862
+ cell: Schema.String;
863
+ checked: Schema.Boolean;
864
+ by: import("foldkit/schema").TaggedUnion<{
865
+ readonly Press: {};
866
+ readonly Key: {
867
+ drawn: Schema.OptionFromNullOr<Schema.Struct<{
868
+ readonly row: Schema.String;
869
+ readonly column: Schema.Literals<readonly (keyof Specs & string)[]>;
870
+ }>>;
871
+ };
872
+ }>;
873
+ };
874
+ /**
875
+ * An edit began on an editable cell, with the text it starts from. A
876
+ * checkbox's cell opens none: it is toggled (`EditToggled`).
877
+ */
685
878
  readonly EditStarted: {
686
879
  address: Schema.Struct<{
687
880
  readonly row: Schema.String;
@@ -786,6 +979,144 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
786
979
  readonly FillEnded: {
787
980
  completed: Schema.Boolean;
788
981
  };
982
+ /**
983
+ * A column's filter form opened, from its button or Alt+ArrowDown on its
984
+ * header, seeded with the application's filter as the view `drawn` it.
985
+ * Focus goes to the header, so closing returns there. A column that does
986
+ * not filter or is hidden, or a `drawn` its column refuses, opens nothing.
987
+ */
988
+ readonly FilterOpened: {
989
+ column: Schema.Literals<readonly (keyof Specs & string)[]>;
990
+ drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
991
+ readonly Contains: {
992
+ text: Schema.String;
993
+ };
994
+ readonly Range: {
995
+ min: Schema.OptionFromNullOr<Schema.Finite>;
996
+ max: Schema.OptionFromNullOr<Schema.Finite>;
997
+ };
998
+ readonly OneOf: {
999
+ options: Schema.$Array<Schema.String>;
1000
+ };
1001
+ readonly Is: {
1002
+ checked: Schema.Boolean;
1003
+ };
1004
+ readonly Between: {
1005
+ from: Schema.OptionFromNullOr<Schema.String>;
1006
+ to: Schema.OptionFromNullOr<Schema.String>;
1007
+ };
1008
+ }>>;
1009
+ };
1010
+ /**
1011
+ * A text field of the open form was typed in. `stale` is set by a frame
1012
+ * drawn after the application's filter changed from outside the form:
1013
+ * the form is seeded again from it first, unless the form has reported
1014
+ * since that frame. A field another kind owns changes nothing.
1015
+ */
1016
+ readonly FilterTyped: {
1017
+ field: Schema.Literals<readonly ["text", "min", "max", "from", "to"]>;
1018
+ text: Schema.String;
1019
+ stale: Schema.OptionFromNullOr<Schema.Struct<{
1020
+ readonly drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
1021
+ readonly Contains: {
1022
+ text: Schema.String;
1023
+ };
1024
+ readonly Range: {
1025
+ min: Schema.OptionFromNullOr<Schema.Finite>;
1026
+ max: Schema.OptionFromNullOr<Schema.Finite>;
1027
+ };
1028
+ readonly OneOf: {
1029
+ options: Schema.$Array<Schema.String>;
1030
+ };
1031
+ readonly Is: {
1032
+ checked: Schema.Boolean;
1033
+ };
1034
+ readonly Between: {
1035
+ from: Schema.OptionFromNullOr<Schema.String>;
1036
+ to: Schema.OptionFromNullOr<Schema.String>;
1037
+ };
1038
+ }>>;
1039
+ readonly generation: Schema.Number;
1040
+ }>>;
1041
+ };
1042
+ /** A choice's option was ticked or unticked; one the column does not offer changes nothing. */
1043
+ readonly FilterOptionToggled: {
1044
+ option: Schema.String;
1045
+ stale: Schema.OptionFromNullOr<Schema.Struct<{
1046
+ readonly drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
1047
+ readonly Contains: {
1048
+ text: Schema.String;
1049
+ };
1050
+ readonly Range: {
1051
+ min: Schema.OptionFromNullOr<Schema.Finite>;
1052
+ max: Schema.OptionFromNullOr<Schema.Finite>;
1053
+ };
1054
+ readonly OneOf: {
1055
+ options: Schema.$Array<Schema.String>;
1056
+ };
1057
+ readonly Is: {
1058
+ checked: Schema.Boolean;
1059
+ };
1060
+ readonly Between: {
1061
+ from: Schema.OptionFromNullOr<Schema.String>;
1062
+ to: Schema.OptionFromNullOr<Schema.String>;
1063
+ };
1064
+ }>>;
1065
+ readonly generation: Schema.Number;
1066
+ }>>;
1067
+ };
1068
+ /** A checkbox's filter was set: any value, checked, or not. */
1069
+ readonly FilterChecked: {
1070
+ state: Schema.Literals<readonly ["any", "true", "false"]>;
1071
+ stale: Schema.OptionFromNullOr<Schema.Struct<{
1072
+ readonly drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
1073
+ readonly Contains: {
1074
+ text: Schema.String;
1075
+ };
1076
+ readonly Range: {
1077
+ min: Schema.OptionFromNullOr<Schema.Finite>;
1078
+ max: Schema.OptionFromNullOr<Schema.Finite>;
1079
+ };
1080
+ readonly OneOf: {
1081
+ options: Schema.$Array<Schema.String>;
1082
+ };
1083
+ readonly Is: {
1084
+ checked: Schema.Boolean;
1085
+ };
1086
+ readonly Between: {
1087
+ from: Schema.OptionFromNullOr<Schema.String>;
1088
+ to: Schema.OptionFromNullOr<Schema.String>;
1089
+ };
1090
+ }>>;
1091
+ readonly generation: Schema.Number;
1092
+ }>>;
1093
+ };
1094
+ /** The open form was emptied: none is reported if a filter held. */
1095
+ readonly FilterCleared: {
1096
+ stale: Schema.OptionFromNullOr<Schema.Struct<{
1097
+ readonly drawn: Schema.OptionFromNullOr<import("foldkit/schema").TaggedUnion<{
1098
+ readonly Contains: {
1099
+ text: Schema.String;
1100
+ };
1101
+ readonly Range: {
1102
+ min: Schema.OptionFromNullOr<Schema.Finite>;
1103
+ max: Schema.OptionFromNullOr<Schema.Finite>;
1104
+ };
1105
+ readonly OneOf: {
1106
+ options: Schema.$Array<Schema.String>;
1107
+ };
1108
+ readonly Is: {
1109
+ checked: Schema.Boolean;
1110
+ };
1111
+ readonly Between: {
1112
+ from: Schema.OptionFromNullOr<Schema.String>;
1113
+ to: Schema.OptionFromNullOr<Schema.String>;
1114
+ };
1115
+ }>>;
1116
+ readonly generation: Schema.Number;
1117
+ }>>;
1118
+ };
1119
+ readonly FilterClosed: {};
789
1120
  }>;
790
1121
  bundle: Bundle.Bundle<"DataGrid", void, {
791
1122
  readonly focus: {
@@ -868,7 +1199,42 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
868
1199
  readonly draft: string;
869
1200
  readonly error: Option.Option<string>;
870
1201
  }>;
1202
+ readonly filtering: Option.Option<{
1203
+ readonly column: keyof Specs & string;
1204
+ readonly form: {
1205
+ readonly text: string;
1206
+ readonly min: string;
1207
+ readonly max: string;
1208
+ readonly options: readonly string[];
1209
+ readonly checked: "any" | "false" | "true";
1210
+ readonly from: string;
1211
+ readonly to: string;
1212
+ };
1213
+ readonly reported: Option.Option<{
1214
+ readonly _tag: "Contains";
1215
+ readonly text: string;
1216
+ } | {
1217
+ readonly _tag: "Between";
1218
+ readonly from: Option.Option<string>;
1219
+ readonly to: Option.Option<string>;
1220
+ } | {
1221
+ readonly _tag: "Is";
1222
+ readonly checked: boolean;
1223
+ } | {
1224
+ readonly _tag: "OneOf";
1225
+ readonly options: readonly string[];
1226
+ } | {
1227
+ readonly _tag: "Range";
1228
+ readonly min: Option.Option<number>;
1229
+ readonly max: Option.Option<number>;
1230
+ }>;
1231
+ readonly generation: number;
1232
+ }>;
871
1233
  }, {
1234
+ readonly _tag: "RedoRequested";
1235
+ } | {
1236
+ readonly _tag: "UndoRequested";
1237
+ } | {
872
1238
  readonly _tag: "AllRowsSelected";
873
1239
  } | {
874
1240
  readonly _tag: "CellPressed";
@@ -943,6 +1309,19 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
943
1309
  } | {
944
1310
  readonly _tag: "EditStepped";
945
1311
  readonly by: "first" | "last" | "next" | "pageNext" | "pagePrevious" | "previous";
1312
+ } | {
1313
+ readonly _tag: "EditToggled";
1314
+ readonly cell: string;
1315
+ readonly checked: boolean;
1316
+ readonly by: {
1317
+ readonly _tag: "Key";
1318
+ readonly drawn: Option.Option<{
1319
+ readonly row: string;
1320
+ readonly column: keyof Specs & string;
1321
+ }>;
1322
+ } | {
1323
+ readonly _tag: "Press";
1324
+ };
946
1325
  } | {
947
1326
  readonly _tag: "EditTyped";
948
1327
  readonly address: {
@@ -975,6 +1354,125 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
975
1354
  };
976
1355
  } | {
977
1356
  readonly _tag: "FillStarted";
1357
+ } | {
1358
+ readonly _tag: "FilterChecked";
1359
+ readonly state: "any" | "false" | "true";
1360
+ readonly stale: Option.Option<{
1361
+ readonly drawn: Option.Option<{
1362
+ readonly _tag: "Contains";
1363
+ readonly text: string;
1364
+ } | {
1365
+ readonly _tag: "Between";
1366
+ readonly from: Option.Option<string>;
1367
+ readonly to: Option.Option<string>;
1368
+ } | {
1369
+ readonly _tag: "Is";
1370
+ readonly checked: boolean;
1371
+ } | {
1372
+ readonly _tag: "OneOf";
1373
+ readonly options: readonly string[];
1374
+ } | {
1375
+ readonly _tag: "Range";
1376
+ readonly min: Option.Option<number>;
1377
+ readonly max: Option.Option<number>;
1378
+ }>;
1379
+ readonly generation: number;
1380
+ }>;
1381
+ } | {
1382
+ readonly _tag: "FilterCleared";
1383
+ readonly stale: Option.Option<{
1384
+ readonly drawn: Option.Option<{
1385
+ readonly _tag: "Contains";
1386
+ readonly text: string;
1387
+ } | {
1388
+ readonly _tag: "Between";
1389
+ readonly from: Option.Option<string>;
1390
+ readonly to: Option.Option<string>;
1391
+ } | {
1392
+ readonly _tag: "Is";
1393
+ readonly checked: boolean;
1394
+ } | {
1395
+ readonly _tag: "OneOf";
1396
+ readonly options: readonly string[];
1397
+ } | {
1398
+ readonly _tag: "Range";
1399
+ readonly min: Option.Option<number>;
1400
+ readonly max: Option.Option<number>;
1401
+ }>;
1402
+ readonly generation: number;
1403
+ }>;
1404
+ } | {
1405
+ readonly _tag: "FilterClosed";
1406
+ } | {
1407
+ readonly _tag: "FilterOpened";
1408
+ readonly column: keyof Specs & string;
1409
+ readonly drawn: Option.Option<{
1410
+ readonly _tag: "Contains";
1411
+ readonly text: string;
1412
+ } | {
1413
+ readonly _tag: "Between";
1414
+ readonly from: Option.Option<string>;
1415
+ readonly to: Option.Option<string>;
1416
+ } | {
1417
+ readonly _tag: "Is";
1418
+ readonly checked: boolean;
1419
+ } | {
1420
+ readonly _tag: "OneOf";
1421
+ readonly options: readonly string[];
1422
+ } | {
1423
+ readonly _tag: "Range";
1424
+ readonly min: Option.Option<number>;
1425
+ readonly max: Option.Option<number>;
1426
+ }>;
1427
+ } | {
1428
+ readonly _tag: "FilterOptionToggled";
1429
+ readonly option: string;
1430
+ readonly stale: Option.Option<{
1431
+ readonly drawn: Option.Option<{
1432
+ readonly _tag: "Contains";
1433
+ readonly text: string;
1434
+ } | {
1435
+ readonly _tag: "Between";
1436
+ readonly from: Option.Option<string>;
1437
+ readonly to: Option.Option<string>;
1438
+ } | {
1439
+ readonly _tag: "Is";
1440
+ readonly checked: boolean;
1441
+ } | {
1442
+ readonly _tag: "OneOf";
1443
+ readonly options: readonly string[];
1444
+ } | {
1445
+ readonly _tag: "Range";
1446
+ readonly min: Option.Option<number>;
1447
+ readonly max: Option.Option<number>;
1448
+ }>;
1449
+ readonly generation: number;
1450
+ }>;
1451
+ } | {
1452
+ readonly _tag: "FilterTyped";
1453
+ readonly field: "from" | "max" | "min" | "text" | "to";
1454
+ readonly text: string;
1455
+ readonly stale: Option.Option<{
1456
+ readonly drawn: Option.Option<{
1457
+ readonly _tag: "Contains";
1458
+ readonly text: string;
1459
+ } | {
1460
+ readonly _tag: "Between";
1461
+ readonly from: Option.Option<string>;
1462
+ readonly to: Option.Option<string>;
1463
+ } | {
1464
+ readonly _tag: "Is";
1465
+ readonly checked: boolean;
1466
+ } | {
1467
+ readonly _tag: "OneOf";
1468
+ readonly options: readonly string[];
1469
+ } | {
1470
+ readonly _tag: "Range";
1471
+ readonly min: Option.Option<number>;
1472
+ readonly max: Option.Option<number>;
1473
+ }>;
1474
+ readonly generation: number;
1475
+ }>;
978
1476
  } | {
979
1477
  readonly _tag: "Focused";
980
1478
  readonly address: {
@@ -1025,8 +1523,6 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1025
1523
  readonly text: string;
1026
1524
  readonly from: string;
1027
1525
  }[];
1028
- } | {
1029
- readonly _tag: "RedoRequested";
1030
1526
  } | {
1031
1527
  readonly _tag: "ResizeEnded";
1032
1528
  readonly completed: boolean;
@@ -1049,13 +1545,49 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1049
1545
  readonly _tag: "RowsExtended";
1050
1546
  readonly rows: readonly string[];
1051
1547
  readonly to: string;
1548
+ }, [FilterableId<Specs>] extends [never] ? {
1549
+ readonly _tag: "Edited";
1550
+ readonly row: string;
1551
+ readonly column: keyof Specs & string;
1552
+ readonly text: string;
1553
+ } | {
1554
+ readonly _tag: "Filled";
1555
+ readonly source: {
1556
+ readonly anchor: {
1557
+ readonly row: string;
1558
+ readonly column: keyof Specs & string;
1559
+ };
1560
+ readonly focus: {
1561
+ readonly row: string;
1562
+ readonly column: keyof Specs & string;
1563
+ };
1564
+ };
1565
+ readonly to: {
1566
+ readonly row: string;
1567
+ readonly column: keyof Specs & string;
1568
+ };
1569
+ } | {
1570
+ readonly _tag: "Pasted";
1571
+ readonly accepted: readonly {
1572
+ readonly row: string;
1573
+ readonly column: keyof Specs & string;
1574
+ readonly text: string;
1575
+ }[];
1576
+ readonly refused: readonly {
1577
+ readonly row: string;
1578
+ readonly column: keyof Specs & string;
1579
+ readonly text: string;
1580
+ readonly error: string;
1581
+ }[];
1052
1582
  } | {
1053
- readonly _tag: "UndoRequested";
1054
- }, {
1055
1583
  readonly _tag: "RedoRequested";
1056
1584
  } | {
1057
- readonly _tag: "UndoRequested";
1585
+ readonly _tag: "RowsRequested";
1586
+ readonly from: string;
1587
+ readonly to: string;
1058
1588
  } | {
1589
+ readonly _tag: "UndoRequested";
1590
+ } : {
1059
1591
  readonly _tag: "Edited";
1060
1592
  readonly row: string;
1061
1593
  readonly column: keyof Specs & string;
@@ -1076,6 +1608,9 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1076
1608
  readonly row: string;
1077
1609
  readonly column: keyof Specs & string;
1078
1610
  };
1611
+ } | {
1612
+ readonly _tag: "Filtered";
1613
+ readonly change: FilterChange<Specs>;
1079
1614
  } | {
1080
1615
  readonly _tag: "Pasted";
1081
1616
  readonly accepted: readonly {
@@ -1089,10 +1624,14 @@ declare const make: <Row, Specs extends Record<string, ColumnSpec<Row, unknown>>
1089
1624
  readonly text: string;
1090
1625
  readonly error: string;
1091
1626
  }[];
1627
+ } | {
1628
+ readonly _tag: "RedoRequested";
1092
1629
  } | {
1093
1630
  readonly _tag: "RowsRequested";
1094
1631
  readonly from: string;
1095
1632
  readonly to: string;
1633
+ } | {
1634
+ readonly _tag: "UndoRequested";
1096
1635
  }, never, never, import("foldkit-bundle").NoView, {}, {}>;
1097
1636
  };
1098
1637
  export declare const DataGrid: {