@sarmal/core 0.12.0 → 0.13.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.
- package/dist/auto-init.cjs +114 -82
- package/dist/auto-init.cjs.map +1 -1
- package/dist/auto-init.d.cts +1 -2
- package/dist/auto-init.d.ts +1 -2
- package/dist/auto-init.js +113 -81
- package/dist/auto-init.js.map +1 -1
- package/dist/curves/artemis2.cjs +10 -7
- package/dist/curves/artemis2.d.cts +1 -1
- package/dist/curves/artemis2.d.ts +1 -1
- package/dist/curves/artemis2.js +9 -6
- package/dist/curves/astroid.cjs +4 -4
- package/dist/curves/astroid.d.cts +1 -1
- package/dist/curves/astroid.d.ts +1 -1
- package/dist/curves/astroid.js +3 -3
- package/dist/curves/deltoid.cjs +4 -4
- package/dist/curves/deltoid.d.cts +1 -1
- package/dist/curves/deltoid.d.ts +1 -1
- package/dist/curves/deltoid.js +3 -3
- package/dist/curves/epicycloid3.cjs +4 -4
- package/dist/curves/epicycloid3.d.cts +1 -1
- package/dist/curves/epicycloid3.d.ts +1 -1
- package/dist/curves/epicycloid3.js +3 -3
- package/dist/curves/epitrochoid7.cjs +5 -5
- package/dist/curves/epitrochoid7.d.cts +1 -1
- package/dist/curves/epitrochoid7.d.ts +1 -1
- package/dist/curves/epitrochoid7.js +4 -4
- package/dist/curves/index.cjs +32 -28
- package/dist/curves/index.d.cts +21 -21
- package/dist/curves/index.d.ts +21 -21
- package/dist/curves/index.js +44 -28
- package/dist/curves/lame.cjs +6 -5
- package/dist/curves/lame.d.cts +1 -1
- package/dist/curves/lame.d.ts +1 -1
- package/dist/curves/lame.js +5 -4
- package/dist/curves/lissajous32.cjs +4 -4
- package/dist/curves/lissajous32.d.cts +1 -1
- package/dist/curves/lissajous32.d.ts +1 -1
- package/dist/curves/lissajous32.js +3 -3
- package/dist/curves/lissajous43.cjs +4 -4
- package/dist/curves/lissajous43.d.cts +1 -1
- package/dist/curves/lissajous43.d.ts +1 -1
- package/dist/curves/lissajous43.js +3 -3
- package/dist/curves/rose3.cjs +4 -4
- package/dist/curves/rose3.d.cts +1 -1
- package/dist/curves/rose3.d.ts +1 -1
- package/dist/curves/rose3.js +3 -3
- package/dist/curves/rose5.cjs +4 -4
- package/dist/curves/rose5.d.cts +1 -1
- package/dist/curves/rose5.d.ts +1 -1
- package/dist/curves/rose5.js +3 -3
- package/dist/index.cjs +135 -87
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +69 -34
- package/dist/index.d.ts +69 -34
- package/dist/index.js +152 -87
- package/dist/index.js.map +1 -1
- package/dist/types-BW0bpL1Z.d.cts +290 -0
- package/dist/types-BW0bpL1Z.d.ts +290 -0
- package/package.json +1 -1
- package/dist/types-BzgdhxE0.d.cts +0 -260
- package/dist/types-BzgdhxE0.d.ts +0 -260
package/dist/index.d.ts
CHANGED
|
@@ -1,35 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
import {
|
|
2
|
+
B as BaseRendererOptions,
|
|
3
|
+
E as Engine,
|
|
4
|
+
S as SarmalInstance,
|
|
5
|
+
C as CurveDef,
|
|
6
|
+
R as RendererOptions,
|
|
7
|
+
a as SarmalOptions,
|
|
8
|
+
} from "./types-BW0bpL1Z.js";
|
|
9
|
+
export {
|
|
10
|
+
J as JumpOptions,
|
|
11
|
+
P as PalettePreset,
|
|
12
|
+
b as Point,
|
|
13
|
+
c as SeekOptions,
|
|
14
|
+
T as TrailStyle,
|
|
15
|
+
} from "./types-BW0bpL1Z.js";
|
|
16
|
+
export { CurveName, curves } from "./curves/index.js";
|
|
17
|
+
export { artemis2 } from "./curves/artemis2.js";
|
|
18
|
+
export { astroid } from "./curves/astroid.js";
|
|
19
|
+
export { deltoid } from "./curves/deltoid.js";
|
|
20
|
+
export { epicycloid3 } from "./curves/epicycloid3.js";
|
|
21
|
+
export { epitrochoid7 } from "./curves/epitrochoid7.js";
|
|
22
|
+
export { lame } from "./curves/lame.js";
|
|
23
|
+
export { lissajous32 } from "./curves/lissajous32.js";
|
|
24
|
+
export { lissajous43 } from "./curves/lissajous43.js";
|
|
25
|
+
export { rose3 } from "./curves/rose3.js";
|
|
26
|
+
export { rose5 } from "./curves/rose5.js";
|
|
14
27
|
|
|
15
|
-
interface SVGRendererOptions {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
/** @default '#ffffff' */
|
|
22
|
-
trailColor?: string;
|
|
23
|
-
/** @default '#ffffff' */
|
|
24
|
-
headColor?: string;
|
|
25
|
-
/** @default 4 */
|
|
26
|
-
headRadius?: number;
|
|
27
|
-
/** @default 'Loading' */
|
|
28
|
-
ariaLabel?: string;
|
|
28
|
+
interface SVGRendererOptions extends BaseRendererOptions {
|
|
29
|
+
/** Container element that will contain the SVG */
|
|
30
|
+
container: Element;
|
|
31
|
+
engine: Engine;
|
|
32
|
+
/** @default 'Loading' */
|
|
33
|
+
ariaLabel?: string;
|
|
29
34
|
}
|
|
30
35
|
interface SVGSarmalOptions extends Omit<SVGRendererOptions, "container" | "engine"> {
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
/** @default 120 */
|
|
37
|
+
trailLength?: number;
|
|
33
38
|
}
|
|
34
39
|
/**
|
|
35
40
|
* Creates a live SVG renderer for sarmal animations
|
|
@@ -44,10 +49,18 @@ declare function createSVGRenderer(options: SVGRendererOptions): SarmalInstance;
|
|
|
44
49
|
* ```ts
|
|
45
50
|
* import { createSarmalSVG, curves } from '@sarmal/core'
|
|
46
51
|
* const sarmal = createSarmalSVG(document.getElementById('spinner'), curves.epitrochoid7)
|
|
47
|
-
*
|
|
52
|
+
*
|
|
53
|
+
* // To control manually, use autoStart: false
|
|
54
|
+
* const controlled = createSarmalSVG(container, curves.artemis2, { autoStart: false })
|
|
55
|
+
* controlled.play() // Start when ready
|
|
56
|
+
* controlled.pause() // Pause later
|
|
48
57
|
* ```
|
|
49
58
|
*/
|
|
50
|
-
declare function createSarmalSVG(
|
|
59
|
+
declare function createSarmalSVG(
|
|
60
|
+
container: Element,
|
|
61
|
+
curveDef: CurveDef,
|
|
62
|
+
options?: SVGSarmalOptions,
|
|
63
|
+
): SarmalInstance;
|
|
51
64
|
|
|
52
65
|
declare function createEngine(curveDef: CurveDef, trailLength?: number): Engine;
|
|
53
66
|
|
|
@@ -64,9 +77,31 @@ declare function createRenderer(options: RendererOptions): SarmalInstance;
|
|
|
64
77
|
* ```ts
|
|
65
78
|
* import { createSarmal, curves } from '@sarmal/core'
|
|
66
79
|
* const sarmal = createSarmal(canvas, curves.artemis2)
|
|
67
|
-
*
|
|
80
|
+
*
|
|
81
|
+
* // To control manually, use autoStart: false
|
|
82
|
+
* const controlled = createSarmal(canvas, curves.artemis2, { autoStart: false })
|
|
83
|
+
* controlled.play() // Start when ready
|
|
84
|
+
* controlled.pause() // Pause later
|
|
68
85
|
* ```
|
|
69
86
|
*/
|
|
70
|
-
declare function createSarmal(
|
|
87
|
+
declare function createSarmal(
|
|
88
|
+
canvas: HTMLCanvasElement,
|
|
89
|
+
curveDef: CurveDef,
|
|
90
|
+
options?: SarmalOptions,
|
|
91
|
+
): SarmalInstance;
|
|
71
92
|
|
|
72
|
-
export {
|
|
93
|
+
export {
|
|
94
|
+
BaseRendererOptions,
|
|
95
|
+
CurveDef,
|
|
96
|
+
Engine,
|
|
97
|
+
RendererOptions,
|
|
98
|
+
type SVGRendererOptions,
|
|
99
|
+
type SVGSarmalOptions,
|
|
100
|
+
SarmalInstance,
|
|
101
|
+
SarmalOptions,
|
|
102
|
+
createEngine,
|
|
103
|
+
createRenderer,
|
|
104
|
+
createSVGRenderer,
|
|
105
|
+
createSarmal,
|
|
106
|
+
createSarmalSVG,
|
|
107
|
+
};
|