/** * @description Enum of animation states * @typedef AnimationState * @prop INVALID * @prop PLAYING * @prop STOPPED * @prop STOPPING * @prop CANCELLED * @prop PAUSED * @prop RESUMED * @prop STARTED * @prop REJECTED */ /** * @interface AnimationInstanceEvents * @description Typed Events for an `AnimationInstance`. * @prop {Event} general Emits when any other event occurs. Passes in an object with * a `name` property, which is the event name, and a `payload` * property, which is the payload of the event. * @prop {Event} audio Emits when animation encounters an audio event. Passes in an * object with a `file` property. * @prop {Event} pixi Emits when animation encounters a pixi event. Passes in an * object with a `file` property. * @prop {Event} holdSafe Emits when the animation encounters a "HOLD_SAFE" event. * @prop {Event} stopped Emits when the animation stops. Usually use the resolution of `play` * to determine when this happens. * @prop {Event} started Emits when the animation starts. * @prop {Event} cancelled Emits when the animation is canceled by a higher priority system. * @prop {Event} rejected Emits when the animation is is rejected since a higher priority * animation is currently playing. */ /** * Handle to an animation instance. Can only be played *once*. * @class AnimationInstance */ /** * Set of animation event emitters. * @type {AnimationInstanceEvents} * @name AnimationInstance#events */ /** * Current state of the animation. * @type {AnimationState} * @name AnimationInstance#state */ /** * Set of dofs this animation acts on. * @type {DOFSet} * @name AnimationInstance#dofs */ /** * Plays this animation on the robot. * @param {string} [requestor='Behavior'] The system making the animation request. * @returns {Promise} Resolves when the animation is finished playing or is canceled. * @method AnimationInstance#play */ /** * Stops this animation if it is running. * @returns {Promise} Resolves when the animation is stopped. * @method AnimationInstance#stop */ /** * Pauses this animation if it is running. * @returns {Promise} Resolves when the animation is paused. * @method AnimationInstance#pause */ /** * Resumes this animation if it is paused. * @returns {Promise} Resolves when the animation is resumed. * @method AnimationInstance#resume */ /** * Removes all event listensers and * @method AnimationInstance#destroy */