@umriss-ui/table 0.15.0 → 0.34.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/index.d.ts CHANGED
@@ -1,28 +1,11 @@
1
1
  import { ComponentType } from 'react';
2
- import { FlatteningEntry } from '@umriss-ui/core';
3
- import { FreshnessAges } from '@umriss-ui/core';
4
- import { HTMLAttributes } from 'react';
5
2
  import { JSX } from 'react';
6
3
  import { LimitSet } from '@umriss-ui/core';
7
4
  import { ReactNode } from 'react';
8
- import { Wording } from '@umriss-ui/core';
9
5
 
10
6
  /** A value that is not there: `null` or `undefined`. */
11
7
  export declare type Absent = null | undefined;
12
8
 
13
- /** Acknowledges the named alarms at the named time. Unknown ids are passed
14
- over, what is already acknowledged stays as it is. */
15
- export declare function acknowledge(alarms: readonly Alarm[], ids: Iterable<string>, time: number): Acknowledgement;
16
-
17
- /** What `acknowledge` returns: the alarms afterwards, and how many it changed. */
18
- export declare interface Acknowledgement {
19
- alarms: Alarm[];
20
- /** How many alarms the acknowledgement actually changed. Acknowledging twice
21
- yields the same set but not the same number - which is why it stands
22
- here. */
23
- count: number;
24
- }
25
-
26
9
  declare interface ActionBase {
27
10
  /** The label – text, because it is read out together with the row's name. */
28
11
  children: string;
@@ -80,227 +63,6 @@ export declare interface AggregateOptions<W, Z> {
80
63
  share?: boolean;
81
64
  }
82
65
 
83
- /** `aggregate`, or its old name `footer` - never both. */
84
- declare type AggregateProps<W, Z> = (AggregateOptions<W, Z> & {
85
- /** The old name of `aggregate` – not together with it. */
86
- footer?: never;
87
- }) | {
88
- /** Not together with `footer`, its old name. */
89
- aggregate?: never;
90
- /** @deprecated Is called `aggregate` now – the same values, and in a
91
- grouped table the group's as well. The old name goes with the next
92
- minor version. */
93
- footer?: FooterFor<W>;
94
- /** The share bar under a sum in a group's header. */
95
- share?: boolean;
96
- };
97
-
98
- /** One occurrence of a type.
99
-
100
- `lifecycle` is the truth about the position; the two points in time are
101
- trimmings for the display. The other way round it would be a pair of
102
- booleans in disguise.
103
-
104
- `availability` is the second field, and its union with the snooze is why
105
- this is a type and not an interface: a snoozed alarm without an end cannot
106
- be written down. A snooze without an end is the snooze ISA-18.2 warns
107
- against - an alarm switched off that nobody will remember switching off. */
108
- export declare type Alarm = AlarmBase & AlarmAvailability;
109
-
110
- /** The columns with the default labels - for callers without a wording. */
111
- export declare const ALARM_COLUMNS: readonly ModelColumn<AlarmRow, AlarmColumn>[];
112
-
113
- /** Whether an alarm is in service, and while it is snoozed until when and by
114
- whom. */
115
- export declare type AlarmAvailability = {
116
- /** Without a statement: in service. */
117
- availability?: Exclude<Availability, "snoozed">;
118
- snooze?: undefined;
119
- } | {
120
- availability: "snoozed";
121
- /** Until when, and by whom. */
122
- snooze: Snooze;
123
- };
124
-
125
- /** What every alarm has, whatever its availability: its id, its type, its
126
- place in the lifecycle and its moments. */
127
- export declare interface AlarmBase {
128
- id: string;
129
- /** Id of the alarm type. */
130
- type: string;
131
- lifecycle: LifecycleState;
132
- /** The moment of coming, in milliseconds. */
133
- raised: number;
134
- /** The moment of resolving; while the alarm is active: none. */
135
- resolved?: number;
136
- /** The moment of the acknowledgement, as long as unacknowledged: none. */
137
- acknowledgedAt?: number;
138
- }
139
-
140
- /** Ids of the columns that are sorted, searched and ordered in. */
141
- export declare type AlarmColumn = "type" | "lifecycle" | "availability" | "priority" | "acknowledgement" | "raised" | "age" | "frequency";
142
-
143
- /**
144
- * The columns of the alarm model, labelled from a wording.
145
- *
146
- * Described only for the pipeline - how a value is read and compared - not for
147
- * presentation. The cells stay the caller's, exactly as with the table. The
148
- * label, though, lands in the column menu and the CSV header row, and that is
149
- * why it comes from the wording: the module is pure and can read no context, so
150
- * it is given one - like `standardPresets`.
151
- */
152
- export declare const alarmColumns: (wording: Wording) => readonly ModelColumn<AlarmRow, AlarmColumn>[];
153
-
154
- /** The input of `alarmModel`: the alarms, their types, the as-of time, and
155
- the rules for chatter and floods. */
156
- export declare interface AlarmInput {
157
- alarms: readonly Alarm[];
158
- /** The catalogue of conditions. An alarm whose type is missing is not thrown
159
- away. */
160
- types: readonly AlarmType[];
161
- /** Milliseconds. The age and every window hang on it; nothing reads a
162
- clock. */
163
- asOf: number;
164
- /** Without it `frequency` counts every occurrence up to the as-of time and
165
- `chatters` stays false. */
166
- chatter?: ChatterRule;
167
- /** Without it no flood is detected and nothing is marked. */
168
- flood?: FloodRule;
169
- /** Show the alarms that are done as well (resolved and acknowledged).
170
- Default: no - that is the only removal the model performs. */
171
- keepDone?: boolean;
172
- /** The columns of the projection; without a statement `ALARM_COLUMNS`.
173
- Whoever changes the label in the column menu or the CSV header row passes
174
- `alarmColumns(wording)`. */
175
- columns?: readonly ModelColumn<AlarmRow, AlarmColumn>[];
176
- }
177
-
178
- /** The list of alarms, operable: a table over the rows of `alarmModel`, with
179
- priority, lifecycle state and age, the acknowledgement of one alarm or of
180
- the selection, and - with `asOf` and `freshness` - how old the data is. It
181
- acknowledges nothing itself: it hands the ids to `onAcknowledge`. */
182
- export declare function AlarmList(props: AlarmListProps): JSX.Element;
183
-
184
- /** The props of `AlarmList`: a div's attributes, the projection to show, and
185
- the hooks for selection, acknowledgement and freshness. */
186
- export declare interface AlarmListProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
187
- /** The projection from `alarmModel`. */
188
- view: AlarmProjection;
189
- /** The caller's selection helper; without it there is no bulk
190
- acknowledgement. Deliberately the same one as for any other table: the
191
- rules on "everything filtered" versus "this page" are already decided
192
- there. */
193
- selection?: TableSelection<string>;
194
- /** Gets the ids that are to be acknowledged. The component does not
195
- acknowledge itself – it does not own the alarms. */
196
- onAcknowledge?: (ids: readonly string[]) => void;
197
- /** Gets the ids the operator wants to snooze and the end they chose
198
- (`asOf` of the view plus a duration of `snoozeDurations`). The component
199
- snoozes nothing – the application calls `snooze()` on its own alarms, or
200
- refuses. The action stands beside "Acknowledge", on the selection, and
201
- needs `selection`, `snoozeDurations` and this handler. With
202
- `snoozeReason` there is a third argument: the reason, trimmed, or
203
- `undefined` when it is optional and left empty. */
204
- onSnooze?: (ids: readonly string[], until: number, reason?: string) => void;
205
- /** Asks for a reason when snoozing: "Snooze" then opens a small panel with
206
- the durations and a field for the reason, and its button reports. With
207
- `"required"` the button waits for text. Without this prop "Snooze" is the
208
- menu of durations and reports at once. The list keeps no draft once the
209
- panel closes; Escape and a click outside close it without reporting. */
210
- snoozeReason?: "optional" | "required";
211
- /** The durations on offer, in milliseconds. Which are permitted is the
212
- application's rule, so there is no default list; empty or missing, there is no
213
- snooze action.
214
- @default no default */
215
- snoozeDurations?: readonly number[];
216
- /** Gets the ids whose snooze the operator wants to end early. Shown, beside
217
- "Acknowledge", only with this handler and a selection. */
218
- onUnsnooze?: (ids: readonly string[]) => void;
219
- /** When the data was true. */
220
- asOf?: Date | number | null;
221
- /** From when the data counts as stale and from when as disconnected. Without
222
- them the list shows no freshness – a time without a rule for when it is
223
- too old is no information. */
224
- freshness?: FreshnessAges;
225
- /** "compact" reduces the row height for very dense views.
226
- @default the density of the `UmrissProvider`, else `"compact"` */
227
- density?: "regular" | "compact";
228
- /** The view of hidden alarms is on. The list does not filter - the
229
- projection does, with the table's own `filter` and `isHidden`; this
230
- only says what the switch shows. */
231
- hiddenOnly?: boolean;
232
- /** Offers the view as a switch beside its count. Without it the count
233
- stands as text. */
234
- onHiddenOnlyChange?: (hiddenOnly: boolean) => void;
235
- }
236
-
237
- /**
238
- * Alarms, types and an as-of time become rows with derived fields and are then
239
- * handed through the table's pipeline: filter -> sort -> page. Everything the
240
- * table guarantees still holds.
241
- *
242
- * `input.sort` without a statement means the default order; expressly `null`
243
- * means input order.
244
- */
245
- export declare function alarmModel(input: AlarmInput, state?: TableInput<AlarmRow, AlarmColumn>): AlarmProjection;
246
-
247
- /** What `alarmModel` returns: the table's projection of the alarm rows -
248
- filtered, sorted, paged -, and beside it the flood and the counts the list
249
- announces. Give it to `AlarmList` as `view`. */
250
- export declare interface AlarmProjection extends TableProjection<AlarmRow, AlarmColumn> {
251
- /** The flood that was detected, when a rule was given and it applies. A
252
- marking beside the complete list, not a replacement for it. */
253
- flood: Flood | null;
254
- /** Active and unacknowledged within the filtered set - the number for the
255
- polite screen reader. From the filtered set, not from the visible page,
256
- like every figure in this house. Only alarms in service count: the
257
- number calls somebody over, and a hidden alarm is one it must not call
258
- to. */
259
- activeUnacknowledged: number;
260
- /** Hidden within the filtered set: snoozed, suppressed, disabled. They are
261
- in the list; this is how many. */
262
- hiddenAlarms: number;
263
- }
264
-
265
- /** An alarm with everything the list and the order need to know about it.
266
- Derived, never stored. */
267
- export declare interface AlarmRow {
268
- /** Id of the alarm - the key for selection and acknowledgement. */
269
- id: string;
270
- alarm: Alarm;
271
- type: AlarmType;
272
- lifecycle: LifecycleState;
273
- /** At the as-of time: an expired snooze is already back in service here. */
274
- availability: Availability;
275
- priority: Priority;
276
- /** 0 is the most urgent. For the sort. */
277
- rank: number;
278
- /** Since the coming, from the as-of time passed in. */
279
- age: number;
280
- /** How long the condition was true - until the resolving, otherwise until the
281
- as-of time. Not the same thing as the age. */
282
- duration: number;
283
- /** Occurrences of this TYPE within the window; without a chatter rule: all of
284
- them up to the as-of time. */
285
- frequency: number;
286
- /** The TYPE chatters. A marking on each of its rows. */
287
- chatters: boolean;
288
- /** This alarm belongs to the flood that was detected. */
289
- inFlood: boolean;
290
- }
291
-
292
- /** The condition that can become true. Not the alarm itself.
293
-
294
- Frequency, chatter and flood are statements about a TYPE over a window and
295
- cannot be expressed without it. */
296
- export declare interface AlarmType {
297
- id: string;
298
- label: string;
299
- priority: Priority;
300
- /** The dead band, when the type has one. */
301
- returnBand?: ReturnBand;
302
- }
303
-
304
66
  /** The table holds every row and does the work itself. */
