@beff/aula 0.8.2 → 0.9.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.
Files changed (65) hide show
  1. package/dist/generated/aula.core5.wasm +0 -0
  2. package/dist/index.d.ts +7304 -6
  3. package/dist/index.js +14864 -11
  4. package/dist/index.js.map +1 -0
  5. package/package.json +8 -25
  6. package/dist/animations.d.ts +0 -635
  7. package/dist/animations.js +0 -1778
  8. package/dist/braces.d.ts +0 -84
  9. package/dist/braces.js +0 -253
  10. package/dist/card.d.ts +0 -17
  11. package/dist/card.js +0 -90
  12. package/dist/colors-palette.d.ts +0 -2242
  13. package/dist/colors-palette.js +0 -2241
  14. package/dist/colors.d.ts +0 -120
  15. package/dist/colors.js +0 -403
  16. package/dist/curves.d.ts +0 -10
  17. package/dist/curves.js +0 -128
  18. package/dist/engine.d.ts +0 -1705
  19. package/dist/engine.js +0 -3561
  20. package/dist/errors.d.ts +0 -19
  21. package/dist/errors.js +0 -25
  22. package/dist/geometry.d.ts +0 -551
  23. package/dist/geometry.js +0 -1555
  24. package/dist/graph.d.ts +0 -117
  25. package/dist/graph.js +0 -526
  26. package/dist/graphing.d.ts +0 -597
  27. package/dist/graphing.js +0 -1504
  28. package/dist/host.d.ts +0 -19
  29. package/dist/host.js +0 -85
  30. package/dist/lexicon.d.ts +0 -10
  31. package/dist/lexicon.js +0 -23
  32. package/dist/load.d.ts +0 -21
  33. package/dist/load.js +0 -109
  34. package/dist/logo.d.ts +0 -30
  35. package/dist/logo.js +0 -186
  36. package/dist/manim.d.ts +0 -22
  37. package/dist/manim.js +0 -19
  38. package/dist/media.d.ts +0 -34
  39. package/dist/media.js +0 -391
  40. package/dist/mobjects.d.ts +0 -127
  41. package/dist/mobjects.js +0 -316
  42. package/dist/picture.d.ts +0 -23
  43. package/dist/picture.js +0 -291
  44. package/dist/pointcloud.d.ts +0 -144
  45. package/dist/pointcloud.js +0 -384
  46. package/dist/rates.d.ts +0 -19
  47. package/dist/rates.js +0 -54
  48. package/dist/run.d.ts +0 -101
  49. package/dist/run.js +0 -323
  50. package/dist/tables.d.ts +0 -179
  51. package/dist/tables.js +0 -403
  52. package/dist/tex.d.ts +0 -8
  53. package/dist/tex.js +0 -257
  54. package/dist/text-layouts.d.ts +0 -64
  55. package/dist/text-layouts.js +0 -225
  56. package/dist/text.d.ts +0 -61
  57. package/dist/text.js +0 -78
  58. package/dist/theme.d.ts +0 -25
  59. package/dist/theme.js +0 -12
  60. package/dist/user-code.d.ts +0 -5
  61. package/dist/user-code.js +0 -20
  62. package/dist/utils.d.ts +0 -152
  63. package/dist/utils.js +0 -517
  64. package/dist/vector-field.d.ts +0 -132
  65. package/dist/vector-field.js +0 -361
