import { TweenOptions } from './opts'; import { DeepPartial } from '../deep-partial'; import { Timeline } from '../timeline/timeline'; import { TweenToStep } from './step-builder/tween-to-step'; import { DeepReadonly } from '../misc/deep-readonly'; import { TweenBuilder } from './tween-builder'; import { SequenceBuilder } from '../sequence'; import { Group } from '../group'; import { AbstractTimeline } from '../timeline/abstract-timeline'; import { TimelineEvents } from '../timeline'; import { TweenFactory } from './tween-factory'; export interface TweenEvents extends TimelineEvents> { completed: [event: {}, source: Tween]; sought: [event: { from: number; }, source: Tween]; updated: [event: { dt: number; value: T; }, source: Tween]; } /** * When given a time, interpolates or "tweens" a value (or values in an object) towards another. * @template T The type of the value to be interpolated. */ export declare class Tween extends AbstractTimeline implements Timeline { private readonly eventEmitter; readonly on: >(eventName: K, handler: (...args: import("@akolos/event-emitter/build/union-to-intersection").UnionToIntersection[K]>) => void) => this; readonly off: >(eventName: K, handler: (...args: import("@akolos/event-emitter/build/union-to-intersection").UnionToIntersection[K]>) => void) => this; protected readonly emit: >(eventName: K, ...args: import("@akolos/event-emitter/build/union-to-intersection").UnionToIntersection[K]>) => this; readonly tweenTo: DeepReadonly>; private tweening?; private _target; private readonly opts; private constructor(); /** * The value being interpolated. */ get target(): T; private captureTweening; protected _update(dt: number): void; protected _completed(): void; protected _start(): void; protected _stop(): void; protected _seek(from: number): void; /** * Creates a tween. * @param target The value/object to tween. * @param propDests If the target is an object, an object containing the properties to tween * and the values they should be tweened to. * @param opts The options for this tween, including the easing function to use and the * length of the tween. */ static start(target: T, tweenTo: DeepPartial, opts: TweenOptions): Tween; } export declare namespace Tween { /** * Makes a factory that can produce tweens that share an easing and length. * @param opts The options that each tween will use. */ function factory(opts: TweenOptions): TweenFactory; /** * Creates a builder for a tween, providing an alternate syntax for creating tweens. * @param opts The options to preload the builder with, if any. */ function builder(opts?: Partial): TweenBuilder; /** * Begins the construction of a Tween, using the provided value as its target. * @param target The target of the tween (i.e. the value or to tween/interpolate). * @returns the next step in the building process, where the value to interpolate towards is given. */ function get(target: T): TweenToStep; /** * Creates a sequence of tweens (or more generally, timelines) that can be treated * and controlled as a single timeline. */ function sequence(): SequenceBuilder; /** * Creates a composite of timelines. Effectively groups timelines together so they can be * controlled together as if they were a single timeline. * @param timelines The timelines to place into this composite. */ function group(timelines: T[]): Group; }