@beff/aula 0.0.0-stage → 0.1.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 (77) hide show
  1. package/README.md +8 -2
  2. package/dist/animations.d.ts +634 -0
  3. package/dist/animations.js +1793 -0
  4. package/dist/braces.d.ts +84 -0
  5. package/dist/braces.js +253 -0
  6. package/dist/card.d.ts +17 -0
  7. package/dist/card.js +90 -0
  8. package/dist/colors-palette.d.ts +2242 -0
  9. package/dist/colors-palette.js +2241 -0
  10. package/dist/colors.d.ts +120 -0
  11. package/dist/colors.js +403 -0
  12. package/dist/curves.d.ts +10 -0
  13. package/dist/curves.js +128 -0
  14. package/dist/engine.d.ts +1595 -0
  15. package/dist/engine.js +3364 -0
  16. package/dist/errors.d.ts +19 -0
  17. package/dist/errors.js +25 -0
  18. package/dist/generated/aula.conditional-suspending-3-i32-to-void.wasm +0 -0
  19. package/dist/generated/aula.core.wasm +0 -0
  20. package/dist/generated/aula.core2.wasm +0 -0
  21. package/dist/generated/aula.core3.wasm +0 -0
  22. package/dist/generated/aula.core4.wasm +0 -0
  23. package/dist/generated/aula.core5.wasm +0 -0
  24. package/dist/generated/aula.core6.wasm +0 -0
  25. package/dist/generated/aula.core7.wasm +0 -0
  26. package/dist/generated/aula.core8.wasm +0 -0
  27. package/dist/generated/aula.d.ts +80 -0
  28. package/dist/generated/aula.js +54639 -0
  29. package/dist/generated/interfaces/aula-engine-engine.d.ts +983 -0
  30. package/dist/generated/interfaces/aula-engine-host.d.ts +10 -0
  31. package/dist/generated/interfaces/aula-engine-tts.d.ts +43 -0
  32. package/dist/generated/interfaces/aula-engine-types.d.ts +60 -0
  33. package/dist/geometry.d.ts +551 -0
  34. package/dist/geometry.js +1821 -0
  35. package/dist/graph.d.ts +117 -0
  36. package/dist/graph.js +526 -0
  37. package/dist/graphing.d.ts +597 -0
  38. package/dist/graphing.js +1504 -0
  39. package/dist/host.d.ts +19 -0
  40. package/dist/host.js +85 -0
  41. package/dist/index.d.ts +5 -0
  42. package/dist/index.js +11 -0
  43. package/dist/licenses/aula-g2p-NOTICE.txt +13 -0
  44. package/dist/licenses/espeak-ng-COPYING.txt +674 -0
  45. package/dist/licenses/fonts-OFL-JetBrainsMono.txt +93 -0
  46. package/dist/licenses/fonts-OFL-NunitoSans.txt +93 -0
  47. package/dist/load.d.ts +16 -0
  48. package/dist/load.js +69 -0
  49. package/dist/logo.d.ts +30 -0
  50. package/dist/logo.js +186 -0
  51. package/dist/manim.d.ts +22 -0
  52. package/dist/manim.js +19 -0
  53. package/dist/mobjects.d.ts +127 -0
  54. package/dist/mobjects.js +316 -0
  55. package/dist/pointcloud.d.ts +144 -0
  56. package/dist/pointcloud.js +400 -0
  57. package/dist/rates.d.ts +19 -0
  58. package/dist/rates.js +54 -0
  59. package/dist/run.d.ts +82 -0
  60. package/dist/run.js +245 -0
  61. package/dist/tables.d.ts +179 -0
  62. package/dist/tables.js +403 -0
  63. package/dist/tex.d.ts +8 -0
  64. package/dist/tex.js +257 -0
  65. package/dist/text-layouts.d.ts +64 -0
  66. package/dist/text-layouts.js +225 -0
  67. package/dist/text.d.ts +35 -0
  68. package/dist/text.js +52 -0
  69. package/dist/theme.d.ts +25 -0
  70. package/dist/theme.js +12 -0
  71. package/dist/user-code.d.ts +5 -0
  72. package/dist/user-code.js +20 -0
  73. package/dist/utils.d.ts +152 -0
  74. package/dist/utils.js +517 -0
  75. package/dist/vector-field.d.ts +132 -0
  76. package/dist/vector-field.js +361 -0
  77. package/package.json +45 -3
