-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
IRow.ts
69 lines (68 loc) 路 2.6 KB
/
IRow.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import type { IAttribute, IHasDisplay, IHasGameObjects, IHasOracleContent, IHasRollTemplate, IHasSuggestions, IHasSummary, IMultipleRolls , IOracle } from "@json_out/index.js";
import type { Nullable } from "@utils/types/Nullable.js";
/**
* Interface representing a single row in an oracle table.
* @public
*/
export interface IRow extends Partial<
Nullable<IHasSummary> &
IHasRollTemplate &
IHasSuggestions &
IHasOracleContent &
IHasGameObjects &
IHasDisplay
> {
/**
* The ID of this row.
* @pattern ^(Ironsworn|Starforged)/Oracles(/[A-z_-]+)+/[1-9][0-9]*(-[1-9][0-9]*)?(/Subtable/[1-9][0-9]*(-[1-9][0-9]*)?)?$
* @nullable
*/
$id?: string | null;
/**
* The low end of the dice range for this row.
* @minimum 1
* @maximum 100
* @nullable
*/
Floor: number | null;
/**
* The high end of the dice range for this row.
* @minimum 1
* @maximum 100
* @nullable
*/
Ceiling: number | null;
/**
* The primary result text for the row, annotated in Markdown.
* In the book, this is frequently the only column aside from the roll column. Otherwise, it is the first column.
* Some tables label this column as something other than Result; see the parent (or grandparent) Oracle.Display for more information.
*/
Result: string;
/**
* A secondary markdown string that must be presented to the user for the implementation to be complete, but may benefit from progressive disclosure (such as a collapsible element, popover/tooltip, etc).
*
* Generally, `Summary` is longer than `Result`.
*
* Some tables label this column as something other than `Result`; see the parent (or grandparent) `IOracle.Display.Table` for more information.
*
* `null` is used in cases where an 'empty' `Summary` exists (example: Starship Type, p. 326). In the book, these table cells are rendered with the text `--` (and this is the recommended placeholder for tabular display). For display as a single result (e.g. VTT table roll output), however, `null` values can be safely omitted.
* @nullable
*/
Summary?: string | null | undefined;
/**
* Additional oracle tables that should be rolled when this row is selected.
*/
"Oracle rolls"?: IOracle["$id"][] | undefined;
/**
* A table to be rolled when this row is selected. If this row references an external oracle, the `Oracles` property is used instead.
*/
Subtable?: IRow[] | undefined;
/**
* Data for rows that call for multiple rolls, e.g. on `Roll twice` results.
*/
"Multiple rolls"?: IMultipleRolls | undefined;
/**
* The attributes set by this row.
*/
Attributes?: IAttribute[] | undefined;
}