305
67
  declare interface AutomaticMode<Z> {
306
68
  /** Without it the table holds every row and does the work itself. */
@@ -319,34 +81,6 @@ declare interface AutomaticMode<Z> {
319
81
  filterOptions?: never;
320
82
  }
321
83
 
322
- /** In service first, then by how near each is to coming back: snoozed (a
323
- person's own decision, with an end), suppressed, disabled. The order of
324
- the default sort. */
325
- export declare const AVAILABILITIES: readonly Availability[];
326
-
327
- /** Whether an alarm is in front of the people watching the list - the second
328
- field beside the lifecycle (ISA-18.2's special states).
329
-
330
- A second field and never a fifth value of the lifecycle, by the same rule
331
- that made the lifecycle one field: one state, one field. The two answer
332
- different questions - what happened to the condition, and whether anyone
333
- is meant to see it now - and a snoozed alarm keeps its lifecycle
334
- underneath: when the snooze ends it comes back active and unacknowledged
335
- if that is what it is.
336
-
337
- `suppressed` has no transition here. It is the application's logic that
338
- suppresses (a service that is switched off raises no error-rate alarm),
339
- and the application writes the field from that logic. */
340
- export declare type Availability = "in-service" | "snoozed" | "suppressed" | "disabled";
341
-
342
- /**
343
- * The availability at the as-of time. A snooze that has reached its end is in
344
- * service again - by the model's clock, not by a timer: nothing here reads a
345
- * clock, and a timer in a user-interface library would bring a snoozed alarm
346
- * back only while a browser tab happens to be open.
347
- */
348
- export declare function availabilityAt(alarm: Alarm, asOf: number): Availability;
349
-
350
84
  /** An edit the user committed - reported, not applied. */
351
85
  export declare interface CellEdit<Z> {
352
86
  rowKey: string;
@@ -374,14 +108,6 @@ export declare interface CellEditorProps<W, Z> {
374
108
  label: string;
375
109
  }
376
110
 
377
- /** From when a type counts as chattering. */
378
- export declare interface ChatterRule {
379
- /** Length of the window in milliseconds. */
380
- windowMs: number;
381
- /** From how many occurrences within the window. Reaching it is enough. */
382
- atLeast: number;
383
- }
384
-
385
111
  /** Without a text form `children` is required. */
386
112
  declare type ChildrenFor<W, Z> = IsDisplayable<W> extends true ? {
387
113
  /** How the value appears: `(value, row)`. Never called for an absent
@@ -548,44 +274,12 @@ export declare type Computed<Z, W> = ColumnBase & ValuePaths<W> & {
548
274
  validate?: (value: W | null, row: Z) => string | null | undefined;
549
275
  };
550
276
 
551
- /** How many of the named alarms an acknowledgement would actually change. The
552
- same condition as `acknowledge`, so that the number the interface names
553
- beforehand and what happens afterwards cannot drift apart. */
554
- export declare function countAcknowledgeable(alarms: readonly Alarm[], ids: Iterable<string>): number;
555
-
556
- /** How many of the points in time lie within the window. Pure, with the as-of
557
- time as a parameter. */
558
- export declare const countInWindow: (times: readonly number[], windowMs: number, asOf: number) => number;
559
-
560
277
  /** The names of the standard presentations of a point in time. */
561
278
  export declare type DateFormat = "date" | "time" | "dateTime";
562
279
 
563
280
  /** The span a point in time is grouped by. */
564
281
  export declare type DatePeriod = "day" | "week" | "month" | "year";
565
282
 
566
- /** In service before hidden, then priority, then acknowledgement, then time -
567
- the worst first, not the newest. As levels of the existing multi-level
568
- sort, so that a caller replaces one value instead of fighting against a
569
- hard-wired comparison.
570
-
571
- Availability stands first because a snoozed alarm of high priority is a
572
- decision already taken; above an active one of medium priority it would
573
- take the first glance from the alarm nobody has decided about. */
574
- export declare const DEFAULT_ORDER: readonly SortLevel<AlarmColumn>[];
575
-
576
- /**
577
- * Is there a flood in the window before the as-of time? Pure calculation over
578
- * timestamps, with window, threshold and as-of time as parameters.
579
- * @returns The flood, or `null` when fewer alarms than the rule's `atLeast`
580
- * were raised in its window.
581
- */
582
- export declare function detectFlood(alarms: readonly Alarm[], rule: FloodRule, asOf: number): Flood | null;
583
-
584
- /** Disables an alarm - from service or from a snooze. A suppressed alarm
585
- stays as it is: that field is the application's logic's, and `enable`
586
- would otherwise hand it back in service with the suppression lost. */
587
- export declare function disable(alarm: Alarm): Alarm;
588
-
589
283
  /** What can appear as text without `children`. */
590
284
  export declare type Displayable = string | number | boolean | Date;
591
285
 
@@ -609,10 +303,6 @@ export declare interface EditOptions<W, Z> {
609
303
  validate?: (value: W | null, row: Z) => string | null | undefined;
610
304
  }
611
305
 
612
- /** Returns a disabled alarm to service. Only that one: a snooze ends by
613
- `unsnooze` or its time, a suppression by the application's logic. */
614
- export declare function enable(alarm: Alarm): Alarm;
615
-
616
306
  /** Writes the filtered set in the visible columns and their order – with the
617
307
  values, not with their presentation. In server mode the table holds one
618
308
  page of the server's, so it writes that page, and its button says so. */
@@ -655,7 +345,7 @@ export declare type FieldColumn<Z, K extends Field<Z>> = ColumnBase & ValuePaths
655
345
  filter?: FilterFor<Z[K]>;
656
346
  /** Groups points in time by `"day"`, `"week"`, `"month"` or `"year"`. */
657
347
  group?: GroupFor<Z[K]>;
658
- } & AggregateProps<Z[K], Z> & EditOptions<Z[K], Z> & ChildrenFor<Z[K], Z>;
348
+ } & AggregateOptions<Z[K], Z> & EditOptions<Z[K], Z> & ChildrenFor<Z[K], Z>;
659
349
 
660
350
  /** What can be set as a condition on a field: a list of its values, and for
661
351
  numbers and points in time a range as well. */
@@ -683,38 +373,10 @@ export declare interface FilterInputProps<W, B> {
683
373
  };
684
374
  }