package/README.md CHANGED
@@ -1,3 +1,9 @@
1
- # Temporary Holding Version
1
+ # @beff/aula
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ The engine of [aula](https://github.com/lucasavila00/aula): narrated explainer videos from chapter modules. Chapters and kits import it: `import { m, defineChapter } from "@beff/aula"`. Everything Manim is `m.<ManimName>` (`m.Circle`, `m.FadeIn`, `m.UP`, the type `m.Mobject`), over a Rust WebAssembly component that records each chapter as Lottie.
4
+
5
+ The `aula` command is in [`@beff/aula-cli`](https://www.npmjs.com/package/@beff/aula-cli). Read the [documentation](https://github.com/lucasavila00/aula#documentation) before you write a chapter. The production steps and the rules for scripts and pictures are in [`@beff/aula-method`](https://www.npmjs.com/package/@beff/aula-method).
6
+
7
+ ## Licenses
8
+
9
+ aula's own code is MIT; the engine includes eSpeak NG, GPL-3.0-or-later, so the package as a whole is MIT AND GPL-3.0-or-later. The engine component also has third-party code and data, with their own licenses, in `dist/licenses/`: eSpeak NG (GPL-3.0-or-later), misaki (Apache-2.0), spaCy (MIT) and the fonts Nunito Sans and JetBrains Mono (SIL Open Font License 1.1).
@@ -0,0 +1,634 @@
1
+ import { Animation, type AnimationOptions, type Animations, type BoundMethod, type Color, DecimalNumberMobject, type MathTexMobject, Mobject, type PathFunc, type Point, type RateFunc, type Scene } from "./engine.ts";
2
+ import { Circle, Rectangle } from "./geometry.ts";
3
+ /** The options of Transform (Manim's keyword arguments). */
4
+ export type TransformOptions = AnimationOptions & {
5
+ /** Points move along arcs of this angle, counter-clockwise for a positive angle. */
6
+ pathArc?: number;
7
+ /** Places the points: `(startPoints, endPoints, alpha) => points` (Manim `path_func`). */
8
+ pathFunc?: PathFunc;
9
+ /** The center of the arcs of `pathArc` (Manim `path_arc_centers`), instead of the arc
10
+ * between each start point and end point. */
11
+ pathArcCenters?: Point;
12
+ /** At the end, `targetMobject` takes the place of `mobject` (as `ReplacementTransform`). */
13
+ replaceMobjectWithTargetInScene?: boolean;
14
+ };
15
+ /** Manim `Transform` and its subclasses: the mobject morphs into a target. Extend it as in
16
+ * Manim: a subclass that overrides `createTarget` morphs into the mobject that it returns,
17
+ * made when the animation begins.
18
+ *
19
+ * class Grow extends m.TransformAnimation {
20
+ * override createTarget() {
21
+ * return this.mobject?.copy().scale(2);
22
+ * }
23
+ * }
24
+ * s.play(new Grow(box)); */
25
+ export declare class TransformAnimation extends Animation {
26
+ #private;
27
+ /** The mobject to morph into (Manim `target_mobject`). */
28
+ targetMobject: Mobject | undefined;
29
+ /** The copy of the target that the morph uses (Manim `target_copy`). */
30
+ targetCopy: Mobject | undefined;
31
+ /** The angle of the arcs that points move along (Manim `path_arc`). */
32
+ pathArc: number;
33
+ /** The function that places the points (Manim `path_func`), when one was given. */
34
+ pathFunc: PathFunc | undefined;
35
+ /** True when the target takes the place of the mobject at the end. */
36
+ replaceMobjectWithTargetInScene: boolean;
37
+ begin(): void;
38
+ interpolate(alpha: number): void;
39
+ finish(): void;
40
+ /** The target (Manim `create_target`). */
41
+ createTarget(): Mobject | undefined;
42
+ createStartingMobject(): Mobject | undefined;
43
+ getAllMobjects(): Mobject[];
44
+ cleanUpFromScene(scene: Scene): void;
45
+ /** Checks the input of the animation (Manim `check_validity_of_input`): an error when it is
46
+ * wrong. `MoveToTarget` checks a mobject, `ApplyMethod` a method. */
47
+ checkValidityOfInput(mobject: unknown): void;
48
+ checkValidityOfInput(method: unknown): void;
49
+ /** Sets `submobject` between `startingSubmobject` and `targetCopy` at `alpha` (Manim
50
+ * `interpolate_submobject`): the points and the style. */
51
+ interpolateSubmobject(submobject: Mobject, startingSubmobject: Mobject, targetCopy: Mobject | number, alpha?: number): this;
52
+ }
53
+ /** `mobject` morphs into `targetMobject` (Manim `Transform`). With
54
+ * `replaceMobjectWithTargetInScene`, the target takes its place at the end. */
55
+ export declare function Transform(mobject: Mobject, targetMobject?: Mobject, opts?: TransformOptions): TransformAnimation;
56
+ /** `mobject` morphs into `targetMobject`, which then takes its place (Manim
57
+ * `ReplacementTransform`). */
58
+ export declare function ReplacementTransform(mobject: Mobject, targetMobject: Mobject, opts?: TransformOptions): TransformAnimation;
59
+ /** A copy of `mobject` morphs into `targetMobject`, which is added; `mobject` stays (Manim
60
+ * `TransformFromCopy`). */
61
+ export declare function TransformFromCopy(mobject: Mobject, targetMobject: Mobject, opts?: TransformOptions): TransformAnimation;
62
+ /** `Transform` along a clockwise half circle (Manim `ClockwiseTransform`, `pathArc` -π). */
63
+ export declare function ClockwiseTransform(mobject: Mobject, targetMobject: Mobject, opts?: TransformOptions): TransformAnimation;
64
+ /** `Transform` along a counter-clockwise half circle (Manim `CounterclockwiseTransform`,
65
+ * `pathArc` π). */
66
+ export declare function CounterclockwiseTransform(mobject: Mobject, targetMobject: Mobject, opts?: TransformOptions): TransformAnimation;
67
+ /** Morphs `mobject` into its `target` (Manim `MoveToTarget`): call `generateTarget()` first. */
68
+ export declare function MoveToTarget(mobject: Mobject, opts?: TransformOptions): TransformAnimation;
69
+ /** Morphs `mobject` back into the state that `saveState()` kept (Manim `Restore`). */
70
+ export declare function Restore(mobject: Mobject, opts?: TransformOptions): TransformAnimation;
71
+ /** Calls method `method` (a method of a Mobject, such as `mob.shift`) on a copy of its Mobject
72
+ * with `args`, and morphs the Mobject into the copy (Manim `ApplyMethod`). The copy is made when
73
+ * the animation begins. */
74
+ export declare function ApplyMethod(method: (...args: never[]) => unknown, ...args: unknown[]): TransformAnimation;
75
+ /** Moves every point through `function` (Manim `ApplyPointwiseFunction`; 3 seconds by default). */
76
+ export declare function ApplyPointwiseFunction(func: (p: Point) => Point, mobject: Mobject, opts?: TransformOptions): TransformAnimation;
77
+ /** Moves the center of the mobject through `function` (Manim `ApplyPointwiseFunctionToCenter`). */
78
+ export declare function ApplyPointwiseFunctionToCenter(func: (p: Point) => Point, mobject: Mobject, opts?: TransformOptions): TransformAnimation;
79
+ /** Changes the colour of the mobject (Manim `FadeToColor`). */
80
+ export declare function FadeToColor(mobject: Mobject, color: Color, opts?: TransformOptions): TransformAnimation;
81
+ /** Scales the mobject about its center (Manim `ScaleInPlace`). */
82
+ export declare function ScaleInPlace(mobject: Mobject, scaleFactor: number, opts?: TransformOptions): TransformAnimation;
83
+ /** Shrinks the mobject to its center (Manim `ShrinkToCenter`). */
84
+ export declare function ShrinkToCenter(mobject: Mobject, opts?: TransformOptions): TransformAnimation;
85
+ /** Morphs the mobject into `function(copy)` (Manim `ApplyFunction`): the function changes the
86
+ * copy, or returns a new Mobject. */
87
+ export declare function ApplyFunction(func: (mobject: Mobject) => Mobject, mobject: Mobject, opts?: TransformOptions): TransformAnimation;
88
+ /** Manim `ApplyMatrix`. */
89
+ export declare class ApplyMatrixAnimation extends TransformAnimation {
90
+ /** The matrix as 3x3: a 2x2 matrix in the top left of the identity (Manim
91
+ * `initialize_matrix`). An error for other sizes. */
92
+ initializeMatrix(matrix: readonly (readonly number[])[]): number[][];
93
+ }
94
+ /** Moves every point `p` to `matrix · (p - aboutPoint) + aboutPoint` (Manim `ApplyMatrix`; 3
95
+ * seconds). A 3x3 matrix uses its 2x2 top left part. */
96
+ export declare function ApplyMatrix(matrix: readonly (readonly number[])[], mobject: Mobject, opts?: TransformOptions & {
97
+ aboutPoint?: Point;
98
+ }): ApplyMatrixAnimation;
99
+ /** Moves every point `z` (a complex number `[re, im]`) to `function(z)` (Manim
100
+ * `ApplyComplexFunction`). The points move in straight lines, as in Manim CE 0.22.1: its
101
+ * `_init_path_func` would set the path arc from `function(1)`, but nothing calls it. */
102
+ export declare function ApplyComplexFunction(func: (z: Point) => Point, mobject: Mobject, opts?: TransformOptions): TransformAnimation;
103
+ /** Each mobject moves to the place of the next one, the last to the first (Manim
104
+ * `CyclicReplace`), along arcs of `pathArc` (90°). */
105
+ export declare function CyclicReplace(...args: (Mobject | TransformOptions)[]): TransformAnimation;
106
+ /** Two mobjects change places (Manim `Swap`: `CyclicReplace` of two). */
107
+ export declare function Swap(...args: (Mobject | TransformOptions)[]): TransformAnimation;
108
+ /** Plays two animations, and morphs the mobject of the first into the mobject of the second
109
+ * (Manim `TransformAnimations`). Both run for the longer run time. */
110
+ export declare function TransformAnimations(startAnim: Animation, endAnim: Animation, opts?: TransformOptions): TransformAnimation;
111
+ /** The options of FadeIn (Manim's keyword arguments). */
112
+ export type FadeInOptions = AnimationOptions & {
113
+ shift?: Point;
114
+ scale?: number;
115
+ targetPosition?: Point | Mobject;
116
+ };
117
+ /** The options of FadeOut (Manim's keyword arguments). */
118
+ export type FadeOutOptions = FadeInOptions;
119
+ /** Fades in one or more mobjects: `FadeIn(a, b, { shift })`. Several fade in as one group. */
120
+ export declare function FadeIn(...args: (Mobject | FadeInOptions)[]): TransformAnimation;
121
+ /** Fades out one or more mobjects, then removes them: `FadeOut(a, b, { shift })`. Several fade
122
+ * out as one group. */
123
+ export declare function FadeOut(...args: (Mobject | FadeOutOptions)[]): TransformAnimation;
124
+ /** The options of FadeTransform (Manim's keyword arguments). */
125
+ export type FadeTransformOptions = AnimationOptions & {
126
+ /** True: each stretches onto the other's box. False: each scales to fit `dimToMatch`. */
127
+ stretch?: boolean;
128
+ /** 0 (x) or 1 (y, the default): the size that matches when `stretch` is false. */
129
+ dimToMatch?: number;
130
+ };
131
+ /** Manim `FadeTransform`: the members of `ghostTo`. */
132
+ export declare class FadeTransformAnimation extends TransformAnimation {
133
+ stretch: boolean;
134
+ dimToMatch: number;
135
+ /** `source` takes the box of `target`, then becomes invisible (Manim `ghost_to`). */
136
+ ghostTo(source: Mobject, target: Mobject): void;
137
+ }
138
+ /** `mobject` stretches onto `targetMobject` while it fades out, and `targetMobject` fades in
139
+ * from `mobject`'s box (Manim `FadeTransform`). At the end the target takes its place. */
140
+ export declare function FadeTransform(mobject: Mobject, targetMobject: Mobject, opts?: FadeTransformOptions): FadeTransformAnimation;
141
+ /** `FadeTransform` part by part: each submobject of `mobject` goes to the submobject of
142
+ * `targetMobject` at the same place in the list (Manim `FadeTransformPieces`). */
143
+ export declare function FadeTransformPieces(mobject: Mobject, targetMobject: Mobject, opts?: FadeTransformOptions): FadeTransformAnimation;
144
+ /** Draws the strokes of the mobject from their start (Manim `Create`; `lagRatio` 1: one part
145
+ * after another). */
146
+ export declare function Create(mobject: Mobject, opts?: AnimationOptions): Animation;
147
+ /** Undraws the strokes, then removes the mobject (Manim `Uncreate`: `Create` with
148
+ * `reverseRateFunction` and `remover`). */
149
+ export declare function Uncreate(mobject: Mobject, opts?: AnimationOptions): Animation;
150
+ /** The options of DrawBorderThenFill (Manim's keyword arguments). */
151
+ export type DrawBorderThenFillOptions = AnimationOptions & {
152
+ /** The width of every outline. Without it, an outline has the stroke width of its part. */
153
+ strokeWidth?: number;
154
+ /** The colour of every outline. Without it, the stroke colour of the part (or its colour). */
155
+ strokeColor?: Color;
156
+ };
157
+ /** Manim `DrawBorderThenFill`, `Write` and `Unwrite`. */
158
+ export declare class DrawBorderThenFillAnimation extends Animation {
159
+ strokeWidth: number;
160
+ strokeColor: Color | undefined;
161
+ /** The last part goes first (Manim `Write(reverse=True)`). */
162
+ reverse: boolean;
163
+ /** The outlines: a copy with no fill (Manim `get_outline`). */
164
+ getOutline(): Mobject | undefined;
165
+ /** The colour of the outline of `vmobject` (Manim `get_stroke_color`). */
166
+ getStrokeColor(vmobject: Mobject): Color;
167
+ getAllMobjects(): Mobject[];
168
+ /** Sets one part at `alpha` (Manim `interpolate_submobject`): the first half draws the
169
+ * outline, the second half blends from the outline to the part. */
170
+ interpolateSubmobject(submobject: Mobject, startingSubmobject: Mobject, outline: Mobject | number, alpha?: number): this;
171
+ /** Reverses the order of the parts (Manim `reverse_submobjects`). */
172
+ reverseSubmobjects(): void;
173
+ }
174
+ /** Draws the outlines, then fills them (Manim `DrawBorderThenFill`; 2 seconds, rate
175
+ * `doubleSmooth`). */
176
+ export declare function DrawBorderThenFill(vmobject: Mobject, opts?: DrawBorderThenFillOptions): DrawBorderThenFillAnimation;
177
+ /** Draws the mobject part by part, outline then fill (Manim `Write`): 1 second, or 2 seconds
178
+ * from 15 parts with points; rate `linear`. With `reverse`, the last part goes first and the
179
+ * mobject is removed at the end, as in Manim. */
180
+ export declare function Write(vmobject: Mobject, opts?: AnimationOptions & {
181
+ reverse?: boolean;
182
+ }): DrawBorderThenFillAnimation;
183
+ /** `Write` backwards, then removed (Manim `Unwrite`). With `reverse` (the default) the last
184
+ * part is erased first. */
185
+ export declare function Unwrite(vmobject: Mobject, opts?: AnimationOptions & {
186
+ reverse?: boolean;
187
+ }): DrawBorderThenFillAnimation;
188
+ /** Manim `ShowPartial`: each member shows the part of its path that `getBounds(alpha)` gives.
189
+ * `ShowPartial` itself has no bounds: use `Create` or `ShowPassingFlash`, or extend it. */
190
+ export declare class ShowPartialAnimation extends Animation {
191
+ /** The proportions `[lower, upper]` of the path to show at `alpha` (Manim `_get_bounds`). */
192
+ getBounds(_alpha: number): [number, number];
193
+ interpolateSubmobject(submobject: Mobject, startingSubmobject: Mobject, alpha: number): this;
194
+ }
195
+ /** Shows a part of each path (Manim `ShowPartial`); extend it with `getBounds`. */
196
+ export declare function ShowPartial(mobject: Mobject, opts?: AnimationOptions): ShowPartialAnimation;
197
+ /** Manim `ShowIncreasingSubsets` and the text animations built on it. */
198
+ export declare class ShowIncreasingSubsetsAnimation extends Animation {
199
+ allSubmobs: Mobject[];
200
+ intFunc: (x: number) => number;
201
+ interpolateMobject(alpha: number): void;
202
+ /** Shows the first `index` submobjects and hides the others (Manim `update_submobject_list`). */
203
+ updateSubmobjectList(index: number): void;
204
+ }
205
+ /** The options of ShowIncreasingSubsets (Manim's keyword arguments). */
206
+ export type ShowIncreasingSubsetsOptions = AnimationOptions & {
207
+ /** Rounds the number of shown submobjects (Manim `int_func`, `np.floor`). */
208
+ intFunc?: (x: number) => number;
209
+ };
210
+ /** Shows the submobjects one more at a time (Manim `ShowIncreasingSubsets`). */
211
+ export declare function ShowIncreasingSubsets(group: Mobject, opts?: ShowIncreasingSubsetsOptions): ShowIncreasingSubsetsAnimation;
212
+ /** Shows one submobject at a time (Manim `ShowSubmobjectsOneByOne`). */
213
+ export declare function ShowSubmobjectsOneByOne(group: Mobject | readonly Mobject[], opts?: ShowIncreasingSubsetsOptions): ShowIncreasingSubsetsAnimation;
214
+ /** The options of AddTextLetterByLetter (Manim's keyword arguments). */
215
+ export type LetterByLetterOptions = ShowIncreasingSubsetsOptions & {
216
+ /** Seconds for each letter (0.1). Without `runTime`, the run time is the letters times this. */
217
+ timePerChar?: number;
218
+ };
219
+ /** Shows the letters of a text one at a time (Manim `AddTextLetterByLetter`; rate `linear`,
220
+ * `timePerChar` 0.1). */
221
+ export declare function AddTextLetterByLetter(text: Mobject, opts?: LetterByLetterOptions): ShowIncreasingSubsetsAnimation;
222
+ /** Hides the letters of a text one at a time, from the last, then removes it (Manim
223
+ * `RemoveTextLetterByLetter`). */
224
+ export declare function RemoveTextLetterByLetter(text: Mobject, opts?: LetterByLetterOptions): ShowIncreasingSubsetsAnimation;
225
+ /** Shows a text one part at a time, with a short pause after each (Manim `AddTextWordByWord`).
226
+ * The parts are the submobjects of the text. */
227
+ export declare function AddTextWordByWord(textMobject: Mobject, opts?: AnimationOptions & {
228
+ timePerChar?: number;
229
+ }): Animation;
230
+ /** The options of TypeWithCursor (Manim's keyword arguments). */
231
+ export type TypeWithCursorOptions = LetterByLetterOptions & {
232
+ /** The space between the last letter and the cursor (0.1). */
233
+ buff?: number;
234
+ /** The cursor keeps its y (true), or takes the y of the text. */
235
+ keepCursorY?: boolean;
236
+ /** The cursor stays at the end (true), or is removed. */
237
+ leaveCursorOn?: boolean;
238
+ };
239
+ /** Manim `TypeWithCursor` and `UntypeWithCursor`. */
240
+ export declare class TypeWithCursorAnimation extends ShowIncreasingSubsetsAnimation {
241
+ #private;
242
+ cursor: Mobject | undefined;
243
+ buff: number;
244
+ keepCursorY: boolean;
245
+ leaveCursorOn: boolean;
246
+ begin(): void;
247
+ finish(): void;
248
+ cleanUpFromScene(scene: Scene): void;
249
+ updateSubmobjectList(index: number): void;
250
+ }
251
+ /** Types a text letter by letter, with `cursor` after the last letter (Manim `TypeWithCursor`). */
252
+ export declare function TypeWithCursor(text: Mobject, cursor: Mobject, opts?: TypeWithCursorOptions): TypeWithCursorAnimation;
253
+ /** Deletes a text letter by letter from the end, with `cursor` after the last letter, then
254
+ * removes it (Manim `UntypeWithCursor`). */
255
+ export declare function UntypeWithCursor(text: Mobject, cursor?: Mobject, opts?: TypeWithCursorOptions): TypeWithCursorAnimation;
256
+ /** The submobjects of `shapes` fly in from `scaleFactor` times their distance to the center,
257
+ * along a spiral, and fade in (Manim `SpiralIn`). */
258
+ export declare function SpiralIn(shapes: Mobject, opts?: AnimationOptions & {
259
+ scaleFactor?: number;
260
+ fadeInFraction?: number;
261
+ }): Animation;
262
+ /** The options of the Grow animations (Manim's keyword arguments). */
263
+ export type GrowOptions = TransformOptions & {
264
+ /** The colour at the start of the growth. */
265
+ pointColor?: Color;
266
+ };
267
+ /** Grows the mobject from `point` (Manim `GrowFromPoint`). */
268
+ export declare function GrowFromPoint(mobject: Mobject, point: Point, opts?: GrowOptions): TransformAnimation;
269
+ /** Grows the mobject from its center (Manim `GrowFromCenter`). */
270
+ export declare function GrowFromCenter(mobject: Mobject, opts?: GrowOptions): TransformAnimation;
271
+ /** Grows the mobject from the critical point in direction `edge` (Manim `GrowFromEdge`). */
272
+ export declare function GrowFromEdge(mobject: Mobject, edge: Point, opts?: GrowOptions): TransformAnimation;
273
+ /** Grows an arrow from its start (Manim `GrowArrow`). */
274
+ export declare function GrowArrow(arrow: Mobject, opts?: GrowOptions): TransformAnimation;
275
+ /** Grows the mobject from its center while it turns by `angle` (Manim `SpinInFromNothing`;
276
+ * π/2). */
277
+ export declare function SpinInFromNothing(mobject: Mobject, opts?: GrowOptions & {
278
+ angle?: number;
279
+ }): TransformAnimation;
280
+ /** Scales the mobject by `scaleFactor` and gives it `color`, then goes back (Manim `Indicate`;
281
+ * rate `thereAndBack`). The default colour is Manim's `PURE_YELLOW`. */
282
+ export declare function Indicate(mobject: Mobject, opts?: TransformOptions & {
283
+ scaleFactor?: number;
284
+ color?: Color;
285
+ }): TransformAnimation;
286
+ /** A dot that covers the frame shrinks onto `focusPoint` (a point or a mobject), then goes
287
+ * (Manim `FocusOn`; 2 seconds). */
288
+ export declare function FocusOn(focusPoint: Point | Mobject, opts?: TransformOptions & {
289
+ opacity?: number;
290
+ color?: Color;
291
+ }): TransformAnimation;
292
+ /** The options of Flash (Manim's keyword arguments). */
293
+ export type FlashOptions = AnimationOptions & {
294
+ lineLength?: number;
295
+ numLines?: number;
296
+ flashRadius?: number;
297
+ lineStrokeWidth?: number;
298
+ color?: Color;
299
+ timeWidth?: number;
300
+ };
301
+ /** Manim `Flash`: its lines and their animations. */
302
+ export declare class FlashAnimation extends Animation {
303
+ point: Point;
304
+ lineLength: number;
305
+ numLines: number;
306
+ flashRadius: number;
307
+ lineStrokeWidth: number;
308
+ color: Color;
309
+ timeWidth: number;
310
+ /** The lines, as a VGroup (Manim `create_lines`). */
311
+ createLines(): Mobject;
312
+ /** A ShowPassingFlash for each line (Manim `create_line_anims`). */
313
+ createLineAnims(): Animation[];
314
+ }
315
+ /** Lines that flash outward around a point, or around the center of a mobject (Manim `Flash`).
316
+ * Each line runs from `flashRadius` to `flashRadius + lineLength` from the center. */
317
+ export declare function Flash(point: Point | Mobject, opts?: FlashOptions): FlashAnimation;
318
+ /** A part of each path, of length `timeWidth`, passes along it (Manim `ShowPassingFlash`). The
319
+ * mobject is removed at the end. */
320
+ export declare function ShowPassingFlash(mobject: Mobject, opts?: AnimationOptions & {
321
+ timeWidth?: number;
322
+ }): ShowPartialAnimation;
323
+ /** `ShowPassingFlash` of `nSegments` copies, thinner toward the tail (Manim
324
+ * `ShowPassingFlashWithThinningStrokeWidth`). */
325
+ export declare function ShowPassingFlashWithThinningStrokeWidth(vmobject: Mobject, opts?: AnimationOptions & {
326
+ nSegments?: number;
327
+ timeWidth?: number;
328
+ }): Animation;
329
+ /** Manim `Wiggle`: grows a little and rocks, then settles back. */
330
+ export declare class WiggleAnimation extends Animation {
331
+ scaleValue: number;
332
+ rotationAngle: number;
333
+ nWiggles: number;
334
+ scaleAboutPoint: Point | undefined;
335
+ rotateAboutPoint: Point | undefined;
336
+ /** The point of the scaling: `scaleAboutPoint`, or the center (Manim `get_scale_about_point`). */
337
+ getScaleAboutPoint(): Point;
338
+ /** The point of the rotation (Manim `get_rotate_about_point`). */
339
+ getRotateAboutPoint(): Point;
340
+ interpolateSubmobject(submobject: Mobject, startingSubmobject: Mobject, alpha: number): this;
341
+ }
342
+ /** The options of Wiggle (Manim's keyword arguments). */
343
+ export type WiggleOptions = AnimationOptions & {
344
+ scaleValue?: number;
345
+ rotationAngle?: number;
346
+ nWiggles?: number;
347
+ scaleAboutPoint?: Point;
348
+ rotateAboutPoint?: Point;
349
+ };
350
+ /** Grows the mobject by `scaleValue` and rocks it `nWiggles` times by `rotationAngle`, then
351
+ * settles back (Manim `Wiggle`; 2 seconds). */
352
+ export declare function Wiggle(mobject: Mobject, opts?: WiggleOptions): WiggleAnimation;
353
+ /** The shape of Circumscribe: `m.Rectangle` or `m.Circle`. */
354
+ export type CircumscribeShape = typeof Rectangle | typeof Circle;
355
+ /** The options of Circumscribe (Manim's keyword arguments). */
356
+ export type CircumscribeOptions = AnimationOptions & {
357
+ shape?: CircumscribeShape;
358
+ fadeIn?: boolean;
359
+ fadeOut?: boolean;
360
+ timeWidth?: number;
361
+ buff?: number;
362
+ color?: Color;
363
+ strokeWidth?: number;
364
+ };
365
+ /** A temporary line around the mobject: `Circumscribe(mob, m.Circle, opts)` or
366
+ * `Circumscribe(mob, opts)`. With no fades, a flash of `timeWidth` passes around the shape.
367
+ * `fadeIn` fades the shape in (else it is drawn), and `fadeOut` fades it out (else it is
368
+ * undrawn), each in half the run time. */
369
+ export declare function Circumscribe(mobject: Mobject, shape?: CircumscribeShape | CircumscribeOptions, opts?: CircumscribeOptions): Animation;
370
+ /** Shows and hides the mobject `blinks` times (Manim `Blink`): `timeOn` (0.5) seconds visible,
371
+ * `timeOff` (0.5) hidden. With `hideAtEnd` it ends hidden. */
372
+ export declare function Blink(mobject: Mobject, opts?: AnimationOptions & {
373
+ timeOn?: number;
374
+ timeOff?: number;
375
+ blinks?: number;
376
+ hideAtEnd?: boolean;
377
+ }): Animation;
378
+ /** A homotopy: `(x, y, z, t) => [x, y]` (Manim's `(x, y, z, t) -> (x, y, z)`; `z` is 0). */
379
+ export type HomotopyFunc = (x: number, y: number, z: number, t: number) => readonly number[];
380
+ /** Manim `Homotopy`: every point moves by a function of its place and the time. */
381
+ export declare class HomotopyAnimation extends Animation {
382
+ homotopy: HomotopyFunc;
383
+ /** Manim's `apply_function_kwargs`: the point that the homotopy is relative to. */
384
+ applyFunctionKwargs: {
385
+ aboutPoint?: Point;
386
+ aboutEdge?: Point;
387
+ };
388
+ /** The function of the points at time `t` (Manim `function_at_time_t`), relative to
389
+ * `aboutPoint` (the origin) or to the critical point `aboutEdge`. */
390
+ functionAtTimeT(t: number): (p: Point) => Point;
391
+ interpolateSubmobject(submobject: Mobject, startingSubmobject: Mobject, alpha: number): this;
392
+ }
393
+ /** Moves every point by `homotopy(x, y, z, t)` while `t` goes from 0 to 1 (Manim `Homotopy`; 3
394
+ * seconds). */
395
+ export declare function Homotopy(homotopy: HomotopyFunc, mobject: Mobject, opts?: AnimationOptions & {
396
+ applyFunctionKwargs?: {
397
+ aboutPoint?: Point;
398
+ aboutEdge?: Point;
399
+ };
400
+ }): HomotopyAnimation;
401
+ /** `Homotopy` that keeps the curves smooth (Manim `SmoothedVectorizedHomotopy`). */
402
+ export declare function SmoothedVectorizedHomotopy(homotopy: HomotopyFunc, mobject: Mobject, opts?: AnimationOptions): HomotopyAnimation;
403
+ /** A wave passes along the mobject from left to right and moves its points in `direction` by
404
+ * up to `amplitude` (Manim `ApplyWave`; 2 seconds). `waveFunc` (smooth) shapes the wave,
405
+ * `timeWidth` (1) is its width and `ripples` (1) its number of ripples. */
406
+ export declare function ApplyWave(mobject: Mobject, opts?: AnimationOptions & {
407
+ direction?: Point;
408
+ amplitude?: number;
409
+ waveFunc?: RateFunc;
410
+ timeWidth?: number;
411
+ ripples?: number;
412
+ }): HomotopyAnimation;
413
+ /** `Homotopy` of a complex function `(z, t) => w`, with a complex number as `[re, im]` (Manim
414
+ * `ComplexHomotopy`). */
415
+ export declare function ComplexHomotopy(complexHomotopy: (z: Point, t: number) => Point, mobject: Mobject, opts?: AnimationOptions): HomotopyAnimation;
416
+ /** Moves every point along the vector field `function` for `virtualTime` (Manim `PhaseFlow`;
417
+ * rate `linear`). */
418
+ export declare function PhaseFlow(func: (p: Point) => Point, mobject: Mobject, opts?: AnimationOptions & {
419
+ virtualTime?: number;
420
+ }): Animation;
421
+ /** Moves the center of the mobject along `path` (Manim `MoveAlongPath`). */
422
+ export declare function MoveAlongPath(mobject: Mobject, path: Mobject, opts?: AnimationOptions): Animation;
423
+ /** Manim `ChangingDecimal`: the number shows `numberUpdateFunc(alpha)`. */
424
+ export declare class ChangingDecimalAnimation extends Animation {
425
+ numberUpdateFunc: (alpha: number) => number;
426
+ /** An error when the mobject is not a DecimalNumber (Manim `check_validity_of_input`). */
427
+ checkValidityOfInput(decimalMob: unknown): void;
428
+ interpolateMobject(alpha: number): void;
429
+ }
430
+ /** The number shows `numberUpdateFunc(alpha)` while alpha goes from 0 to 1 (Manim
431
+ * `ChangingDecimal`). */
432
+ export declare function ChangingDecimal(decimalMob: DecimalNumberMobject, numberUpdateFunc: (alpha: number) => number, opts?: AnimationOptions): ChangingDecimalAnimation;
433
+ /** The number counts to `targetNumber` (Manim `ChangeDecimalToValue`). */
434
+ export declare function ChangeDecimalToValue(decimalMob: DecimalNumberMobject, targetNumber: number, opts?: AnimationOptions): ChangingDecimalAnimation;
435
+ /** The options of Rotate and Rotating (Manim's keyword arguments). */
436
+ export type RotateOptions = TransformOptions & {
437
+ aboutPoint?: Point;
438
+ aboutEdge?: Point;
439
+ };
440
+ /** Turns the mobject by `angle` about `aboutPoint`, or about the critical point `aboutEdge`, or
441
+ * about its center (Manim `Rotate`). */
442
+ export declare function Rotate(mobject: Mobject, angle?: number, opts?: RotateOptions): TransformAnimation;
443
+ /** Turns the mobject by `angle` (TAU) over the run time (Manim `Rotating`; 5 seconds, rate
444
+ * `linear`). */
445
+ export declare function Rotating(mobject: Mobject, opts?: AnimationOptions & {
446
+ angle?: number;
447
+ aboutPoint?: Point;
448
+ aboutEdge?: Point;
449
+ }): Animation;
450
+ /** Rings of `mobject` spread out from `focalPoint` and fade (Manim `Broadcast`): `nMobs` (5)
451
+ * copies, from `initialWidth` (0) and `initialOpacity` (1) to the size of the mobject and
452
+ * `finalOpacity` (0); 3 seconds, `lagRatio` 0.2. */
453
+ export declare function Broadcast(mobject: Mobject, opts?: AnimationOptions & {
454
+ focalPoint?: Point;
455
+ nMobs?: number;
456
+ initialOpacity?: number;
457
+ finalOpacity?: number;
458
+ initialWidth?: number;
459
+ }): Animation;
460
+ /** Manim `ChangeSpeed`: plays `anim` at the speeds of `speedinfo`. */
461
+ export declare class ChangeSpeedAnimation extends Animation {
462
+ #private;
463
+ anim: Animation | undefined;
464
+ speedinfo: [number, number][];
465
+ /** The updaters of `addUpdater` get the changed `dt` while it plays. */
466
+ affectsSpeedUpdaters: boolean;
467
+ /** The run time of `anim` at speed 1. */
468
+ animRunTime: number;
469
+ /** The run time of `anim` at speed 1, as a fraction (Manim `get_scaled_total_time`). */
470
+ getScaledTotalTime(): number;
471
+ /** Prepares `anim` (Manim `setup`): returns it. */
472
+ setup(anim: Animation): Animation;
473
+ /** Adds an updater to `mobject` (Manim's class method `ChangeSpeed.add_updater`). While a
474
+ * ChangeSpeed with `affectsSpeedUpdaters` plays, its `dt` follows the changed speed. */
475
+ addUpdater(mobject: Mobject, updateFunction: (m: Mobject, dt: number) => void, callUpdater?: boolean): void;
476
+ begin(): void;
477
+ interpolate(alpha: number): void;
478
+ updateMobjects(dt: number): void;
479
+ finish(): void;
480
+ cleanUpFromScene(scene: Scene): void;
481
+ }
482
+ /** Plays `anim` with speeds that change: `speedinfo` maps a point of the animation (0 to 1)
483
+ * to a speed, and the speed changes smoothly between them (Manim `ChangeSpeed`). */
484
+ export declare function ChangeSpeed(anim: Animation, speedinfo: Readonly<Record<number, number>>, opts?: AnimationOptions & {
485
+ affectsSpeedUpdaters?: boolean;
486
+ }): ChangeSpeedAnimation;
487
+ /** Manim `AnimationGroup`, `LaggedStart` and `Succession`: the animations and their timings. */
488
+ export declare class AnimationGroupAnimation extends Animation {
489
+ /** The animations of the group, in order. */
490
+ animations: Animation[];
491
+ /** The mobject of the group (Manim `group`). */
492
+ group: Mobject | undefined;
493
+ /** Each animation's run time when the group was made. */
494
+ runTimes: number[];
495
+ getAllMobjects(): Mobject[];
496
+ /** The run time of the group: `runTime`, or the end of its last animation (Manim
497
+ * `init_run_time`). */
498
+ initRunTime(runTime?: number): number;
499
+ /** Each animation with its start and end in seconds (Manim `build_animations_with_timings`):
500
+ * each starts when the one before it is `lagRatio` done. */
501
+ buildAnimationsWithTimings(): [Animation, number, number][];
502
+ }
503
+ /** The options of AnimationGroup (Manim's keyword arguments). */
504
+ export type AnimationGroupOptions = AnimationOptions & {
505
+ group?: Mobject;
506
+ };
507
+ /** Plays animations together (Manim `AnimationGroup`; `lagRatio` 0, rate `linear` over the
508
+ * group). */
509
+ export declare function AnimationGroup(...args: (Animations | AnimationGroupOptions)[]): AnimationGroupAnimation;
510
+ /** Starts each animation when the one before it is `lagRatio` (0.05) done (Manim `LaggedStart`). */
511
+ export declare function LaggedStart(...args: (Animations | AnimationGroupOptions)[]): AnimationGroupAnimation;
512
+ /** Plays the animations one after another (Manim `Succession`; `lagRatio` 1). */
513
+ export declare function Succession(...args: (Animations | AnimationGroupOptions)[]): AnimationGroupAnimation;
514
+ /** `LaggedStart` of `animationClass(...argCreator(sub))` for each submobject of `mobject`
515
+ * (Manim `LaggedStartMap`; 2 seconds). */
516
+ export declare function LaggedStartMap(animationClass: (...args: never[]) => Animation, mobject: Mobject, opts?: AnimationGroupOptions & {
517
+ argCreator?: (m: Mobject) => unknown[];
518
+ }): AnimationGroupAnimation;
519
+ /** Holds the picture for `runTime` seconds, as an animation (Manim `Wait`): a pause in a
520
+ * `Succession`. */
521
+ export declare function Wait(runTime?: number, opts?: AnimationOptions & {
522
+ frozenFrame?: boolean;
523
+ }): Animation;
524
+ /** Adds the mobjects to the stage, at once (Manim `Add`; run time 0). */
525
+ export declare function Add(...args: (Mobject | AnimationOptions)[]): Animation;
526
+ /** Plays animations to their end at once, off stage (not in Manim). */
527
+ export declare function settle(...items: Animations[]): void;
528
+ /** The options of TransformMatchingTex and TransformMatchingShapes (Manim's keyword arguments). */
529
+ export type TransformMatchingOptions = TransformOptions & {
530
+ /** The parts with no match morph into each other, as one group, instead of fading. */
531
+ transformMismatches?: boolean;
532
+ /** The parts with no match `FadeTransform` into each other, as one group. */
533
+ fadeTransformMismatches?: boolean;
534
+ /** A source key and the target key that it matches. */
535
+ keyMap?: Readonly<Record<string, string>>;
536
+ };
537
+ /** Manim's `TransformMatchingShapes` and `TransformMatchingTex`: the parts and their keys. */
538
+ export declare class TransformMatchingAnimation extends TransformAnimation {
539
+ #private;
540
+ /** The parts of `mobject` that match (Manim `get_mobject_parts`): the submobjects of a
541
+ * formula, or the family members with points. */
542
+ getMobjectParts(mobject: Mobject): Mobject[];
543
+ /** The key of a part (Manim `get_mobject_key`): its LaTeX, or its shape. */
544
+ getMobjectKey(mobject: Mobject): string;
545
+ static tex(a: TransformMatchingAnimation): void;
546
+ }
547
+ /** Parts with the same LaTeX morph into each other, the others fade; at the end
548
+ * `targetMobject` takes the place of `mobject` (Manim `TransformMatchingTex`). */
549
+ export declare function TransformMatchingTex(mobject: MathTexMobject, targetMobject: MathTexMobject, opts?: TransformMatchingOptions): TransformMatchingAnimation;
550
+ /** Parts with the same shape (the same points after each is centred and scaled to height 1)
551
+ * morph into each other, the others fade; at the end `targetMobject` takes the place of
552
+ * `mobject` (Manim `TransformMatchingShapes`). */
553
+ export declare function TransformMatchingShapes(mobject: Mobject, targetMobject: Mobject, opts?: TransformMatchingOptions): TransformMatchingAnimation;
554
+ /** An error when `method` is not a method of a Mobject (Manim `assert_is_mobject_method`). */
555
+ export declare function assertIsMobjectMethod(method: unknown): asserts method is BoundMethod;
556
+ /** Calls `method(...args)` on its Mobject on every frame (Manim `always`):
557
+ * `m.always(label.nextTo, dot, m.UP)`. Returns the Mobject. */
558
+ export declare function always(method: (...args: never[]) => unknown, ...args: unknown[]): Mobject;
559
+ /** Calls `method(...argGenerators.map((g) => g()))` on its Mobject on every frame (Manim
560
+ * `f_always`). Returns the Mobject. */
561
+ export declare function fAlways(method: (...args: never[]) => unknown, ...argGenerators: (() => unknown)[]): Mobject;
562
+ /** Moves the mobject by `rate` units a second in `direction` (Manim `always_shift`). */
563
+ export declare function alwaysShift(mobject: Mobject, direction?: Point, rate?: number): Mobject;
564
+ /** Turns the mobject by `rate` radians a second (Manim `always_rotate`; 20°). */
565
+ export declare function alwaysRotate(mobject: Mobject, rate?: number, opts?: {
566
+ aboutPoint?: Point;
567
+ }): Mobject;
568
+ /** Plays `animation` in an updater of its mobject, from now, after `delay` seconds (Manim
569
+ * `turn_animation_into_updater`). With `cycle`, it starts again at its end. Returns the mobject. */
570
+ export declare function turnAnimationIntoUpdater(animation: Animation, opts?: {
571
+ cycle?: boolean;
572
+ delay?: number;
573
+ }): Mobject;
574
+ /** `turnAnimationIntoUpdater` with `cycle` (Manim `cycle_animation`). */
575
+ export declare function cycleAnimation(animation: Animation, opts?: {
576
+ delay?: number;
577
+ }): Mobject;
578
+ /** Manim `UpdateFromFunc` and `UpdateFromAlphaFunc`. */
579
+ export declare class UpdateFromFuncAnimation extends Animation {
580
+ updateFunction: (m: Mobject, alpha: number) => void;
581
+ withAlpha: boolean;
582
+ interpolateMobject(alpha: number): void;
583
+ }
584
+ /** Calls `updateFunction(mobject)` on every frame of the animation (Manim `UpdateFromFunc`). */
585
+ export declare function UpdateFromFunc(mobject: Mobject, updateFunction: (m: Mobject) => void, opts?: AnimationOptions): UpdateFromFuncAnimation;
586
+ /** Calls `updateFunction(mobject, alpha)` on every frame, with the progress after the rate
587
+ * function (Manim `UpdateFromAlphaFunc`). */
588
+ export declare function UpdateFromAlphaFunc(mobject: Mobject, updateFunction: (m: Mobject, alpha: number) => void, opts?: AnimationOptions): UpdateFromFuncAnimation;
589
+ /** Keeps the mobject at the same offset from `trackedMobject` during the animation (Manim
590
+ * `MaintainPositionRelativeTo`). */
591
+ export declare function MaintainPositionRelativeTo(mobject: Mobject, trackedMobject: Mobject, opts?: AnimationOptions): Animation;
592
+ /** Manim `AnimatedBoundary`: two copies of the outline of a mobject that draw and fade in
593
+ * turn, in `colors`. */
594
+ export declare class AnimatedBoundaryMobject extends Mobject {
595
+ vmobject: Mobject | undefined;
596
+ colors: Color[];
597
+ maxStrokeWidth: number;
598
+ cycleRate: number;
599
+ backAndForth: boolean;
600
+ drawRateFunc: RateFunc;
601
+ fadeRateFunc: RateFunc;
602
+ totalTime: number;
603
+ /** Draws and fades the two copies at the time after `dt` more seconds (Manim
604
+ * `update_boundary_copies`). */
605
+ updateBoundaryCopies(dt: number): void;
606
+ /** Each family member of `mob1` takes the part from `a` to `b` of the member of `mob2`
607
+ * (Manim `full_family_become_partial`). */
608
+ fullFamilyBecomePartial(mob1: Mobject, mob2: Mobject, a: number, b: number): this;
609
+ }
610
+ /** The outline of `vmobject`, drawn again and again in the colours of `colors` (Manim
611
+ * `AnimatedBoundary`). Add it to the scene; its updater runs it. */
612
+ export declare function AnimatedBoundary(vmobject: Mobject, opts?: {
613
+ colors?: readonly Color[];
614
+ maxStrokeWidth?: number;
615
+ cycleRate?: number;
616
+ backAndForth?: boolean;
617
+ drawRateFunc?: RateFunc;
618
+ fadeRateFunc?: RateFunc;
619
+ }): AnimatedBoundaryMobject;
620
+ /** Manim `TracedPath`: a path that follows a point. */
621
+ export declare class TracedPathMobject extends Mobject {
622
+ tracedPointFunc: () => Point;
623
+ dissipatingTime: number | undefined;
624
+ time: number | undefined;
625
+ /** Adds the point of `tracedPointFunc` to the path (Manim `update_path`). */
626
+ updatePath(mob: Mobject, dt: number): void;
627
+ }
628
+ /** A line that follows the point that `tracedPointFunc` gives on every frame (Manim
629
+ * `TracedPath`). With `dissipatingTime`, the oldest part goes after that many seconds. */
630
+ export declare function TracedPath(tracedPointFunc: () => Point, opts?: {
631
+ strokeWidth?: number;
632
+ strokeColor?: Color;
633
+ dissipatingTime?: number;
634
+ }): TracedPathMobject;