Skip to content

Commit 500004e

Browse files
committed
more comments
1 parent 3341032 commit 500004e

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

src/runtime/define.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,27 @@ import {main} from "./index.js";
55
import {input} from "./stdlib/generators/index.js";
66
import {Mutator} from "./stdlib/mutable.js";
77

8-
export type DefineState = DisplayState & {variables: Variable[]};
8+
export type DefineState = DisplayState & {
9+
/** the runtime variables associated with this cell */
10+
variables: Variable[]
11+
};
912

1013
export type Definition = {
14+
/** the unique cell id; a positive integer */
1115
id: number;
16+
/** the cell’s definition function */
1217
body: VariableDefinition;
18+
/** the names of this cell’s inputs (unbound references), if any */
1319
inputs?: string[];
20+
/** the names of this cell’s outputs (top-level declarations), if any */
1421
outputs?: string[];
22+
/** the singular output name of this cell, if any; an alternative to outputs */
1523
output?: string;
24+
/** whether to display this cell’s singular output automatically */
1625
autodisplay?: boolean;
26+
/** whether this cell’s singular output is a view */
1727
autoview?: boolean;
28+
/** whether this cell’s singular output is a mutable */
1829
automutable?: boolean;
1930
};
2031

src/runtime/display.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import {inspect, inspectError, getExpanded} from "./inspect.js";
22

33
export type DisplayState = {
4+
/** the HTML element in which to render this cell’s display */
45
root: HTMLDivElement;
6+
/** for inspected values, any expanded paths; see getExpanded */
57
expanded: (number[][] | undefined)[];
68
};
79

0 commit comments

Comments
 (0)