@altnovatrail/canvas 0.3.39 → 0.3.41
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 +1 -1
- package/lib/core/boxes.d.ts +7 -7
- package/lib/core/boxes.js +10 -10
- package/lib/core/clock.d.ts +5 -5
- package/lib/core/clock.js +5 -5
- package/lib/core/crop.d.ts +13 -13
- package/lib/core/crop.js +10 -10
- package/lib/core/eraser.d.ts +6 -6
- package/lib/core/eraser.js +6 -6
- package/lib/core/example.d.ts +6 -6
- package/lib/core/example.js +9 -9
- package/lib/core/fields.d.ts +1 -1
- package/lib/core/fields.js +1 -1
- package/lib/core/geometry.d.ts +6 -5
- package/lib/core/geometry.js +8 -6
- package/lib/core/grid.d.ts +3 -3
- package/lib/core/grid.js +3 -3
- package/lib/core/groups.d.ts +14 -14
- package/lib/core/groups.js +6 -6
- package/lib/core/hands.d.ts +19 -18
- package/lib/core/hands.js +16 -15
- package/lib/core/history.d.ts +10 -10
- package/lib/core/history.js +6 -6
- package/lib/core/index.js +8 -9
- package/lib/core/ink.js +3 -3
- package/lib/core/manifest.d.ts +3 -3
- package/lib/core/manifest.js +6 -6
- package/lib/core/marks.d.ts +39 -39
- package/lib/core/marks.js +35 -35
- package/lib/core/notation.d.ts +5 -5
- package/lib/core/outline.d.ts +3 -3
- package/lib/core/outline.js +6 -6
- package/lib/core/page.d.ts +7 -7
- package/lib/core/page.js +10 -10
- package/lib/core/png.d.ts +3 -3
- package/lib/core/png.js +3 -3
- package/lib/core/raster.d.ts +3 -3
- package/lib/core/raster.js +3 -3
- package/lib/core/recorder.d.ts +8 -8
- package/lib/core/recorder.js +8 -8
- package/lib/core/screen.d.ts +2 -2
- package/lib/core/screen.js +1 -1
- package/lib/core/sets.d.ts +1 -1
- package/lib/core/sets.js +1 -1
- package/lib/core/sheet.d.ts +5 -5
- package/lib/core/sheet.js +5 -5
- package/lib/core/submission.d.ts +24 -24
- package/lib/core/submission.js +21 -21
- package/lib/core/task.d.ts +17 -16
- package/lib/core/task.js +14 -13
- package/lib/core/tracing.d.ts +19 -19
- package/lib/core/tracing.js +19 -19
- package/lib/core/widths.d.ts +2 -2
- package/lib/core/widths.js +5 -5
- package/lib/core/work.d.ts +19 -19
- package/lib/core/work.js +22 -22
- package/lib/core/zoom.d.ts +5 -5
- package/lib/core/zoom.js +5 -5
- package/lib/element/icons.d.ts +1 -1
- package/lib/element/icons.js +2 -2
- package/lib/element/index.d.ts +87 -87
- package/lib/element/index.js +286 -283
- package/lib/element/labels.d.ts +17 -17
- package/lib/element/labels.js +7 -8
- package/lib/element/notation.js +1 -1
- package/lib/element/parts.d.ts +2 -2
- package/lib/element/parts.js +6 -6
- package/lib/element/pictures.js +1 -1
- package/lib/element/probe.d.ts +2 -2
- package/lib/element/probe.js +3 -3
- package/lib/element/session.js +2 -2
- package/lib/element/statement.d.ts +2 -2
- package/lib/element/statement.js +6 -6
- package/lib/element/tools.d.ts +17 -18
- package/lib/element/tools.js +30 -29
- package/lib/element/tracing.js +8 -8
- package/package.json +3 -3
package/lib/element/index.d.ts
CHANGED
|
@@ -6,12 +6,12 @@ import { type Manifest } from "../core/manifest.js";
|
|
|
6
6
|
import { type Marks } from "../core/marks.js";
|
|
7
7
|
import { type Task, type Tool } from "../core/task.js";
|
|
8
8
|
/**
|
|
9
|
-
* The types of the contract of canvas and app are spec's
|
|
9
|
+
* The types of the contract of canvas and app are spec's: the element as
|
|
10
10
|
* CanvasElement has it, what its events tell and the work it gives for checking, here, and the data
|
|
11
11
|
* — the history of writing, the context of a submission, the filled slots and the state of a demo
|
|
12
12
|
* — through the DOM-free part. The entry point gives them under spec's names, the same types, the
|
|
13
13
|
* media and the tutor's marks too. The crop and a task with its temporary tools are the element's
|
|
14
|
-
* own
|
|
14
|
+
* own.
|
|
15
15
|
*/
|
|
16
16
|
export type { Box, CanvasElement, CanvasEventMap, DemoChangeEvent, ExportedCell, ExportedPaper, ExportedSheet, ExportedWork, ExportedWorkbook, GridChange, GridChangeEvent, HistoryChange, HistoryChangeEvent, Media, PaperGrid, PaperTask, ToolChange, ToolChangeEvent, TracingChangeEvent, TracingReadEvent, TracingReading, TracingState, } from "@altnovatrail/spec/canvas";
|
|
17
17
|
export type { Filled, Filling } from "../core/boxes.js";
|
|
@@ -27,46 +27,46 @@ export type { Canvas, Task, Tool } from "../core/task.js";
|
|
|
27
27
|
/** The name the element is registered under. */
|
|
28
28
|
export declare const TAG = "novatrail-canvas";
|
|
29
29
|
/**
|
|
30
|
-
* The element `<novatrail-canvas>`: the contract's `CanvasElement
|
|
30
|
+
* The element `<novatrail-canvas>`: the contract's `CanvasElement`, and beyond it the
|
|
31
31
|
* commands undo and clear, which the contract does not name.
|
|
32
32
|
*/
|
|
33
33
|
export declare class NovatrailCanvas extends HTMLElement implements CanvasElement {
|
|
34
34
|
#private;
|
|
35
35
|
constructor();
|
|
36
|
-
/** The element follows its own `lang`: its buttons are labelled in it
|
|
36
|
+
/** The element follows its own `lang`: its buttons are labelled in it. */
|
|
37
37
|
static readonly observedAttributes: string[];
|
|
38
38
|
/**
|
|
39
|
-
* What a press of the primary button does: "pen" writes, as the element starts, "eraser" erases
|
|
40
|
-
*
|
|
39
|
+
* What a press of the primary button does: "pen" writes, as the element starts, "eraser" erases,
|
|
40
|
+
* and "hand" moves the sheet, under any pointer. The learner switches it with the
|
|
41
41
|
* element's own buttons, which say a choice of theirs with a `toolchange`, and the consumer may
|
|
42
|
-
* set it too, which says nothing
|
|
42
|
+
* set it too, which says nothing. A press under way goes on as it began. A pen's eraser
|
|
43
43
|
* erases whatever the tool but the hand. A task without the eraser has none of it: "eraser" is a
|
|
44
44
|
* TypeError then, and a new task without it puts the pen back. Every sheet the learner writes on
|
|
45
|
-
* has the hand. A worked example has the pen alone, which writes nothing on its sheet
|
|
45
|
+
* has the hand. A worked example has the pen alone, which writes nothing on its sheet.
|
|
46
46
|
*/
|
|
47
47
|
get tool(): Tool;
|
|
48
48
|
set tool(tool: Tool);
|
|
49
49
|
/**
|
|
50
|
-
* The open view of the task, of the module format 0.4
|
|
51
|
-
* element shows above the page
|
|
52
|
-
*
|
|
53
|
-
* items. A workbook's items are its lines, which the template shows, laid out on the page
|
|
54
|
-
*
|
|
50
|
+
* The open view of the task, of the module format 0.4: its ID, its statement, which the
|
|
51
|
+
* element shows above the page, what the statement gives and asks, which app shows, its
|
|
52
|
+
* canvas — the kind, the sheet's grid and the tools the task allows — and its
|
|
53
|
+
* items. A workbook's items are its lines, which the template shows, laid out on the page. The
|
|
54
|
+
* type is spec's, with the element's own tools. A task the schema
|
|
55
55
|
* refuses is a TypeError that names the field, a field the open view has not among it, and so are
|
|
56
|
-
* a workbook whose lines do not fit, at the first item that does not
|
|
56
|
+
* a workbook whose lines do not fit, at the first item that does not, and an answer slot in
|
|
57
57
|
* a zone; the sheet passes over a choice and an item's text, which app shows. Another task of the
|
|
58
58
|
* same layer, tools and statement changes nothing, and any other changes the template alone, of
|
|
59
|
-
* either kind: the work stays, for the next task is a new element
|
|
59
|
+
* either kind: the work stays, for the next task is a new element. A task without the
|
|
60
60
|
* eraser puts the pen back, with no event. While a worked example is shown a task is a TypeError,
|
|
61
|
-
* and `undefined` changes nothing: the element shows one or the other
|
|
61
|
+
* and `undefined` changes nothing: the element shows one or the other.
|
|
62
62
|
*/
|
|
63
63
|
get task(): Task | undefined;
|
|
64
64
|
set task(task: Task | undefined);
|
|
65
65
|
/**
|
|
66
|
-
* A lesson's worked example
|
|
67
|
-
* module format 0.4 — its statement, which the element shows above the sheet as a task's
|
|
66
|
+
* A lesson's worked example: the open view of a segment `worked_example` of the
|
|
67
|
+
* module format 0.4 — its statement, which the element shows above the sheet as a task's,
|
|
68
68
|
* the grid of its sheet or the lines of its workbook, and the parts of the author's demo, which
|
|
69
|
-
* on a workbook fill the lines' boxes with their values
|
|
69
|
+
* on a workbook fill the lines' boxes with their values. The type is spec's.
|
|
70
70
|
* The element shows a task or a worked example, not both: an example while a task is given, while
|
|
71
71
|
* the sheet has a history of writing, or while a stroke or an erasing is under way, is a
|
|
72
72
|
* TypeError, and so is one the schema refuses, at its field. `undefined` takes the example off,
|
|
@@ -75,9 +75,9 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
75
75
|
*
|
|
76
76
|
* On a worked example's sheet the learner does not write: the canvas takes no input, and a finger
|
|
77
77
|
* or a pen there scrolls the sheet as the browser scrolls the statement. It has no bar: its row
|
|
78
|
-
* holds Next and Demo, and its region is named a worked example's. `task`, `history` other than
|
|
79
|
-
* `marks` are TypeErrors, and so is an eraser: the tool is the pen alone, and
|
|
80
|
-
* `filled` give null. The next segment of a lesson is a new element
|
|
78
|
+
* holds Next and Demo, and its region is named a worked example's. `task`, `history` other than
|
|
79
|
+
* the empty one and `marks` are TypeErrors, and so is an eraser: the tool is the pen alone, and
|
|
80
|
+
* `exportWork()` and `filled` give null. The next segment of a lesson is a new element.
|
|
81
81
|
*
|
|
82
82
|
* The parts of the demo the learner opens one at a time with the row's Next, into a list between
|
|
83
83
|
* the statement and the sheet, and hides and shows whole with Demo; `demoState` tells how far
|
|
@@ -86,33 +86,34 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
86
86
|
get workedExample(): WorkedExample | undefined;
|
|
87
87
|
set workedExample(example: WorkedExample | undefined);
|
|
88
88
|
/**
|
|
89
|
-
* A task from the learner's paper
|
|
89
|
+
* A task from the learner's paper: `statement`, the task's crop as app cut it, a
|
|
90
90
|
* Blob of a JPEG or a PNG. The element shows it in place of a task and of a worked example: a
|
|
91
91
|
* dotted sheet with no statement, the pen and the eraser, and the crop over it as tracing paper,
|
|
92
92
|
* at the element's own place for it, shown, which `tracing` tells. While a task or an example is
|
|
93
93
|
* shown it is a TypeError, and so is what is not such a task. Another task from paper, of
|
|
94
94
|
* another crop, lays its crop at the start again, and the history stays: the next task is a new
|
|
95
|
-
* element
|
|
96
|
-
* history has strokes on the tracing paper, a TypeError. Either drops a stroke or an erasing
|
|
97
|
-
* way on the tracing paper, as a new history drops the one under the pen. The crop's
|
|
98
|
-
* read as it comes; till then the paper has its largest size.
|
|
95
|
+
* element; one of the same crop changes nothing. `undefined` takes it off, but not while the
|
|
96
|
+
* history has strokes on the tracing paper, a TypeError. Either drops a stroke or an erasing
|
|
97
|
+
* under way on the tracing paper, as a new history drops the one under the pen. The crop's
|
|
98
|
+
* picture is read as it comes; till then the paper has its largest size.
|
|
99
99
|
*/
|
|
100
100
|
get paper(): PaperTask | undefined;
|
|
101
101
|
set paper(paper: PaperTask | undefined);
|
|
102
102
|
/**
|
|
103
103
|
* Where the tracing paper of the task from paper lies on the sheet, its top left corner in sheet
|
|
104
|
-
* units, and whether it is hidden
|
|
105
|
-
* `undefined` without a task from paper. The learner moves it by its grip and hides or shows it
|
|
106
|
-
* the button atop the tools, which a `tracingchange` tells; the consumer keeps it and gives it
|
|
107
|
-
* back, which tells nothing. Given before the task from paper it is a TypeError, and so is a
|
|
108
|
-
* that is not one, or one that puts the paper wholly off the sheet; `undefined` changes
|
|
109
|
-
* Till the crop's picture is read the paper has its largest size: a state that puts the
|
|
110
|
-
* its real size wholly off the sheet then moves to the nearest place wholly on it, with
|
|
104
|
+
* units, and whether it is hidden: frozen, and the same object until it changes;
|
|
105
|
+
* `undefined` without a task from paper. The learner moves it by its grip and hides or shows it
|
|
106
|
+
* by the button atop the tools, which a `tracingchange` tells; the consumer keeps it and gives it
|
|
107
|
+
* back, which tells nothing. Given before the task from paper it is a TypeError, and so is a
|
|
108
|
+
* state that is not one, or one that puts the paper wholly off the sheet; `undefined` changes
|
|
109
|
+
* nothing. Till the crop's picture is read the paper has its largest size: a state that puts the
|
|
110
|
+
* paper of its real size wholly off the sheet then moves to the nearest place wholly on it, with
|
|
111
|
+
* no event.
|
|
111
112
|
*/
|
|
112
113
|
get tracing(): TracingState | undefined;
|
|
113
114
|
set tracing(state: TracingState | undefined);
|
|
114
115
|
/**
|
|
115
|
-
* The reading of the task from paper's statement in clean print
|
|
116
|
+
* The reading of the task from paper's statement in clean print: `undefined` offers no
|
|
116
117
|
* "Recognise"; `"ready"` offers it, and its press sends a `tracingread`; `"busy"` waits; `"done"`
|
|
117
118
|
* holds the statements, which take the crop's place for the learner who asked, till "Original".
|
|
118
119
|
* Frozen; given without a task from paper, or not a reading, it is a TypeError.
|
|
@@ -120,7 +121,7 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
120
121
|
get reading(): TracingReading | undefined;
|
|
121
122
|
set reading(reading: TracingReading | undefined);
|
|
122
123
|
/**
|
|
123
|
-
* How far the learner has gone through the worked example's demo
|
|
124
|
+
* How far the learner has gone through the worked example's demo: `opened`, how many of
|
|
124
125
|
* its parts are open, from the first, and `hidden`, whether the whole demo is hidden — frozen,
|
|
125
126
|
* and the same object until it changes. A new example starts at `{ opened: 0, hidden: false }`,
|
|
126
127
|
* and without one it is `undefined`. The learner changes it with the row's Next and Demo, which
|
|
@@ -134,8 +135,8 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
134
135
|
get demoState(): DemoState | undefined;
|
|
135
136
|
set demoState(state: DemoState | undefined);
|
|
136
137
|
/**
|
|
137
|
-
* The open view of the module's manifest
|
|
138
|
-
* module format — "0.4", or the manifest is a TypeError
|
|
138
|
+
* The open view of the module's manifest, of which the element reads the version of the
|
|
139
|
+
* module format — "0.4", or the manifest is a TypeError — the height of a digit on the
|
|
139
140
|
* crop for checking, `canvas.digit_height`, 24 px unless given, and the explanation language, the
|
|
140
141
|
* statement's and a workbook's lines'. Without a manifest the digits are 24 px, and the statement
|
|
141
142
|
* and the lines are in the element's own `lang`. The rest of it the element passes over, but for
|
|
@@ -143,14 +144,14 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
143
144
|
* cannot read is a TypeError that names the field, and the element stays as it was; the same
|
|
144
145
|
* object given again is read again, for the consumer may have changed it. The task and the
|
|
145
146
|
* manifest are each the consumer's to give, in either order: `exportWork()` takes the height
|
|
146
|
-
* when it is called
|
|
147
|
+
* when it is called.
|
|
147
148
|
*/
|
|
148
149
|
get manifest(): Manifest | undefined;
|
|
149
150
|
set manifest(manifest: Manifest | undefined);
|
|
150
151
|
/**
|
|
151
|
-
* What gives the files of the pictures, by their references, as the contract has it
|
|
152
|
-
*
|
|
153
|
-
* its demo, which it asks for as the example comes, before the learner opens them
|
|
152
|
+
* What gives the files of the pictures, by their references, as the contract has it: a
|
|
153
|
+
* task's statement's, and a worked example's — its statement's and every part's of
|
|
154
|
+
* its demo, which it asks for as the example comes, before the learner opens them. A
|
|
154
155
|
* reference is asked for once, whichever pictures show it, and its file stays while the task or
|
|
155
156
|
* the example names it. Until a picture's file comes, or if it never does, its frame shows what
|
|
156
157
|
* it shows in words. A new function serves the references that have no file yet, and stops no
|
|
@@ -159,7 +160,7 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
159
160
|
get media(): Media | undefined;
|
|
160
161
|
set media(media: Media | undefined);
|
|
161
162
|
/**
|
|
162
|
-
* The grid of the task from paper's sheet
|
|
163
|
+
* The grid of the task from paper's sheet: `undefined` without a task from paper, and
|
|
163
164
|
* "dots" as one comes. The learner turns it by the element's button, which a `gridchange`
|
|
164
165
|
* tells; the consumer keeps it and gives it back, which tells nothing. A grid given before the
|
|
165
166
|
* task from paper is a TypeError, and so is one not of `PaperGrid`; `undefined` changes nothing.
|
|
@@ -167,7 +168,7 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
167
168
|
get grid(): PaperGrid | undefined;
|
|
168
169
|
set grid(grid: PaperGrid | undefined);
|
|
169
170
|
/**
|
|
170
|
-
* The history of writing
|
|
171
|
+
* The history of writing: every stroke, erasing, clearing and undo on the sheet, in the
|
|
171
172
|
* order they landed, at the sheet's time — frozen, and the same array until the next action. The
|
|
172
173
|
* consumer keeps it, adding what `historychange` tells, and gives it back to open the sheet as it
|
|
173
174
|
* was: the strokes, and the actions undo takes back.
|
|
@@ -181,95 +182,94 @@ export declare class NovatrailCanvas extends HTMLElement implements CanvasElemen
|
|
|
181
182
|
* event, the next stroke takes the next ID, and the tutor's marks go back on the strokes, or off,
|
|
182
183
|
* if the history has not their strokes. A history that is where the sheet's began loses what came
|
|
183
184
|
* after, and says so in the console. The task and the history are each the consumer's to give, in
|
|
184
|
-
* either order. A worked example's sheet has the empty history alone: any other is a TypeError
|
|
185
|
-
* (R42).
|
|
185
|
+
* either order. A worked example's sheet has the empty history alone: any other is a TypeError.
|
|
186
186
|
*/
|
|
187
187
|
get history(): readonly HistoryEvent[];
|
|
188
188
|
set history(history: readonly HistoryEvent[] | undefined);
|
|
189
189
|
/**
|
|
190
190
|
* Which answer slots the learner's strokes fill, per item, per slot, in the task's order, by the
|
|
191
191
|
* strokes `exportWork()` would take — not the stroke under way, but those under an eraser not
|
|
192
|
-
* yet lifted. A workbook's boxes, each whether it holds one
|
|
193
|
-
* or in none, by the rule
|
|
194
|
-
* on it or the whole sheet, whether the sheet holds one
|
|
192
|
+
* yet lifted. A workbook's boxes, each whether it holds one: a stroke is in one box
|
|
193
|
+
* or in none, by the boxes' rule, and what is in none is the draft. A sheet's one answer anywhere
|
|
194
|
+
* on it or the whole sheet, whether the sheet holds one. `null` for a sheet of choices,
|
|
195
195
|
* whose options app marks, for a sheet with no task, and for a worked example. Frozen, and the
|
|
196
196
|
* same array until a slot changes. An action on the sheet changes it before its
|
|
197
197
|
* `historychange`, and a task or a history given changes it with no event.
|
|
198
198
|
*/
|
|
199
199
|
get filled(): Filled | null;
|
|
200
200
|
/**
|
|
201
|
-
* The tutor's marks of one submission, with the context the element gave with its work
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
*
|
|
205
|
-
*
|
|
206
|
-
*
|
|
207
|
-
*
|
|
208
|
-
*
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
212
|
-
*
|
|
213
|
-
*
|
|
214
|
-
*
|
|
201
|
+
* The tutor's marks of one submission, with the context the element gave with its work: each a
|
|
202
|
+
* frame where a group of strokes is, or a box on the crop the model saw, and on a workbook where
|
|
203
|
+
* an answer cell is, by its item and its slot. A mark holds on to the strokes the model saw there
|
|
204
|
+
* and is drawn around those of them the sheet shows, as they are now — a cell's around its box
|
|
205
|
+
* too: new strokes do not move it, and when all of them are erased it is gone, till undo brings
|
|
206
|
+
* them back. A box of a workbook that was empty is framed alone. A box that comes near no stroke,
|
|
207
|
+
* and a cell on a sheet, which takes no zones, have no frame: the question is asked without one.
|
|
208
|
+
* The type is spec's. A submission goes back to a sheet whose history holds its strokes, as its
|
|
209
|
+
* digest tells, and a workbook's to a page of its boxes: one of other strokes or other boxes is a
|
|
210
|
+
* TypeError, and so are marks given before the task and the history they hold on to, and marks
|
|
211
|
+
* that are not marks. A new history, and a new page, put the marks back on their strokes, or take
|
|
212
|
+
* them off. `undefined` takes the marks off. Every value is checked as it comes, and marks equal
|
|
213
|
+
* to those shown write nothing. A worked example's sheet has nothing to mark: marks are a
|
|
214
|
+
* TypeError there.
|
|
215
215
|
*/
|
|
216
216
|
get marks(): Marks | undefined;
|
|
217
217
|
set marks(marks: Marks | undefined);
|
|
218
|
-
/** The element moved into another document: its root adopts that document's sheet
|
|
218
|
+
/** The element moved into another document: its root adopts that document's sheet. */
|
|
219
219
|
adoptedCallback(): void;
|
|
220
220
|
connectedCallback(): void;
|
|
221
221
|
/**
|
|
222
222
|
* The element's `lang` came, changed or went: its buttons and a workbook's boxes are labelled in
|
|
223
|
-
* it, or in English for a language their labels are not in, and for none
|
|
223
|
+
* it, or in English for a language their labels are not in, and for none. Or
|
|
224
224
|
* `tools-hidden` did: while the element has it, the bar is out of sight and of the accessibility
|
|
225
|
-
* tree, as `app` hides it on a phone under its tutor's sheet
|
|
225
|
+
* tree, as `app` hides it on a phone under its tutor's sheet. An attribute the
|
|
226
226
|
* element had before it was defined comes here just after the constructor, which reads no
|
|
227
227
|
* attribute.
|
|
228
228
|
*/
|
|
229
229
|
attributeChangedCallback(name: string): void;
|
|
230
230
|
/**
|
|
231
231
|
* Takes back the last action on the sheet — the last stroke written, the last erasing, or the
|
|
232
|
-
* clearing — and says whether there was one
|
|
233
|
-
*
|
|
232
|
+
* clearing — and says whether there was one, with a `historychange` if there was.
|
|
233
|
+
* The element's Undo button calls it, and so may the consumer. A stroke under way
|
|
234
234
|
* stays: it lands when it ends. So does an erasing: what it came near leaves the sheet when it
|
|
235
235
|
* lifts, if it is on the sheet then.
|
|
236
236
|
*/
|
|
237
237
|
undo(): boolean;
|
|
238
238
|
/**
|
|
239
239
|
* Takes every stroke off the sheet, an action that undo takes back, and says whether there were
|
|
240
|
-
* any
|
|
241
|
-
* so may the consumer
|
|
240
|
+
* any, with a `historychange` if there were. The element's Clear button calls it, and
|
|
241
|
+
* so may the consumer. A stroke under way stays: it lands when it ends.
|
|
242
242
|
*/
|
|
243
243
|
clear(): boolean;
|
|
244
244
|
/**
|
|
245
|
-
* The work for checking
|
|
246
|
-
* digit the manifest asks for
|
|
245
|
+
* The work for checking, when the consumer asks for it, at Check, at the height of a
|
|
246
|
+
* digit the manifest asks for. On a sheet it is the crop of the strokes the sheet
|
|
247
247
|
* shows, its PNG, and the context of the submission — the crop's numbers, the groups and their
|
|
248
|
-
* digest
|
|
249
|
-
* its item and its slot, and the context — the table «box → stroke IDs» and its digest
|
|
250
|
-
*
|
|
251
|
-
* places to be checked
|
|
248
|
+
* digest. On a workbook it is the crop of each filled box, by its strokes alone, with
|
|
249
|
+
* its item and its slot, and the context — the table «box → stroke IDs» and its digest; the
|
|
250
|
+
* draft goes nowhere. The consumer keeps the context, sends only the PNGs and their
|
|
251
|
+
* places to be checked, and gives the context back with the tutor's marks. It is the
|
|
252
252
|
* sheet as it is when this is called: a stroke under way is not on it yet, while the strokes
|
|
253
253
|
* under an eraser not yet lifted still are, as `filled` has them. A sheet without strokes, and a
|
|
254
254
|
* workbook with no box filled, have no work to check, and the promise gives null (H3); so has a
|
|
255
|
-
* worked example, whose sheet the learner does not write on
|
|
255
|
+
* worked example, whose sheet the learner does not write on.
|
|
256
256
|
*/
|
|
257
257
|
exportWork(): Promise<ExportedWork | null>;
|
|
258
258
|
/**
|
|
259
259
|
* The picture of the work, for the `picture` of a stored work that app puts on the server, a
|
|
260
|
-
* method of the agreement with app
|
|
260
|
+
* method of the agreement with app: the PNG of the strokes the surface shows,
|
|
261
261
|
* with no condition — the sheet's page, or the workbook's whole page with its draft, and the ink
|
|
262
|
-
* past the page, right and down, with the tracing paper where it lies
|
|
262
|
+
* past the page, right and down, with the tracing paper where it lies: one pixel a unit,
|
|
263
263
|
* 1000 × 1400 for the page alone, and scaled down past the page to hold no more pixels than it,
|
|
264
264
|
* its size in its PNG's header —, whatever is filled and whether the work was sent to be checked
|
|
265
|
-
* or not; an empty surface, and a worked example's, is white. The strokes are those
|
|
266
|
-
* the history has them: not the stroke under way, but those under an
|
|
267
|
-
* is the outline the screen fills, black on white with no theme and
|
|
268
|
-
* paper the strokes of both layers, the tracing paper's where it
|
|
269
|
-
* crop's picture laid in grey and multiplied
|
|
270
|
-
*
|
|
271
|
-
*
|
|
272
|
-
*
|
|
265
|
+
* or not; an empty surface, and a worked example's, is white. The strokes are those
|
|
266
|
+
* `exportWork()` takes, as the history has them: not the stroke under way, but those under an
|
|
267
|
+
* eraser not yet lifted. Each is the outline the screen fills, black on white with no theme and
|
|
268
|
+
* no template — on a task from paper the strokes of both layers, the tracing paper's where it
|
|
269
|
+
* lies, hidden or not, with the crop's picture laid in grey and multiplied —, and the pixels go
|
|
270
|
+
* through the crop's encoder, grey a byte each: so the picture looks as the sheet does, and holds
|
|
271
|
+
* at most 1,576,640 bytes, for the encoder spends at most 9 bits on a byte of a row, under the 4
|
|
272
|
+
* MiB of a stored work.
|
|
273
273
|
*/
|
|
274
274
|
exportPicture(): Promise<Blob>;
|
|
275
275
|
disconnectedCallback(): void;
|