activateTool: (tool: string | undefined) => void
addAnimationKeyframe
addAnimationKeyframe: (
offset: number,
props: Record<string, any>,
node?: Element2D,
) => void
addSubNode
addSubNode: () => void
alignBottom
alignBottom: () => void
alignHorizontalCenter
alignHorizontalCenter: () => void
alignLeft
alignLeft: () => void
alignRight
alignRight: () => void
alignTop
alignTop: () => void
alignVerticalCenter
alignVerticalCenter: () => void
applyAnimationPreset
applyAnimationPreset: (id: string, node?: Element2D) => void
applyFormatPaint: (targets?: Element2D[]) => void
bindVariable
bindVariable: (styleKey: string, variableId: string, node?: Element2D) => void
bringForward
bringForward: (target?: Node) => void
bringToFront
bringToFront: (target?: Node | Node[]) => void
clearDoc
clearDoc: () => void
clearRulerLines
clearRulerLines: () => void
createComponent
createComponent: (node?: Element2D) => string | undefined
createVariable
createVariable: (
collectionId: string,
variable: { name: string; type: VariableType; value: VariableValue },
) => string
createVariableCollection
createVariableCollection: (name: string, modeName?: string) => string
createVariableMode
createVariableMode: (collectionId: string, name: string) => string
cut
cut: () => Promise<void>
detachInstance
detachInstance: (node?: Element2D) => void
disableFlexLayout
disableFlexLayout: () => void
distributeHorizontalSpacing
distributeHorizontalSpacing: () => void
distributeVerticalSpacing
distributeVerticalSpacing: () => void
duplicate
duplicate: () => void
eachTextSelection
eachTextSelection: (
textSelection: IndexCharacter[],
cb: (arg: Record<string, any>) => boolean,
) => void
editElement
editElement: () => void
enableFlexLayout
enableFlexLayout: (direction?: FlexDirection) => void
exitFormatPaint: () => void
exportSlice
exportSlice: (options: ExportOptions) => Promise<HTMLCanvasElement | undefined> flipHorizontal
flipHorizontal: () => void
flipVertical
flipVertical: () => void
frameSelection
frameSelection: () => void
getComponents
getComponents: () => ComponentDef[]
getEasings
getEasings: () => Record<string, string>
getElementInteractions
getElementInteractions: (node?: Element2D) => Interaction[] getElementKeyframes
getElementKeyframes: (node?: Element2D) => Keyframe[]
getTextFill
getTextFill: () => NormalizedFill | undefined
getTextStyle
getTextStyle: (key: string) => any
getVariablesState
getVariablesState: () => VariablesState
groupSelection
groupSelection: () => void
hidePanel
hidePanel: (name: string) => void
isFlexLayout
isFlexLayout: () => boolean
isPanelVisible
isPanelVisible: (name: string) => boolean
isUiVisible
isUiVisible: (name: keyof UIConfig) => boolean layerScrollIntoView: () => boolean
loadComponentPresets
loadComponentPresets: (defs: ComponentDef[]) => void
loadDoc
loadDoc: (source: any) => Promise<Doc>
marqueeSelect
marqueeSelect: (marquee?: Aabb2D) => void
moveBottom
moveBottom: (distance?: number) => void
moveLeft
moveLeft: (distance?: number) => void
moveRight
moveRight: (distance?: number) => void
moveTop
moveTop: (distance?: number) => void
openContextMenu: (event?: MouseEvent) => boolean
openDoc
openDoc: () => Promise<void>
pauseElementAnimation
pauseElementAnimation: (node?: Element2D) => void
playElementAnimation
playElementAnimation: (node?: Element2D, restart?: boolean) => void
registerEasing
registerEasing: (name: string, value: string) => void
removeAnimationKeyframe
removeAnimationKeyframe: (offset: number, node?: Element2D) => void
removeComponent
removeComponent: (componentId: string) => void
resolveVariables
resolveVariables: () => void
rotate
rotate: (deg: number) => void
rotate90
rotate90: () => void
runInteraction
runInteraction: (interaction: Interaction, source: Node) => void seekEnd
seekEnd: () => void
seekStart
seekStart: () => void
selectAll
selectAll: () => void
selectChildren
selectChildren: () => void
selectInverse
selectInverse: () => void
selectNextSibling
selectNextSibling: () => void
selectNone
selectNone: () => void
selectParent
selectParent: () => void
selectPreviousSibling
selectPreviousSibling: () => void
sendBackward
sendBackward: (target?: Node) => void
sendToBack
sendToBack: (target?: Node | Node[]) => void
setActiveVariableMode
setActiveVariableMode: (collectionId: string, modeId: string) => void
setAnimationKeyframeEasing
setAnimationKeyframeEasing: (
offset: number,
easing: string,
node?: Element2D,
) => void
setComponent
setComponent: (componentId: string, node?: Element2D) => void
setElementInteractions
setElementInteractions: (interactions: Interaction[], node?: Element2D) => void setInstanceOverride
setInstanceOverride: (path: string, value: any, node?: Element2D) => void
setPanelVisible
setPanelVisible: (name: string, visible: boolean | "toggle") => void
setSmartSelectionCurrentElement
setSmartSelectionCurrentElement: (element?: Element2D) => void
setState
setState: (value: State) => void setTextContentByEachFragment
setTextContentByEachFragment: (
handler: (fragment: NormalizedFragment) => void,
) => void
setTextFill
setTextFill: (value: NormalizedFill | undefined) => void
setTextStyle
setTextStyle: (key: string, value: any) => void
setUiVisible
setUiVisible: (name: keyof UIConfig, visible: boolean | "toggle") => void setVariableValue
setVariableValue: (
variableId: string,
modeId: string,
value: VariableValue,
) => void
showPanel
showPanel: (name: string) => void
startTransform: (event?: MouseEvent) => boolean
startTyping
startTyping: (event?: MouseEvent) => Promise<boolean>
stepBackward
stepBackward: () => void
stepForward
stepForward: () => void
stopElementAnimation
stopElementAnimation: (node?: Element2D) => void
syncInstancesOf
syncInstancesOf: (componentId: string) => void
testPerformance: (count?: number) => void
textFontSizeToFit
textFontSizeToFit: (element: Element2D, scale?: number) => void
toggleElementAnimation
toggleElementAnimation: (node?: Element2D) => void
toggleFlexLayout
toggleFlexLayout: () => void
togglePanel
togglePanel: (name: string) => void
togglePlay
togglePlay: () => void
togglePreview
togglePreview: () => void
toggleSelectionLock
toggleSelectionLock: (target?: "lock" | "unlock") => void
toggleSelectionVisible
toggleSelectionVisible: (target?: "show" | "hide") => void
toggleUi
toggleUi: (name: keyof UIConfig) => void unbindVariable
unbindVariable: (styleKey: string, node?: Element2D) => void
ungroupSelection
ungroupSelection: () => void
zoomOut
zoomOut: () => void
zoomTo100
zoomTo100: () => void
zoomToFit
zoomToFit: () => void
zOrder
zOrder: (type: ZOrderType, target?: Node | Node[]) => void
在指定时间点(offset 0..1)插入 / 更新关键帧(合并 props)。