685
375
 
686
- /** A flood that has been detected. A marking, not a suppression: the alarms all
687
- stay in the list. */
688
- export declare interface Flood {
689
- /** Earliest and latest moment of the alarms involved - so that the interface
690
- can say "forty alarms in 82 seconds". */
691
- from: number;
692
- to: number;
693
- count: number;
694
- /** Ids of the alarms involved. */
695
- alarms: readonly string[];
696
- }
697
-
698
- /** From when a set of alarms is a flood. */
699
- export declare interface FloodRule {
700
- windowMs: number;
701
- /** From how many alarms within the window - across all types, because one
702
- fault drags nine others with it. Reaching it is enough. */
703
- atLeast: number;
704
- }
705
-
706
- /** What the old `footer` accepts: `"sum"` and `"avg"` for numbers, nothing
707
- for every other value. */
708
- export declare type FooterFor<W> = [Present<W>] extends [number] ? "sum" | "avg" : never;
709
-
710
376
  /** What a column accepts as `format`: a number format for numbers, a date
711
377
  format for points in time, nothing for every other value. */
712
378
  export declare type FormatFor<W> = [Present<W>] extends [number] ? NumberFormat : [Present<W>] extends [Date] ? DateFormat : never;
713
379
 
714
- /** Frequency per alarm type within the window. Grouped by TYPE, not by
715
- occurrence - a chattering source is one problem, not forty. */
716
- export declare function frequencyByType(alarms: readonly Alarm[], windowMs: number, asOf: number): Map<string, number>;
717
-
718
380
  /** What every group key takes, whatever its value. */
