@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
@@ -0,0 +1,10 @@
1
+ /** @module Interface aula:engine/host **/
2
+ export function callUpdater(id: number, dt: number): boolean;
3
+ export function callAlpha(id: number, alpha: number): boolean;
4
+ export function callRedraw(id: number): boolean;
5
+ export function callPoint(id: number, p: Point): Point | undefined;
6
+ export function callRate(id: number, t: number): number | undefined;
7
+ export function callPath(id: number, starts: Array<Point>, ends: Array<Point>, t: number): Array<Point> | undefined;
8
+ export function dropCallback(id: number): void;
9
+ export function reportPanic(message: string): void;
10
+ export type Point = import('./aula-engine-types.js').Point;
@@ -0,0 +1,43 @@
1
+ /** @module Interface aula:engine/tts **/
2
+ export type Diagnostic = import('./aula-engine-types.js').Diagnostic;
3
+ export interface SpeakOptions {
4
+ voice?: number,
5
+ speed: number,
6
+ durations?: Uint32Array,
7
+ }
8
+ export interface TtsOutput {
9
+ audio: Float32Array,
10
+ durations: Uint32Array,
11
+ }
12
+ export interface Encoding {
13
+ encoder: Float32Array,
14
+ logits: Float32Array,
15
+ }
16
+
17
+ export class TtsModel implements Disposable {
18
+ /**
19
+ * This type does not have a public constructor.
20
+ */
21
+ private constructor();
22
+ /**
23
+ * @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
24
+ */
25
+ static load(weights: Uint8Array): TtsModel;
26
+ hop(): number;
27
+ parity(): boolean;
28
+ setParity(parity: boolean): void;
29
+ memoryBytes(): bigint;
30
+ /**
31
+ * @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
32
+ */
33
+ speak(tokens: Uint32Array, options: SpeakOptions): TtsOutput;
34
+ /**
35
+ * @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
36
+ */
37
+ durations(tokens: Uint32Array, options: SpeakOptions): Uint32Array;
38
+ /**
39
+ * @throws {Error & { payload: Diagnostic }} The error of the result, as the `payload` of the thrown error.
40
+ */
41
+ encode(tokens: Uint32Array, options: SpeakOptions): Encoding;
42
+ [Symbol.dispose](): void;
43
+ }
@@ -0,0 +1,60 @@
1
+ /** @module Interface aula:engine/types **/
2
+ export type Point = [number, number];
3
+ export type Color = string;
4
+ /**
5
+ * # Variants
6
+ *
7
+ * ## `"error"`
8
+ *
9
+ * ## `"warning"`
10
+ */
11
+ export type Severity = "error" | "warning";
12
+ export interface Location {
13
+ file: string,
14
+ line: number,
15
+ col: number,
16
+ }
17
+ export interface Frame {
18
+ "function": string,
19
+ location: Location,
20
+ }
21
+ export interface Related {
22
+ label: string,
23
+ location: Location,
24
+ }
25
+ export interface Diagnostic {
26
+ severity: Severity,
27
+ message: string,
28
+ location?: Location,
29
+ source?: string,
30
+ stack: Array<Frame>,
31
+ hint?: string,
32
+ related: Array<Related>,
33
+ }
34
+ export interface Note {
35
+ key: string,
36
+ values: Array<string>,
37
+ }
38
+ export interface Say {
39
+ place: Location,
40
+ text: string,
41
+ }
42
+ export interface Move {
43
+ place: Location,
44
+ note: string,
45
+ timing: string,
46
+ done: boolean,
47
+ say: number,
48
+ }
49
+ export interface ParagraphText {
50
+ place?: Location,
51
+ notes: Array<Note>,
52
+ says: Array<Say>,
53
+ moves: Array<Move>,
54
+ }
55
+ export interface ChapterText {
56
+ place?: Location,
57
+ heading: string,
58
+ metaphor: string,
59
+ paragraphs: Array<ParagraphText>,
60
+ }
@@ -0,0 +1,551 @@
1
+ import { Mobject, type StyleSettings } from "./engine.ts";
2
+ import type { Color, MathTexMobject, Point, Points, StyleOptions } from "./engine.ts";
3
+ /** An arrow tip: Manim's `ArrowTip`. Its first point is the tip point, and the point half
4
+ * way along its path is the base. */
5
+ export declare class ArrowTipMobject extends Mobject {
6
+ /** The point half way along the path (Manim `base`). */
7
+ get base(): Point;
8
+ /** The first point (Manim `tip_point`). */
9
+ get tipPoint(): Point;
10
+ /** `tipPoint - base` (Manim `vector`). */
11
+ get vector(): Point;
12
+ /** The angle of `vector` (Manim `tip_angle`). */
13
+ get tipAngle(): number;
14
+ /** The length of `vector` (Manim `length`), not the number of submobjects. */
15
+ get length(): number;
16
+ copy(): ArrowTipMobject;
17
+ }
18
+ /** The tip of a stealth arrow: its `length` is 1.6 times `vector`. */
19
+ export declare class StealthTipMobject extends ArrowTipMobject {
20
+ get length(): number;
21
+ copy(): StealthTipMobject;
22
+ }
23
+ /** The options of a tip (Manim's keyword arguments). */
24
+ export type TipOptions = StyleOptions & {
25
+ length?: number;
26
+ width?: number;
27
+ startAngle?: number;
28
+ };
29
+ /** A tip shape: `m.ArrowTriangleFilledTip`, `m.StealthTip`, … */
30
+ export type TipShape = (opts?: TipOptions) => ArrowTipMobject;
31
+ /** Manim's `ArrowTip` is abstract: make a tip with one of the tip shapes. */
32
+ export declare function ArrowTip(): ArrowTipMobject;
33
+ /** A triangle tip that points left before it is placed (Manim `ArrowTriangleTip`). Alone, it is
34
+ * blue, as Manim's `Triangle`; on a path, it takes the colour of the path. */
35
+ export declare function ArrowTriangleTip(opts?: TipOptions): ArrowTipMobject;
36
+ export declare function ArrowTriangleFilledTip(opts?: TipOptions): ArrowTipMobject;
37
+ /** A circle tip (Manim `ArrowCircleTip`): its path starts at angle 0, as in Manim. */
38
+ export declare function ArrowCircleTip(opts?: TipOptions): ArrowTipMobject;
39
+ export declare function ArrowCircleFilledTip(opts?: TipOptions): ArrowTipMobject;
40
+ /** A square tip (Manim `ArrowSquareTip`): a corner is the tip point. */
41
+ export declare function ArrowSquareTip(opts?: TipOptions): ArrowTipMobject;
42
+ export declare function ArrowSquareFilledTip(opts?: TipOptions): ArrowTipMobject;
43
+ /** A stealth tip (Manim `StealthTip`). */
44
+ export declare function StealthTip(opts?: TipOptions): StealthTipMobject;
45
+ /** The options of `addTip`, `createTip` and `getUnpositionedTip` (Manim's keyword arguments). */
46
+ export interface AddTipOptions {
47
+ /** A tip to add as it is. */
48
+ tip?: ArrowTipMobject;
49
+ tipShape?: TipShape;
50
+ tipLength?: number;
51
+ tipWidth?: number;
52
+ atStart?: boolean;
53
+ }
54
+ /** The options of a TipableVMobject: the default tip length and the style of its tips. */
55
+ export type TipableOptions = StyleOptions & {
56
+ tipLength?: number;
57
+ tipStyle?: StyleOptions;
58
+ };
59
+ /** A path that can have a tip at each end (Manim `TipableVMobject`). */
60
+ export declare class TipableVMobjectMobject extends Mobject {
61
+ #private;
62
+ tipLength: number;
63
+ tipStyle: StyleOptions;
64
+ /** A copy with the same class, tips and settings. */
65
+ copy(): this;
66
+ /** Copies the settings of `from` (a copy of the same node) to this copy. */
67
+ protected takeSettings(from: this): void;
68
+ /** Adds a tip (Manim `add_tip`): `tip` as it is, or a new tip of `tipShape`. The path is
69
+ * shortened to end at the base of the tip. A tip at the end makes the Mobject an arrow
70
+ * for the arrow checks. */
71
+ addTip(opts?: AddTipOptions): this;
72
+ /** A new tip, placed at the start or the end (Manim `create_tip`). */
73
+ createTip(opts?: Omit<AddTipOptions, "tip">): ArrowTipMobject;
74
+ /** A new tip in the colour of the path, not placed yet (Manim `get_unpositioned_tip`). */
75
+ getUnpositionedTip(opts?: Omit<AddTipOptions, "tip" | "atStart">): ArrowTipMobject;
76
+ /** Turns and moves `tip` so that its tip point is at the end (or the start) and it points
77
+ * along the path (Manim `position_tip`). */
78
+ positionTip(tip: ArrowTipMobject, atStart?: boolean): ArrowTipMobject;
79
+ /** Moves the end of the path (or its start) to the base of `tip` (Manim
80
+ * `reset_endpoints_based_on_tip`). */
81
+ resetEndpointsBasedOnTip(tip: ArrowTipMobject, atStart: boolean): this;
82
+ /** Keeps `tip` as the tip at the end, or at the start (Manim `assign_tip_attr`). */
83
+ assignTipAttr(tip: ArrowTipMobject, atStart: boolean): this;
84
+ hasTip(): boolean;
85
+ hasStartTip(): boolean;
86
+ /** Removes the tips and gives them as a group; the path keeps its ends (Manim `pop_tips`). */
87
+ popTips(): Mobject;
88
+ /** The tips, the end tip first (Manim `get_tips`). */
89
+ getTips(): Mobject;
90
+ /** The end tip, else the start tip. No tip is an error (Manim `get_tip`). */
91
+ getTip(): ArrowTipMobject;
92
+ getDefaultTipLength(): number;
93
+ /** The second control point (Manim `get_first_handle`). */
94
+ getFirstHandle(): Point;
95
+ /** The control point before the last (Manim `get_last_handle`). */
96
+ getLastHandle(): Point;
97
+ /** The tip point of the end tip, else the end of the path. */
98
+ getEnd(): Point;
99
+ /** The tip point of the start tip, else the start of the path. */
100
+ getStart(): Point;
101
+ /** The distance from `getStart()` to `getEnd()`. */
102
+ getLength(): number;
103
+ }
104
+ /** An empty path that can have tips (Manim `TipableVMobject`). */
105
+ export declare function TipableVMobject(opts?: TipableOptions): TipableVMobjectMobject;
106
+ /** An arc: Manim's `Arc`, with its centre methods. */
107
+ export declare class ArcMobject extends TipableVMobjectMobject {
108
+ /** The centre of the circle of the first curve (Manim `get_arc_center`), or the origin when
109
+ * the first curve is straight. aula prints no warning. */
110
+ getArcCenter(_opts?: {
111
+ warning?: boolean;
112
+ }): Point;
113
+ moveArcCenterTo(point: Point): this;
114
+ /** The angle of the last point about the centre, from 0 to TAU (Manim `stop_angle`). */
115
+ stopAngle(): number;
116
+ }
117
+ /** The options of Arc (Manim's keyword arguments). */
118
+ export type ArcOptions = TipableOptions & {
119
+ radius?: number;
120
+ startAngle?: number;
121
+ angle?: number;
122
+ /** The number of anchors: `numComponents - 1` curves. */
123
+ numComponents?: number;
124
+ arcCenter?: Point;
125
+ };
126
+ /** An arc of `radius` about `arcCenter`, counter-clockwise from `startAngle` by `angle`. */
127
+ export declare function Arc(opts?: ArcOptions): ArcMobject;
128
+ /** The options of ArcBetweenPoints (Manim's keyword arguments). */
129
+ export type ArcBetweenPointsOptions = Omit<ArcOptions, "startAngle" | "arcCenter"> & {
130
+ angle?: number;
131
+ };
132
+ /** An arc from `start` to `end` that turns by `angle`, or on a circle of `radius` (Manim
133
+ * `ArcBetweenPoints`). A positive angle bends it counter-clockwise. */
134
+ export declare function ArcBetweenPoints(start: Point, end: Point, opts?: ArcBetweenPointsOptions): ArcMobject;
135
+ /** The options of CurvedArrow and CurvedDoubleArrow. */
136
+ export type CurvedArrowOptions = ArcBetweenPointsOptions & {
137
+ tipShape?: TipShape;
138
+ tipShapeStart?: TipShape;
139
+ tipShapeEnd?: TipShape;
140
+ };
141
+ /** An arc from `startPoint` to `endPoint` with a tip at the end (Manim `CurvedArrow`). The
142
+ * default `angle` (TAU / 4) bends it counter-clockwise. */
143
+ export declare function CurvedArrow(startPoint: Point, endPoint: Point, opts?: CurvedArrowOptions): ArcMobject;
144
+ /** A CurvedArrow with a tip at both ends (Manim `CurvedDoubleArrow`). */
145
+ export declare function CurvedDoubleArrow(startPoint: Point, endPoint: Point, opts?: CurvedArrowOptions): ArcMobject;
146
+ /** A circle: Manim's `Circle`, with `surround`, `pointAtAngle` and `fromThreePoints`. */
147
+ export declare class CircleMobject extends ArcMobject {
148
+ /** Fits the circle around `mobject` and grows it by `bufferFactor` (Manim `surround`). */
149
+ surround(mobject: Mobject, opts?: {
150
+ dimToMatch?: number;
151
+ stretch?: boolean;
152
+ bufferFactor?: number;
153
+ }): this;
154
+ /** The point at `angle` (radians from the start of the circle, Manim `point_at_angle`). */
155
+ pointAtAngle(angle: number): Point;
156
+ /** The circle through three points (Manim `Circle.from_three_points`). */
157
+ fromThreePoints(p1: Point, p2: Point, p3: Point, opts?: StyleOptions): CircleMobject;
158
+ }
159
+ /** A circle of `radius` (Manim `Circle`). */
160
+ export declare function Circle(opts?: StyleOptions & {
161
+ radius?: number;
162
+ }): CircleMobject;
163
+ export declare namespace Circle {
164
+ var fromThreePoints: (p1: Point, p2: Point, p3: Point, opts?: StyleOptions) => CircleMobject;
165
+ }
166
+ /** A filled dot: Manim's `fillOpacity` 1 and `strokeWidth` 0. */
167
+ export declare function Dot(point?: Point, opts?: StyleOptions & {
168
+ radius?: number;
169
+ }): CircleMobject;
170
+ /** A dot with a white ring (Manim `AnnotationDot`). */
171
+ export declare function AnnotationDot(opts?: StyleOptions & {
172
+ radius?: number;
173
+ point?: Point;
174
+ }): CircleMobject;
175
+ /** A dot with a label in it (Manim `LabeledDot`). A string becomes a black `MathTex`. */
176
+ export declare function LabeledDot(label: string | Mobject, opts?: StyleOptions & {
177
+ radius?: number;
178
+ buff?: number;
179
+ point?: Point;
180
+ }): CircleMobject;
181
+ export declare function Ellipse(opts?: StyleOptions & {
182
+ width?: number;
183
+ height?: number;
184
+ }): CircleMobject;
185
+ /** The options of AnnularSector (Manim's keyword arguments). */
186
+ export type AnnularSectorOptions = StyleOptions & {
187
+ innerRadius?: number;
188
+ outerRadius?: number;
189
+ angle?: number;
190
+ startAngle?: number;
191
+ arcCenter?: Point;
192
+ };
193
+ /** A filled ring piece: Manim's `fillOpacity` 1 and `strokeWidth` 0. */
194
+ export declare function AnnularSector(opts?: AnnularSectorOptions): ArcMobject;
195
+ /** A filled circle piece (Manim `Sector`): an AnnularSector with inner radius 0. */
196
+ export declare function Sector(opts?: Omit<AnnularSectorOptions, "innerRadius" | "outerRadius"> & {
197
+ radius?: number;
198
+ }): ArcMobject;
199
+ /** A filled ring (Manim `Annulus`): the outer circle and the inner circle backwards. */
200
+ export declare function Annulus(opts?: StyleOptions & {
201
+ innerRadius?: number;
202
+ outerRadius?: number;
203
+ arcCenter?: Point;
204
+ }): CircleMobject;
205
+ /** A path with the arcs as submobjects (Manim `ArcPolygon` and `ArcPolygonFromArcs`). */
206
+ export declare class ArcPolygonMobject extends Mobject {
207
+ /** The arcs (Manim `arcs`). */
208
+ get arcs(): Mobject[];
209
+ copy(): ArcPolygonMobject;
210
+ }
211
+ /** The options of ArcPolygon (Manim's keyword arguments). */
212
+ export type ArcPolygonOptions = StyleOptions & {
213
+ angle?: number;
214
+ radius?: number;
215
+ /** The options of every arc, or of each arc. */
216
+ arcConfig?: ArcBetweenPointsOptions | readonly ArcBetweenPointsOptions[];
217
+ };
218
+ /** A closed path of arcs between the vertices (Manim `ArcPolygon`): `ArcPolygon(...vertices, opts)`. */
219
+ export declare function ArcPolygon(...args: (Points | ArcPolygonOptions)[]): ArcPolygonMobject;
220
+ /** A closed path of the arcs, with straight lines between them (Manim `ArcPolygonFromArcs`). */
221
+ export declare function ArcPolygonFromArcs(...args: (Mobject | StyleOptions)[]): ArcPolygonMobject;
222
+ /** An arc of `radius` that touches both lines (Manim `TangentialArc`). `corner` picks the
223
+ * corner: the sign along each line from the intersection. */
224
+ export declare function TangentialArc(line1: Mobject, line2: Mobject, radius: number, opts?: ArcBetweenPointsOptions & {
225
+ corner?: readonly [number, number];
226
+ }): ArcMobject;
227
+ /** The options of Line (Manim's keyword arguments). */
228
+ export type LineOptions = TipableOptions & {
229
+ buff?: number;
230
+ pathArc?: number;
231
+ };
232
+ /** A line: Manim's `Line`, with its methods. */
233
+ export declare class LineMobject extends TipableVMobjectMobject {
234
+ /** Sets the points from `start` to `end` with `buff` and `pathArc` (Manim `set_points_by_ends`). */
235
+ setPointsByEnds(start: Point | Mobject, end: Point | Mobject, opts?: {
236
+ buff?: number;
237
+ pathArc?: number;
238
+ }): this;
239
+ /** Bends the line into an arc of `newValue` between its ends (Manim `set_path_arc`). */
240
+ setPathArc(newValue: number): this;
241
+ /** The point of the line (made infinite) nearest to `point` (Manim `get_projection`). */
242
+ getProjection(point: Point): Point;
243
+ /** `tan(getAngle())` (Manim `get_slope`). */
244
+ getSlope(): number;
245
+ /** Turns the line about `aboutPoint` (default its start) to the angle `angle` (Manim `set_angle`). */
246
+ setAngle(angle: number, opts?: {
247
+ aboutPoint?: Point;
248
+ }): this;
249
+ /** Scales the line about its centre to `length` (Manim `set_length`). */
250
+ setLength(length: number): this;
251
+ }
252
+ /** A line from `start` to `end`, points or mobjects. `buff` leaves a gap at both ends;
253
+ * `pathArc` bends it into an arc of that angle (counter-clockwise for a positive angle). */
254
+ export declare function Line(start?: Point | Mobject, end?: Point | Mobject, opts?: LineOptions): LineMobject;
255
+ /** A dashed line: Manim's `DashedLine`. Its dashes are its submobjects. */
256
+ export declare class DashedLineMobject extends LineMobject {
257
+ getStart(): Point;
258
+ getEnd(): Point;
259
+ getFirstHandle(): Point;
260
+ getLastHandle(): Point;
261
+ }
262
+ /** The options of DashedLine (Manim's keyword arguments). */
263
+ export type DashedLineOptions = LineOptions & {
264
+ dashLength?: number;
265
+ /** The share of each dash period that is drawn. */
266
+ dashedRatio?: number;
267
+ /** The number of dashes, in place of `dashLength` (not in Manim). */
268
+ numDashes?: number;
269
+ };
270
+ /** A dashed line (Manim `DashedLine`): `max(2, ceil(length / dashLength * dashedRatio))` dashes. */
271
+ export declare function DashedLine(start?: Point | Mobject, end?: Point | Mobject, opts?: DashedLineOptions): DashedLineMobject;
272
+ /** A line of `length` that touches `vmob` at proportion `alpha` (Manim `TangentLine`). */
273
+ export declare function TangentLine(vmob: Mobject, alpha: number, opts?: LineOptions & {
274
+ length?: number;
275
+ dAlpha?: number;
276
+ }): LineMobject;
277
+ /** Two short lines at a right angle (Manim `Elbow`), turned by `angle` about the origin. */
278
+ export declare function Elbow(opts?: StyleOptions & {
279
+ width?: number;
280
+ angle?: number;
281
+ }): Mobject;
282
+ /** The options of Arrow (Manim's keyword arguments). */
283
+ export type ArrowSettings = LineOptions & {
284
+ color?: Color;
285
+ strokeWidth?: number;
286
+ maxTipLengthToLengthRatio?: number;
287
+ maxStrokeWidthToLengthRatio?: number;
288
+ tipShape?: TipShape;
289
+ tipShapeStart?: TipShape;
290
+ tipShapeEnd?: TipShape;
291
+ };
292
+ /** An arrow: Manim's `Arrow`. Its first submobject is the tip. */
293
+ export declare class ArrowMobject extends LineMobject {
294
+ maxTipLengthToLengthRatio: number;
295
+ maxStrokeWidthToLengthRatio: number;
296
+ initialStrokeWidth: number;
297
+ protected takeSettings(from: this): void;
298
+ /** Scales the arrow. The tips keep their size unless `scaleTips` (Manim `Arrow.scale`). */
299
+ scale(factor: number, opts?: {
300
+ scaleTips?: boolean;
301
+ aboutPoint?: Point;
302
+ aboutEdge?: Point;
303
+ }): this;
304
+ /** `min(tipLength, maxTipLengthToLengthRatio * length)` (Manim `get_default_tip_length`). */
305
+ getDefaultTipLength(): number;
306
+ private setStrokeWidthFromLength;
307
+ }
308
+ /** An arrow from `start` to `end` (Manim `Arrow`). `pathArc` bends it; `tipShape` sets the tip. */
309
+ export declare function Arrow(start?: Point | Mobject, end?: Point | Mobject, opts?: ArrowSettings): ArrowMobject;
310
+ /** An arrow with a tip at both ends (Manim `DoubleArrow`): `tipShapeStart` and `tipShapeEnd`. */
311
+ export declare function DoubleArrow(start?: Point | Mobject, end?: Point | Mobject, opts?: ArrowSettings): ArrowMobject;
312
+ /** An arrow from the origin: Manim's `Vector`. */
313
+ export declare class VectorMobject extends ArrowMobject {
314
+ /** The coordinates of the end as a column (Manim `coordinate_label`), next to the end. A
315
+ * `MathTex` matrix, not Manim's `Matrix`. */
316
+ coordinateLabel(opts?: {
317
+ integerLabels?: boolean;
318
+ nDim?: number;
319
+ color?: Color;
320
+ }): MathTexMobject;
321
+ }
322
+ /** An arrow from the origin to `direction`, with no gaps (Manim `Vector`). */
323
+ export declare function Vector(direction?: Point, opts?: ArrowSettings): VectorMobject;
324
+ /** An angle mark between two lines: Manim's `Angle`. */
325
+ export declare class AngleMobject extends Mobject {
326
+ lines: readonly [Mobject, Mobject] | undefined;
327
+ /** The angle in radians (Manim `angle_value`). */
328
+ angleValue: number;
329
+ copy(): AngleMobject;
330
+ /** The two lines (Manim `get_lines`). */
331
+ getLines(): Mobject;
332
+ /** The angle in radians, or in degrees with `degrees` (Manim `get_value`). */
333
+ getValue(opts?: {
334
+ degrees?: boolean;
335
+ }): number;
336
+ /** The angle at `B` from `A` to `C` (Manim `Angle.from_three_points`). */
337
+ fromThreePoints(A: Point, B: Point, C: Point, opts?: AngleOptions): AngleMobject;
338
+ }
339
+ /** The options of Angle (Manim's keyword arguments). */
340
+ export type AngleOptions = StyleOptions & {
341
+ radius?: number;
342
+ /** The side of each line from the intersection: 1 toward its end, -1 toward its start. */
343
+ quadrant?: readonly [number, number];
344
+ otherAngle?: boolean;
345
+ dot?: boolean;
346
+ dotRadius?: number;
347
+ dotDistance?: number;
348
+ dotColor?: Color;
349
+ elbow?: boolean;
350
+ };
351
+ /** An arc (or with `elbow`, a right-angle mark) between two lines (Manim `Angle`). */
352
+ export declare function Angle(line1: Mobject, line2: Mobject, opts?: AngleOptions): AngleMobject;
353
+ export declare namespace Angle {
354
+ var fromThreePoints: (A: Point, B: Point, C: Point, opts?: AngleOptions) => AngleMobject;
355
+ }
356
+ /** A right-angle mark between two lines (Manim `RightAngle`): an elbow of side `length`. */
357
+ export declare function RightAngle(line1: Mobject, line2: Mobject, opts?: Omit<AngleOptions, "radius" | "elbow"> & {
358
+ length?: number;
359
+ }): AngleMobject;
360
+ /** A path of closed polygons: Manim's `Polygram`, `Polygon`, `Rectangle`, … */
361
+ export declare class PolygramMobject extends Mobject {
362
+ copy(): PolygramMobject;
363
+ /** The first point of each curve (Manim `get_vertices`). */
364
+ getVertices(): Point[];
365
+ /** The vertices of each closed polygon (Manim `get_vertex_groups`). */
366
+ getVertexGroups(): Point[][];
367
+ /** Rounds each corner with an arc of `radius` (or each radius of a list, in turn) (Manim
368
+ * `round_corners`). */
369
+ roundCorners(opts?: {
370
+ radius?: number | readonly number[];
371
+ evenlyDistributeAnchors?: boolean;
372
+ componentsPerRoundedCorner?: number;
373
+ }): this;
374
+ }
375
+ /** Closed polygons, one for each list of vertices (Manim `Polygram`): `Polygram(group1, group2, opts)`. */
376
+ export declare function Polygram(...args: (readonly Point[] | StyleOptions)[]): PolygramMobject;
377
+ /** `Polygon(...vertices, opts)`: the vertices are points or arrays of points. */
378
+ export declare function Polygon(...args: (Points | StyleOptions)[]): PolygramMobject;
379
+ /** The options of RegularPolygram (Manim's keyword arguments). */
380
+ export type RegularPolygramOptions = StyleOptions & {
381
+ density?: number;
382
+ radius?: number;
383
+ startAngle?: number;
384
+ };
385
+ /** A regular star polygon {numVertices/density} (Manim `RegularPolygram`). */
386
+ export declare function RegularPolygram(numVertices: number, opts?: RegularPolygramOptions): PolygramMobject;
387
+ export declare function RegularPolygon(n?: number, opts?: StyleOptions & {
388
+ radius?: number;
389
+ startAngle?: number;
390
+ }): PolygramMobject;
391
+ export declare function Triangle(opts?: StyleOptions & {
392
+ radius?: number;
393
+ startAngle?: number;
394
+ }): PolygramMobject;
395
+ /** The options of Star (Manim's keyword arguments). */
396
+ export type StarOptions = StyleOptions & {
397
+ outerRadius?: number;
398
+ innerRadius?: number;
399
+ density?: number;
400
+ startAngle?: number;
401
+ };
402
+ /** A star of `n` points (Manim `Star`). Without `innerRadius`, `density` sets it: 2 makes the
403
+ * lines of a pentagram. */
404
+ export declare function Star(n?: number, opts?: StarOptions): PolygramMobject;
405
+ /** The options of Rectangle (Manim's keyword arguments). */
406
+ export type RectangleOptions = StyleOptions & {
407
+ width?: number;
408
+ height?: number;
409
+ /** Vertical grid lines this far apart. */
410
+ gridXstep?: number;
411
+ /** Horizontal grid lines this far apart. */
412
+ gridYstep?: number;
413
+ };
414
+ export declare function Rectangle(opts?: RectangleOptions): PolygramMobject;
415
+ /** A rectangle with round corners (Manim `RoundedRectangle`). A list of radii rounds the
416
+ * corners in turn. */
417
+ export declare function RoundedRectangle(opts?: Omit<RectangleOptions, "gridXstep" | "gridYstep"> & {
418
+ cornerRadius?: number | readonly number[];
419
+ }): PolygramMobject;
420
+ /** A square: Manim's `Square`, with `sideLength`. */
421
+ export declare class SquareMobject extends PolygramMobject {
422
+ /** The length of a side (Manim `side_length`); setting it scales the square. */
423
+ get sideLength(): number;
424
+ set sideLength(value: number);
425
+ }
426
+ export declare function Square(opts?: Omit<RectangleOptions, "width" | "height"> & {
427
+ sideLength?: number;
428
+ }): SquareMobject;
429
+ /** `mainShape` with holes in the shapes of `mobjects` (Manim `Cutout`). */
430
+ export declare function Cutout(mainShape: Mobject, ...args: (Mobject | StyleOptions)[]): Mobject;
431
+ /** The convex hull of the points, counter-clockwise (Manim `ConvexHull`). */
432
+ export declare function ConvexHull(...args: (Points | (StyleOptions & {
433
+ tolerance?: number;
434
+ }))[]): PolygramMobject;
435
+ type Buff = number | readonly [number, number];
436
+ /** A box around one or more mobjects (Manim `SurroundingRectangle`): `SurroundingRectangle(a, b, opts)`. */
437
+ export declare function SurroundingRectangle(...args: (Mobject | (StyleOptions & {
438
+ buff?: Buff;
439
+ cornerRadius?: number;
440
+ }))[]): PolygramMobject;
441
+ /** A filled box behind mobjects: Manim's `BackgroundRectangle`. */
442
+ export declare class BackgroundRectangleMobject extends PolygramMobject {
443
+ originalFillOpacity: number;
444
+ copy(): BackgroundRectangleMobject;
445
+ /** Sets the fill opacity to `b` times the first one (Manim's `pointwise_become_partial`,
446
+ * which `Create` uses). */
447
+ pointwiseBecomePartial(mobject: Mobject, a: number, b: number): this;
448
+ /** A black fill of `fillOpacity` and no stroke (Manim `set_style`); other options are ignored. */
449
+ setStyle(fillOpacity?: number | (StyleSettings & {
450
+ family?: boolean;
451
+ })): this;
452
+ }
453
+ /** A filled box behind one or more mobjects (Manim `BackgroundRectangle`), black by default. */
454
+ export declare function BackgroundRectangle(...args: (Mobject | (StyleOptions & {
455
+ buff?: Buff;
456
+ cornerRadius?: number;
457
+ }))[]): BackgroundRectangleMobject;
458
+ /** Two crossed lines over `mobject` (Manim `Cross`). */
459
+ export declare function Cross(mobject?: Mobject, opts?: StyleOptions & {
460
+ scaleFactor?: number;
461
+ }): Mobject;
462
+ /** A line under `mobject`, as wide as it (Manim `Underline`). */
463
+ export declare function Underline(mobject: Mobject, opts?: LineOptions): LineMobject;
464
+ /** The options of a label's text, box and frame (Manim `label_config`, `box_config`, `frame_config`). */
465
+ export interface LabelOptions {
466
+ labelConfig?: {
467
+ color?: Color;
468
+ fontSize?: number;
469
+ };
470
+ boxConfig?: StyleOptions & {
471
+ buff?: number;
472
+ };
473
+ frameConfig?: StyleOptions & {
474
+ buff?: number;
475
+ };
476
+ }
477
+ /** A label on a box with a frame (Manim `Label`): a string becomes a `MathTex`. Its
478
+ * submobjects are the box, the label and the frame. */
479
+ export declare function Label(label: string | Mobject, opts?: LabelOptions): Mobject;
480
+ /** The options of LabeledLine and LabeledArrow (Manim's keyword arguments). */
481
+ export type LabeledLineOptions = ArrowSettings & LabelOptions & {
482
+ /** Where the label sits, as a share of the line from its start. */
483
+ labelPosition?: number;
484
+ start?: Point | Mobject;
485
+ end?: Point | Mobject;
486
+ };
487
+ /** A line with a label (Manim `LabeledLine`): `LabeledLine("x", { start, end, labelPosition })`. */
488
+ export declare function LabeledLine(label: string | Mobject, opts?: LabeledLineOptions): LineMobject;
489
+ /** An arrow with a label (Manim `LabeledArrow`). */
490
+ export declare function LabeledArrow(label: string | Mobject, opts?: LabeledLineOptions): ArrowMobject;
491
+ /** A polygram with a label at its pole of inaccessibility (Manim `LabeledPolygram`):
492
+ * `LabeledPolygram(group1, group2, { label })`. */
493
+ export declare function LabeledPolygram(...args: (readonly Point[] | (StyleOptions & LabelOptions & {
494
+ label: string | Mobject;
495
+ precision?: number;
496
+ }))[]): PolygramMobject;
497
+ /** The area inside any of the mobjects (Manim `Union`): `Union(a, b, opts)`. */
498
+ export declare function Union(...args: (Mobject | StyleOptions)[]): Mobject;
499
+ /** The area inside all the mobjects (Manim `Intersection`). */
500
+ export declare function Intersection(...args: (Mobject | StyleOptions)[]): Mobject;
501
+ /** The area of `subject` outside `clip` (Manim `Difference`). */
502
+ export declare function Difference(subject: Mobject, clip: Mobject, opts?: StyleOptions): Mobject;
503
+ /** The area inside one of the two, not both (Manim `Exclusion`). */
504
+ export declare function Exclusion(subject: Mobject, clip: Mobject, opts?: StyleOptions): Mobject;
505
+ /** A scale of ParametricFunction: `m.LinearBase()` or `m.LogBase()` (Manim `scaling`). */
506
+ export interface Scaling {
507
+ function(value: number): number;
508
+ }
509
+ /** `[min, max]` (step 0.01) or `[min, max, step]`. */
510
+ export type TRange = readonly [number, number] | readonly [number, number, number];
511
+ /** A curve: Manim's `ParametricFunction`. */
512
+ export declare class ParametricFunctionMobject extends Mobject {
513
+ function: (t: number) => Point;
514
+ copy(): ParametricFunctionMobject;
515
+ getFunction(): (t: number) => Point;
516
+ getPointFromFunction(t: number): Point;
517
+ }
518
+ /** The options of ParametricFunction (Manim's keyword arguments). */
519
+ export type ParametricFunctionOptions = StyleOptions & {
520
+ tRange?: TRange;
521
+ scaling?: Scaling;
522
+ dt?: number;
523
+ /** Values of `t` where the curve breaks. */
524
+ discontinuities?: readonly number[];
525
+ useSmoothing?: boolean;
526
+ };
527
+ /** The curve of `function(t)` for `t` in `tRange` (Manim `ParametricFunction`). */
528
+ export declare function ParametricFunction(fn: (t: number) => Point, opts?: ParametricFunctionOptions): ParametricFunctionMobject;
529
+ /** The graph of `y = function(x)`: Manim's `FunctionGraph`. */
530
+ export declare class FunctionGraphMobject extends Mobject {
531
+ function: (x: number) => number;
532
+ copy(): FunctionGraphMobject;
533
+ /** The function `x => y` (Manim `get_function`). */
534
+ getFunction(): (x: number) => number;
535
+ /** `[x, function(x)]` (Manim `get_point_from_function`). */
536
+ getPointFromFunction(x: number): Point;
537
+ }
538
+ /** The graph of `function` over `xRange` (Manim `FunctionGraph`): the frame's width by default. */
539
+ export declare function FunctionGraph(fn: (x: number) => number, opts?: Omit<ParametricFunctionOptions, "tRange"> & {
540
+ xRange?: TRange;
541
+ }): FunctionGraphMobject;
542
+ /** The curves where `func(x, y) = 0` (Manim `ImplicitFunction`), found on a grid of
543
+ * `2 ** minDepth` cells for each side (at most `maxQuads` cells). */
544
+ export declare function ImplicitFunction(func: (x: number, y: number) => number, opts?: StyleOptions & {
545
+ xRange?: readonly [number, number];
546
+ yRange?: readonly [number, number];
547
+ minDepth?: number;
548
+ maxQuads?: number;
549
+ useSmoothing?: boolean;
550
+ }): Mobject;
551
+ export {};