/** * Copyright (c) 2025 mol* contributors, licensed under MIT, See LICENSE file for more info. * * @author David Sehnal */ import { OptionalField, RequiredField, ValueFor } from '../generic/field-schema.js'; import { SimpleParamsSchema, UnionParamsSchema } from '../generic/params-schema.js'; import { NodeFor, ParamsOfKind, SubtreeOfKind, TreeFor, TreeSchema } from '../generic/tree-schema.js'; import { ColorT, ContinuousPalette, DiscretePalette, Vector3 } from '../mvs/param-types.js'; type Easing = 'linear' | 'bounce-in' | 'bounce-out' | 'bounce-in-out' | 'circle-in' | 'circle-out' | 'circle-in-out' | 'cubic-in' | 'cubic-out' | 'cubic-in-out' | 'exp-in' | 'exp-out' | 'exp-in-out' | 'quad-in' | 'quad-out' | 'quad-in-out' | 'sin-in' | 'sin-out' | 'sin-in-out'; declare const Easing: import("io-ts").Type; export type MVSAnimationEasing = ValueFor; export declare const MVSAnimationSchema: TreeSchema<{ animation: SimpleParamsSchema<{ /** Frame time in milliseconds. */ frame_time_ms: OptionalField; /** Total duration of the animation. If not specified, computed as maximum of all transitions. */ duration_ms: OptionalField; /** Determines whether the animation should autoplay when a snapshot is loaded */ autoplay: OptionalField; /** Determines whether the animation should loop when it reaches the end. */ loop: OptionalField; /** Determines whether the camera state should be included in the animation. */ include_camera: OptionalField; /** Determines whether the canvas state should be included in the animation. */ include_canvas: OptionalField; }>; interpolate: UnionParamsSchema<"kind", { scalar: SimpleParamsSchema<{ /** Magnitude of the noise to apply to the interpolated value. */ noise_magnitude: OptionalField; /** Start value. If a list of values is provided, each element will be interpolated separately. If unset, parent state value is used. */ start: OptionalField; /** End value. If a list of values is provided, each element will be interpolated separately. If unset, only noise is applied. */ end: OptionalField; /** Whether to round the values to the closest integer. Useful for example for trajectory animation. */ discrete: OptionalField; /** Easing function to use for the transition. */ easing: OptionalField; /** Determines how many times the interpolation loops. Current T = frequency * t mod 1. */ frequency: OptionalField; /** Whether to alternate the direction of the interpolation for frequency > 1. */ alternate_direction: OptionalField; /** Reference to the node. */ target_ref: RequiredField; /** Value accessor. */ property: RequiredField; /** Start time of the transition in milliseconds. */ start_ms: OptionalField; /** Duration of the transition in milliseconds. */ duration_ms: RequiredField; }>; vec3: SimpleParamsSchema<{ /** Magnitude of the noise to apply to the interpolated value. */ noise_magnitude: OptionalField; /** Start value. If unset, parent state value is used. Must be array of length 3N (x1, y1, z1, x2, y2, z2, ...). */ start: OptionalField; /** End value. Must be array of length 3N (x1, y1, z1, x2, y2, z2, ...). If unset, only noise is applied. */ end: OptionalField; /** Whether to use spherical interpolation. */ spherical: OptionalField; /** Easing function to use for the transition. */ easing: OptionalField; /** Determines how many times the interpolation loops. Current T = frequency * t mod 1. */ frequency: OptionalField; /** Whether to alternate the direction of the interpolation for frequency > 1. */ alternate_direction: OptionalField; /** Reference to the node. */ target_ref: RequiredField; /** Value accessor. */ property: RequiredField; /** Start time of the transition in milliseconds. */ start_ms: OptionalField; /** Duration of the transition in milliseconds. */ duration_ms: RequiredField; }>; rotation_matrix: SimpleParamsSchema<{ /** Magnitude of the noise to apply to the interpolated value. */ noise_magnitude: OptionalField; /** Start value. If unset, parent state value is used. */ start: OptionalField; /** End value. If unset, only noise is applied. */ end: OptionalField; /** Easing function to use for the transition. */ easing: OptionalField; /** Determines how many times the interpolation loops. Current T = frequency * t mod 1. */ frequency: OptionalField; /** Whether to alternate the direction of the interpolation for frequency > 1. */ alternate_direction: OptionalField; /** Reference to the node. */ target_ref: RequiredField; /** Value accessor. */ property: RequiredField; /** Start time of the transition in milliseconds. */ start_ms: OptionalField; /** Duration of the transition in milliseconds. */ duration_ms: RequiredField; }>; transform_matrix: SimpleParamsSchema<{ /** Pivot point for rotation and scale. */ pivot: OptionalField; /** Start rotation value. If unset, parent state value is used. */ rotation_start: OptionalField; /** End rotation value. If unset, only noise is applied */ rotation_end: OptionalField; /** Magnitude of the noise to apply to the rotation. */ rotation_noise_magnitude: OptionalField; /** Easing function to use for the rotation. */ rotation_easing: OptionalField; /** Determines how many times the rotation interpolation loops. Current T = frequency * t mod 1. */ rotation_frequency: OptionalField; /** Whether to alternate the direction of the interpolation for frequency > 1. */ rotation_alternate_direction: OptionalField; /** Start translation value. If unset, parent state value is used. */ translation_start: OptionalField; /** End translation value. If unset, only noise is applied. */ translation_end: OptionalField; /** Magnitude of the noise to apply to the translation. */ translation_noise_magnitude: OptionalField; /** Easing function to use for the translation. */ translation_easing: OptionalField; /** Determines how many times the translation interpolation loops. Current T = frequency * t mod 1. */ translation_frequency: OptionalField; /** Whether to alternate the direction of the interpolation for frequency > 1. */ translation_alternate_direction: OptionalField; /** Start scale value. If unset, parent state value is used. */ scale_start: OptionalField; /** End scale value. If unset, only noise is applied. */ scale_end: OptionalField; /** Magnitude of the noise to apply to the scale. */ scale_noise_magnitude: OptionalField; /** Easing function to use for the scale. */ scale_easing: OptionalField; /** Determines how many times the scale interpolation loops. Current T = frequency * t mod 1. */ scale_frequency: OptionalField; /** Whether to alternate the direction of the interpolation for frequency > 1. */ scale_alternate_direction: OptionalField; /** Reference to the node. */ target_ref: RequiredField; /** Value accessor. */ property: RequiredField; /** Start time of the transition in milliseconds. */ start_ms: OptionalField; /** Duration of the transition in milliseconds. */ duration_ms: RequiredField; }>; color: SimpleParamsSchema<{ /** Start value. If unset, parent state value is used. */ start: OptionalField; /** End value. */ end: OptionalField; /** Palette to sample colors from. Overrides start and end values. */ palette: OptionalField; /** Easing function to use for the transition. */ easing: OptionalField; /** Determines how many times the interpolation loops. Current T = frequency * t mod 1. */ frequency: OptionalField; /** Whether to alternate the direction of the interpolation for frequency > 1. */ alternate_direction: OptionalField; /** Reference to the node. */ target_ref: RequiredField; /** Value accessor. */ property: RequiredField; /** Start time of the transition in milliseconds. */ start_ms: OptionalField; /** Duration of the transition in milliseconds. */ duration_ms: RequiredField; }>; }>; }, "animation">; export type MVSAnimationKind = keyof typeof MVSAnimationSchema.nodes; export type MVSAnimationNode = NodeFor; export type MVSAnimationTree = TreeFor; export type MVSAnimationNodeParams = ParamsOfKind; export type MVSAnimationSubtree = SubtreeOfKind; export {};