@field/cascade 0.2.22 → 0.3.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/AGENTS.md +47 -7
- package/ARCHITECTURE.md +30 -2
- package/CHANGELOG.md +89 -0
- package/DESIGN.md +10 -5
- package/README.md +103 -7
- package/dist/assets/CodeEditor-BADFbTJS.js +623 -0
- package/dist/assets/CodePanel-faK6PRfz.js +2 -0
- package/dist/assets/CustomNodeDialog-DhlKuviy.js +1 -0
- package/dist/assets/{ExportDialog-DWN4nhXI.js → ExportDialog-BJu2Bpvv.js} +2 -2
- package/dist/assets/ProjectSettings-D6a6kjqR.js +2 -0
- package/dist/assets/SettingsDialog-DJZdIvLC.js +1 -0
- package/dist/assets/VersionHistoryDialog-C1X3HOhc.js +3 -0
- package/dist/assets/{core-Bji4aZUU.js → core-CiuiuWZi.js} +29 -38
- package/dist/assets/{cssMode-B6Z_Q1Kh.js → cssMode-D-NwZSMJ.js} +1 -1
- package/dist/assets/{editor.api-jMoW_43X.js → editor.api-DT3WEvBd.js} +1 -1
- package/dist/assets/{freemarker2-DvvPV6m5.js → freemarker2-eKNYQaiz.js} +1 -1
- package/dist/assets/geo-DUvVbLnx.js +1 -0
- package/dist/assets/{handlebars-B8rfuSIa.js → handlebars-C2w1ggK2.js} +1 -1
- package/dist/assets/{html-DyHm6JCp.js → html-DQb41jyo.js} +1 -1
- package/dist/assets/{htmlMode-E9XLWE5u.js → htmlMode-IhNlh6Lv.js} +1 -1
- package/dist/assets/{image-BUcQC7PG.js → image-DMCXBY-_.js} +26 -40
- package/dist/assets/index-BDV5xGBZ.css +1 -0
- package/dist/assets/index-HTCN44kj.js +212 -0
- package/dist/assets/index-client-BoJgsN9M.js +1 -0
- package/dist/assets/{javascript-C_bM5PCN.js → javascript-BIT6jMLC.js} +1 -1
- package/dist/assets/{jsonMode-BdyVS7G4.js → jsonMode-CNfyB1ro.js} +1 -1
- package/dist/assets/{legacy-DIu3XRwl.js → legacy-CAj2_7QE.js} +2 -2
- package/dist/assets/{liquid-CDkn3spA.js → liquid-CmSmJmOG.js} +1 -1
- package/dist/assets/{lspLanguageFeatures-AB5DMAsr.js → lspLanguageFeatures-BqMm3uMP.js} +1 -1
- package/dist/assets/{mdx-BvH_NjDN.js → mdx-6r6YgOFw.js} +1 -1
- package/dist/assets/{nodeTypeUtils-CweA3NHd.js → nodeTypeUtils-BBA1JqHx.js} +1 -1
- package/dist/assets/{python-B7uii4fi.js → python-x1H0TQuI.js} +1 -1
- package/dist/assets/{razor-Z48fWdJc.js → razor-Dzl1vZFm.js} +1 -1
- package/dist/assets/{tsMode-BDgacVG4.js → tsMode-n6DMMe3a.js} +1 -1
- package/dist/assets/{typescript-Derb6Oqa.js → typescript-ziEz65xN.js} +1 -1
- package/dist/assets/{workers-BtoMX_pm.js → workers-D-qUdp-r.js} +1 -1
- package/dist/assets/{xml-B1CaFSrG.js → xml-DMZjt5lE.js} +1 -1
- package/dist/assets/{yaml-HmIeA0KH.js → yaml-DFe5qZSO.js} +1 -1
- package/dist/cli/index.js +16194 -10195
- package/dist/cli/runtime/io.ts +93 -7
- package/dist/contracts/animation.d.ts +40 -0
- package/dist/contracts/animation.js +14 -0
- package/dist/contracts/definition.d.ts +39 -1
- package/dist/contracts/document.d.ts +15 -0
- package/dist/contracts/index.d.ts +1 -0
- package/dist/contracts/index.js +1 -0
- package/dist/contracts/validate.d.ts +10 -1
- package/dist/contracts/validate.js +9 -1
- package/dist/graphs/default.cascade +1 -1
- package/dist/index.html +5 -5
- package/dist/io.d.ts +196 -0
- package/dist/io.js +303 -0
- package/dist/net.d.ts +1 -0
- package/dist/net.js +28 -0
- package/dist/runtime/animation/channel.d.ts +108 -0
- package/dist/runtime/animation/channel.js +204 -0
- package/dist/runtime/animation/frameRange.d.ts +78 -0
- package/dist/runtime/animation/frameRange.js +76 -0
- package/dist/runtime/animation/index.d.ts +10 -0
- package/dist/runtime/animation/index.js +8 -0
- package/dist/runtime/builtins/core/random.d.ts +1 -1
- package/dist/runtime/builtins/core/remap.d.ts +1 -1
- package/dist/runtime/builtins/geo/copyToPoints.d.ts +1 -1
- package/dist/runtime/builtins/geo/copyToPoints.js +1 -1
- package/dist/runtime/builtins/geo/generators.d.ts +1 -1
- package/dist/runtime/builtins/geo/merge.d.ts +1 -1
- package/dist/runtime/builtins/geo/svgExport.d.ts +1 -1
- package/dist/runtime/builtins/geo/svgExport.js +1 -1
- package/dist/runtime/builtins/geo/transform.d.ts +1 -1
- package/dist/runtime/builtins/geo/transform.js +1 -1
- package/dist/runtime/definition/architecture.d.ts +1 -1
- package/dist/runtime/definition/extract.d.ts +1 -1
- package/dist/runtime/definition/extract.js +1 -1
- package/dist/runtime/error.d.ts +1 -1
- package/dist/runtime/expressions/evaluator.d.ts +53 -0
- package/dist/runtime/expressions/evaluator.js +193 -0
- package/dist/runtime/expressions/index.d.ts +15 -0
- package/dist/runtime/expressions/index.js +12 -0
- package/dist/runtime/expressions/math.d.ts +75 -0
- package/dist/runtime/expressions/math.js +140 -0
- package/dist/runtime/expressions/preprocess.d.ts +33 -0
- package/dist/runtime/expressions/preprocess.js +102 -0
- package/dist/runtime/expressions/scope.d.ts +27 -0
- package/dist/runtime/expressions/scope.js +10 -0
- package/dist/runtime/expressions/time.d.ts +54 -0
- package/dist/runtime/expressions/time.js +71 -0
- package/dist/runtime/expressions/types.d.ts +66 -0
- package/dist/runtime/expressions/types.js +9 -0
- package/dist/runtime/geometry/attributes.d.ts +2 -2
- package/dist/runtime/geometry/attributes.js +1 -1
- package/dist/runtime/geometry/builder.d.ts +1 -1
- package/dist/runtime/geometry/builder.js +1 -1
- package/dist/runtime/geometry/copy.d.ts +1 -1
- package/dist/runtime/geometry/copy.js +1 -1
- package/dist/runtime/geometry/generate.d.ts +1 -1
- package/dist/runtime/geometry/groups.d.ts +1 -1
- package/dist/runtime/geometry/groups.js +1 -1
- package/dist/runtime/geometry/matrix.d.ts +1 -1
- package/dist/runtime/geometry/merge.d.ts +1 -1
- package/dist/runtime/geometry/merge.js +1 -1
- package/dist/runtime/geometry/primitives.d.ts +1 -1
- package/dist/runtime/geometry/primitives.js +1 -1
- package/dist/runtime/geometry/promote.d.ts +1 -1
- package/dist/runtime/geometry/promote.js +1 -1
- package/dist/runtime/geometry/resample.d.ts +1 -1
- package/dist/runtime/geometry/resample.js +1 -1
- package/dist/runtime/geometry/svg.d.ts +1 -1
- package/dist/runtime/geometry/svg.js +1 -1
- package/dist/runtime/geometry/transform.d.ts +1 -1
- package/dist/runtime/geometry/transform.js +1 -1
- package/dist/runtime/index.d.ts +4 -1
- package/dist/runtime/index.js +4 -1
- package/dist/runtime/params/animator.d.ts +74 -0
- package/dist/runtime/params/animator.js +137 -0
- package/dist/runtime/params/index.d.ts +11 -0
- package/dist/runtime/params/index.js +9 -0
- package/dist/runtime/params/resolve.d.ts +73 -0
- package/dist/runtime/params/resolve.js +62 -0
- package/dist/runtime/runtime.d.ts +22 -0
- package/dist/runtime/runtime.js +242 -14
- package/dist/runtime/types.d.ts +30 -4
- package/dist/shell.d.ts +3 -3
- package/doc/NODE_REFERENCE.md +395 -0
- package/doc/PROJECT_AUTHORING.md +148 -6
- package/package.json +26 -3
- package/dist/assets/CodeEditor-DoaNEUaM.js +0 -641
- package/dist/assets/CodePanel-B0_2XJ-t.js +0 -2
- package/dist/assets/CustomNodeDialog-026lzecD.js +0 -1
- package/dist/assets/ProjectSettings-BzT164Yx.js +0 -2
- package/dist/assets/SettingsDialog-DmHb1V0r.js +0 -1
- package/dist/assets/VersionHistoryDialog-hH6VsXLX.js +0 -3
- package/dist/assets/geo-CXmCtzMM.js +0 -2
- package/dist/assets/index-BXYXSdgh.js +0 -224
- package/dist/assets/index-CrNke7SW.css +0 -1
- package/dist/assets/index-client-DN_FvjN8.js +0 -1
- package/dist/assets/quill-DjZ69wL_.js +0 -121
- package/dist/cli/index.js.map +0 -7
- package/dist/contracts/capabilities.d.ts.map +0 -1
- package/dist/contracts/capabilities.js.map +0 -1
- package/dist/contracts/color.d.ts.map +0 -1
- package/dist/contracts/color.js.map +0 -1
- package/dist/contracts/definition.d.ts.map +0 -1
- package/dist/contracts/definition.js.map +0 -1
- package/dist/contracts/document.d.ts.map +0 -1
- package/dist/contracts/document.js.map +0 -1
- package/dist/contracts/geometry.d.ts.map +0 -1
- package/dist/contracts/geometry.js.map +0 -1
- package/dist/contracts/index.d.ts.map +0 -1
- package/dist/contracts/index.js.map +0 -1
- package/dist/contracts/schema.d.ts.map +0 -1
- package/dist/contracts/schema.js.map +0 -1
- package/dist/contracts/validate.d.ts.map +0 -1
- package/dist/contracts/validate.js.map +0 -1
- package/dist/contracts/values.d.ts.map +0 -1
- package/dist/contracts/values.js.map +0 -1
- package/dist/graphs/default-orig.cascade +0 -128
- package/dist/runtime/browser.d.ts.map +0 -1
- package/dist/runtime/browser.js.map +0 -1
- package/dist/runtime/builtins/core/index.d.ts.map +0 -1
- package/dist/runtime/builtins/core/index.js.map +0 -1
- package/dist/runtime/builtins/core/random.d.ts.map +0 -1
- package/dist/runtime/builtins/core/random.js.map +0 -1
- package/dist/runtime/builtins/core/remap.d.ts.map +0 -1
- package/dist/runtime/builtins/core/remap.js.map +0 -1
- package/dist/runtime/builtins/core/routing.d.ts.map +0 -1
- package/dist/runtime/builtins/core/routing.js.map +0 -1
- package/dist/runtime/builtins/core/structural.d.ts.map +0 -1
- package/dist/runtime/builtins/core/structural.js.map +0 -1
- package/dist/runtime/builtins/geo/copyToPoints.d.ts.map +0 -1
- package/dist/runtime/builtins/geo/copyToPoints.js.map +0 -1
- package/dist/runtime/builtins/geo/definitions.d.ts.map +0 -1
- package/dist/runtime/builtins/geo/definitions.js.map +0 -1
- package/dist/runtime/builtins/geo/generators.d.ts.map +0 -1
- package/dist/runtime/builtins/geo/generators.js.map +0 -1
- package/dist/runtime/builtins/geo/index.d.ts.map +0 -1
- package/dist/runtime/builtins/geo/index.js.map +0 -1
- package/dist/runtime/builtins/geo/merge.d.ts.map +0 -1
- package/dist/runtime/builtins/geo/merge.js.map +0 -1
- package/dist/runtime/builtins/geo/namespace.d.ts.map +0 -1
- package/dist/runtime/builtins/geo/namespace.js.map +0 -1
- package/dist/runtime/builtins/geo/svgExport.d.ts.map +0 -1
- package/dist/runtime/builtins/geo/svgExport.js.map +0 -1
- package/dist/runtime/builtins/geo/transform.d.ts.map +0 -1
- package/dist/runtime/builtins/geo/transform.js.map +0 -1
- package/dist/runtime/builtins/index.d.ts.map +0 -1
- package/dist/runtime/builtins/index.js.map +0 -1
- package/dist/runtime/definition/architecture.d.ts.map +0 -1
- package/dist/runtime/definition/architecture.js.map +0 -1
- package/dist/runtime/definition/extract.d.ts.map +0 -1
- package/dist/runtime/definition/extract.js.map +0 -1
- package/dist/runtime/error.d.ts.map +0 -1
- package/dist/runtime/error.js.map +0 -1
- package/dist/runtime/geometry/attributes.d.ts.map +0 -1
- package/dist/runtime/geometry/attributes.js.map +0 -1
- package/dist/runtime/geometry/builder.d.ts.map +0 -1
- package/dist/runtime/geometry/builder.js.map +0 -1
- package/dist/runtime/geometry/copy.d.ts.map +0 -1
- package/dist/runtime/geometry/copy.js.map +0 -1
- package/dist/runtime/geometry/generate.d.ts.map +0 -1
- package/dist/runtime/geometry/generate.js.map +0 -1
- package/dist/runtime/geometry/groups.d.ts.map +0 -1
- package/dist/runtime/geometry/groups.js.map +0 -1
- package/dist/runtime/geometry/index.d.ts.map +0 -1
- package/dist/runtime/geometry/index.js.map +0 -1
- package/dist/runtime/geometry/matrix.d.ts.map +0 -1
- package/dist/runtime/geometry/matrix.js.map +0 -1
- package/dist/runtime/geometry/merge.d.ts.map +0 -1
- package/dist/runtime/geometry/merge.js.map +0 -1
- package/dist/runtime/geometry/primitives.d.ts.map +0 -1
- package/dist/runtime/geometry/primitives.js.map +0 -1
- package/dist/runtime/geometry/promote.d.ts.map +0 -1
- package/dist/runtime/geometry/promote.js.map +0 -1
- package/dist/runtime/geometry/resample.d.ts.map +0 -1
- package/dist/runtime/geometry/resample.js.map +0 -1
- package/dist/runtime/geometry/svg.d.ts.map +0 -1
- package/dist/runtime/geometry/svg.js.map +0 -1
- package/dist/runtime/geometry/transform.d.ts.map +0 -1
- package/dist/runtime/geometry/transform.js.map +0 -1
- package/dist/runtime/index.d.ts.map +0 -1
- package/dist/runtime/index.js.map +0 -1
- package/dist/runtime/node.d.ts.map +0 -1
- package/dist/runtime/node.js.map +0 -1
- package/dist/runtime/runtime.d.ts.map +0 -1
- package/dist/runtime/runtime.js.map +0 -1
- package/dist/runtime/types.d.ts.map +0 -1
- package/dist/runtime/types.js.map +0 -1
- package/dist/shell.js.map +0 -7
- package/dist/stage.js.map +0 -7
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frame-range evaluation, neutral runtime.
|
|
3
|
+
*
|
|
4
|
+
* The loop the engine has always been missing: set the frame, mark the
|
|
5
|
+
* time-dependent nodes dirty, hand the frame to a caller, repeat. It writes no
|
|
6
|
+
* files and spawns no encoder — frames are produced where the canvas is, so
|
|
7
|
+
* what the caller does with each frame is the caller's business.
|
|
8
|
+
*
|
|
9
|
+
* The loop owns no graph and no clock of its own. It drives a `FrameClock`,
|
|
10
|
+
* which a host binds to its own engine state.
|
|
11
|
+
*/
|
|
12
|
+
export interface FrameClock {
|
|
13
|
+
/** Set the current frame. Fractional frames must be preserved. */
|
|
14
|
+
setFrame(frame: number): void;
|
|
15
|
+
/** Dirty every node whose parameters depend on time. */
|
|
16
|
+
markTimeDependentDirty(): void;
|
|
17
|
+
/** Integer frame — $F */
|
|
18
|
+
getFrame(): number;
|
|
19
|
+
/** Fractional frame — $FF */
|
|
20
|
+
getFrameFraction(): number;
|
|
21
|
+
/** Seconds — $T */
|
|
22
|
+
getTime(): number;
|
|
23
|
+
/** Rate — $FPS */
|
|
24
|
+
getFps(): number;
|
|
25
|
+
}
|
|
26
|
+
/** What a caller is told about the frame it has been handed. */
|
|
27
|
+
export interface FrameInfo {
|
|
28
|
+
/** 0-based position in the range. */
|
|
29
|
+
index: number;
|
|
30
|
+
/** Total frames in the range. */
|
|
31
|
+
total: number;
|
|
32
|
+
/** Integer frame — $F */
|
|
33
|
+
frame: number;
|
|
34
|
+
/** Fractional frame — $FF */
|
|
35
|
+
fframe: number;
|
|
36
|
+
/** Seconds — $T */
|
|
37
|
+
time: number;
|
|
38
|
+
/** Rate — $FPS */
|
|
39
|
+
fps: number;
|
|
40
|
+
}
|
|
41
|
+
export interface FrameRangeOptions {
|
|
42
|
+
/** First frame, inclusive. */
|
|
43
|
+
start: number;
|
|
44
|
+
/** Last frame, inclusive when the step lands on it. */
|
|
45
|
+
end: number;
|
|
46
|
+
/** Frame increment. Must be > 0; may be fractional for sub-frame stepping. */
|
|
47
|
+
step?: number;
|
|
48
|
+
/** Called once per frame, after the frame is set and dirt is marked. */
|
|
49
|
+
onFrame: (info: FrameInfo) => void | Promise<void>;
|
|
50
|
+
/** Cooperative cancellation, checked before each frame. */
|
|
51
|
+
signal?: {
|
|
52
|
+
readonly aborted: boolean;
|
|
53
|
+
};
|
|
54
|
+
/** Restore the clock's frame when the loop finishes. Default true. */
|
|
55
|
+
restoreFrame?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface FrameRangeResult {
|
|
58
|
+
/** The fractional frames visited, in order. */
|
|
59
|
+
frames: number[];
|
|
60
|
+
frameCount: number;
|
|
61
|
+
/** True if a signal cut the loop short. */
|
|
62
|
+
aborted: boolean;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* The frames a range visits. Pure — no clock, no side effects — so a caller can
|
|
66
|
+
* size a progress bar or a sequence without running anything.
|
|
67
|
+
*/
|
|
68
|
+
export declare function frameRange(start: number, end: number, step?: number): number[];
|
|
69
|
+
/**
|
|
70
|
+
* Walk a frame range against a clock, calling back once per frame.
|
|
71
|
+
*
|
|
72
|
+
* Per frame, in this order: set the frame, mark time-dependent nodes dirty,
|
|
73
|
+
* then call `onFrame`. The callback is where a cook happens — the loop does not
|
|
74
|
+
* assume one, which is what lets the same loop serve a render, a test, or a
|
|
75
|
+
* headless evaluation.
|
|
76
|
+
*/
|
|
77
|
+
export declare function runFrameRange(clock: FrameClock, options: FrameRangeOptions): Promise<FrameRangeResult>;
|
|
78
|
+
//# sourceMappingURL=frameRange.d.ts.map
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Frame-range evaluation, neutral runtime.
|
|
3
|
+
*
|
|
4
|
+
* The loop the engine has always been missing: set the frame, mark the
|
|
5
|
+
* time-dependent nodes dirty, hand the frame to a caller, repeat. It writes no
|
|
6
|
+
* files and spawns no encoder — frames are produced where the canvas is, so
|
|
7
|
+
* what the caller does with each frame is the caller's business.
|
|
8
|
+
*
|
|
9
|
+
* The loop owns no graph and no clock of its own. It drives a `FrameClock`,
|
|
10
|
+
* which a host binds to its own engine state.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* The frames a range visits. Pure — no clock, no side effects — so a caller can
|
|
14
|
+
* size a progress bar or a sequence without running anything.
|
|
15
|
+
*/
|
|
16
|
+
export function frameRange(start, end, step = 1) {
|
|
17
|
+
if (!Number.isFinite(start) || !Number.isFinite(end)) {
|
|
18
|
+
throw new Error(`frameRange: start and end must be finite (got ${start}, ${end})`);
|
|
19
|
+
}
|
|
20
|
+
if (!Number.isFinite(step) || step <= 0) {
|
|
21
|
+
throw new Error(`frameRange: step must be a finite number greater than 0 (got ${step})`);
|
|
22
|
+
}
|
|
23
|
+
if (end < start) {
|
|
24
|
+
throw new Error(`frameRange: end (${end}) must not be before start (${start})`);
|
|
25
|
+
}
|
|
26
|
+
// Count from the span rather than accumulating, so a fractional step does not
|
|
27
|
+
// drift and an inclusive end lands exactly.
|
|
28
|
+
const span = end - start;
|
|
29
|
+
const count = Math.floor(span / step + 1e-9) + 1;
|
|
30
|
+
const frames = new Array(count);
|
|
31
|
+
for (let i = 0; i < count; i++)
|
|
32
|
+
frames[i] = start + i * step;
|
|
33
|
+
return frames;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Walk a frame range against a clock, calling back once per frame.
|
|
37
|
+
*
|
|
38
|
+
* Per frame, in this order: set the frame, mark time-dependent nodes dirty,
|
|
39
|
+
* then call `onFrame`. The callback is where a cook happens — the loop does not
|
|
40
|
+
* assume one, which is what lets the same loop serve a render, a test, or a
|
|
41
|
+
* headless evaluation.
|
|
42
|
+
*/
|
|
43
|
+
export async function runFrameRange(clock, options) {
|
|
44
|
+
const { start, end, step = 1, onFrame, signal, restoreFrame = true } = options;
|
|
45
|
+
const frames = frameRange(start, end, step);
|
|
46
|
+
const previousFrame = clock.getFrameFraction();
|
|
47
|
+
const visited = [];
|
|
48
|
+
let aborted = false;
|
|
49
|
+
try {
|
|
50
|
+
for (let index = 0; index < frames.length; index++) {
|
|
51
|
+
if (signal?.aborted) {
|
|
52
|
+
aborted = true;
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
clock.setFrame(frames[index]);
|
|
56
|
+
clock.markTimeDependentDirty();
|
|
57
|
+
await onFrame({
|
|
58
|
+
index,
|
|
59
|
+
total: frames.length,
|
|
60
|
+
frame: clock.getFrame(),
|
|
61
|
+
fframe: clock.getFrameFraction(),
|
|
62
|
+
time: clock.getTime(),
|
|
63
|
+
fps: clock.getFps()
|
|
64
|
+
});
|
|
65
|
+
visited.push(clock.getFrameFraction());
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
finally {
|
|
69
|
+
if (restoreFrame) {
|
|
70
|
+
clock.setFrame(previousFrame);
|
|
71
|
+
clock.markTimeDependentDirty();
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
return { frames: visited, frameCount: visited.length, aborted };
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=frameRange.js.map
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animation: keyframe channels, and frame-range evaluation over a host-bound
|
|
3
|
+
* clock. Neither holds a clock of its own — the host owns time, which is what
|
|
4
|
+
* keeps a cook deterministic.
|
|
5
|
+
*/
|
|
6
|
+
export { DEFAULT_INTERPOLATION, EMPTY_CHANNEL, createChannel, deleteKey, deserializeChannel, isChannel, isEmptyChannel, isInterpolation, keyAt, sampleChannel, serializeChannel, setKey, setKeyInterpolation } from "./channel.js";
|
|
7
|
+
export type { Channel, Interpolation, Keyframe, KeyframeInput, SerializedChannel, SerializedKeyframe } from "./channel.js";
|
|
8
|
+
export { frameRange, runFrameRange } from "./frameRange.js";
|
|
9
|
+
export type { FrameClock, FrameInfo, FrameRangeOptions, FrameRangeResult } from "./frameRange.js";
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Animation: keyframe channels, and frame-range evaluation over a host-bound
|
|
3
|
+
* clock. Neither holds a clock of its own — the host owns time, which is what
|
|
4
|
+
* keeps a cook deterministic.
|
|
5
|
+
*/
|
|
6
|
+
export { DEFAULT_INTERPOLATION, EMPTY_CHANNEL, createChannel, deleteKey, deserializeChannel, isChannel, isEmptyChannel, isInterpolation, keyAt, sampleChannel, serializeChannel, setKey, setKeyInterpolation } from "./channel.js";
|
|
7
|
+
export { frameRange, runFrameRange } from "./frameRange.js";
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeExecutionContext } from "cascade/contracts";
|
|
1
|
+
import type { NodeExecutionContext } from "@field/cascade/contracts";
|
|
2
2
|
import { copyToPointsDefinition } from "./definitions.js";
|
|
3
3
|
/**
|
|
4
4
|
* Copy to Points SOP: the source instanced onto every point of the target.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emptyGeometry } from "cascade/contracts";
|
|
1
|
+
import { emptyGeometry } from "@field/cascade/contracts";
|
|
2
2
|
import { copyToPoints } from "../../geometry/copy.js";
|
|
3
3
|
import { copyToPointsDefinition } from "./definitions.js";
|
|
4
4
|
import { geoModuleId } from "./namespace.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeExecutionContext } from "cascade/contracts";
|
|
1
|
+
import type { NodeExecutionContext } from "@field/cascade/contracts";
|
|
2
2
|
import { circleDefinition, rectangleDefinition } from "./definitions.js";
|
|
3
3
|
/**
|
|
4
4
|
* The two generators. Houdini has no Rectangle and its Grid with two rows does
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeExecutionContext } from "cascade/contracts";
|
|
1
|
+
import type { NodeExecutionContext } from "@field/cascade/contracts";
|
|
2
2
|
import { mergeDefinition } from "./definitions.js";
|
|
3
3
|
/**
|
|
4
4
|
* Merge SOP: N geometries concatenated, with points, vertices and primitives
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emptyGeometry } from "cascade/contracts";
|
|
1
|
+
import { emptyGeometry } from "@field/cascade/contracts";
|
|
2
2
|
import { geometryToSvg, utf8Bytes } from "../../geometry/svg.js";
|
|
3
3
|
import { svgExportDefinition } from "./definitions.js";
|
|
4
4
|
import { geoModuleId } from "./namespace.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { NodeExecutionContext } from "cascade/contracts";
|
|
1
|
+
import type { NodeExecutionContext } from "@field/cascade/contracts";
|
|
2
2
|
import { transformDefinition } from "./definitions.js";
|
|
3
3
|
/**
|
|
4
4
|
* Transform SOP's parameters, by its names: translate, rotate, scale, pivot,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { emptyGeometry } from "cascade/contracts";
|
|
1
|
+
import { emptyGeometry } from "@field/cascade/contracts";
|
|
2
2
|
import { transformMatrix } from "../../geometry/matrix.js";
|
|
3
3
|
import { transformGeometry } from "../../geometry/transform.js";
|
|
4
4
|
import { transformDefinition } from "./definitions.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as TypeScript from "typescript";
|
|
2
|
-
import type { Diagnostic } from "cascade/contracts";
|
|
2
|
+
import type { Diagnostic } from "@field/cascade/contracts";
|
|
3
3
|
/**
|
|
4
4
|
* Enforces the statically inspectable node-module boundary. This is an
|
|
5
5
|
* architecture check for trusted project code, not a security sandbox.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as TypeScript from "typescript";
|
|
2
|
-
import { type Diagnostic, type NodeDefinition } from "cascade/contracts";
|
|
2
|
+
import { type Diagnostic, type NodeDefinition } from "@field/cascade/contracts";
|
|
3
3
|
export type DefinitionExtractionResult = {
|
|
4
4
|
readonly ok: true;
|
|
5
5
|
readonly definition: NodeDefinition;
|
package/dist/runtime/error.d.ts
CHANGED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The neutral expression evaluator.
|
|
3
|
+
*
|
|
4
|
+
* Compiles parameter expressions and evaluates them against a time state and a
|
|
5
|
+
* host-supplied scope. It imports nothing from Studio and touches no platform
|
|
6
|
+
* API, so a headless cook can resolve `sin($T)` on a parameter exactly as the
|
|
7
|
+
* editor does.
|
|
8
|
+
*
|
|
9
|
+
* Determinism: an expression is a parameter resolved *before* execute runs, so
|
|
10
|
+
* the node receives a plain number and stays pure. Same graph plus same frame
|
|
11
|
+
* gives the same output.
|
|
12
|
+
*/
|
|
13
|
+
import type { ExpressionScope, Node as NodeShape } from "./scope.js";
|
|
14
|
+
import { TimeState } from "./time.js";
|
|
15
|
+
import type { CompiledExpression, ExpressionContext, ExpressionResult } from "./types.js";
|
|
16
|
+
export declare class ExpressionEvaluator<TNode extends NodeShape = NodeShape> {
|
|
17
|
+
protected readonly timeState: TimeState;
|
|
18
|
+
private readonly compiledCache;
|
|
19
|
+
private scope;
|
|
20
|
+
constructor(scope?: ExpressionScope<TNode> | null);
|
|
21
|
+
/** Bind (or rebind) the host scope. Clears nothing: compilation is scope-free. */
|
|
22
|
+
setScope(scope: ExpressionScope<TNode> | null): void;
|
|
23
|
+
getScope(): ExpressionScope<TNode> | null;
|
|
24
|
+
/** Set the current frame. Fractional frames are preserved. */
|
|
25
|
+
setFrame(frame: number): void;
|
|
26
|
+
/** Set the current time in seconds, keeping the sub-frame remainder. */
|
|
27
|
+
setTime(seconds: number): void;
|
|
28
|
+
setFps(fps: number): void;
|
|
29
|
+
/** seconds — $T */
|
|
30
|
+
get time(): number;
|
|
31
|
+
/** integer frame — $F */
|
|
32
|
+
get frame(): number;
|
|
33
|
+
/** fractional frame — $FF */
|
|
34
|
+
get fframe(): number;
|
|
35
|
+
/** rate — $FPS */
|
|
36
|
+
get fps(): number;
|
|
37
|
+
compile(expression: string): CompiledExpression<TNode>;
|
|
38
|
+
evaluate(expression: string, node: TNode): ExpressionResult;
|
|
39
|
+
/** Build the context an expression sees. */
|
|
40
|
+
createContext(node: TNode): ExpressionContext<TNode>;
|
|
41
|
+
ch(node: TNode, path: string): number;
|
|
42
|
+
chs(node: TNode, path: string): string;
|
|
43
|
+
chv(node: TNode, path: string): number[];
|
|
44
|
+
private resolveParam;
|
|
45
|
+
/** True if a referenced path resolves from this node. */
|
|
46
|
+
validatePath(fromNode: TNode, path: string): boolean;
|
|
47
|
+
/** Parameter paths referenced through ch/chs/chv. */
|
|
48
|
+
extractDependencies(expression: string): string[];
|
|
49
|
+
/** True if the expression references time, in either the bare or `$` spelling. */
|
|
50
|
+
hasTimeReference(expression: string): boolean;
|
|
51
|
+
clearCache(): void;
|
|
52
|
+
}
|
|
53
|
+
//# sourceMappingURL=evaluator.d.ts.map
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The neutral expression evaluator.
|
|
3
|
+
*
|
|
4
|
+
* Compiles parameter expressions and evaluates them against a time state and a
|
|
5
|
+
* host-supplied scope. It imports nothing from Studio and touches no platform
|
|
6
|
+
* API, so a headless cook can resolve `sin($T)` on a parameter exactly as the
|
|
7
|
+
* editor does.
|
|
8
|
+
*
|
|
9
|
+
* Determinism: an expression is a parameter resolved *before* execute runs, so
|
|
10
|
+
* the node receives a plain number and stays pure. Same graph plus same frame
|
|
11
|
+
* gives the same output.
|
|
12
|
+
*/
|
|
13
|
+
import { clamp, fit, fit01, lerp, MATH_SCOPE, noise, padzero, random, smooth } from "./math.js";
|
|
14
|
+
import { hasTimeReference, preprocessExpression } from "./preprocess.js";
|
|
15
|
+
import { TimeState } from "./time.js";
|
|
16
|
+
const DEPENDENCY_PATTERN = /\b(?:ch|chs|chv)\s*\(\s*['"]([^'"]+)['"]\s*\)/g;
|
|
17
|
+
export class ExpressionEvaluator {
|
|
18
|
+
timeState = new TimeState();
|
|
19
|
+
compiledCache = new Map();
|
|
20
|
+
scope;
|
|
21
|
+
constructor(scope = null) {
|
|
22
|
+
this.scope = scope;
|
|
23
|
+
}
|
|
24
|
+
/** Bind (or rebind) the host scope. Clears nothing: compilation is scope-free. */
|
|
25
|
+
setScope(scope) {
|
|
26
|
+
this.scope = scope;
|
|
27
|
+
}
|
|
28
|
+
getScope() {
|
|
29
|
+
return this.scope;
|
|
30
|
+
}
|
|
31
|
+
// ============ Time ============
|
|
32
|
+
/** Set the current frame. Fractional frames are preserved. */
|
|
33
|
+
setFrame(frame) {
|
|
34
|
+
this.timeState.setFrame(frame);
|
|
35
|
+
}
|
|
36
|
+
/** Set the current time in seconds, keeping the sub-frame remainder. */
|
|
37
|
+
setTime(seconds) {
|
|
38
|
+
this.timeState.setTime(seconds);
|
|
39
|
+
}
|
|
40
|
+
setFps(fps) {
|
|
41
|
+
this.timeState.setFps(fps);
|
|
42
|
+
}
|
|
43
|
+
/** seconds — $T */
|
|
44
|
+
get time() {
|
|
45
|
+
return this.timeState.time;
|
|
46
|
+
}
|
|
47
|
+
/** integer frame — $F */
|
|
48
|
+
get frame() {
|
|
49
|
+
return this.timeState.frame;
|
|
50
|
+
}
|
|
51
|
+
/** fractional frame — $FF */
|
|
52
|
+
get fframe() {
|
|
53
|
+
return this.timeState.frameFraction;
|
|
54
|
+
}
|
|
55
|
+
/** rate — $FPS */
|
|
56
|
+
get fps() {
|
|
57
|
+
return this.timeState.fps;
|
|
58
|
+
}
|
|
59
|
+
// ============ Compile / evaluate ============
|
|
60
|
+
compile(expression) {
|
|
61
|
+
const cached = this.compiledCache.get(expression);
|
|
62
|
+
if (cached)
|
|
63
|
+
return cached;
|
|
64
|
+
const dependencies = this.extractDependencies(expression);
|
|
65
|
+
const isTimeDependent = hasTimeReference(expression);
|
|
66
|
+
const compiledSource = preprocessExpression(expression);
|
|
67
|
+
try {
|
|
68
|
+
const fnBody = `
|
|
69
|
+
with (context) {
|
|
70
|
+
return (${compiledSource});
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
const evaluator = new Function("context", fnBody);
|
|
74
|
+
const compiled = {
|
|
75
|
+
source: expression,
|
|
76
|
+
compiledSource,
|
|
77
|
+
evaluate: evaluator,
|
|
78
|
+
dependencies,
|
|
79
|
+
isTimeDependent
|
|
80
|
+
};
|
|
81
|
+
this.compiledCache.set(expression, compiled);
|
|
82
|
+
return compiled;
|
|
83
|
+
}
|
|
84
|
+
catch (err) {
|
|
85
|
+
return {
|
|
86
|
+
source: expression,
|
|
87
|
+
compiledSource,
|
|
88
|
+
evaluate: () => undefined,
|
|
89
|
+
dependencies,
|
|
90
|
+
isTimeDependent,
|
|
91
|
+
error: err instanceof Error ? err.message : String(err)
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
evaluate(expression, node) {
|
|
96
|
+
const compiled = this.compile(expression);
|
|
97
|
+
if (compiled.error)
|
|
98
|
+
return { value: undefined, error: compiled.error };
|
|
99
|
+
try {
|
|
100
|
+
return { value: compiled.evaluate(this.createContext(node)) };
|
|
101
|
+
}
|
|
102
|
+
catch (err) {
|
|
103
|
+
return {
|
|
104
|
+
value: undefined,
|
|
105
|
+
error: err instanceof Error ? err.message : String(err)
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
/** Build the context an expression sees. */
|
|
110
|
+
createContext(node) {
|
|
111
|
+
return {
|
|
112
|
+
time: this.timeState.time,
|
|
113
|
+
frame: this.timeState.frame,
|
|
114
|
+
fframe: this.timeState.frameFraction,
|
|
115
|
+
fps: this.timeState.fps,
|
|
116
|
+
self: node,
|
|
117
|
+
ch: (path) => this.ch(node, path),
|
|
118
|
+
chs: (path) => this.chs(node, path),
|
|
119
|
+
chv: (path) => this.chv(node, path),
|
|
120
|
+
opexist: (path) => (this.scope?.nodeExists(node, path) ? 1 : 0),
|
|
121
|
+
opinput: (index) => this.scope?.inputNode(node, index) ?? null,
|
|
122
|
+
fit,
|
|
123
|
+
fit01,
|
|
124
|
+
clamp,
|
|
125
|
+
lerp,
|
|
126
|
+
smooth,
|
|
127
|
+
noise,
|
|
128
|
+
random,
|
|
129
|
+
padzero,
|
|
130
|
+
// Bare maths — `sin($FF * 0.5)` rather than `Math.sin(...)`. Spread
|
|
131
|
+
// before `Math` so nothing here can shadow the namespace itself.
|
|
132
|
+
...MATH_SCOPE,
|
|
133
|
+
Math
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
// ============ Channel functions ============
|
|
137
|
+
ch(node, path) {
|
|
138
|
+
const resolved = this.resolveParam(node, path);
|
|
139
|
+
if (!resolved)
|
|
140
|
+
return 0;
|
|
141
|
+
const value = resolved.value;
|
|
142
|
+
if (typeof value === "number")
|
|
143
|
+
return value;
|
|
144
|
+
if (typeof value === "string")
|
|
145
|
+
return parseFloat(value) || 0;
|
|
146
|
+
if (typeof value === "boolean")
|
|
147
|
+
return value ? 1 : 0;
|
|
148
|
+
return 0;
|
|
149
|
+
}
|
|
150
|
+
chs(node, path) {
|
|
151
|
+
const resolved = this.resolveParam(node, path);
|
|
152
|
+
if (!resolved)
|
|
153
|
+
return "";
|
|
154
|
+
return String(resolved.value ?? "");
|
|
155
|
+
}
|
|
156
|
+
chv(node, path) {
|
|
157
|
+
const resolved = this.resolveParam(node, path);
|
|
158
|
+
if (!resolved)
|
|
159
|
+
return [];
|
|
160
|
+
const value = resolved.value;
|
|
161
|
+
if (Array.isArray(value)) {
|
|
162
|
+
return value.map((v) => (typeof v === "number" ? v : parseFloat(String(v)) || 0));
|
|
163
|
+
}
|
|
164
|
+
if (typeof value === "number")
|
|
165
|
+
return [value];
|
|
166
|
+
return [];
|
|
167
|
+
}
|
|
168
|
+
resolveParam(node, path) {
|
|
169
|
+
return this.scope?.resolveParam(node, path) ?? null;
|
|
170
|
+
}
|
|
171
|
+
/** True if a referenced path resolves from this node. */
|
|
172
|
+
validatePath(fromNode, path) {
|
|
173
|
+
return this.resolveParam(fromNode, path) !== null;
|
|
174
|
+
}
|
|
175
|
+
/** Parameter paths referenced through ch/chs/chv. */
|
|
176
|
+
extractDependencies(expression) {
|
|
177
|
+
const deps = [];
|
|
178
|
+
DEPENDENCY_PATTERN.lastIndex = 0;
|
|
179
|
+
let match;
|
|
180
|
+
while ((match = DEPENDENCY_PATTERN.exec(expression)) !== null) {
|
|
181
|
+
deps.push(match[1]);
|
|
182
|
+
}
|
|
183
|
+
return deps;
|
|
184
|
+
}
|
|
185
|
+
/** True if the expression references time, in either the bare or `$` spelling. */
|
|
186
|
+
hasTimeReference(expression) {
|
|
187
|
+
return hasTimeReference(expression);
|
|
188
|
+
}
|
|
189
|
+
clearCache() {
|
|
190
|
+
this.compiledCache.clear();
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=evaluator.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameter expressions, neutral runtime.
|
|
3
|
+
*
|
|
4
|
+
* Compilation, `$` time variables, math utilities and the host scope binding.
|
|
5
|
+
* Depends on nothing outside this folder, so both Studio and a headless host
|
|
6
|
+
* evaluate parameters with the same engine.
|
|
7
|
+
*/
|
|
8
|
+
export { ExpressionEvaluator } from "./evaluator.js";
|
|
9
|
+
export { clamp, fit, fit01, lerp, noise, padzero, random, smooth } from "./math.js";
|
|
10
|
+
export { TIME_IDENTIFIERS, TIME_TOKENS, hasTimeReference, preprocessExpression } from "./preprocess.js";
|
|
11
|
+
export { DEFAULT_FPS, MIN_FRAME, TimeState } from "./time.js";
|
|
12
|
+
export type { TimeVariables } from "./time.js";
|
|
13
|
+
export type { ExpressionScope, Node as ExpressionNode } from "./scope.js";
|
|
14
|
+
export type { CompiledExpression, ExpressionContext, ExpressionResult, PathWarning } from "./types.js";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parameter expressions, neutral runtime.
|
|
3
|
+
*
|
|
4
|
+
* Compilation, `$` time variables, math utilities and the host scope binding.
|
|
5
|
+
* Depends on nothing outside this folder, so both Studio and a headless host
|
|
6
|
+
* evaluate parameters with the same engine.
|
|
7
|
+
*/
|
|
8
|
+
export { ExpressionEvaluator } from "./evaluator.js";
|
|
9
|
+
export { clamp, fit, fit01, lerp, noise, padzero, random, smooth } from "./math.js";
|
|
10
|
+
export { TIME_IDENTIFIERS, TIME_TOKENS, hasTimeReference, preprocessExpression } from "./preprocess.js";
|
|
11
|
+
export { DEFAULT_FPS, MIN_FRAME, TimeState } from "./time.js";
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Expression math utilities.
|
|
3
|
+
*
|
|
4
|
+
* Pure functions, no ambient state, deterministic for a given input — the same
|
|
5
|
+
* contract the rest of the runtime holds. `noise` and `random` are seeded
|
|
6
|
+
* closed forms rather than anything drawn from process state.
|
|
7
|
+
*/
|
|
8
|
+
/** Remap a value from one range to another. */
|
|
9
|
+
export declare function fit(value: number, oldMin: number, oldMax: number, newMin: number, newMax: number): number;
|
|
10
|
+
/** Remap a 0..1 value into a new range. */
|
|
11
|
+
export declare function fit01(value: number, newMin: number, newMax: number): number;
|
|
12
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
13
|
+
export declare function lerp(a: number, b: number, t: number): number;
|
|
14
|
+
/** Smooth hermite interpolation (smoothstep). */
|
|
15
|
+
export declare function smooth(value: number, min: number, max: number): number;
|
|
16
|
+
/**
|
|
17
|
+
* Perlin-like noise in -1..1. Not true Perlin — a deterministic sum of sines.
|
|
18
|
+
*/
|
|
19
|
+
export declare function noise(...coords: number[]): number;
|
|
20
|
+
/** Deterministic random in 0..1 from a seed. */
|
|
21
|
+
export declare function random(seed: number): number;
|
|
22
|
+
/** Zero-pad a number to a given number of digits. */
|
|
23
|
+
export declare function padzero(digits: number, value: number): string;
|
|
24
|
+
/** Degrees to radians. */
|
|
25
|
+
export declare function radians(degrees: number): number;
|
|
26
|
+
/** Radians to degrees. */
|
|
27
|
+
export declare function degrees(radians: number): number;
|
|
28
|
+
/** Sine of an angle in degrees — Houdini's `sin()`. */
|
|
29
|
+
export declare function sind(degrees: number): number;
|
|
30
|
+
/** Cosine of an angle in degrees — Houdini's `cos()`. */
|
|
31
|
+
export declare function cosd(degrees: number): number;
|
|
32
|
+
/** Tangent of an angle in degrees — Houdini's `tan()`. */
|
|
33
|
+
export declare function tand(degrees: number): number;
|
|
34
|
+
/**
|
|
35
|
+
* The bare maths names available to every expression. Spread into the
|
|
36
|
+
* evaluation scope; kept as one object so adding a function is a one-line
|
|
37
|
+
* change here rather than a change in two files.
|
|
38
|
+
*/
|
|
39
|
+
export declare const MATH_SCOPE: {
|
|
40
|
+
readonly sin: (x: number) => number;
|
|
41
|
+
readonly cos: (x: number) => number;
|
|
42
|
+
readonly tan: (x: number) => number;
|
|
43
|
+
readonly asin: (x: number) => number;
|
|
44
|
+
readonly acos: (x: number) => number;
|
|
45
|
+
readonly atan: (x: number) => number;
|
|
46
|
+
readonly atan2: (y: number, x: number) => number;
|
|
47
|
+
readonly sinh: (x: number) => number;
|
|
48
|
+
readonly cosh: (x: number) => number;
|
|
49
|
+
readonly tanh: (x: number) => number;
|
|
50
|
+
readonly sind: typeof sind;
|
|
51
|
+
readonly cosd: typeof cosd;
|
|
52
|
+
readonly tand: typeof tand;
|
|
53
|
+
readonly radians: typeof radians;
|
|
54
|
+
readonly degrees: typeof degrees;
|
|
55
|
+
readonly sqrt: (x: number) => number;
|
|
56
|
+
readonly cbrt: (x: number) => number;
|
|
57
|
+
readonly pow: (x: number, y: number) => number;
|
|
58
|
+
readonly exp: (x: number) => number;
|
|
59
|
+
readonly log: (x: number) => number;
|
|
60
|
+
readonly log2: (x: number) => number;
|
|
61
|
+
readonly log10: (x: number) => number;
|
|
62
|
+
readonly hypot: (...values: number[]) => number;
|
|
63
|
+
readonly abs: (x: number) => number;
|
|
64
|
+
readonly sign: (x: number) => number;
|
|
65
|
+
readonly floor: (x: number) => number;
|
|
66
|
+
readonly ceil: (x: number) => number;
|
|
67
|
+
readonly round: (x: number) => number;
|
|
68
|
+
readonly trunc: (x: number) => number;
|
|
69
|
+
readonly min: (...values: number[]) => number;
|
|
70
|
+
readonly max: (...values: number[]) => number;
|
|
71
|
+
readonly PI: number;
|
|
72
|
+
readonly TAU: number;
|
|
73
|
+
readonly E: number;
|
|
74
|
+
};
|
|
75
|
+
//# sourceMappingURL=math.d.ts.map
|