package/dist/engine.d.ts DELETED
@@ -1,1705 +0,0 @@
1
- import type { Animation as RawAnimation, Mobject as RawMobject, Rate as RawRate, Chapter as RawChapter, Narration, NarrationWait, Screen, LexiconEntry, SayPart, PlayedEmbed } from "./generated/interfaces/aula-engine-engine.js";
2
- import type { Color, Diagnostic, Location, Point, ChapterText as RawChapterText, ParagraphText as RawParagraphText } from "./generated/interfaces/aula-engine-types.js";
3
- import type { Lexicon } from "./lexicon.ts";
4
- import type { MediaInfo } from "./media.ts";
5
- import type { PlacedPicture } from "./picture.ts";
6
- import type { Theme } from "./theme.ts";
7
- import { type CapStyleType, type Complex, type LineJointType } from "./utils.ts";
8
- export type { Instant, Screen, Shown } from "./generated/interfaces/aula-engine-engine.js";
9
- export type { Color, Diagnostic, Location, Point };
10
- export declare const ORIGIN: Point;
11
- export declare const UP: Point;
12
- export declare const DOWN: Point;
13
- export declare const LEFT: Point;
14
- export declare const RIGHT: Point;
15
- export declare const UL: Point;
16
- export declare const UR: Point;
17
- export declare const DL: Point;
18
- export declare const DR: Point;
19
- export declare const FRAME_HEIGHT = 8;
20
- /** The frame is 16:9. */
21
- export declare const FRAME_WIDTH: number;
22
- /** The width of a frame in pixels (854). */
23
- export declare const PIXEL_WIDTH = 854;
24
- export declare const WHITE: Color;
25
- export declare const BLACK: Color;
26
- /** Manim's `YELLOW` (`YELLOW_C`). */
27
- export declare const YELLOW: Color;
28
- /** Manim's `PURE_YELLOW`: the default colour of `Indicate`, `Flash`, `Circumscribe` and
29
- * `SurroundingRectangle`. */
30
- export declare const PURE_YELLOW: Color;
31
- export declare const PI: number;
32
- export declare const TAU: number;
33
- export declare const DEGREES: number;
34
- export declare const SMALL_BUFF = 0.1;
35
- export declare const MED_SMALL_BUFF = 0.25;
36
- export declare const MED_LARGE_BUFF = 0.5;
37
- export declare const LARGE_BUFF = 1;
38
- export declare const BOLD = "BOLD";
39
- export declare const NORMAL = "NORMAL";
40
- /** A rate function (Manim `rate_func`): linear progress 0..1 to eased progress. */
41
- export type RateFunc = (t: number) => number;
42
- /** The engine's form of `f`: a built-in name, or a JS function in the callback table. */
43
- export declare function rawRate(f: RateFunc): RawRate;
44
- export declare const linear: RateFunc;
45
- /** Slow at the start and the end (Manim `smooth`). The engine runs the default inflection 10. */
46
- export declare function smooth(t: number, inflection?: number): number;
47
- /** Manim `rush_into`: the first half of `smooth`, stretched. */
48
- export declare function rushInto(t: number, inflection?: number): number;
49
- /** Manim `rush_from`: the second half of `smooth`, stretched. */
50
- export declare function rushFrom(t: number, inflection?: number): number;
51
- export declare const slowInto: RateFunc;
52
- export declare const doubleSmooth: RateFunc;
53
- /** Manim `there_and_back`: `smooth` to 1 at the middle, then back to 0. */
54
- export declare function thereAndBack(t: number, inflection?: number): number;
55
- /** Manim `there_and_back_with_pause`: there, a pause of `pauseRatio` of the time at 1, back. */
56
- export declare function thereAndBackWithPause(t: number, pauseRatio?: number): number;
57
- export declare const easeInSine: RateFunc;
58
- export declare const easeOutSine: RateFunc;
59
- export declare const easeInOutSine: RateFunc;
60
- export declare const easeInQuad: RateFunc;
61
- export declare const easeOutQuad: RateFunc;
62
- export declare const easeInOutQuad: RateFunc;
63
- export declare const easeInCubic: RateFunc;
64
- export declare const easeOutCubic: RateFunc;
65
- export declare const easeInOutCubic: RateFunc;
66
- export declare const easeInQuart: RateFunc;
67
- export declare const easeOutQuart: RateFunc;
68
- export declare const easeInOutQuart: RateFunc;
69
- export declare const easeInQuint: RateFunc;
70
- export declare const easeOutQuint: RateFunc;
71
- export declare const easeInOutQuint: RateFunc;
72
- export declare const easeInExpo: RateFunc;
73
- export declare const easeOutExpo: RateFunc;
74
- export declare const easeInOutExpo: RateFunc;
75
- export declare const easeInCirc: RateFunc;
76
- export declare const easeOutCirc: RateFunc;
77
- export declare const easeInOutCirc: RateFunc;
78
- export declare const easeInBack: RateFunc;
79
- export declare const easeOutBack: RateFunc;
80
- export declare const easeInOutBack: RateFunc;
81
- export declare const easeInElastic: RateFunc;
82
- export declare const easeOutElastic: RateFunc;
83
- export declare const easeInOutElastic: RateFunc;
84
- export declare const easeInBounce: RateFunc;
85
- export declare const easeOutBounce: RateFunc;
86
- export declare const easeInOutBounce: RateFunc;
87
- export declare function add(a: Point, b: Point): Point;
88
- export declare function sub(a: Point, b: Point): Point;
89
- export declare function mul(v: Point, k: number): Point;
90
- /** Euclidean length. */
91
- export declare function norm(v: Point): number;
92
- /** `a + (b - a) * t`. */
93
- export declare function lerp(a: Point, b: Point, t: number): Point;
94
- declare const RAW: unique symbol;
95
- declare const ID: unique symbol;
96
- declare const ANIMATION: unique symbol;
97
- /** The engine handle of a Mobject. */
98
- export declare function raw(m: Mobject): RawMobject;
99
- /** An argument error with Manim's name of the function. */
100
- export declare function wrong(label: string, message: string, hint?: string): never;
101
- /** The fill and stroke of `setStyle` and `getStyle` (Manim's keyword arguments). */
102
- export interface StyleSettings {
103
- fillColor?: Color;
104
- fillOpacity?: number;
105
- strokeColor?: Color;
106
- strokeWidth?: number;
107
- strokeOpacity?: number;
108
- }
109
- /** The point options of the methods that change points (Manim `about_point`, `about_edge`). */
110
- export interface AboutOptions {
111
- aboutPoint?: Point;
112
- aboutEdge?: Point;
113
- }
114
- /** The options of `arrangeInGrid` (Manim's keyword arguments). */
115
- export interface GridOptions {
116
- rows?: number;
117
- cols?: number;
118
- /** The gap between cells, or `[horizontal, vertical]`. */
119
- buff?: number | readonly [number, number];
120
- cellAlignment?: Point;
121
- /** One character for each row, top to bottom: `u` up, `c` centre, `d` down. */
122
- rowAlignments?: string;
123
- /** One character for each column, left to right: `l` left, `c` centre, `r` right. */
124
- colAlignments?: string;
125
- /** A height for each row, top to bottom; undefined fits the row. */
126
- rowHeights?: readonly (number | undefined)[];
127
- /** A width for each column, left to right; undefined fits the column. */
128
- colWidths?: readonly (number | undefined)[];
129
- /** The fill order: "rd" (the default), "dr", "ld", "dl", "ru", "ur", "lu" or "ul". */
130
- flowOrder?: "rd" | "dr" | "ld" | "dl" | "ru" | "ur" | "lu" | "ul";
131
- }
132
- /** The radial gradient options (Manim `set_colors_by_radial_gradient`). */
133
- export interface RadialGradientOptions {
134
- center?: Point;
135
- radius?: number;
136
- innerColor?: Color;
137
- outerColor?: Color;
138
- }
139
- /** The options of `addBackgroundRectangle` (Manim's keyword arguments). */
140
- export interface BackgroundRectangleOptions {
141
- color?: Color;
142
- opacity?: number;
143
- buff?: number;
144
- }
145
- /** The attributes that `set` changes (Manim `set(**kwargs)`). */
146
- export interface MobjectAttributes {
147
- width?: number;
148
- height?: number;
149
- name?: string;
150
- zIndex?: number;
151
- target?: Mobject;
152
- }
153
- /** The wrapper of the node of `handle`: the one that exists, or a new Mobject. An unused
154
- * handle is freed when it is collected (jco's dispose of a handle from a list frees the
155
- * wrong handle). */
156
- export declare function wrap(handle: RawMobject): Mobject;
157
- /** The Mobject of a method that `mob.method` gave (Python's `method.__self__`). */
158
- export declare const METHOD_SELF: unique symbol;
159
- /** The unbound function of such a method (Python's `method.__func__`). */
160
- export declare const METHOD_FUNC: unique symbol;
161
- /** A method of a Mobject, bound to it: `m.ApplyMethod(mob.shift, m.UP)` and `m.always(mob.nextTo,
162
- * …)` find the Mobject, as Python's bound methods do. */
163
- export interface BoundMethod {
164
- (...args: never[]): unknown;
165
- readonly [METHOD_SELF]: Mobject;
166
- readonly [METHOD_FUNC]: (...args: never[]) => unknown;
167
- }
168
- /** One node of the picture tree. Each node has one Mobject: `group[0] === circle` when `circle`
169
- * is the first child of `group`. `group[i]` is child `i` (negative from the end), `length` is
170
- * the number of children, and `for (const m of group)` goes through the children. Methods
171
- * that change it return it, so they chain. */
172
- declare class MobjectClass {
173
- readonly [RAW]: RawMobject;
174
- /** The id of the node. */
175
- readonly [ID]: number;
176
- /** Child `i` (Manim `group[i]`); negative counts from the end. */
177
- readonly [index: number]: Mobject;
178
- /** Manim's `name`: "Mobject" unless the options give one. */
179
- name: string;
180
- /** Manim's VMobject settings: `applyFunction` first moves each handle this fraction of the way
181
- * to its anchor, and then back. */
182
- preFunctionHandleToAnchorScaleFactor: number;
183
- /** True: `applyFunction` ends with `makeSmooth`. */
184
- makeSmoothAfterApplyingFunctions: boolean;
185
- /** The distance at which `considerPointsEquals` takes two points as equal. */
186
- toleranceForPointEquality: number;
187
- /** Manim's `close_new_points`. Only Manim's OpenGL renderer reads it. */
188
- closeNewPoints: boolean;
189
- constructor(handle: RawMobject);
190
- /** The children (Manim `submobjects`). */
191
- get submobjects(): Mobject[];
192
- /** The number of children (Manim `len(group)`). */
193
- get length(): number;
194
- /** The children, in order (Manim `for m in group`). */
195
- [Symbol.iterator](): Iterator<Mobject>;
196
- add(...items: Mobjects[]): this;
197
- remove(...items: Mobjects[]): this;
198
- /** This node and every descendant, depth first. `recurse` has no effect, as in Manim. */
199
- getFamily(recurse?: boolean): Mobject[];
200
- /** The family members that have points of their own (Manim `family_members_with_points`). */
201
- familyMembersWithPoints(): Mobject[];
202
- /** Puts `mobject` at child `index` (Manim `insert`). */
203
- insert(index: number, mobject: Mobject): this;
204
- /** Puts the mobjects first among the children, in their order (Manim `add_to_back`). */
205
- addToBack(...items: Mobject[]): this;
206
- /** Sets attributes: `set({ width: 3, zIndex: 2 })` (Manim `set(**kwargs)`). */
207
- set(attributes: MobjectAttributes): this;
208
- /** The children that have points or children (Manim `nonempty_submobjects`). */
209
- nonemptySubmobjects(): Mobject[];
210
- /** `[this]` if it has points of its own, then the children (Manim `split`). */
211
- split(): Mobject[];
212
- /** The group class of this mobject: `m.VGroup` (Manim `get_group_class`). */
213
- getGroupClass(): typeof VGroup;
214
- /** The base class of this mobject: `m.VMobject` (Manim `get_mobject_type_class`). */
215
- getMobjectTypeClass(): typeof VMobject;
216
- /** True when `m` is this node or inside it. */
217
- contains(m: Mobject): boolean;
218
- /** True when the node has points of its own. */
219
- hasPoints(): boolean;
220
- /** True when the node has no points of its own (Manim `has_no_points`). */
221
- hasNoPoints(): boolean;
222
- /** The number of own control points (Manim `get_num_points`). */
223
- getNumPoints(): number;
224
- /** The names of the point arrays: `["points"]` (Manim `get_array_attrs`). */
225
- getArrayAttrs(): string[];
226
- /** Changes the own points with `func` (Manim `apply_over_attr_arrays`). */
227
- applyOverAttrArrays(func: (points: Point[]) => Point[]): this;
228
- /** The points of the whole family (Manim `get_merged_array("points")`). */
229
- getMergedArray(arrayAttr?: "points"): Point[];
230
- /** The points of the whole family (Manim `get_all_points`). */
231
- getAllPoints(): Point[];
232
- /** The anchors of the family: the points that set the bounds (Manim
233
- * `get_points_defining_boundary`). */
234
- getPointsDefiningBoundary(): Point[];
235
- /** `reduceFunc` of the coordinates `dim` of the boundary points; 0 without points (Manim
236
- * `reduce_across_dimension`). */
237
- reduceAcrossDimension(reduceFunc: (values: number[]) => number, dim: number): number;
238
- /** A number for the node while it lives. `a === b` also compares nodes. */
239
- id(): number;
240
- copy(): Mobject;
241
- /** `[[minX, minY], [maxX, maxY]]`, or undefined without points. */
242
- bounds(): [Point, Point] | undefined;
243
- getCriticalPoint(direction: Point): Point;
244
- getCenter(): Point;
245
- getLeft(): Point;
246
- getRight(): Point;
247
- getTop(): Point;
248
- getBottom(): Point;
249
- /** The x of the critical point in `direction` (Manim `get_x`). */
250
- getX(direction?: Point): number;
251
- /** The y of the critical point in `direction` (Manim `get_y`). */
252
- getY(direction?: Point): number;
253
- /** Coordinate `dim` (0 x, 1 y) of the critical point in `direction` (Manim `get_coord`). */
254
- getCoord(dim: number, direction?: Point): number;
255
- /** The min (`key` < 0), the middle (0) or the max (> 0) of coordinate `dim` of `points`
256
- * (default: the boundary points) (Manim `get_extremum_along_dim`). */
257
- getExtremumAlongDim(opts?: {
258
- points?: readonly Point[];
259
- dim?: number;
260
- key?: number;
261
- }): number;
262
- /** The size along `dim`: 0 the width, 1 the height (Manim `length_over_dim`). */
263
- lengthOverDim(dim: number): number;
264
- /** The mean of the points of the family (Manim `get_center_of_mass`). */
265
- getCenterOfMass(): Point;
266
- /** The boundary point that is farthest in `direction` (Manim `get_boundary_point`). */
267
- getBoundaryPoint(direction: Point): Point;
268
- /** The point halfway along the path (Manim `get_midpoint`). */
269
- getMidpoint(): Point;
270
- /** `[getStart(), getEnd()]` (Manim `get_start_and_end`). */
271
- getStartAndEnd(): [Point, Point];
272
- /** The proportion of the path's length at `point`, which must be on the path (Manim
273
- * `proportion_from_point`). */
274
- proportionFromPoint(point: Point): number;
275
- /** `nPieces` copies of the own path, each one piece of it, as a VGroup (Manim
276
- * `get_pieces`). */
277
- getPieces(nPieces: number): Mobject;
278
- /** The own path becomes the part of `mobject`'s own path from proportion `a` to `b`
279
- * (Manim `pointwise_become_partial`). */
280
- pointwiseBecomePartial(mobject: Mobject, a: number, b: number): this;
281
- /** The point that orders this mobject among equal `zIndex` values: its center (Manim
282
- * `get_z_index_reference_point`). */
283
- getZIndexReferencePoint(): Point;
284
- /** Manim's `z_index`: the frame draws the members of the stage sorted by it. */
285
- get zIndex(): number;
286
- set zIndex(value: number);
287
- /** Sets `zIndex` of the family, or of this node only (Manim `set_z_index`). A higher value is
288
- * drawn on top; equal values keep the order of the stage. */
289
- setZIndex(zIndexValue: number, opts?: {
290
- family?: boolean;
291
- }): this;
292
- /** True when the mobject is fully outside the frame (Manim `is_off_screen`). */
293
- isOffScreen(): boolean;
294
- get width(): number;
295
- /** Scales the mobject to this width (Manim's `width` setter: `scaleToFitWidth`). */
296
- set width(value: number);
297
- get height(): number;
298
- /** Scales the mobject to this height (Manim's `height` setter: `scaleToFitHeight`). */
299
- set height(value: number);
300
- /** The x of the left edge. */
301
- left(): number;
302
- right(): number;
303
- top(): number;
304
- bottom(): number;
305
- getStart(): Point;
306
- /** The last point (an arrow: its tip). */
307
- getEnd(): Point;
308
- isClosed(): boolean;
309
- getCubicBezierTuples(): [Point, Point, Point, Point][];
310
- pointFromProportion(alpha: number): Point;
311
- /** The critical point in a corner direction, such as `m.UR` (Manim `get_corner`). */
312
- getCorner(direction: Point): Point;
313
- /** The critical point in an edge direction, such as `m.UP` (Manim `get_edge_center`). */
314
- getEdgeCenter(direction: Point): Point;
315
- /** `getEnd() - getStart()` (Manim `Line.get_vector`). */
316
- getVector(): Point;
317
- /** The distance from `getStart()` to `getEnd()` (Manim `Line.get_length`). */
318
- getLength(): number;
319
- /** The angle of `getVector()`, in radians from the x axis (Manim `Line.get_angle`). */
320
- getAngle(): number;
321
- /** `getVector()` with length 1, or `[0, 0]` (Manim `Line.get_unit_vector`). */
322
- getUnitVector(): Point;
323
- /** Moves the centre to the origin (Manim `center`). */
324
- center(): this;
325
- /** Moves along `dim` (0 x, 1 y) so that the critical point in `direction` has coordinate
326
- * `value` (Manim `set_coord`). */
327
- setCoord(value: number, dim: number, direction?: Point): this;
328
- /** Moves along x so that the critical point in `direction` has x `x` (Manim `set_x`). */
329
- setX(x: number, direction?: Point): this;
330
- /** Moves along y so that the critical point in `direction` has y `y` (Manim `set_y`). */
331
- setY(y: number, direction?: Point): this;
332
- /** Maps every point of the family through `function`, about `aboutPoint` (the origin by
333
- * default) or the critical point `aboutEdge` (Manim `apply_function`). */
334
- applyFunction(func: (p: Point) => Point, opts?: AboutOptions): this;
335
- /** Moves the center to `function(center)` (Manim `apply_functo_position`). */
336
- applyFunctionToPosition(func: (p: Point) => Point): this;
337
- /** Moves the center of each child through `function` (Manim
338
- * `apply_functo_submobject_positions`). */
339
- applyFunctionToSubmobjectPositions(func: (p: Point) => Point): this;
340
- /** Maps the points by a 2 x 2 matrix (or the top-left of a 3 x 3 one), about the origin by
341
- * default (Manim `apply_matrix`). */
342
- applyMatrix(matrix: readonly (readonly number[])[], opts?: AboutOptions): this;
343
- /** Maps the points as complex numbers `m.Complex`, `[re, im]` (Manim `apply_complex_function`). */
344
- applyComplexFunction(func: (z: Complex) => Complex, opts?: AboutOptions): this;
345
- /** Changes the own points of each family member with `func`, about `aboutPoint` or the
346
- * critical point `aboutEdge` (the center by default) (Manim
347
- * `apply_points_funcabout_point`). */
348
- applyPointsFunctionAboutPoint(func: (points: Point[]) => Point[], opts?: AboutOptions): this;
349
- /** Reverses the order of the points of each family member (Manim `reverse_points`). */
350
- reversePoints(): this;
351
- /** Repeats the points of each family member `count` times (Manim `repeat`). */
352
- repeat(count: number): this;
353
- /** The own points of each family member take those of `mobject`'s family, member by member;
354
- * the style stays (Manim `match_points`). */
355
- matchPoints(mobject: Mobject, _opts?: {
356
- copySubmobjects?: boolean;
357
- }): this;
358
- shift(vector: Point): this;
359
- /** Scales about `aboutPoint` or the critical point `aboutEdge` (the center by default). With
360
- * `scaleStroke`, the stroke widths scale too. */
361
- scale(scaleFactor: number, opts?: AboutOptions & {
362
- scaleStroke?: boolean;
363
- }): this;
364
- /** Stretches axis `dim` (0 x, 1 y) by `factor` about `aboutPoint` or the critical point
365
- * `aboutEdge` (the center by default). */
366
- stretch(factor: number, dim: number, opts?: AboutOptions): this;
367
- /** Stretches axis `dim` by `factor` about `point` (Manim `stretch_about_point`). */
368
- stretchAboutPoint(factor: number, dim: number, point: Point): this;
369
- /** Scales (or with `stretch`, stretches) so that the size along `dim` is `length` (Manim
370
- * `rescale_to_fit`). A mobject with no size there does not change. */
371
- rescaleToFit(length: number, dim: number, opts?: AboutOptions & {
372
- stretch?: boolean;
373
- }): this;
374
- /** Scales the group by `factor` and each child by `1 / factor`: the children move apart
375
- * (Manim `space_out_submobjects`). */
376
- spaceOutSubmobjects(factor?: number, opts?: AboutOptions): this;
377
- stretchToFitHeight(height: number, opts?: {
378
- aboutEdge?: Point;
379
- }): this;
380
- stretchToFitWidth(width: number, opts?: {
381
- aboutEdge?: Point;
382
- }): this;
383
- scaleToFitWidth(width: number): this;
384
- scaleToFitHeight(height: number): this;
385
- /** Shrinks (never grows) to at most `width`. */
386
- fitWidth(width: number): this;
387
- /** Rotates counter-clockwise by `angle` about `aboutPoint` or the critical point
388
- * `aboutEdge` (the center by default). */
389
- rotate(angle: number, opts?: AboutOptions): this;
390
- /** Rotates about the origin (Manim `rotate_about_origin`). */
391
- rotateAboutOrigin(angle: number): this;
392
- /** Mirrors the mobject across the line through its center (or `aboutPoint`, or the critical
393
- * point `aboutEdge`) in the direction `axis` (Manim `flip`: a half turn about `axis`). */
394
- flip(axis?: Point, opts?: AboutOptions): this;
395
- /** Moves the critical point `alignedEdge` of the mobject onto the point, or onto the same
396
- * critical point of the mobject. `coorMask` `[1, 0]` moves along x only. */
397
- moveTo(pointOrMobject: Point | Mobject, opts?: {
398
- alignedEdge?: Point;
399
- coorMask?: Point;
400
- }): this;
401
- /** Puts the mobject `buff` away from `mobjectOrPoint` in `direction`. With `alignedEdge`,
402
- * the edges of both in that direction line up (Manim `aligned_edge`).
403
- * `submobjectToAlign` or `indexOfSubmobjectToAlign` lines up a child in place of the whole;
404
- * `coorMask` `[1, 0]` moves along x only. */
405
- nextTo(mobjectOrPoint: Mobject | Point, direction?: Point, opts?: {
406
- buff?: number;
407
- alignedEdge?: Point;
408
- submobjectToAlign?: Mobject;
409
- indexOfSubmobjectToAlign?: number;
410
- coorMask?: Point;
411
- }): this;
412
- /** Moves the critical point in `direction` to the frame edge, `buff` inside (Manim
413
- * `align_on_border`). */
414
- alignOnBorder(direction: Point, buff?: number): this;
415
- /** Moves the mobject inside the frame where an edge is past it, `buff` from the edge
416
- * (Manim `shift_onto_screen`). */
417
- shiftOntoScreen(opts?: {
418
- buff?: number;
419
- }): this;
420
- toCorner(corner?: Point, opts?: {
421
- buff?: number;
422
- }): this;
423
- toEdge(edge?: Point, opts?: {
424
- buff?: number;
425
- }): this;
426
- /** Moves the mobject so that its edge in `direction` lines up with the same edge of
427
- * `mobjectOrPoint` (or with the point), on each axis where `direction` is not 0. */
428
- alignTo(mobjectOrPoint: Mobject | Point, direction?: Point): this;
429
- replace(mobject: Mobject, opts?: {
430
- dimToMatch?: number;
431
- stretch?: boolean;
432
- }): this;
433
- /** `replace(mobject)`, then a margin of `buff` along `dimToMatch` (Manim `surround`). */
434
- surround(mobject: Mobject, opts?: {
435
- dimToMatch?: number;
436
- stretch?: boolean;
437
- buff?: number;
438
- }): this;
439
- /** Scales so that the size along `dim` is that of `mobject` (Manim `match_dim_size`). */
440
- matchDimSize(mobject: Mobject, dim: number, opts?: AboutOptions & {
441
- stretch?: boolean;
442
- }): this;
443
- /** Scales to the width of `mobject` (Manim `match_width`). */
444
- matchWidth(mobject: Mobject, opts?: AboutOptions & {
445
- stretch?: boolean;
446
- }): this;
447
- /** Scales to the height of `mobject` (Manim `match_height`). */
448
- matchHeight(mobject: Mobject, opts?: AboutOptions & {
449
- stretch?: boolean;
450
- }): this;
451
- /** Moves along `dim` to the coordinate of `mobject`'s critical point `direction` (Manim
452
- * `match_coord`). */
453
- matchCoord(mobject: Mobject, dim: number, direction?: Point): this;
454
- /** Moves along x to the x of `mobject` (Manim `match_x`). */
455
- matchX(mobject: Mobject, direction?: Point): this;
456
- /** Moves along y to the y of `mobject` (Manim `match_y`). */
457
- matchY(mobject: Mobject, direction?: Point): this;
458
- /** Rotates and scales the own straight path so it runs from `start` to `end`. */
459
- putStartAndEndOn(start: Point, end: Point): this;
460
- /** Puts each submobject next to the one before it in `direction`. `center` (true) then
461
- * moves the group to the origin; `alignedEdge` lines up the edges of the submobjects. */
462
- arrange(direction?: Point, opts?: {
463
- buff?: number;
464
- center?: boolean;
465
- alignedEdge?: Point;
466
- }): this;
467
- /** Puts the submobjects in a grid and keeps the center of the group (Manim
468
- * `arrange_in_grid`). With no `rows` and `cols`, the grid is about square; with one of them,
469
- * the other fits all the submobjects. */
470
- arrangeInGrid(opts?: GridOptions): this;
471
- /** Sorts the children by `pointToNumFunc` of their centers, or by `submobFunc` (Manim `sort`). */
472
- sort(pointToNumFunc?: (p: Point) => number, opts?: {
473
- submobFunc?: (m: Mobject) => number;
474
- }): this;
475
- /** Puts the children in a random order, the same in each run (Manim `shuffle`). */
476
- shuffle(opts?: {
477
- recursive?: boolean;
478
- }): this;
479
- /** Reverses the order of the children (Manim `invert`). */
480
- invert(opts?: {
481
- recursive?: boolean;
482
- }): this;
483
- /** `arrange` (Manim's older name `arrange_submobjects`). */
484
- arrangeSubmobjects(...args: Parameters<MobjectClass["arrange"]>): this;
485
- /** `sort` (Manim's older name `sort_submobjects`). */
486
- sortSubmobjects(...args: Parameters<MobjectClass["sort"]>): this;
487
- /** `shuffle` (Manim's older name `shuffle_submobjects`). */
488
- shuffleSubmobjects(...args: Parameters<MobjectClass["shuffle"]>): this;
489
- /** `setFill(color, { opacity })`; `setFill({ opacity })` keeps the colour. */
490
- setFill(color?: Color | {
491
- opacity?: number;
492
- family?: boolean;
493
- }, opts?: {
494
- opacity?: number;
495
- family?: boolean;
496
- }): this;
497
- /** `setStroke(color, { width, opacity })`; `setStroke({ width })` keeps the colour. */
498
- setStroke(color?: Color | {
499
- width?: number;
500
- opacity?: number;
501
- family?: boolean;
502
- }, opts?: {
503
- width?: number;
504
- opacity?: number;
505
- family?: boolean;
506
- }): this;
507
- /** Sets the fill and stroke colour of the family, or of this node only with `family: false`.
508
- * `alpha` has no effect, as in Manim. */
509
- setColor(color?: Color, opts?: {
510
- alpha?: number;
511
- family?: boolean;
512
- }): this;
513
- /** Sets both opacities of the family, or of this node only (Manim `set_opacity`). */
514
- setOpacity(opacity: number, opts?: {
515
- family?: boolean;
516
- }): this;
517
- /** Multiplies both opacities by `1 - darkness`, of the family or of this node only. */
518
- fade(darkness?: number, opts?: {
519
- family?: boolean;
520
- }): this;
521
- /** Mixes the colour of each member with points `alpha` of the way to `color` (Manim
522
- * `fade_to`). */
523
- fadeTo(color: Color, alpha: number, opts?: {
524
- family?: boolean;
525
- }): this;
526
- /** The stroke colour, or the fill colour when there is no stroke (Manim `get_color`). */
527
- getColor(): Color;
528
- /** Gives the family the colour that `getColor` gives (Manim `to_original_color`). */
529
- toOriginalColor(): this;
530
- /** Takes the colour of `mobject` (Manim `match_color`). */
531
- matchColor(mobject: Mobject): this;
532
- /** Colours the members with points along the colours, in order (Manim
533
- * `set_color_by_gradient`). */
534
- setColorByGradient(...colors: Color[]): this;
535
- /** Colours the members with points along the colours, in order (Manim
536
- * `set_submobject_colors_by_gradient`). */
537
- setSubmobjectColorsByGradient(...colors: Color[]): this;
538
- /** Colours the members with points by the distance of their centers from `center` (the
539
- * center by default): `innerColor` at the center, `outerColor` from `radius` (Manim
540
- * `set_colors_by_radial_gradient`). */
541
- setColorsByRadialGradient(opts?: RadialGradientOptions): this;
542
- /** As `setColorsByRadialGradient` (Manim `set_submobject_colors_by_radial_gradient`). */
543
- setSubmobjectColorsByRadialGradient(opts?: RadialGradientOptions): this;
544
- /** Adds a `BackgroundRectangle` as the first child (Manim `add_background_rectangle`). */
545
- addBackgroundRectangle(opts?: BackgroundRectangleOptions): this;
546
- /** Adds a background rectangle to each child (Manim
547
- * `add_background_rectangle_to_submobjects`). */
548
- addBackgroundRectangleToSubmobjects(opts?: BackgroundRectangleOptions): this;
549
- /** Adds a background rectangle to each member with points (Manim
550
- * `add_background_rectangle_to_family_members_with_points`). */
551
- addBackgroundRectangleToFamilyMembersWithPoints(opts?: BackgroundRectangleOptions): this;
552
- /** The own style becomes the mix of the styles of `mobject1` and `mobject2` at `alpha`
553
- * (Manim `interpolate_color`). */
554
- interpolateColor(mobject1: Mobject, mobject2: Mobject, alpha: number): this;
555
- /** The own points become `pathFunc` of the points of `mobject1` and `mobject2` at `alpha`
556
- * (a straight line by default), and the own style their mix (Manim `interpolate`). Both must
557
- * have the same number of points: call `alignData` first. */
558
- interpolate(mobject1: Mobject, mobject2: Mobject, alpha: number, pathFunc?: (start: Point[], end: Point[], alpha: number) => Point[]): this;
559
- /** Makes this family and `mobject`'s family the same shape, with the same number of points
560
- * in each member, for `interpolate` (Manim `align_data`). */
561
- alignData(mobject: Mobject, opts?: {
562
- skipPointAlignment?: boolean;
563
- }): this;
564
- /** An invisible mobject with one point at `center` (the center by default) (Manim
565
- * `get_point_mobject`). */
566
- getPointMobject(center?: Point): Mobject;
567
- /** Gives both own paths the same number of curves, subpath by subpath (Manim
568
- * `align_points`). */
569
- alignPoints(mobject: Mobject): this;
570
- /** Adds curves to the own path until it has as many points as `largerMobject` (Manim
571
- * `align_points_with_larger`). */
572
- alignPointsWithLarger(largerMobject: Mobject): this;
573
- /** Gives both mobjects the same number of children, with faded copies (Manim
574
- * `align_submobjects`). */
575
- alignSubmobjects(mobject: Mobject): this;
576
- /** When one of the two has no own points and the other has, the other moves its own path
577
- * into a child (Manim `null_point_align`). */
578
- nullPointAlign(mobject: Mobject): this;
579
- /** Moves the own path into a new first child (Manim `push_self_into_submobjects`). */
580
- pushSelfIntoSubmobjects(): this;
581
- /** Adds `n` children: faded copies of the children, spread evenly (Manim
582
- * `add_n_more_submobjects`). */
583
- addNMoreSubmobjects(n: number): this;
584
- /** A copy of `submob` (Manim `repeat_submobject`). */
585
- repeatSubmobject(submob: Mobject): Mobject;
586
- /** Removes the own points (Manim `reset_points`). */
587
- resetPoints(): this;
588
- /** Runs `func` on each member with points (Manim `apply_to_family`). */
589
- applyToFamily(func: (m: Mobject) => void): this;
590
- getFillOpacity(): number;
591
- getStrokeOpacity(): number;
592
- getStrokeWidth(): number;
593
- getFillColor(): Color;
594
- getStrokeColor(): Color;
595
- /** Takes the points and styles of `other`'s family, member by member (same tree shape). */
596
- becomePointsOf(other: Mobject): this;
597
- /** Becomes a copy of `mobject`: points, styles, children, kind and flags. `matchHeight`,
598
- * `matchWidth` and `stretch` first fit the copy to this size, and `matchCenter` moves it
599
- * here (Manim `become`). */
600
- become(mobject: Mobject, opts?: {
601
- matchHeight?: boolean;
602
- matchWidth?: boolean;
603
- matchCenter?: boolean;
604
- stretch?: boolean;
605
- }): this;
606
- /** Keeps a copy as `target` and returns it (Manim `generate_target`). Change the target,
607
- * then play `m.MoveToTarget(mob)`. A copy is always deep, so `useDeepcopy` has no effect. */
608
- generateTarget(useDeepcopy?: boolean): Mobject;
609
- /** The target of `generateTarget` (Manim `target`). Reading it without a target is an error. */
610
- get target(): Mobject;
611
- set target(target: Mobject);
612
- /** Keeps a copy of the current state (Manim `save_state`). `restore()` and `m.Restore(mob)`
613
- * go back to it. */
614
- saveState(): this;
615
- /** Becomes the state that `saveState` kept (Manim `restore`). */
616
- restore(): this;
617
- /** The own control points, four for each curve: `[anchor, handle, handle, anchor]`
618
- * (Manim `points`). The children are not included. */
619
- getPoints(): Point[];
620
- /** Sets the own path from control points, four for each curve, as `getPoints` gives
621
- * them (Manim `set_points`). One point is a path of that point alone (Manim's
622
- * `VectorizedPoint`). Points after the last whole curve start a path that is not drawn
623
- * until a curve ends it. The style stays. */
624
- setPoints(points: readonly Point[]): this;
625
- /** Sets the own path to a smooth curve through `points` (Manim `set_points_smoothly`).
626
- * The style stays. */
627
- setPointsSmoothly(points: readonly Point[]): this;
628
- /** The number of points of a curve: 4 (Manim `n_points_per_curve`). */
629
- get nPointsPerCurve(): number;
630
- /** Removes the own points (Manim `clear_points`). */
631
- clearPoints(): this;
632
- /** Adds points after the own points (Manim `append_points`). */
633
- appendPoints(newPoints: readonly Point[]): this;
634
- /** Gives the own points `newLength` points: cut, or repeated from the start (Manim
635
- * `resize_points`). */
636
- resizePoints(newLength: number, resizeFunc?: (points: Point[], length: number) => Point[]): this;
637
- /** Sets the own curves from four lists: start anchors, first handles, second handles and end
638
- * anchors (Manim `set_anchors_and_handles`). */
639
- setAnchorsAndHandles(anchors1: readonly Point[], handles1: readonly Point[], handles2: readonly Point[], anchors2: readonly Point[]): this;
640
- /** Starts a new subpath at `point` (Manim `start_new_path`). */
641
- startNewPath(point: Point): this;
642
- /** Adds one curve (Manim `add_cubic_bezier_curve`). */
643
- addCubicBezierCurve(anchor1: Point, handle1: Point, handle2: Point, anchor2: Point): this;
644
- /** Adds curves, each `[anchor, handle, handle, anchor]` (Manim `add_cubic_bezier_curves`). */
645
- addCubicBezierCurves(curves: readonly (readonly Point[])[]): this;
646
- /** Adds a curve from the last point (Manim `add_cubic_bezier_curve_to`). A path with no
647
- * points is an error: call `startNewPath` first. */
648
- addCubicBezierCurveTo(handle1: Point, handle2: Point, anchor: Point): this;
649
- /** Adds a quadratic curve from the last point, as a cubic (Manim
650
- * `add_quadratic_bezier_curve_to`). */
651
- addQuadraticBezierCurveTo(handle: Point, anchor: Point): this;
652
- /** Adds a straight line from the last point (Manim `add_line_to`). */
653
- addLineTo(point: Point): this;
654
- /** Adds a curve that goes on smoothly from the last curve: `addSmoothCurveTo(anchor)` or
655
- * `addSmoothCurveTo(handle2, anchor)` (Manim `add_smooth_curve_to`). */
656
- addSmoothCurveTo(...points: Point[]): this;
657
- /** True when the last point starts a path that has no curve yet (Manim
658
- * `has_new_path_started`). */
659
- hasNewPathStarted(): boolean;
660
- /** The last own point (Manim `get_last_point`). */
661
- getLastPoint(): Point;
662
- /** Adds a line back to the start of the last subpath, if the path is not closed (Manim
663
- * `close_path`). */
664
- closePath(): this;
665
- /** Adds straight lines from the last point through `points` (Manim
666
- * `add_points_as_corners`). */
667
- addPointsAsCorners(points: readonly Point[]): this;
668
- /** The own path becomes straight lines through `points` (Manim `set_points_as_corners`). */
669
- setPointsAsCorners(points: readonly Point[]): this;
670
- /** Moves the handles of each member with points: `"smooth"` makes each subpath a smooth
671
- * curve through its anchors, `"jagged"` makes straight lines (Manim `change_anchor_mode`). */
672
- changeAnchorMode(mode: "jagged" | "smooth"): this;
673
- /** `changeAnchorMode("smooth")` (Manim `make_smooth`). */
674
- makeSmooth(): this;
675
- /** `changeAnchorMode("jagged")` (Manim `make_jagged`). */
676
- makeJagged(): this;
677
- /** Adds a subpath of whole curves (Manim `add_subpath`). */
678
- addSubpath(points: readonly Point[]): this;
679
- /** Adds the own points of `vectorizedMobject` (Manim `append_vectorized_mobject`). */
680
- appendVectorizedMobject(vectorizedMobject: Mobject): this;
681
- /** Moves each handle `factor` of the way from its anchor (Manim
682
- * `scale_handle_to_anchor_distances`). */
683
- scaleHandleToAnchorDistances(factor: number): this;
684
- /** True when the points are equal up to `toleranceForPointEquality` (Manim
685
- * `consider_points_equals`). */
686
- considerPointsEquals(p0: Point, p1: Point): boolean;
687
- /** `considerPointsEquals` (Manim `consider_points_equals_2d`: points have two numbers here). */
688
- considerPointsEquals2d(p0: Point, p1: Point): boolean;
689
- /** The curves of `points`, four points each (Manim `get_cubic_bezier_tuples_from_points`). */
690
- getCubicBezierTuplesFromPoints(points: readonly Point[]): Point[][];
691
- /** As `getCubicBezierTuplesFromPoints` (Manim `gen_cubic_bezier_tuples_from_points`). */
692
- genCubicBezierTuplesFromPoints(points: readonly Point[]): Point[][];
693
- /** The subpaths of `points`: a curve that does not start where the last one ended starts a
694
- * new subpath (Manim `get_subpaths_from_points`). */
695
- getSubpathsFromPoints(points: readonly Point[]): Point[][];
696
- /** As `getSubpathsFromPoints` (Manim `gen_subpaths_from_points_2d`). */
697
- genSubpathsFromPoints2d(points: readonly Point[]): Point[][];
698
- /** `[start, end)` point indices of each subpath of `points` (Manim
699
- * `get_subpath_split_indices_from_points`). `nDims` has no effect: points have two numbers. */
700
- getSubpathSplitIndicesFromPoints(points: readonly Point[], nDims?: number): [number, number][];
701
- /** The subpaths of the own points (Manim `get_subpaths`). */
702
- getSubpaths(): Point[][];
703
- /** The four points of curve `n` (Manim `get_nth_curve_points`). */
704
- getNthCurvePoints(n: number): Point[];
705
- /** Curve `n` as a function of `t` from 0 to 1 (Manim `get_nth_curve_function`). */
706
- getNthCurveFunction(n: number): (t: number) => Point;
707
- /** The lengths of the `samplePoints - 1` straight pieces of curve `n` (default 10 samples)
708
- * (Manim `get_nth_curve_length_pieces`). */
709
- getNthCurveLengthPieces(n: number, samplePoints?: number): number[];
710
- /** The length of curve `n` (Manim `get_nth_curve_length`). */
711
- getNthCurveLength(n: number, samplePoints?: number): number;
712
- /** `[function, length]` of curve `n` (Manim `get_nth_curve_function_with_length`). */
713
- getNthCurveFunctionWithLength(n: number, samplePoints?: number): [(t: number) => Point, number];
714
- /** The number of own curves (Manim `get_num_curves`). */
715
- getNumCurves(): number;
716
- /** Each own curve as a function of `t` (Manim `get_curve_functions`). */
717
- getCurveFunctions(): ((t: number) => Point)[];
718
- /** `[function, length]` of each own curve (Manim `get_curve_functions_with_lengths`). */
719
- getCurveFunctionsWithLengths(opts?: {
720
- samplePoints?: number;
721
- }): [(t: number) => Point, number][];
722
- /** `[startAnchors, firstHandles, secondHandles, endAnchors]` (Manim
723
- * `get_anchors_and_handles`). */
724
- getAnchorsAndHandles(): [Point[], Point[], Point[], Point[]];
725
- /** The start anchor of each own curve (Manim `get_start_anchors`). */
726
- getStartAnchors(): Point[];
727
- /** The end anchor of each own curve (Manim `get_end_anchors`). */
728
- getEndAnchors(): Point[];
729
- /** The start and end anchor of each own curve, in turn (Manim `get_anchors`). */
730
- getAnchors(): Point[];
731
- /** The length of the own path (Manim `get_arc_length`). */
732
- getArcLength(samplePointsPerCurve?: number): number;
733
- /** Adds `n` curves to the own path: the curves are cut into pieces (Manim
734
- * `insert_n_curves`). */
735
- insertNCurves(n: number): this;
736
- /** `points` with `n` more curves (Manim `insert_n_curves_to_point_list`). */
737
- insertNCurvesToPointList(n: number, points: readonly Point[]): Point[];
738
- /** Each mobject has one fill colour and one stroke colour: nothing to align (Manim
739
- * `align_rgbas`). */
740
- alignRgbas(vmobject: Mobject): this;
741
- /** A copy whose own path is the part of this path from proportion `a` to `b` (Manim
742
- * `get_subcurve`). */
743
- getSubcurve(a: number, b: number): Mobject;
744
- /** `"CW"` or `"CCW"`: the direction of the anchors (Manim `get_direction`). A brace gives its
745
- * direction as a unit vector, as in Manim. */
746
- getDirection(): "CW" | "CCW" | Point;
747
- /** Reverses the own points (Manim `reverse_direction`). */
748
- reverseDirection(): this;
749
- /** Reverses the own points when the direction is not `targetDirection` (Manim
750
- * `force_direction`). */
751
- forceDirection(targetDirection: "CW" | "CCW"): this;
752
- /** Sets the fill and the stroke, of the family or of this node only (Manim `set_style`). */
753
- setStyle(opts?: StyleSettings & {
754
- family?: boolean;
755
- }): this;
756
- /** The fill and the stroke (Manim `get_style`). `simple` has no effect: a mobject has one
757
- * colour and one opacity each. */
758
- getStyle(_opts?: {
759
- simple?: boolean;
760
- }): StyleSettings;
761
- /** Takes the style of `vmobject`, and with `family`, the children take the styles of its
762
- * children, paired evenly (Manim `match_style`). */
763
- matchStyle(vmobject: Mobject, opts?: {
764
- family?: boolean;
765
- }): this;
766
- /** The ends of the stroke of the family (Manim `set_cap_style`). */
767
- setCapStyle(capStyle: CapStyleType): this;
768
- /** The ends of the stroke (Manim `cap_style`). */
769
- get capStyle(): CapStyleType;
770
- /** The corners of the stroke (Manim `joint_type`). Setting it changes the family. */
771
- get jointType(): LineJointType;
772
- set jointType(value: LineJointType);
773
- /** `[[r, g, b, opacity]]`, each from 0 to 1 (Manim `get_fill_rgbas`). */
774
- getFillRgbas(): [number, number, number, number][];
775
- /** `[[r, g, b, opacity]]` of the stroke (Manim `get_stroke_rgbas`). */
776
- getStrokeRgbas(): [number, number, number, number][];
777
- /** `[[r, g, b, opacity]]` of `color` (Manim `generate_rgbas_array`). */
778
- generateRgbasArray(color: Color, opacity: number): [number, number, number, number][];
779
- /** Sets the fill (`"fill_rgbas"`) or the stroke (`"stroke_rgbas"`) of the family (Manim
780
- * `update_rgbas_array`). */
781
- updateRgbasArray(arrayName: "fill_rgbas" | "stroke_rgbas", color?: Color, opacity?: number): this;
782
- /** `[fill colour]` (Manim `get_fill_colors`: one colour each here). */
783
- getFillColors(): Color[];
784
- /** `[fill opacity]` (Manim `get_fill_opacities`). */
785
- getFillOpacities(): number[];
786
- /** `[stroke colour]` (Manim `get_stroke_colors`). */
787
- getStrokeColors(): Color[];
788
- /** `[stroke opacity]` (Manim `get_stroke_opacities`). */
789
- getStrokeOpacities(): number[];
790
- /** Adds a filled triangle tip in the stroke colour (Manim `add_tip`). The path is
791
- * shortened to end at the base of the tip. A tip at the end makes the Mobject an arrow
792
- * for the arrow checks. */
793
- addTip(opts?: {
794
- tipLength?: number;
795
- tipWidth?: number;
796
- atStart?: boolean;
797
- }): this;
798
- /** The text without whitespace ("" for a non-text). */
799
- text(): string;
800
- get fontSize(): number;
801
- /** Runs `updateFunction(m, dt)` on every frame while on stage; with `callUpdater`, once now
802
- * with dt 0. `index` puts it at that place among the updaters of this node.
803
- *
804
- * An updater that takes `dt` runs on the real clock: in a move, it runs after the move with
805
- * real seconds, so its speed is the same in the move and after it. Its object is then closed
806
- * in the move: from the first part of the move, the move code does not read or change it.
807
- * With `clock: "move"`, it runs on the clock of the move: with the Manim seconds of each
808
- * part, together with the animations. An updater with no `dt` runs on the clock of the move. */
809
- addUpdater(updateFunction: (m: this, dt: number) => void, opts?: {
810
- index?: number;
811
- callUpdater?: boolean;
812
- clock?: "move";
813
- }): this;
814
- /** Removes `updateFunction` from the updaters of this node (Manim `remove_updater`). */
815
- removeUpdater(updateFunction: (m: this, dt: number) => void): this;
816
- /** Removes the updaters of the family, or of this node only (Manim `clear_updaters`). */
817
- clearUpdaters(opts?: {
818
- recursive?: boolean;
819
- }): this;
820
- hasUpdaters(): boolean;
821
- /** The updaters of this node, in order (Manim `get_updaters`). */
822
- getUpdaters(): ((m: Mobject, dt: number) => void)[];
823
- /** The updaters of the family (Manim `get_family_updaters`). */
824
- getFamilyUpdaters(): ((m: Mobject, dt: number) => void)[];
825
- /** The updaters of this node that take `dt`: functions of two parameters (Manim
826
- * `get_time_based_updaters`). */
827
- getTimeBasedUpdaters(): ((m: Mobject, dt: number) => void)[];
828
- /** True when an updater of this node takes `dt` (Manim `has_time_based_updater`). */
829
- hasTimeBasedUpdater(): boolean;
830
- /** The updaters of this node become those of `mobject` (Manim `match_updaters`). */
831
- matchUpdaters(mobject: Mobject): this;
832
- /** Runs the updaters of the family, or of this node only (Manim `update`). */
833
- update(dt?: number, opts?: {
834
- recursive?: boolean;
835
- }): this;
836
- /** Pauses the updaters of the family, or of this node only (Manim `suspend_updating`). */
837
- suspendUpdating(opts?: {
838
- recursive?: boolean;
839
- }): this;
840
- /** Resumes the updaters and runs them once (Manim `resume_updating`). */
841
- resumeUpdating(opts?: {
842
- recursive?: boolean;
843
- }): this;
844
- /** `mob.always.nextTo(other, m.UP)` adds an updater that calls the method on every frame,
845
- * and calls it now (Manim `always`). The methods chain: each adds its own updater. */
846
- get always(): UpdaterBuilder;
847
- /** Manim's `.animate`: the Mobject methods change a copy, played as one animation. */
848
- get animate(): AnimationBuilder;
849
- }
850
- /** The options every animation takes (Manim's `Animation` keyword arguments). */
851
- export interface AnimationOptions {
852
- /** The rate function: `smooth` unless the animation has another default. */
853
- rateFunc?: RateFunc;
854
- /** Staggers the family members: each starts when the one before it is this fraction done. */
855
- lagRatio?: number;
856
- /** Seconds (Manim `run_time`): 1 by default, the length of its animations for a group. The
857
- * `runTime` of `s.play` replaces it. */
858
- runTime?: number;
859
- /** Runs the rate function backwards: `rateFunc(1 - t)`. */
860
- reverseRateFunction?: boolean;
861
- /** The name of the animation (Manim shows it while it renders). */
862
- name?: string;
863
- /** Removes the mobject from the stage at the end. */
864
- remover?: boolean;
865
- /** Pauses the updaters of the mobject while the animation plays. */
866
- suspendMobjectUpdating?: boolean;
867
- /** Marks an animation that brings its mobject onto the stage (Manim `introducer`). */
868
- introducer?: boolean;
869
- }
870
- /** True when `a` runs in JavaScript: a subclass of `m.Animation` that its class drives, not an
871
- * engine animation. */
872
- export declare function isDriven(a: Animation): boolean;
873
- /** One animation: it plays once. Make your own animation as in Manim: extend `m.Animation` and
874
- * override `interpolateMobject(alpha)` or `interpolateSubmobject(submobject, start, alpha)`.
875
- * Such an animation runs in JavaScript, with the engine's clock:
876
- *
877
- * class Spin extends m.Animation {
878
- * interpolateMobject(alpha: number) {
879
- * this.mobject?.becomePointsOf(this.startingMobject!).rotate(this.rateFunc(alpha) * m.TAU);
880
- * }
881
- * }
882
- * s.play(new Spin(square, { runTime: 2 }));
883
- */
884
- export declare class Animation {
885
- #private;
886
- readonly [ANIMATION]: RawAnimation;
887
- /** The animated mobject (Manim `mobject`), or undefined (`Wait`, a group). */
888
- mobject: Mobject | undefined;
889
- /** The copy that `begin` keeps (Manim `starting_mobject`). */
890
- startingMobject: Mobject | undefined;
891
- name: string | undefined;
892
- lagRatio: number;
893
- reverseRateFunction: boolean;
894
- /** The rate function (Manim `rate_func`). */
895
- rateFunc: RateFunc;
896
- constructor(mobject?: Mobject, opts?: AnimationOptions);
897
- /** Pauses the updaters of the mobject while the animation plays (Manim
898
- * `suspend_mobject_updating`). */
899
- get suspendMobjectUpdating(): boolean;
900
- set suspendMobjectUpdating(suspend: boolean);
901
- /** The run time in seconds (Manim `run_time`). */
902
- get runTime(): number;
903
- set runTime(seconds: number);
904
- /** Prepares the animation and sets the start (Manim `begin`). The engine calls it when the
905
- * animation starts; call it yourself only to drive an animation in an updater. */
906
- begin(): void;
907
- /** Sets the end (Manim `finish`). */
908
- finish(): void;
909
- /** Removes the mobject from `scene` when the animation is a remover (Manim
910
- * `clean_up_from_scene`). The engine does this at the end of a play. */
911
- cleanUpFromScene(scene: Scene): void;
912
- /** A copy of the mobject, which `begin` keeps (Manim `create_starting_mobject`). */
913
- createStartingMobject(): Mobject | undefined;
914
- /** The mobjects of the animation (Manim `get_all_mobjects`). */
915
- getAllMobjects(): Mobject[];
916
- /** The family members with points of each of `getAllMobjects()`, zipped (Manim
917
- * `get_all_families_zipped`). */
918
- getAllFamiliesZipped(): Mobject[][];
919
- /** Runs the updaters of the other mobjects of the animation (Manim `update_mobjects`). */
920
- updateMobjects(dt: number): void;
921
- /** `getAllMobjects()` without the animated mobject (Manim `get_all_mobjects_to_update`). */
922
- getAllMobjectsToUpdate(): Mobject[];
923
- /** Sets the animation at linear progress `alpha`, 0 to 1 (Manim `interpolate`). */
924
- interpolate(alpha: number): void;
925
- /** Sets the mobject at linear progress `alpha` (Manim `interpolate_mobject`): calls
926
- * `interpolateSubmobject` for each family member, with its own progress. */
927
- interpolateMobject(alpha: number): void;
928
- /** Sets one family member at its progress (Manim `interpolate_submobject`). It does nothing
929
- * here: an animation that you write overrides it. */
930
- interpolateSubmobject(submobject: Mobject, startingSubmobject: Mobject, alpha: number): this;
931
- /** The progress of member `index` of `numSubmobjects`, with `lagRatio` and the rate function
932
- * (Manim `get_sub_alpha`). */
933
- getSubAlpha(alpha: number, index: number, numSubmobjects: number): number;
934
- setRunTime(runTime: number): this;
935
- /** The run time in seconds: the one that was set, or the default of the animation. */
936
- getRunTime(): number;
937
- /** Manim `set_rate_func`: a built-in rate function such as `m.smooth`, or any `(t) => number`. */
938
- setRateFunc(rateFunc: RateFunc): this;
939
- getRateFunc(): RateFunc;
940
- /** Sets `lagRatio`, as the `lagRatio` option does. */
941
- setLagRatio(lagRatio: number): this;
942
- setName(name: string): this;
943
- /** True when the animation removes its mobject at the end. */
944
- isRemover(): boolean;
945
- /** True when the animation brings its mobject onto the stage. */
946
- isIntroducer(): boolean;
947
- }
948
- /** The options of `m.Mobject(opts)` (Manim's keyword arguments). */
949
- export interface MobjectOptions {
950
- color?: Color;
951
- name?: string;
952
- target?: Mobject;
953
- zIndex?: number;
954
- }
955
- /** One node of the picture tree (Manim `Mobject`). */
956
- export type Mobject = MobjectClass;
957
- /** `m.Mobject(opts)` makes an empty Mobject, as Manim's `Mobject()`. `instanceof m.Mobject`
958
- * is true for every node. */
959
- export declare const Mobject: typeof MobjectClass & ((opts?: MobjectOptions) => Mobject);
960
- /** The options of an engine animation that are not Manim's keyword arguments of its call. */
961
- export interface EngineDefaults {
962
- rate?: RateFunc;
963
- lagRatio?: number;
964
- introducer?: boolean;
965
- remover?: boolean;
966
- }
967
- /** An engine animation as an Animation (or a subclass `Cls`): `opts` are the caller's options,
968
- * `defaults` the defaults of the engine animation. */
969
- export declare function engineAnimation<T extends Animation>(Cls: new (mobject?: Mobject, opts?: AnimationOptions) => T, handle: RawAnimation, mobject: Mobject | undefined, opts?: AnimationOptions & {
970
- pathArc?: number;
971
- shift?: Point;
972
- scale?: number;
973
- pathFunc?: PathFunc;
974
- }, defaults?: EngineDefaults): T;
975
- /** Manim's `path_func`: the points at progress `alpha`, from the start points and the end
976
- * points of one family member. */
977
- export type PathFunc = (startPoints: Point[], endPoints: Point[], alpha: number) => Point[];
978
- /** The Mobject methods that return the Mobject (they chain on `.animate`). */
979
- type Chaining = {
980
- [K in Exclude<keyof Mobject, "animate" | "always">]: Mobject[K] extends (...args: never[]) => Mobject ? K : never;
981
- }[Exclude<keyof Mobject, "animate" | "always">];
982
- type BuilderMethods = {
983
- [K in Chaining]: (...args: Parameters<Mobject[K]>) => AnimationBuilder;
984
- };
985
- /** `mob.always`: each Mobject method that chains adds an updater that calls it. */
986
- export type UpdaterBuilder = {
987
- [K in Chaining]: (...args: Parameters<Mobject[K]>) => UpdaterBuilder;
988
- };
989
- /** `mob.animate.shift(m.UP).setColor(c)`, or `mob.animate({ rateFunc, pathArc }).shift(m.UP)`: an
990
- * Animation to a copy of `mob` that the chained Mobject methods change. */
991
- export type AnimationBuilder = Animation & BuilderMethods & ((opts: AnimationOptions & {
992
- pathArc?: number;
993
- }) => AnimationBuilder);
994
- /** Animations as `s.play` and the groups take them: arrays flatten. */
995
- export type Animations = Animation | readonly Animations[];
996
- /** The Animations of rest arguments, arrays flattened. */
997
- export declare function animationList(items: readonly Animations[]): Animation[];
998
- /** Rest arguments `T` with an optional options object `O` last. */
999
- export declare function split<T, O>(args: readonly (T | O)[]): [T[], O | undefined];
1000
- /** The engine animations of rest arguments (arrays flatten), each checked. */
1001
- export declare function animations(label: string, items: readonly Animations[]): RawAnimation[];
1002
- /** The shape functions that Circumscribe draws as a circle: geometry.ts adds `m.Circle`. */
1003
- export declare const circleFrames: WeakSet<object>;
1004
- /** The animations of `tracker.animate`. */
1005
- interface TrackerMethods {
1006
- setValue(value: number): Animation;
1007
- incrementValue(delta: number): Animation;
1008
- }
1009
- /** `tracker.animate`: `.setValue(v)` and `.incrementValue(d)`, or called with the animation
1010
- * options first, as `mob.animate`. */
1011
- export type TrackerBuilder = TrackerMethods & ((opts: AnimationOptions) => TrackerMethods);
1012
- /** A number that animations change and updaters read. */
1013
- declare class Tracker {
1014
- #private;
1015
- constructor(value?: number);
1016
- getValue(): number;
1017
- setValue(value: number): this;
1018
- incrementValue(dValue: number): this;
1019
- /** Sets the value between the values of two trackers at `alpha` (Manim `interpolate`).
1020
- * `pathFunc` maps `[a, 0]`, `[b, 0]` and `alpha` to the point whose x is the value. */
1021
- interpolate(mobject1: Tracker, mobject2: Tracker, alpha: number, pathFunc?: (a: Point, b: Point, alpha: number) => Point): this;
1022
- /** `tracker.animate.setValue(v)`, `tracker.animate.incrementValue(d)`, or with the
1023
- * animation options first: `tracker.animate({ rateFunc }).setValue(v)`. */
1024
- get animate(): TrackerBuilder;
1025
- }
1026
- /** A ValueTracker. */
1027
- export type ValueTracker = Tracker;
1028
- /** `ValueTracker(value)` (Manim; called without `new`). */
1029
- export declare function ValueTracker(value?: number): ValueTracker;
1030
- /** The style options of every shape (Manim's VMobject keyword arguments). `color` sets the
1031
- * fill and stroke colours; `fillColor` and `strokeColor` then replace one of them. */
1032
- export interface StyleOptions {
1033
- color?: Color;
1034
- fillColor?: Color;
1035
- fillOpacity?: number;
1036
- strokeColor?: Color;
1037
- strokeWidth?: number;
1038
- strokeOpacity?: number;
1039
- }
1040
- /** `m` with the style options applied, in Manim's order. */
1041
- export declare function styled<T extends Mobject>(m: T, style?: StyleOptions): T;
1042
- /** A text weight (Manim's `weight` and `t2w`): `m.BOLD` and the heavier weights use the house
1043
- * font's semibold face; the others use its regular face. */
1044
- export type Weight = string;
1045
- /** A text slant (Manim's `slant` and `t2s`): `"ITALIC"` and `"OBLIQUE"` slant the glyphs. */
1046
- export type Slant = string;
1047
- /** The options of Text and MarkupText (Manim's keyword arguments). */
1048
- export interface TextOptions {
1049
- fontSize?: number;
1050
- color?: Color;
1051
- fillOpacity?: number;
1052
- strokeWidth?: number;
1053
- /** Manim's `line_spacing`: -1 (the default) is the font's spacing; another value puts the
1054
- * baselines `(1 + lineSpacing) / 1.3` times as far apart. */
1055
- lineSpacing?: number;
1056
- slant?: Slant;
1057
- weight?: Weight;
1058
- /** A colour for each occurrence of a substring, or for a slice `"[start:end]"` of the
1059
- * text (spaces count). A later key wins where two overlap. */
1060
- t2c?: Readonly<Record<string, Color>>;
1061
- /** A slant for each key, as `t2c`. */
1062
- t2s?: Readonly<Record<string, Slant>>;
1063
- /** A weight for each key, as `t2c`. */
1064
- t2w?: Readonly<Record<string, Weight>>;
1065
- /** A colour gradient for each key, as `t2c`. */
1066
- t2g?: Readonly<Record<string, readonly Color[]>>;
1067
- /** Colours spread over the characters, first to last. */
1068
- gradient?: readonly Color[];
1069
- /** The number of spaces for each tab. */
1070
- tabWidth?: number;
1071
- /** Scales the text to this height. */
1072
- height?: number;
1073
- /** Scales the text to this width. */
1074
- width?: number;
1075
- }
1076
- /** Manim's `color_gradient`: `n` colours spread evenly over `colors`. */
1077
- export declare function gradientColors(colors: readonly Color[], n: number): Color[];
1078
- /** House-font text (Manim `Text`). All on-screen words use Text. Its submobjects are the
1079
- * glyphs, one for each character that is not whitespace. */
1080
- export declare function Text(text: string, opts?: TextOptions): Mobject;
1081
- /** The options of Image. */
1082
- export interface ImageOptions {
1083
- /** The height in scene units (default 2, or what `width` gives). */
1084
- height?: number;
1085
- /** The width in scene units. */
1086
- width?: number;
1087
- }
1088
- /** A picture from a file of the project (`m.Image("shot.png")`), an object of the scene like a
1089
- * shape: it moves, scales, rotates and fades (`fadeIn`, `setOpacity`), and the frame crops it.
1090
- * The path is from the chapter file and stays inside the project folder (no URLs). PNG, JPEG and
1091
- * WebP are shown as they are, a GIF shows its first frame, and an SVG is a picture. It is 2 units
1092
- * high, as wide as the file's ratio gives. `aula check` reports a missing file, an unknown
1093
- * format and a file that is too large, at this call. A picture has no stroke. */
1094
- export declare function Image(path: string, opts?: ImageOptions): Mobject;
1095
- /** The background panel of Code (Manim's `background_config`). Colours default to the
1096
- * formatter style's panel. */
1097
- export interface CodeBackgroundConfig {
1098
- buff?: number;
1099
- fillColor?: Color;
1100
- fillOpacity?: number;
1101
- strokeColor?: Color;
1102
- strokeWidth?: number;
1103
- cornerRadius?: number;
1104
- }
1105
- /** The text of Code (Manim's `paragraph_config`). */
1106
- export interface CodeParagraphConfig {
1107
- fontSize?: number;
1108
- /** Extra space between lines, in ems: 0.5 puts the baselines 1.5 ems apart. */
1109
- lineSpacing?: number;
1110
- }
1111
- /** The options of Code (Manim's keyword arguments). */
1112
- export interface CodeOptions {
1113
- /** The source code. */
1114
- codeString: string;
1115
- /** A language name or file extension: typescript (ts), javascript (js), json, rust (rs),
1116
- * python (py) or bash (sh, shell). Omitted: plain text. */
1117
- language?: string;
1118
- /** The colour theme: "dark" (the default) or "light". */
1119
- formatterStyle?: "dark" | "light";
1120
- tabWidth?: number;
1121
- addLineNumbers?: boolean;
1122
- lineNumbersFrom?: number;
1123
- background?: "rectangle" | "window";
1124
- backgroundConfig?: CodeBackgroundConfig;
1125
- paragraphConfig?: CodeParagraphConfig;
1126
- }
1127
- /** Source code with syntax highlighting: Manim's `Code`. Its submobjects are the background,
1128
- * the line numbers (with `addLineNumbers`) and the code lines. */
1129
- export declare class CodeMobject extends Mobject {
1130
- #private;
1131
- /** The code lines: line `i` is `codeLines.submobjects[i]`, and its submobjects are its
1132
- * characters that are not whitespace. */
1133
- get codeLines(): Mobject;
1134
- /** The line numbers, one submobject for each line, or undefined without them. */
1135
- get lineNumbers(): Mobject | undefined;
1136
- /** The panel (with the window buttons as its submobjects). */
1137
- get background(): Mobject;
1138
- copy(): CodeMobject;
1139
- }
1140
- /** A code block as a type: what Code returns. */
1141
- export type Code = CodeMobject;
1142
- /** Source code with syntax highlighting (Manim `Code`): `Code({ codeString, language })`. The
1143
- * engine has the grammars of bat. A language with no grammar is an error at the call; no
1144
- * language is plain text. */
1145
- export declare function Code(opts: CodeOptions): CodeMobject;
1146
- /** The options of MathTex and Tex (Manim's keyword arguments). */
1147
- export interface TexOptions {
1148
- fontSize?: number;
1149
- color?: Color;
1150
- /** Put between the arguments: " " for MathTex, "" for Tex. */
1151
- argSeparator?: string;
1152
- /** Each occurrence becomes a part of its own. */
1153
- substringsToIsolate?: readonly string[];
1154
- /** Each key becomes a part of its own, in the colour. */
1155
- texToColorMap?: Readonly<Record<string, Color>>;
1156
- }
1157
- /** How getPartsByTex and setColorByTex compare a part with `tex`. */
1158
- export interface TexMatch {
1159
- /** True (the default): the part contains `tex`. False: the part is `tex`. */
1160
- substring?: boolean;
1161
- caseSensitive?: boolean;
1162
- }
1163
- /** A formula: Manim's `MathTex` or `Tex`. Its submobjects are the parts, one for each
1164
- * argument, `{{ … }}` group and isolated substring; each part's submobjects are its glyphs. */
1165
- export declare class MathTexMobject extends Mobject {
1166
- #private;
1167
- /** The whole LaTeX (Manim `tex_string`). */
1168
- readonly texString: string;
1169
- constructor(handle: RawMobject, texStrings: readonly string[], texString: string);
1170
- /** The LaTeX of each part (Manim `tex_strings`). */
1171
- get texStrings(): readonly string[];
1172
- /** The whole LaTeX (Manim `get_tex_string`). */
1173
- getTexString(): string;
1174
- /** Sets the opacity of the parts that match `tex`; with `remainingOpacity`, the other parts
1175
- * take that opacity first (Manim `set_opacity_by_tex`). */
1176
- setOpacityByTex(tex: string, opacity?: number, remainingOpacity?: number, opts?: TexMatch): this;
1177
- /** Sorts the parts by their LaTeX (Manim `sort_alphabetically`). */
1178
- sortAlphabetically(): this;
1179
- copy(): MathTexMobject;
1180
- /** The parts whose LaTeX contains `tex` (or is `tex`), as a VGroup. */
1181
- getPartsByTex(tex: string, opts?: TexMatch): Mobject;
1182
- /** The first part whose LaTeX contains `tex`, or undefined (Manim `None`). */
1183
- getPartByTex(tex: string, opts?: TexMatch): Mobject | undefined;
1184
- setColorByTex(tex: string, color: Color, opts?: TexMatch): this;
1185
- setColorByTexToColorMap(texsToColorMap: Readonly<Record<string, Color>>, opts?: TexMatch): this;
1186
- /** The index of `part` among the parts. */
1187
- indexOfPart(part: Mobject): number;
1188
- indexOfPartByTex(tex: string, opts?: TexMatch): number;
1189
- }
1190
- /** A formula as a type: what MathTex and Tex return. */
1191
- export type MathTex = MathTexMobject;
1192
- /** What Tex returns. */
1193
- export type Tex = MathTexMobject;
1194
- /** Math-mode LaTeX (Manim `MathTex`), drawn by MathJax: `MathTex("a^2", "+", "b^2", { fontSize })`. */
1195
- export declare function MathTex(...args: (string | TexOptions)[]): MathTexMobject;
1196
- /** Text-mode LaTeX (Manim `Tex`): math goes between `$` signs. */
1197
- export declare function Tex(...args: (string | TexOptions)[]): MathTexMobject;
1198
- /** Mobjects of rest arguments: arrays nest to any depth. */
1199
- export type Mobjects = Mobject | readonly Mobjects[];
1200
- /** The options of `m.VMobject` (Manim's keyword arguments). */
1201
- export interface VMobjectOptions extends StyleOptions {
1202
- jointType?: LineJointType;
1203
- capStyle?: CapStyleType;
1204
- closeNewPoints?: boolean;
1205
- preFunctionHandleToAnchorScaleFactor?: number;
1206
- makeSmoothAfterApplyingFunctions?: boolean;
1207
- toleranceForPointEquality?: number;
1208
- /** 4: a curve is a cubic Bézier curve. Another value is an error. */
1209
- nPointsPerCubicCurve?: number;
1210
- }
1211
- /** A Mobject with no points: build its path with `startNewPath`, `addLineTo`,
1212
- * `setPointsAsCorners` and the other path methods (Manim `VMobject`). */
1213
- export declare function VMobject(opts?: VMobjectOptions): Mobject;
1214
- export declare function VGroup(...items: Mobjects[]): Mobject;
1215
- /** Points of rest arguments: points, or arrays of them nested to any depth. */
1216
- export type Points = Point | readonly Points[];
1217
- export declare function flatPoints(items: readonly Points[]): Point[];
1218
- /** An open polyline through `points` (not in Manim): `Polyline(...points, opts)`. */
1219
- export declare function Polyline(...args: (Points | StyleOptions)[]): Mobject;
1220
- export declare function CubicBezier(startAnchor: Point, startHandle: Point, endHandle: Point, endAnchor: Point, opts?: StyleOptions): Mobject;
1221
- /** The options of DashedVMobject (Manim's keyword arguments). */
1222
- export interface DashedVMobjectOptions {
1223
- numDashes?: number;
1224
- /** The share of the length that the dashes cover. */
1225
- dashedRatio?: number;
1226
- /** Moves the dashes along the path, in periods (dash and gap). */
1227
- dashOffset?: number;
1228
- /** As in Manim, the style of `vmobject` replaces it. */
1229
- color?: Color;
1230
- /** True: the dashes have the same length. False: proportions count curves. */
1231
- equalLengths?: boolean;
1232
- }
1233
- /** `vmobject` as dashes (Manim `DashedVMobject`), in the style of `vmobject`. */
1234
- export declare function DashedVMobject(vmobject: Mobject, opts?: DashedVMobjectOptions): Mobject;
1235
- /** The options of DecimalNumber and Integer (Manim's keyword arguments). */
1236
- export interface DecimalNumberOptions {
1237
- numDecimalPlaces?: number;
1238
- /** A `+` before positive numbers and zero. */
1239
- includeSign?: boolean;
1240
- /** Commas between groups of three digits (default true). */
1241
- groupWithCommas?: boolean;
1242
- /** Plain text after the number, such as `"%"` or `" kg"`. */
1243
- unit?: string;
1244
- /** The edge that stays in place when the value changes (default `m.LEFT`). */
1245
- edgeToFix?: Point;
1246
- fontSize?: number;
1247
- color?: Color;
1248
- /** The stroke width of the glyphs (default 0). */
1249
- strokeWidth?: number;
1250
- /** The fill opacity of the glyphs (default 1). */
1251
- fillOpacity?: number;
1252
- }
1253
- /** A number that `setValue` changes: Manim's `DecimalNumber`. Its submobjects are the glyphs. */
1254
- export declare class DecimalNumberMobject extends Mobject {
1255
- copy(): DecimalNumberMobject;
1256
- getValue(): number;
1257
- /** Draws `number` in place of the value, at the same size, with the edge `edgeToFix` in place. */
1258
- setValue(number: number): this;
1259
- incrementValue(deltaT?: number): this;
1260
- }
1261
- /** A whole number: Manim's `Integer`. `getValue` rounds (half to even). */
1262
- export declare class IntegerMobject extends DecimalNumberMobject {
1263
- copy(): IntegerMobject;
1264
- getValue(): number;
1265
- }
1266
- /** A number as a type: what DecimalNumber returns. */
1267
- export type DecimalNumber = DecimalNumberMobject;
1268
- /** What Integer returns. */
1269
- export type Integer = IntegerMobject;
1270
- /** A number in the house font (Manim `DecimalNumber`): `DecimalNumber(3.14159, { numDecimalPlaces: 3 })`. */
1271
- export declare function DecimalNumber(number?: number, opts?: DecimalNumberOptions): DecimalNumberMobject;
1272
- /** A whole number (Manim `Integer`): `DecimalNumber` with no decimal places. */
1273
- export declare function Integer(number?: number, opts?: DecimalNumberOptions): IntegerMobject;
1274
- /** Rebuilt by `func` on every frame (Manim `always_redraw`). */
1275
- export declare function alwaysRedraw(func: () => Mobject): Mobject;
1276
- declare const ROW: unique symbol;
1277
- /** The notes of a paragraph: plain data that a kit gives and `aula timeline` prints, in order. */
1278
- export type Notes = Readonly<Record<string, string | readonly string[]>>;
1279
- /** A paragraph of the chapter's text, for a kit check: its place, its says and moves, its
1280
- * index in the chapter (from 0), its notes, and what was on screen while it played. */
1281
- export interface CheckedParagraph extends Omit<RawParagraphText, "notes"> {
1282
- index: number;
1283
- notes: Notes;
1284
- /** What was on screen while the paragraph played: one instant for each animation that changes it, with the
1285
- * line of its move, and the texts (`m.Text`, not `m.Code` or `m.MathTex`) and the dashed shapes on
1286
- * screen at its end, each with the line of the call that first showed it, and its bounds and its
1287
- * opacity at that instant. */
1288
- screen: Screen;
1289
- }
1290
- /** The chapter's text, for a kit check, with the chapter's number (from 1) and the number of
1291
- * chapters of the project. */
1292
- export interface CheckedChapter extends RawChapterText {
1293
- number: number;
1294
- count: number;
1295
- /** True when `path`, from the working directory (as the paths in diagnostics are), is a
1296
- * file (`Host.exists`). */
1297
- exists(path: string): boolean;
1298
- }
1299
- /** One kit finding: a warning that `aula check` prints. */
1300
- export interface Finding {
1301
- message: string;
1302
- /** The default is the line of the paragraph. */
1303
- at?: Location;
1304
- }
1305
- /** A kit's rules on one paragraph: aula calls it one time, after the chapter is drawn. */
1306
- export type Check = (p: CheckedParagraph, chapter: CheckedChapter) => Finding[];
1307
- /** One frame of a call stack: its function, and its file as the host names it, line and
1308
- * column. */
1309
- export interface StackFrame {
1310
- function: string;
1311
- file: string;
1312
- line: number;
1313
- col: number;
1314
- }
1315
- /** A call that needs a place (a row, `defineChapter`, `defineProject`): an Error made at the
1316
- * call. The host reads its frames when the chapter runs (`ChapterSlot.frames`). */
1317
- type Call = Error;
1318
- type RowData = {
1319
- readonly kind: "paragraph";
1320
- readonly call: Call;
1321
- readonly notes: Notes;
1322
- readonly check: Check | undefined;
1323
- } | {
1324
- readonly kind: "say";
1325
- readonly call: Call;
1326
- readonly parts: readonly SayPart[];
1327
- } | {
1328
- readonly kind: "embed";
1329
- readonly call: Call;
1330
- readonly note: string;
1331
- /** The path of the file, as written. */
1332
- readonly path: string;
1333
- readonly image: string | undefined;
1334
- } | {
1335
- readonly kind: "show";
1336
- readonly call: Call;
1337
- readonly note: string;
1338
- readonly move: ((s: Scene) => void) | undefined;
1339
- /** The timing text after the note: a share of its `say` (`25%`) or seconds (`3s`). The
1340
- * engine reads it, and stops at the row when it is not a timing or when there is none. */
1341
- readonly timing: string | undefined;
1342
- };
1343
- /** One row of a chapter: `paragraph(…)`, ``say`text` `` or ``show`note``25%`(move)``. */
1344
- export interface Row {
1345
- readonly [ROW]: RowData;
1346
- }
1347
- /** ``show`note``25%` ``: an open move (no animation yet). Called with its move function, it
1348
- * returns the move: ``show`note``25%`((s) => { … })``. */
1349
- export interface OpenMove extends Row {
1350
- (move: (s: Scene) => void): Row;
1351
- }
1352
- /** ``show`note` ``: not a row yet. It takes the timing of the move, a second template right
1353
- * after the note: ``show`note``25%` `` (a share of its `say`) or ``show`note``3s` `` (seconds). */
1354
- export interface Untimed {
1355
- (timing: TemplateStringsArray): OpenMove;
1356
- }
1357
- /** The fields of `defineChapter`: one chapter of a project. */
1358
- export interface ChapterFields {
1359
- /** The `##` heading, spoken first: a plain string (the usual form), or a ``say`…` `` when a word
1360
- * needs `pronounce`. The cards show the written text, and the narrator speaks the reading. */
1361
- heading: string | SayRow;
1362
- /** The one recurring picture that the chapter is built on. */
1363
- metaphor: string;
1364
- /** Makes the objects of the chapter and returns its rows in time order. aula calls it for
1365
- * each run, and it must return the same rows each time. */
1366
- rows: () => Row[];
1367
- }
1368
- /** What `defineChapter` returns. */
1369
- export interface ChapterDefinition extends Readonly<Omit<ChapterFields, "heading">> {
1370
- /** The heading as written: the cards, the chapter names and `aula script` show it. */
1371
- readonly heading: string;
1372
- /** The parts of the heading's `say`: a plain string is one part with no reading. */
1373
- readonly headingParts: readonly SayPart[];
1374
- /** The call of the heading's `say` (its line), or the defineChapter call for a plain string. */
1375
- readonly headingCall: Error;
1376
- /** The defineChapter call: its second frame is the chapter file (`definedAt` in
1377
- * `@beff/aula/run`). */
1378
- readonly call: Error;
1379
- }
1380
- /** `export default defineChapter({ heading, metaphor, rows: () => [ … ] })`: one chapter.
1381
- * Makes no engine call. */
1382
- export declare function defineChapter(fields: ChapterFields): ChapterDefinition;
1383
- declare const PROJECT: unique symbol;
1384
- /** The fields of `defineProject`: one project. */
1385
- export interface ProjectFields {
1386
- /** The project title: the title card (chapter 0). The name of the project is its folder name.
1387
- * A plain string (the usual form), or a ``say`…` `` when a word needs `pronounce`. The title card
1388
- * shows the written text, and the narrator speaks the reading. */
1389
- title: string | SayRow;
1390
- /** The storyboard header: recurring objects, symbols and colour rules. */
1391
- storyboard?: string;
1392
- /** The colours and text sizes of the chrome (title card, chapter cards, docked heading) and
1393
- * the colour of the frame. The default is `m.theme`. */
1394
- theme?: Theme;
1395
- /** The chapter card and the docked heading of each chapter and of the title card. The
1396
- * default is `m.card`. */
1397
- card?: Card;
1398
- /** The chapters, in order: the default exports of their chapter modules. */
1399
- chapters: readonly ChapterDefinition[];
1400
- /** The words that have one reading in all of the video: each key is a written word, and each
1401
- * value is the reading that the narrator speaks at each use of the word in a `say`, in the
1402
- * title and in a heading (the reading of `pronounce`). The match is the whole word, with marks around it and a
1403
- * possessive `'s`, in the same case; a key that starts with a lowercase letter also matches
1404
- * the word with a capital first letter. `pronounce` comes first, and aula's own lexicon and
1405
- * misaki come after it. The default is no word. */
1406
- lexicon?: Lexicon;
1407
- }
1408
- /** What `defineProject` returns. */
1409
- export interface ProjectDefinition extends Required<Omit<ProjectFields, "card" | "theme" | "title">> {
1410
- /** The title as written: the title card, the list of videos and `aula script` show it. */
1411
- readonly title: string;
1412
- /** The parts of the title's `say`: a plain string is one part with no reading. */
1413
- readonly titleParts: readonly SayPart[];
1414
- /** The call of the title's `say` (its line), or the defineProject call for a plain string. */
1415
- readonly titleCall: Error;
1416
- /** The theme that the project gives, if any. */
1417
- readonly theme?: Theme;
1418
- /** The card that the project gives, if any. */
1419
- readonly card?: Card;
1420
- readonly [PROJECT]: true;
1421
- /** The defineProject call: its second frame is the project module (`definedAt` in
1422
- * `@beff/aula/run`). */
1423
- readonly call: Error;
1424
- }
1425
- /** `export default defineProject({ title, storyboard, theme, lexicon, chapters })`: one project,
1426
- * in the `index.ts` of its folder. Makes no engine call. */
1427
- export declare function defineProject(fields: ProjectFields): ProjectDefinition;
1428
- /** True for a value that defineProject made. */
1429
- export declare function isProjectDefinition(v: unknown): v is ProjectDefinition;
1430
- /** Starts a paragraph: one narration cue. `notes` is plain data that `aula timeline` prints
1431
- * under the paragraph. `check` is for kits: aula calls it one time, after the chapter is drawn,
1432
- * and reports its findings. */
1433
- export declare function paragraph(notes?: Notes, check?: Check): Row;
1434
- declare const PRONOUNCE: unique symbol;
1435
- /** How the narrator reads the word of `pronounce`: `{ say: "…" }` is plain text, which goes
1436
- * through the normal front end (aula's lexicon, then misaki), and `{ phonemes: "…" }` is
1437
- * phonemes of Kokoro's token table (misaki's symbols, as `aula tokens` shows them). */
1438
- export type Reading = {
1439
- readonly say: string;
1440
- } | {
1441
- readonly phonemes: string;
1442
- };
1443
- /** What `pronounce` returns: one written word and its reading. Only a `say` takes it: a `say` row,
1444
- * or a `say` that is the `title` of `defineProject` or the `heading` of `defineChapter`. */
1445
- export interface Pronounce {
1446
- readonly [PRONOUNCE]: true;
1447
- readonly written: string;
1448
- readonly reading: Reading;
1449
- }
1450
- /** ``say`The file is 4 ${pronounce("GB", { say: "gigabytes" })}.` ``: one word that the
1451
- * screen, the word times and `aula script` show as `written`, and that the narrator reads as
1452
- * `reading`. The written part is one word, and its word time covers all of the reading. Use it
1453
- * only for a word whose reading changes with the context. It goes in a `say`: a row, the
1454
- * `title` of `defineProject` or the `heading` of `defineChapter`. `aula check` gives an error when the
1455
- * written part is not one word, or when a phoneme is not in Kokoro's token table. */
1456
- export declare function pronounce(written: string, reading: Reading): Pronounce;
1457
- /** The text of a row tag (`name` is the tag), as written: one template with no invalid escape
1458
- * and no line break. A `${…}` can only be the value of `pronounce`, and its written word is in
1459
- * the text. Throws a AulaError at the row. A kit's own row tag calls it with the values of its
1460
- * template. */
1461
- export declare function tagText(name: string, strings: TemplateStringsArray, ...values: readonly unknown[]): string;
1462
- declare const SAY: unique symbol;
1463
- /** What ``say`…` `` returns: a row of the narration, or the `title` of `defineProject` or the
1464
- * `heading` of `defineChapter`. */
1465
- export interface SayRow extends Row {
1466
- readonly [SAY]: true;
1467
- }
1468
- /** ``say`text` ``: the next words of the narration. A `${…}` can only be
1469
- * `pronounce(written, reading)`: ``say`The file is 4 ${pronounce("GB", { say: "gigabytes" })}.` ``.
1470
- * The written text is on the screen where aula shows the text (the cards, for a title or a
1471
- * heading), in the word times and in `aula script`, and the narrator speaks the reading. A
1472
- * `say` is a row, the `title` of `defineProject` or the `heading` of `defineChapter`. */
1473
- export declare function say(strings: TemplateStringsArray, ...words: readonly Pronounce[]): SayRow;
1474
- /** ``show`note``timing` ``: a move. The note says what changes on screen. The timing, a
1475
- * second template right after the note, gives the length of the move: ``25%`` is a share of the
1476
- * `say` above it (0 < N <= 100) and scales with the narration, and ``3s`` is seconds (N > 0).
1477
- * ``25%`` is the usual timing. ``show`note``25%` `` is an open move, ``show`note``25%`((s) =>
1478
- * { … })`` a move, and ``show`note``25%`(() => {})`` a hold. The move starts on the first word
1479
- * of its `say`, and its parts (each `s.play`, `s.fadeAll` and `s.wait`) split its length in
1480
- * proportion to their Manim lengths, each at least 0.5 seconds. The longer one wins: the picture holds until the `say`
1481
- * ends, or the narration waits until the move ends. */
1482
- export declare function show(strings: TemplateStringsArray): Untimed;
1483
- /** The options of ``embed`note`(path, options)``. */
1484
- export interface EmbedOptions {
1485
- /** The picture that stays on screen while a sound plays: a PNG or JPEG file of the project
1486
- * folder. Without it, the picture before the clip stays. */
1487
- readonly image?: string;
1488
- }
1489
- /** ``embed`note`(path)``: a prepared clip that plays between two `say` rows, while the
1490
- * narration is silent. The note says what the clip shows. The `path` is a file of the project
1491
- * folder: an MP4 (H.264, AAC) or WebM (VP8 or VP9, Opus or Vorbis) video, which fills the
1492
- * picture in 16:9 on the theme background, or a WAV (PCM) or MP3 sound, which plays over the
1493
- * picture that stays (or over `{ image }`, a PNG or JPEG file). The clip plays after the `say`
1494
- * above it, and the next `say` starts 0.25 s after it ends: the narration waits for it, and no
1495
- * move runs. Write it after a `say` that ends a sentence. `aula check` gives an error at the row
1496
- * for a file that is missing or too big (50 MB), with a format that aula does not play or a
1497
- * header with no length. */
1498
- export declare function embed(strings: TemplateStringsArray): (path: string, options?: EmbedOptions) => Row;
1499
- /** The heading cue that a card draws: the input of the hook of the chapter card. */
1500
- export interface Heading {
1501
- /** The heading of the chapter, or the project title on the title card. */
1502
- readonly title: string;
1503
- /** The number of the chapter, from 1, or 0 for the title card. */
1504
- readonly chapter: number;
1505
- /** The number of chapters, without the title card. */
1506
- readonly count: number;
1507
- /** The theme of the project. */
1508
- readonly theme: Theme;
1509
- /** Seconds from the chapter start where the speech of the heading starts, on the frame grid. */
1510
- readonly start: number;
1511
- /** Seconds from the chapter start where the speech of the heading ends, on the frame grid. */
1512
- readonly end: number;
1513
- /** Makes `mobjects` the chrome of the chapter: the card and the docked heading. `s.fadeAll`,
1514
- * `s.clear`, `s.canvas()` and `s.getTopLevelMobjects()` leave the chrome, and the reading
1515
- * checks skip it. The overlap checks see it as ordinary text. Each call replaces the list. */
1516
- chrome(...mobjects: Mobject[]): void;
1517
- }
1518
- /** The chapter card: it plays while the heading is spoken and leaves the docked heading. aula
1519
- * calls it at the start of each chapter, and on the title card, when the chapter is drawn (not
1520
- * when it is only read). The default is `m.card`; a project gives its own to
1521
- * `defineProject({ card })`. */
1522
- export type Card = (s: Scene, heading: Heading) => void;
1523
- /** The scene of a move, as `self` in a Manim `construct`: the picture calls. */
1524
- export declare class Scene {
1525
- #private;
1526
- constructor(handle: RawChapter, slot: ChapterSlot, at?: Location);
1527
- /** Plays animations together (Manim `self.play`) until the longest ends. `rateFunc` and
1528
- * `lagRatio` replace the values of every animation, as in Manim. In a move, the play is one
1529
- * part of the move, and `runTime` (or its longest animation) is its Manim length: the parts
1530
- * split the length of the move in proportion to their Manim lengths. `runTime` replaces the
1531
- * run time of every animation; outside a move (the card), it is seconds. */
1532
- play(...args: (Animations | {
1533
- runTime?: number;
1534
- rateFunc?: RateFunc;
1535
- lagRatio?: number;
1536
- })[]): void;
1537
- add(...items: Mobjects[]): void;
1538
- remove(...items: Mobjects[]): void;
1539
- /** Moves the mobjects to the front, in order (Manim `self.bring_to_front`, the same as
1540
- * `add`). A mobject that is not on the stage is added. */
1541
- bringToFront(...items: Mobjects[]): void;
1542
- /** Moves the mobjects to the back, in order (Manim `self.bring_to_back`). A mobject that is
1543
- * not on the stage is added at the back. */
1544
- bringToBack(...items: Mobjects[]): void;
1545
- /** Holds the picture (Manim `self.wait`) for `duration` seconds, 1 by default. In a move, it is
1546
- * one part of the move, and `duration` is its Manim length. `frozenFrame` has no effect: the
1547
- * updaters run on every frame. */
1548
- wait(duration?: number, _opts?: {
1549
- frozenFrame?: boolean;
1550
- }): void;
1551
- /** `wait(duration)` (Manim `pause`). */
1552
- pause(duration?: number): void;
1553
- /** The objects on the stage, without the docked heading, that no other object on the stage
1554
- * holds (Manim `get_top_level_mobjects`). */
1555
- getTopLevelMobjects(): Mobject[];
1556
- /** Every object on the stage and all their members (Manim `get_mobject_family_members`). */
1557
- getMobjectFamilyMembers(): Mobject[];
1558
- /** The values of the attributes `keys` (Manim `get_attrs`). */
1559
- getAttrs(...keys: string[]): unknown[];
1560
- /** Runs the updaters of the objects on the stage now (Manim `update_mobjects`). */
1561
- updateMobjects(dt: number): void;
1562
- /** Runs the scene updaters now (Manim `update_self`). */
1563
- updateSelf(dt: number): void;
1564
- /** True when a scene updater or an updater that takes `dt` is on the stage (Manim
1565
- * `should_update_mobjects`). */
1566
- shouldUpdateMobjects(): boolean;
1567
- /** Runs `func(dt)` on every frame, after the updaters of the objects (Manim
1568
- * `Scene.add_updater`). */
1569
- addUpdater(func: (dt: number) => void): void;
1570
- /** Removes the scene updater `func` (Manim `Scene.remove_updater`). */
1571
- removeUpdater(func: (dt: number) => void): void;
1572
- /** `newMobject` takes the place of `oldMobject` on the stage, or inside the object that holds
1573
- * it (Manim `replace`). `oldMobject` that is not on the stage is an error. */
1574
- replace(oldMobject: Mobject, newMobject: Mobject): void;
1575
- /** Removes every object except the docked heading now, with no animation (Manim `clear`). */
1576
- clear(): void;
1577
- /** Adds the mobjects and keeps them in front: each later `add` moves them back to the front
1578
- * (Manim `add_foreground_mobjects`). */
1579
- addForegroundMobjects(...items: Mobjects[]): void;
1580
- /** `addForegroundMobjects(mobject)` (Manim `add_foreground_mobject`). */
1581
- addForegroundMobject(mobject: Mobject): void;
1582
- /** The mobjects are no longer kept in front; they stay on the stage (Manim
1583
- * `remove_foreground_mobjects`). */
1584
- removeForegroundMobjects(...items: Mobjects[]): void;
1585
- /** `removeForegroundMobjects(mobject)` (Manim `remove_foreground_mobject`). */
1586
- removeForegroundMobject(mobject: Mobject): void;
1587
- /** Fades everything except the docked heading and `keep` (a new canvas). In a move, the fade
1588
- * is one part of the move. */
1589
- fadeAll(opts?: {
1590
- keep?: Mobjects;
1591
- }): void;
1592
- /** Everything on screen except the docked heading, as one group. */
1593
- canvas(): Mobject;
1594
- /** A kit finding on the picture: a warning with `message`, at the calling line or at `at`.
1595
- * `aula check` reports it. */
1596
- warn(message: string, at?: Location): void;
1597
- /** The kit findings so far. */
1598
- get warnings(): readonly Diagnostic[];
1599
- /** Seconds since the chapter start. */
1600
- get time(): number;
1601
- }
1602
- /** Where a chapter runs: its number (from 1), the number of chapters of the project, its file,
1603
- * and how the host reads the frames of a call. */
1604
- export interface ChapterSlot {
1605
- number: number;
1606
- count: number;
1607
- /** The chapter file as the frames name it. */
1608
- source: string;
1609
- /** The chapter file as diagnostics name it. */
1610
- file: string;
1611
- /** The frames of an error (`Host.frames`). */
1612
- frames(error: Error): readonly StackFrame[];
1613
- /** The project lexicon in the engine's form. */
1614
- lexicon: readonly LexiconEntry[];
1615
- /** What the file `path` of an `embed` is (a path from the project folder), or why it cannot
1616
- * play: the message of the error. */
1617
- clip(path: string): MediaInfo | string;
1618
- /** The picture of the file `path` of an `m.Image` (a path from the chapter file, inside the
1619
- * project folder), or why it cannot be drawn: the message of the error. */
1620
- picture(path: string): PlacedPicture | string;
1621
- }
1622
- /** Reads a chapter: calls `rows` and no move. It gives the text and the text problems; the
1623
- * paragraph checks run only in `drawRows`. A chapter error is thrown (a AulaError, a WIT
1624
- * `result` error or the JS error). */
1625
- export declare function readRows(chapter: ChapterDefinition, slot: ChapterSlot): {
1626
- text: RawChapterText;
1627
- diagnostics: Diagnostic[];
1628
- };
1629
- /** Checks a chapter (`aula check`): calls `rows`, then each move in list order, with no clock
1630
- * and no narration. Each animation jumps to its end, and the engine's checks, the kit findings
1631
- * and the paragraph checks (with `exists`, `Host.exists`) look at the pictures in order. A
1632
- * chapter error is thrown (a AulaError, a WIT `result` error or the JS error). */
1633
- export declare function checkRows(chapter: ChapterDefinition, theme: Theme, card: Card, slot: ChapterSlot, exists: (path: string) => boolean): {
1634
- diagnostics: Diagnostic[];
1635
- };
1636
- /** Checks chapter 0: the card of the project `title`, with no clock. */
1637
- export declare function checkTitleCard(title: string, theme: Theme, card: Card, count: number): {
1638
- diagnostics: Diagnostic[];
1639
- };
1640
- /** How a chapter is drawn against a narration. */
1641
- export interface Drawing {
1642
- /** The narration. */
1643
- narration: Narration;
1644
- /** The name of the Lottie animation. */
1645
- name: string;
1646
- /** Draw no frames: only the clock, the waits and the narration on the clock of the picture. */
1647
- lint: boolean;
1648
- /** The number of chapters with the title card. */
1649
- count: number;
1650
- /** Leave out the linear keyframes that a player interpolates to within a small error. */
1651
- prune: boolean;
1652
- }
1653
- /** A drawn chapter: its problems and its Lottie, on the narration clock. */
1654
- export interface ChapterRun {
1655
- /** Text problems that did not stop the chapter, and a warning at each move that the
1656
- * narration waits for 1 second or more. The checks of the picture are `checkChapter`'s. */
1657
- diagnostics: Diagnostic[];
1658
- lottie: string;
1659
- frames: number;
1660
- chapterSeconds: number;
1661
- /** Each wait of the narration: `samples` of silence before audio sample `sample`, while a
1662
- * move that is longer than its `say` ends. The audio of the chapter has them
1663
- * (`@beff/aula-narration`'s `withWaits`). */
1664
- waits: NarrationWait[];
1665
- /** Each clip of an `embed` that plays, in order: its file, and the audio sample where it
1666
- * starts on the clock of the picture, in its wait (so inside the audio with the waits). */
1667
- embeds: PlayedEmbed[];
1668
- /** The narration on the clock of the picture: each cue and word after a wait comes later by
1669
- * the wait. */
1670
- narration: Narration;
1671
- }
1672
- /** Draws a chapter on the narration clock: calls `rows`, then each move once, in list order,
1673
- * from the first word of its `say` to its end (or for its own length), with its parts sharing
1674
- * that time. An open move holds the picture. When a move is longer than its `say`, the
1675
- * narration waits. A chapter error is thrown (a AulaError, a WIT `result` error or the JS
1676
- * error). */
1677
- export declare function drawRows(chapter: ChapterDefinition, theme: Theme, card: Card, slot: ChapterSlot, drawing: Drawing): ChapterRun;
1678
- /** Draws chapter 0: the card of the project `title` while the title is spoken. */
1679
- export declare function drawTitle(title: string, theme: Theme, card: Card, drawing: Drawing): ChapterRun;
1680
- /** One leaf of one frame of a scene, in frame units, y up. */
1681
- export interface Leaf {
1682
- /** Anchors and handles. */
1683
- points: Point[];
1684
- /** Fill colour: red, green, blue, each 0..=1. */
1685
- fill: [number, number, number];
1686
- /** Fill opacity, 0..=1. */
1687
- fillOpacity: number;
1688
- /** Stroke colour: red, green, blue, each 0..=1. */
1689
- stroke: [number, number, number];
1690
- /** Stroke opacity, 0..=1. */
1691
- strokeOpacity: number;
1692
- /** Stroke width in Manim units (1 = 0.01 frame units). */
1693
- strokeWidth: number;
1694
- /** The path is closed. */
1695
- closed: boolean;
1696
- }
1697
- /** A drawn scene: its Lottie, its frame count and the leaves of each frame. */
1698
- export interface SceneRun {
1699
- lottie: string;
1700
- frames: number;
1701
- trace: Leaf[][];
1702
- }
1703
- /** Draws `draw` as a Manim construct. `s.play` and `s.wait` run from t = 0 at 60 frames a
1704
- * second, on a black background. There is no project, no narration and no heading. */
1705
- export declare function renderScene(draw: (s: Scene) => void): SceneRun;