719
381
  export declare interface GroupByBase {
720
382
  /** Names the group key where a grouping is chosen, and in the grouping's tag in the table toolbar. */
@@ -761,75 +423,16 @@ export declare interface GroupLevel<Z> {
761
423
  order?: (row: Z) => unknown;
762
424
  }
763
425
 
764
- /**
765
- * Has the value come back far enough for an active alarm to resolve? The value
766
- * must come back past the return value, not merely past the bound that
767
- * triggered the alarm - which is why `limit` does not appear in this
768
- * calculation.
769
- *
770
- * The condition of resolving, not that of raising: that a measured value raises
771
- * an alarm the caller's process layer decides. It lives here because only this
772
- * module knows what the alarm just was.
773
- *
774
- * The return value itself belongs to the return: reaching it is enough.
775
- */
776
- export declare const hasReturned: (band: ReturnBand, value: number) => boolean;
777
-
778
- /** Whether someone has acknowledged the alarm, active or resolved. */
779
- export declare const isAcknowledged: (state: LifecycleState) => boolean;
780
-
781
- /** Whether the condition still holds: active, acknowledged or not. */
782
- export declare const isActive: (state: LifecycleState) => boolean;
783
-
784
426
  /** `true` where the value present can appear as text without `children`
785
427
  (`Displayable`), `false` otherwise - what decides the filters and
786
428
  aggregates a column offers. */
787
429
  export declare type IsDisplayable<W> = [Present<W>] extends [never] ? false : [Present<W>] extends [Displayable] ? true : false;
788
430
 
789
- /** Resolved and acknowledged: the only position that leaves the list. */
790
- export declare const isDone: (state: LifecycleState) => boolean;
791
-
792
- /** Everything but in service: still in the list, drawn neutrally and counted,
793
- never removed. "Not absent, only deliberately hidden." */
794
- export declare const isHidden: (availability: Availability) => boolean;
795
-
796
- /** One field, four values. `resolved-unacknowledged` is the fleeting alarm and the
797
- reason why no pair of booleans stands here. */
798
- export declare type LifecycleState = "active-unacknowledged" | "active-acknowledged" | "resolved-unacknowledged" | "resolved-acknowledged";
799
-
800
- /** One line of a grouped table. A header heads a group of an outer level; a row
801
- of the innermost level stands in its span; a folded span is one line. */
802
- declare type Line<Z> = {
803
- kind: "header";
804
- group: RowGroup<Z>;
805
- /** The headers around it. */
806
- parents: readonly RowGroup<Z>[];
807
- /** Repeated at the top of a page that begins inside the group. */
808
- continued: boolean;
809
- } | {
810
- kind: "row";
811
- row: Z;
812
- parents: readonly RowGroup<Z>[];
813
- /** The span the row stands in - the innermost group, when there are
814
- several levels; a single level has no span, its rows stand under
815
- their group header. */
816
- span: RowGroup<Z> | undefined;
817
- /** The span shows its value on this line: the group's first row, or the
818
- first of a page that begins inside it. */
819
- first: boolean;
820
- continued: boolean;
821
- } | {
822
- kind: "folded";
823
- group: RowGroup<Z>;
824
- parents: readonly RowGroup<Z>[];
825
- };
826
-
827
431
  /** The condition of a list filter: the chosen values, an absent one as `null`. */
828
432
  export declare type ListCondition<W> = readonly (Present<W> | null)[];
829
433
 
830
434
  /** A column as the model reads it - what sorting, search, hiding and the
831
- export need of it, not its presentation. `alarmModel` takes them, and
832
- `ALARM_COLUMNS` are the alarm list's. */
435
+ export need of it, not its presentation. */
833
436
  export declare interface ModelColumn<Z, K extends string = string> {
834
437
  id: K;
835
438
  /** Human-readable label – for the column menu and the CSV header row.
@@ -855,15 +458,6 @@ export declare interface ModelColumn<Z, K extends string = string> {
855
458
  width?: number;
856
459
  }
857
460
 
858
- /**
859
- * The transition as pure calculation.
860
- *
861
- * `raised` always leads to `active-unacknowledged`, even out of an
862
- * acknowledged position: a renewed occurrence of the condition is a new
863
- * event and demands that somebody see it again.
864
- */
865
- export declare function nextLifecycleState(state: LifecycleState, transition: Transition): LifecycleState;
866
-
867
461
  /** The field names whose value is a number or may be absent. */
868
462
  export declare type NumberField<Z> = {
869
463
  [K in Field<Z>]: Z[K] extends number | Absent ? K : never;
@@ -904,44 +498,12 @@ export declare type Present<W> = Exclude<W, Absent>;
904
498
  /** What a column draws in a cell: the value present and its row. */
905
499
  export declare type Presentation<W, Z> = (value: Present<W>, row: Z) => ReactNode;
906
500
 
907
- /** From the most urgent to the last - the order of the scale. */
908
- export declare const PRIORITIES: readonly Priority[];
909
-
910
- /** Three levels. Not two, because an alarm system orders the urgency of acting
911
- more finely than a limit does; not seven, because every level above about
912
- four gets used as a synonym of the one below it.
913
-
914
- This is a DIFFERENT scale from the severity of a limit (which has two), on a
915
- different object. The mapping between the two is the caller's, in his code,
916
- where the application's convention stands. */
917
- export declare type Priority = "high" | "medium" | "low";
918
-
919
- /** 0 is the most urgent. Sorted ascending it stands on top. */
920
- export declare const priorityRank: (priority: Priority) => number;
921
-
922
501
  /** The condition of a range filter: both bounds inclusive, each may be absent. */
923
502
  export declare interface RangeCondition<W> {
924
503
  from?: W;
925
504
  to?: W;
926
505
  }
927
506
 
928
- /** The triggering bound and the return band of an alarm type.
929
-
930
- With an upper bound the return value lies below it, with a lower one above
931
- it. That is the dead band: it keeps the value sitting on the bound from
932
- producing a hundred alarms. */
933
- export declare interface ReturnBand {
934
- /** `upper`: the alarm comes when the value rises above the bound.
935
- `lower`: it comes when the value falls below it. */
936
- direction: "upper" | "lower";
937
- /** The bound that triggered the alarm. Stands here so that the condition is
938
- described completely in one place - for the decision about resolving it is
939
- expressly not read. */
940
- limit: number;
941
- /** The value the reading must come back past before the alarm resolves. */
942
- returnTo: number;
943
- }
944
-
945
507
  /** The props of `RowActions`: the `Action`s of each row, in its menu. */
946
508
  export declare interface RowActionsProps {
947
509
  /** The row's `Action`s. */
@@ -1083,23 +645,6 @@ export declare interface SetFilter<Z> {
1083
645
  <I extends string>(column: I & (I extends Field<Z> ? never : unknown), condition: unknown): void;
1084
646
  }
1085
647
 
1086
- /** A snooze: a person's own, time-limited decision to take an alarm out of
1087
- the way. */
1088
- export declare interface Snooze {
1089
- /** When it ends, in milliseconds. Reaching it is enough. */
1090
- until: number;
1091
- /** Who snoozed it - a snooze is tracked, not anonymous. */
1092
- by: string;
1093
- /** Why, when the application asked for one. The list does not show it. */
1094
- reason?: string;
1095
- }
1096
-
1097
- /** Snoozes an alarm in service, or snoozes anew what is snoozed. A disabled
1098
- or suppressed alarm stays as it is: the stronger removal is not
1099
- overwritten by the weaker one, or the end of the snooze would put an alarm
1100
- disabled for maintenance back in service. */
1101
- export declare function snooze(alarm: Alarm, until: number, by: string, reason?: string): Alarm;
1102
-
1103
648
  /** The direction of one sort level: `asc` puts the smallest value on top,
1104
649
  `desc` the largest. */
1105
650
  export declare type SortDirection = "asc" | "desc";
@@ -1130,8 +675,7 @@ export declare interface TableInput<Z = unknown, K extends string = string> {
1130
675
  /** An additional filter beside the free-text search, e.g. a status choice. */
1131
676
  filter?: (row: Z) => boolean;
1132
677
  /** One level or several. A single level means the same as a list holding
1133
- only it – which is why callers that still pass a single object remain
1134
- correct unchanged. */
678
+ only it. */
1135
679
  sort?: SortLevel<K> | readonly SortLevel<K>[] | null;
1136
680
  /** 1-based; is clamped to the valid range. */
1137
681
  page?: number;
@@ -1157,7 +701,7 @@ export declare interface TableInput<Z = unknown, K extends string = string> {
1157
701
  };
1158
702
  /** Tree rows: the rows are the roots, and these read their children. The
1159
703
  model then sorts every level on its own, filters by core's path rule and
1160
- pages nothing (table-tree-rows). */
704
+ pages nothing. */
1161
705
  tree?: TreeInput<Z>;
1162
706
  }
1163
707
 
@@ -1183,24 +727,20 @@ declare interface TableOptionsCommon<Z> {
1183
727
  admits. It may stand in the call; a change leaves the page standing, and
1184
728
  the model clamps it. */
1185
729
  preFilter?: (row: Z) => boolean;
1186
- /** The old name of `preFilter` – the same filter, the same meaning.
1187
- @deprecated Is called `preFilter` now; the old name goes with the next minor version. */
1188
- filter?: (row: Z) => boolean;
1189
730
  /** The row filters the table has: conditions the application defines over
1190
731
  the whole row and sets with `t.setFilter(filter, condition)` from a
1191
732
  control of its own. Named here so that a condition from `initialView`,
1192
733
  which arrives by id, is known in the first render. */
1193
734
  rowFilters?: readonly RowFilter<Z, any>[];
1194
- /** The view to start from, and to go to whenever one differing in content
1195
- from the last is handed in - the same view again changes nothing, and
1196
- what it leaves out is reset; one the table reported itself, handed back
1197
- late, is its own state coming back and not gone to. The table remembers
1198
- none: where a view is kept is the application's decision. Names no
1199
- column carries fall out. */
735
+ /** The view to start from, read once when the hook first runs; a different
736
+ value on a later render is ignored, as React ignores a changed
737
+ `defaultValue`. To go to a view later, call `setView`. The table
738
+ remembers none: where a view is kept is the application's decision.
739
+ Names no column carries fall out. */
1200
740
  initialView?: TableView;
1201
- /** Every change of the view, once, always the whole view - the one to keep,
1202
- or to hand another table as its `initialView`. Not called for the view
1203
- the table starts with. */
741
+ /** Every change the reader makes, once, always the whole view - the one to
742
+ keep, or to hand another table's `setView`. Not called for the view the
743
+ table starts with, nor for one `setView` applies. */
1204
744
  onViewChange?: (view: TableView) => void;
1205
745
  /** Renders only what stands in the scroll area; paging is then off. Every
1206
746
  row is one row pitch tall, which the table measures itself (ADR-0042). */
@@ -1211,40 +751,6 @@ declare interface TableOptionsCommon<Z> {
1211
751
  selection?: TableSelection<string>;
1212
752
  }
1213
753
 
1214
- declare interface TableProjection<Z, K extends string = string> {
1215
- /** The visible columns in their order – the basis for the header row, the
1216
- column menu and the CSV export. */
1217
- columns: readonly ModelColumn<Z, K>[];
1218
- /** Everything the filter leaves – the basis for figures and the selection. */
1219
- filtered: Z[];
1220
- /** Only the current page - with a grouping, the rows among its lines. */
1221
- visible: Z[];
1222
- /** With a grouping: the groups, outermost first. */
1223
- groups?: RowGroup<Z>[];
1224
- /** With a grouping: every line of the filtered set. */
1225
- lines?: Line<Z>[];
1226
- /** With a grouping: the lines of the current page, with what it repeats. */
1227
- visibleLines?: Line<Z>[];
1228
- /** Tree rows: the flattening - the rows shown, in reading order, with
1229
- their level and state. `visible` holds their rows. */
1230
- entries?: readonly FlatteningEntry<Z>[];
1231
- /** Tree rows: every row the flattening shows, before a virtual window. */
1232
- shown?: Z[];
1233
- /** Tree rows: the roots that match or lead to a match - what a footer
1234
- sums, since a parent already holds its children. */
1235
- roots?: Z[];
1236
- /** Tree rows: every row of the filtered tree in reading order, open or
1237
- not, path rows included - what the export writes. */
1238
- exported?: readonly FlatteningEntry<Z>[];
1239
- /** Tree rows: how many rows the tree has on every level - what "of 1,204"
1240
- counts, as the rows the pre-filter admits do for a flat table. */
1241
- total?: number;
1242
- /** The clamped page actually shown. */
1243
- page: number;
1244
- pageCount: number;
1245
- columnCount: number;
1246
- }
1247
-
1248
754
  /** The props of `Table`: how the table looks and behaves. Its state comes from
1249
755
  `useTable`, its columns from the JSX inside it. */
1250
756
  export declare interface TableProps<Z> {
@@ -1403,6 +909,12 @@ export declare interface TableSnapshot<Z> {
1403
909
  grouping: readonly string[];
1404
910
  /** Groups by these columns or group keys; `[]` ungroups. Back to page one. */
1405
911
  setGrouping: (grouping: readonly string[]) => void;
912
+ /** Goes to a whole view; what it leaves out goes back to where the table
913
+ starts, and names no column carries fall out. Not reported through `onViewChange`:
914
+ two tables kept in step by `onViewChange: (v) => other.setView(v)` in
915
+ both directions do not answer each other. A view with the content
916
+ already shown changes nothing. */
917
+ setView: (view: TableView) => void;
1406
918
  /** The paths of the folded groups that still occur. */
1407
919
  folded: readonly string[];
1408
920
  /** Folds a group or unfolds it. A group of one row does not fold. */
@@ -1425,6 +937,9 @@ export declare interface TableSnapshot<Z> {
1425
937
  /** The filtered set in the visible columns as text for a spreadsheet - in
1426
938
  server mode the page. */
1427
939
  asCsv: () => string;
940
+ /** The selected rows within the filtered set as tab-separated text under a
941
+ header line - the text Ctrl+C writes. `""` with nothing selected. */
942
+ selectionAsText: () => string;
1428
943
  /** Whether it virtualises. */
1429
944
  virtual: boolean;
1430
945
  /** How many rows the filtered set has - in server mode the server's count. */
@@ -1488,10 +1003,6 @@ export declare interface ToolbarProps {
1488
1003
  /** The size of a toolbar's controls. */
1489
1004
  export declare type ToolbarSize = "sm" | "md";
1490
1005
 
1491
- /** What can happen to an alarm. The caller reports the event; what it means the
1492
- model knows. */
1493
- export declare type Transition = "raised" | "acknowledged" | "resolved";
1494
-
1495
1006
  /** Tree rows for the model: how a row is keyed, how its children are read,
1496
1007
  and which branches are open. */
1497
1008
  export declare interface TreeInput<Z> {
@@ -1504,9 +1015,6 @@ export declare interface TreeInput<Z> {
1504
1015
  admit?: (row: Z) => boolean;
1505
1016
  }
1506
1017
 
1507
- /** Ends a snooze before its time. */
1508
- export declare function unsnooze(alarm: Alarm): Alarm;
1509
-
1510
1018
  /** A table over your rows: the hook holds its state - sort, filters, search,
1511
1019
  grouping, page, selection, column widths -, and the parts it returns are
1512
1020
  typed at your row, so that a field name in `Column` is checked by the