CanvasAttrSpec
An attribute in an environment's vocabulary: the compiler's attribute spec, plus whether and how the value animates.
@internote/canvas-sdkimport { CanvasAttrSpec } from '@internote/canvas-sdk';An animatable attribute is emitted to the compiler as a plain string, because a keyframe chain cannot be parsed by the declared value type. The declared type still governs how the base value and each keyframe target are refined after the compile.
#Fields
aliasesOther names source may write the attribute under; the compiled node carries the canonical name.
string[]animatableHow the value interpolates under
!cue.to. Absent means the attribute cannot be animated.InterpolationKinddefaultParsed through
type; arrays/numbers/booleans are stringified first. Defaults for inline/record/reference types are written in SOURCE syntax as strings (e.g. '!(x: 1)').unknownrequiredOptionality is
required, and nothing else — no type means "or nothing".booleantypeREQUIRED — there is no implicit
string. A default of the most permissive type is what an unconsidered attribute receives by accident, making it indistinguishable from a deliberately textual one. The rule governs the EFFECTIVE merged attribute, so refining a primitive's attribute need not restate its type.TypeRefSpec#Example
attributes: {
zoom: { type: 'float', default: 1, animatable: 'number' },
'x-domain': { type: 'interval', default: '[-10, 10]', animatable: 'interval' },
colour: { type: 'paint', default: 'blue' },
}Declared in packages/canvas-sdk/src/environment/compile-spec.ts:34.