@eagleoutice/flowr 2.17.13 → 2.17.14
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/README.md +15 -15
- package/cli/repl/core.js +9 -27
- package/data/r-datasets.generated.js +2 -2
- package/dataflow/environments/ambient-effect.d.ts +4 -0
- package/dataflow/environments/ambient-effect.js +5 -4
- package/dataflow/environments/ambient-state-name.d.ts +2 -2
- package/dataflow/environments/ambient-state-name.js +3 -3
- package/dataflow/environments/built-in-props.d.ts +5 -0
- package/dataflow/environments/default-builtin-config/base-functions.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/base-functions.js +4 -2
- package/dataflow/environments/default-builtin-config/base-language.d.ts +12 -1
- package/dataflow/environments/default-builtin-config/base-language.js +3 -2
- package/dataflow/environments/default-builtin-config/index.d.ts +12 -2
- package/dataflow/environments/default-builtin-config/misc-packages.d.ts +1 -1
- package/dataflow/environments/default-builtin-config/misc-packages.js +2 -0
- package/dataflow/environments/default-builtin-config/shared-configs.d.ts +24 -0
- package/dataflow/environments/default-builtin-config/shared-configs.js +8 -6
- package/dataflow/environments/pkg-name.d.ts +1 -0
- package/dataflow/eval/resolve/alias-tracking.js +11 -12
- package/dataflow/graph/df-helper.d.ts +6 -6
- package/dataflow/graph/df-helper.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +18 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +29 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +12 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +24 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +10 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -2
- package/documentation/doc-readme.js +1 -2
- package/documentation/doc-util/doc-query.d.ts +1 -1
- package/documentation/doc-util/doc-query.js +4 -2
- package/documentation/wiki-linter.d.ts +2 -0
- package/documentation/wiki-linter.js +7 -1
- package/documentation/wiki-query.js +28 -0
- package/linter/linter-format.d.ts +5 -1
- package/linter/linter-format.js +4 -0
- package/linter/linter-output.js +18 -16
- package/linter/linter-rules.d.ts +50 -0
- package/linter/linter-rules.js +5 -1
- package/linter/rules/notebook-cell-order.d.ts +43 -0
- package/linter/rules/notebook-cell-order.js +97 -0
- package/linter/rules/project-entry-point.d.ts +53 -0
- package/linter/rules/project-entry-point.js +62 -0
- package/linter/rules/undefined-symbol.d.ts +2 -0
- package/linter/rules/undefined-symbol.js +6 -1
- package/notebook/cell-graph.d.ts +23 -0
- package/notebook/cell-graph.js +48 -0
- package/notebook/cell-order-mermaid.d.ts +16 -0
- package/notebook/cell-order-mermaid.js +51 -0
- package/notebook/cell-order.d.ts +270 -0
- package/notebook/cell-order.js +1452 -0
- package/notebook/cell-split.d.ts +27 -0
- package/notebook/cell-split.js +99 -0
- package/package.json +1 -1
- package/project/context/flowr-analyzer-dependencies-context.d.ts +4 -0
- package/project/context/flowr-analyzer-files-context.d.ts +2 -0
- package/project/flowr-analyzer.js +5 -1
- package/project/plugins/file-plugins/files/cell-runner.d.ts +22 -0
- package/project/plugins/file-plugins/files/cell-runner.js +32 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +4 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +22 -6
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +22 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +63 -7
- package/project/plugins/file-plugins/files/flowr-rsession-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-rsession-file.js +2 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +3 -5
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +6 -0
- package/project/plugins/file-plugins/files/recorded-runs.d.ts +2 -0
- package/queries/catalog/aliases-query/aliases-query-executor.d.ts +6 -0
- package/queries/catalog/aliases-query/aliases-query-executor.js +108 -0
- package/queries/catalog/aliases-query/aliases-query-format.d.ts +21 -0
- package/queries/catalog/aliases-query/aliases-query-format.js +34 -0
- package/queries/catalog/cell-order-query/cell-order-query-format.d.ts +81 -0
- package/queries/catalog/cell-order-query/cell-order-query-format.js +82 -0
- package/queries/catalog/linter-query/linter-query-format.js +2 -1
- package/queries/query.d.ts +17 -2
- package/queries/query.js +6 -2
- package/queries/virtual-query/compound-query.d.ts +1 -1
- package/util/flowr-version.d.ts +1 -1
- package/util/flowr-version.js +2 -2
- package/util/mermaid/ast.js +4 -11
- package/util/mermaid/cfg.js +1 -2
- package/util/mermaid/dfg.d.ts +5 -0
- package/util/mermaid/dfg.js +23 -4
- package/util/mermaid/mermaid.d.ts +5 -0
- package/util/mermaid/mermaid.js +8 -0
- package/util/r-datasets.d.ts +2 -0
- package/util/r-datasets.js +3 -0
- package/util/text/playground-link.d.ts +2 -2
- package/util/text/playground-link.js +2 -2
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import type { ReadOnlyFlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
|
|
2
|
+
import type { DataflowInformation } from '../dataflow/info';
|
|
3
|
+
import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
+
import { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
5
|
+
import { type BrandedIdentifier } from '../dataflow/environments/identifier';
|
|
6
|
+
import type { DependencyInfo } from '../queries/catalog/dependencies-query/dependencies-query-format';
|
|
7
|
+
import { CellRunner } from '../project/plugins/file-plugins/files/cell-runner';
|
|
8
|
+
import { type Line, SourceRange } from '../util/range';
|
|
9
|
+
import type { FlowrFileProvider } from '../project/context/flowr-file';
|
|
10
|
+
import type { ReadonlyFlowrAnalysisProvider } from '../project/flowr-analyzer';
|
|
11
|
+
/** A code cell of a notebook as the lines of its code, `head` and `tail` being the lines of its fences or marker if it has them. */
|
|
12
|
+
export interface NotebookCell {
|
|
13
|
+
readonly from: Line;
|
|
14
|
+
readonly to: Line;
|
|
15
|
+
readonly head?: Line;
|
|
16
|
+
readonly tail?: Line;
|
|
17
|
+
/** the file the lines are in, any file of the analysis if omitted */
|
|
18
|
+
readonly file?: string;
|
|
19
|
+
/** what runs the cell, a session if omitted */
|
|
20
|
+
readonly runner?: CellRunner;
|
|
21
|
+
/** the chunk options the header of the cell sets, which override what `opts_chunk$set` set before */
|
|
22
|
+
readonly sets?: readonly string[];
|
|
23
|
+
/** the variables its chunk options read, as knitr evaluates them before the cell runs (`eval = cran`) */
|
|
24
|
+
readonly reads?: readonly string[];
|
|
25
|
+
/** knitr may not run the cell, as its `eval` is an expression (`eval = cran`), so what it removes may stay */
|
|
26
|
+
readonly maybe?: true;
|
|
27
|
+
}
|
|
28
|
+
/** Whether a name is bound to a function, to something else, or either. */
|
|
29
|
+
export declare enum SymbolKind {
|
|
30
|
+
Function = "function",
|
|
31
|
+
Value = "value",
|
|
32
|
+
Any = "any"
|
|
33
|
+
}
|
|
34
|
+
/** What a cell reads from the session or puts into it. */
|
|
35
|
+
export declare enum CellResource {
|
|
36
|
+
/** a name of the global environment */
|
|
37
|
+
Variable = "variable",
|
|
38
|
+
/** a name bound beside the global environment, as `attach` binds it: assigning the name does not replace it, nor does `rm(list = ls())` remove it */
|
|
39
|
+
Attached = "attached",
|
|
40
|
+
/** a package on the search path */
|
|
41
|
+
Package = "package",
|
|
42
|
+
/** a part of R's global state flowR tracks (an option, the random seed, the working directory, the plot, ...), without its `#` */
|
|
43
|
+
State = "state",
|
|
44
|
+
/** a file a cell writes, which another reads */
|
|
45
|
+
File = "file",
|
|
46
|
+
/** a column a cell adds to a data frame (`d$c <- 1`, `d <- mutate(d, c = 1)`), named `d$c`, which a cell reading the bare name (`lm(c ~ x, data = d)`) needs and binding `d` anew takes away */
|
|
47
|
+
Column = "column",
|
|
48
|
+
/** a state a call puts the object a name holds in (`solve(lp)`), named `lp#solved`, which a call needing it (`get.variables(lp)`) needs and binding `lp` anew takes away */
|
|
49
|
+
ObjectState = "object-state"
|
|
50
|
+
}
|
|
51
|
+
export interface CellSymbol {
|
|
52
|
+
readonly resource: CellResource;
|
|
53
|
+
readonly name: string;
|
|
54
|
+
readonly kind: SymbolKind;
|
|
55
|
+
}
|
|
56
|
+
/** The index of a code cell, counting from 0 the cells that run (so not those with `eval = FALSE`). */
|
|
57
|
+
export type CellIndex = number;
|
|
58
|
+
/** What a cell needs another cell to have run first: any one of `anyOf`, which the cells `providers` supply. */
|
|
59
|
+
export interface CellNeed {
|
|
60
|
+
/** the name the cell reads, which for a package names the function it calls */
|
|
61
|
+
readonly name: string;
|
|
62
|
+
readonly resource: CellResource;
|
|
63
|
+
readonly id: NodeId;
|
|
64
|
+
/** where the cell reads it, if the read has a place in the code */
|
|
65
|
+
readonly range?: SourceRange;
|
|
66
|
+
readonly anyOf: readonly CellSymbol[];
|
|
67
|
+
readonly providers: readonly CellIndex[];
|
|
68
|
+
/** the cell reads global state (an option, the seed, ...) another cell sets: it runs either way, but what it does depends on the order */
|
|
69
|
+
readonly soft?: true;
|
|
70
|
+
/** the cell reads the name only to change a part of it (`x[1] <- 5`), so running it again does not build on its own result */
|
|
71
|
+
readonly changes?: true;
|
|
72
|
+
}
|
|
73
|
+
/** What running a cell does to the session, in the order the cell does it. */
|
|
74
|
+
export type CellEffect = {
|
|
75
|
+
readonly binds: CellSymbol; /** where the cell binds it */
|
|
76
|
+
readonly range?: SourceRange; /** the vertex that binds it */
|
|
77
|
+
readonly id?: NodeId;
|
|
78
|
+
} | {
|
|
79
|
+
readonly removes: CellSymbol;
|
|
80
|
+
}
|
|
81
|
+
/** `rm(list = ls())` removes the names of the global environment, all but those it keeps */
|
|
82
|
+
| {
|
|
83
|
+
readonly clears: true;
|
|
84
|
+
readonly except?: readonly BrandedIdentifier[];
|
|
85
|
+
}
|
|
86
|
+
/** `load` of a file whose names flowR does not know, or `attach` of what it cannot see into, may bind any name */
|
|
87
|
+
| {
|
|
88
|
+
readonly bindsAny: CellResource.Variable | CellResource.Attached;
|
|
89
|
+
};
|
|
90
|
+
export interface CellFacts {
|
|
91
|
+
readonly cell: NotebookCell;
|
|
92
|
+
readonly needs: readonly CellNeed[];
|
|
93
|
+
/** what the cell reads before it binds it, and no other cell binds (`print(d); d <- 1`): no order of the cells helps, but a run of the cell without it fails */
|
|
94
|
+
readonly lacks: readonly CellNeed[];
|
|
95
|
+
readonly effects: readonly CellEffect[];
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* The code cells of a notebook: the chunks of R Markdown, Quarto, and Sweave, the code cells of a Jupyter notebook,
|
|
99
|
+
* the commands of an R console transcript, or the `# %%` cells of a script. A file that has none is no notebook.
|
|
100
|
+
*/
|
|
101
|
+
export declare function notebookCells(file: FlowrFileProvider | undefined): NotebookCell[];
|
|
102
|
+
/** The `# %%` cells of a script, a `# %% [markdown]` cell holding text. */
|
|
103
|
+
export declare function scriptCells(text: string): NotebookCell[];
|
|
104
|
+
/** The facts of the cells of the analyzed notebook (or of `cells` if given), derived once per analysis from its dataflow graph. */
|
|
105
|
+
export declare function analyzeNotebook(analyzer: ReadonlyFlowrAnalysisProvider, cells?: readonly NotebookCell[]): Promise<CellFacts[]>;
|
|
106
|
+
/**
|
|
107
|
+
* The files of a project as the units that run one after another, in flowR's loading order: each script or notebook as
|
|
108
|
+
* one cell of all its lines, but not a file another file sources, as it runs as part of that file. A notebook is one unit
|
|
109
|
+
* as a whole, as running a cell, then a whole file, and then another cell is no order anyone means.
|
|
110
|
+
*/
|
|
111
|
+
export declare function projectFiles(analyzer: ReadonlyFlowrAnalysisProvider, everyFile?: boolean): Promise<NotebookCell[]>;
|
|
112
|
+
/**
|
|
113
|
+
* The facts of the files of the analyzed project as {@link projectFiles}, derived once per analysis. With `everyFile`, each file
|
|
114
|
+
* is a unit of its own, also one another file sources, to show what each file reads of the others rather than how they run.
|
|
115
|
+
*/
|
|
116
|
+
export declare function analyzeProject(analyzer: ReadonlyFlowrAnalysisProvider, everyFile?: boolean): Promise<CellFacts[]>;
|
|
117
|
+
/**
|
|
118
|
+
* The file that says in which order the files of a project run, if the project has one: a file named like an entry
|
|
119
|
+
* (`main.R`, `_targets.R`, a makefile, a package's `DESCRIPTION`) in the root of the project, or an order flowR knows for sure, else `undefined`.
|
|
120
|
+
* An entry deeper down (a package in a subfolder) runs only its own part of the project.
|
|
121
|
+
*/
|
|
122
|
+
export declare function projectEntry(analyzer: ReadonlyFlowrAnalysisProvider): string | undefined;
|
|
123
|
+
/** What a symbol stands for, said in words: `dplyr` as `package dplyr`, the state `option:digits` as `option digits`, or the name itself. */
|
|
124
|
+
export declare function describeSymbol(symbol: Pick<CellSymbol, 'resource' | 'name'>): string;
|
|
125
|
+
/** What a cell needs, said in words: `mutate (package dplyr)`, `file out`, `option digits`, or the name it reads. */
|
|
126
|
+
export declare function describeNeed(need: Pick<CellNeed, 'name' | 'resource' | 'anyOf'>): string;
|
|
127
|
+
export declare const binds: (have: CellSymbol, want: CellSymbol) => boolean;
|
|
128
|
+
/** What the dependencies query found that the cells depend on: the packages they attach, the files they read, and the scripts they source. */
|
|
129
|
+
export interface CellDependencies {
|
|
130
|
+
readonly libraries: readonly DependencyInfo[];
|
|
131
|
+
readonly reads: readonly DependencyInfo[];
|
|
132
|
+
readonly sources?: readonly DependencyInfo[];
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* What each of the `cells` needs and does, read off the one dataflow graph of the whole notebook: a cell needs what it
|
|
136
|
+
* reads before it binds it itself, the packages its calls come from, the files other cells write, and the global state
|
|
137
|
+
* (options, the seed, the plot, ...) it reads.
|
|
138
|
+
*/
|
|
139
|
+
export declare function cellFacts(cells: readonly NotebookCell[], ast: NormalizedAst, df: DataflowInformation, deps: CellDependencies, ctx: ReadOnlyFlowrAnalyzerContext): CellFacts[];
|
|
140
|
+
/** A cell that lacked something when it ran, `at` being its place in the order. */
|
|
141
|
+
export interface OrderFailure {
|
|
142
|
+
readonly cell: CellIndex;
|
|
143
|
+
readonly at: number;
|
|
144
|
+
readonly missing: readonly CellNeed[];
|
|
145
|
+
}
|
|
146
|
+
/** Runs the cells in `order` in one fresh session and reports each cell that needs something the session lacks when it runs. */
|
|
147
|
+
export declare function checkOrder(facts: readonly CellFacts[], order: readonly CellIndex[]): OrderFailure[];
|
|
148
|
+
/**
|
|
149
|
+
* Every order in which the cells run without missing anything, each running as many cells as it can, cells earlier in the
|
|
150
|
+
* notebook first. An order that ends before all cells ran left the others unable to run (e.g., after an `rm`).
|
|
151
|
+
*/
|
|
152
|
+
export declare function workingOrders(facts: readonly CellFacts[]): Generator<CellIndex[]>;
|
|
153
|
+
/** The cells that may have to run again once the `changed` cells ran again or changed, as they (transitively) read what these provide. */
|
|
154
|
+
export declare function affectedCells(facts: readonly CellFacts[], changed: readonly CellIndex[]): CellIndex[];
|
|
155
|
+
/** What makes the result of a notebook depend on how often and in which order its cells ran, beyond whether they run. */
|
|
156
|
+
export declare enum HazardKind {
|
|
157
|
+
/** the cell reads what it binds itself (`x <- x + 1`), so each time it runs again it builds on its own last result */
|
|
158
|
+
Accumulates = "accumulates",
|
|
159
|
+
/** several cells bind what the cell reads, each without reading it, so the cell gets the value of whichever ran last */
|
|
160
|
+
Competes = "competes",
|
|
161
|
+
/** the cell draws on a plot another cell opens, so each time it runs again it draws once more */
|
|
162
|
+
Draws = "draws"
|
|
163
|
+
}
|
|
164
|
+
export interface OrderHazard {
|
|
165
|
+
readonly kind: HazardKind;
|
|
166
|
+
readonly cell: CellIndex;
|
|
167
|
+
readonly need: CellNeed;
|
|
168
|
+
/** for {@link HazardKind.Accumulates} the cells that bind the name first, for {@link HazardKind.Competes} those binding it anew */
|
|
169
|
+
readonly providers: readonly CellIndex[];
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* The reads of the cells whose result depends on more than whether the cells run: a cell building on its own last result,
|
|
173
|
+
* which gives another result each time it runs again, and a read of a name several cells bind anew, which gets the value of
|
|
174
|
+
* whichever of them ran last.
|
|
175
|
+
*/
|
|
176
|
+
export declare function orderHazards(facts: readonly CellFacts[]): OrderHazard[];
|
|
177
|
+
/** The first order in which every cell runs, preferring the order of the notebook, if one of the first `tries` orders is one. */
|
|
178
|
+
export declare function firstWorkingOrder(facts: readonly CellFacts[], tries?: number): CellIndex[] | undefined;
|
|
179
|
+
/** How to move the cells of a notebook so that it runs top to bottom: the lines `from` to `to` become `text`. */
|
|
180
|
+
export interface Reordering {
|
|
181
|
+
readonly from: Line;
|
|
182
|
+
readonly to: Line;
|
|
183
|
+
readonly text: string;
|
|
184
|
+
/** the order the cells run in afterwards, top to bottom */
|
|
185
|
+
readonly order: readonly CellIndex[];
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Moves the cells of `rows` so that the notebook runs top to bottom, or `undefined` if it does already or no order of
|
|
189
|
+
* the first `tries` does. Only cells with fences or markers move, as text. With `withText`, the text above a cell (up
|
|
190
|
+
* to the cell before it) moves along with it, inline code in it included, else the text stays where it is. Either
|
|
191
|
+
* way, the inline code of the text must still find what it reads in the cells above it.
|
|
192
|
+
*/
|
|
193
|
+
export declare function reorderCells(rows: readonly string[], facts: readonly CellFacts[], withText?: boolean, tries?: number): Reordering | undefined;
|
|
194
|
+
/** What the runs of a session mean for a cell that ran, in the order they are checked. */
|
|
195
|
+
export declare enum RunState {
|
|
196
|
+
/** its code changed since it ran, so its run says nothing about the code as it is now */
|
|
197
|
+
Edited = "edited",
|
|
198
|
+
/** when it last ran, something it needs was missing, see {@link CellRunState#missing} */
|
|
199
|
+
Missing = "missing",
|
|
200
|
+
/** it used what only a cell below provides, which running the notebook top to bottom does not reproduce */
|
|
201
|
+
OutOfOrder = "out of order",
|
|
202
|
+
/** it builds on its own last result and ran again since a cell it reads first bound it, see {@link CellRunState#because} */
|
|
203
|
+
Repeated = "repeated",
|
|
204
|
+
/** a cell it reads changed, ran again, or is stale itself since it ran, see {@link CellRunState#because} */
|
|
205
|
+
Stale = "stale",
|
|
206
|
+
UpToDate = "up to date"
|
|
207
|
+
}
|
|
208
|
+
export interface CellRunState {
|
|
209
|
+
readonly cell: CellIndex;
|
|
210
|
+
readonly state: RunState;
|
|
211
|
+
/** for {@link RunState.Missing}: what the cell lacked when it last ran */
|
|
212
|
+
readonly missing?: readonly CellNeed[];
|
|
213
|
+
/** for {@link RunState.OutOfOrder}: what it used of a cell below */
|
|
214
|
+
readonly below?: CellNeed;
|
|
215
|
+
/** for {@link RunState.Stale}: the cell it reads that changed, ran again, or is stale, for {@link RunState.Repeated}: the cell to run before it */
|
|
216
|
+
readonly because?: CellIndex;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* What the `runs` of a session (the cells in the order they ran, a cell as often as it ran) mean for each cell that ran.
|
|
220
|
+
* `edited` are the cells whose code changed since they last ran.
|
|
221
|
+
*/
|
|
222
|
+
export declare function runStates(facts: readonly CellFacts[], runs: readonly CellIndex[], edited?: ReadonlySet<CellIndex>): CellRunState[];
|
|
223
|
+
/** What to call a cell (or a file of a project) in a message, by its index: `cell 3` by default, `cell 3 / plot` in the playground, `a.R` for a file. */
|
|
224
|
+
export type CellNamer = (cell: CellIndex) => string;
|
|
225
|
+
/** A run state in words: a short label, the reason behind it, and whether the run went wrong rather than only being out of date. */
|
|
226
|
+
export interface RunStateText {
|
|
227
|
+
readonly label: string;
|
|
228
|
+
readonly reason: string;
|
|
229
|
+
readonly issue: boolean;
|
|
230
|
+
}
|
|
231
|
+
/** The `states` of {@link runStates} in words, for each cell that is not up to date. */
|
|
232
|
+
export declare function describeRunStates(facts: readonly CellFacts[], states: readonly CellRunState[], name?: CellNamer): Map<CellIndex, RunStateText>;
|
|
233
|
+
/** What a cell failing in an order lacks and which cells provide it, `undefined` if it only reads global state another cell sets. */
|
|
234
|
+
export declare function describeFailure(failure: OrderFailure, name?: CellNamer): string | undefined;
|
|
235
|
+
/** A hazard of {@link orderHazards} in words: what the cell reads, and what to run before it. */
|
|
236
|
+
export declare function describeHazard(hazard: OrderHazard, name?: CellNamer): string;
|
|
237
|
+
/** A cell that reads what others provide: what it reads, in words, and the cells it reads it from. */
|
|
238
|
+
export interface CellLink {
|
|
239
|
+
readonly cell: CellIndex;
|
|
240
|
+
readonly reads: readonly string[];
|
|
241
|
+
readonly from: readonly CellIndex[];
|
|
242
|
+
}
|
|
243
|
+
/** For each cell that reads what others provide: what and from which, without the global state it reads. */
|
|
244
|
+
export declare function cellLinks(facts: readonly CellFacts[]): CellLink[];
|
|
245
|
+
/** The {@link cellLinks} in words, as `cell 2 reads x from cell 1`, or `b.R reads x from a.R` with a namer for files. */
|
|
246
|
+
export declare function describeLinks(facts: readonly CellFacts[], name?: CellNamer): string[];
|
|
247
|
+
/**
|
|
248
|
+
* Helper object for the cells of a notebook: which cells there are, what each needs of the others, the orders they run in,
|
|
249
|
+
* what reruns and edits mean for them, and all of this in words. See {@link CellGraph} for the cells as a dataflow graph.
|
|
250
|
+
* @helper project
|
|
251
|
+
*/
|
|
252
|
+
export declare const CellOrder: {
|
|
253
|
+
readonly name: "CellOrder";
|
|
254
|
+
readonly cells: typeof notebookCells;
|
|
255
|
+
readonly analyze: typeof analyzeNotebook;
|
|
256
|
+
readonly check: typeof checkOrder;
|
|
257
|
+
readonly orders: typeof workingOrders;
|
|
258
|
+
readonly firstOrder: typeof firstWorkingOrder;
|
|
259
|
+
readonly affected: typeof affectedCells;
|
|
260
|
+
readonly links: typeof cellLinks;
|
|
261
|
+
readonly hazards: typeof orderHazards;
|
|
262
|
+
readonly runStates: typeof runStates;
|
|
263
|
+
readonly reorder: typeof reorderCells;
|
|
264
|
+
readonly describeSymbol: typeof describeSymbol;
|
|
265
|
+
readonly describeNeed: typeof describeNeed;
|
|
266
|
+
readonly describeFailure: typeof describeFailure;
|
|
267
|
+
readonly describeHazard: typeof describeHazard;
|
|
268
|
+
readonly describeLinks: typeof describeLinks;
|
|
269
|
+
readonly describeRunStates: typeof describeRunStates;
|
|
270
|
+
};
|