import type { CommonDisplayableConfig } from "../../types"; import { TransformDefinitions } from "./type"; import { CSSProps } from "../../elements/transition/type"; type OverwriteMap = { overwrite: CSSProps; }; export type OverwriteDefinition = { [K in keyof OverwriteMap]?: OverwriteHandler; }; type OverwriteHandler = (value: Partial) => T; export declare class Transform { /** * Apply transform immediately */ static immediate(props: TransformDefinitions.SequenceProps): Transform; /** * Go to the left side of the stage */ static left(duration: number, easing?: TransformDefinitions.EasingDefinition): Transform; /** * Go to the right side of the stage */ static right(duration: number, easing?: TransformDefinitions.EasingDefinition): Transform; /** * Go to the center of the stage */ static center(duration: number, easing?: TransformDefinitions.EasingDefinition): Transform; /** * Create a new transform with the given config. The sequences will be empty. * @param config - The config for the transform. * @returns A new transform with the given config. */ static create(config?: Partial): Transform; /** * @example * ```ts * const transform = new Transform({ * opacity: 1, * position: "center" * }, { * duration: 0, * ease: "linear" * }); * ``` */ constructor(sequences: TransformDefinitions.Sequence[], transformConfig?: Partial); constructor(props: TransformDefinitions.SequenceProps, options?: Partial); /** * Create a new transform that repeats {@link n} x current repeat count times. * @example * ```ts * transform * .repeat(2) * .repeat(3) * // repeat 6 times * ``` */ repeat(n: number): Transform; /** * Copy the current transform. * @returns {Transform} A new transform with the same sequences and config. */ copy(): Transform; /** * Commits all staged changes to the transform sequence. * This method will create a new sequence from all pending changes that have been staged via chained methods. * If there are no staged changes, this method will return the current instance without modification. * After committing, the staged changes array will be cleared. * @returns {this} The current Transform i nstance for method chaining * @example * ```ts * transform * .position({ x: 100, y: 100 }) * .opacity(1).commit() // will create a new sequence with opacity 1 and position x: 100, y: 100 * .position({ x: 200, y: 200 }) * .opacity(0).commit({ duration: 1000 }) // will create a new sequence with opacity 0 and position x: 200, y: 200 with a duration of 1 second * ``` * * **Note**: The staged changes will be committed before animation starts to ensure the latest changes are applied. */ commit(options?: Partial): this; /** * Set the zoom of the current staging sequence. * @param zoom - The zoom of the transform. use `1` to keep the original size */ zoom(zoom: TransformDefinitions.Types["zoom"]): this; /** * Set the scale of the current staging sequence on x axis. * @param scaleX - The scale of the transform on x axis. */ scaleX(scaleX: TransformDefinitions.Types["scaleX"]): this; /** * Set the scale of the current staging sequence on y axis. * @param scaleY - The scale of the transform on y axis. */ scaleY(scaleY: TransformDefinitions.Types["scaleY"]): this; /** * Set the scale of the current staging sequence. * @param scaleX - The scale of the transform on x axis. use negative value to invert the scale * @param scaleY - The scale of the transform on y axis. use negative value to invert the scale */ scale(scaleX: TransformDefinitions.Types["scaleX"], scaleY: TransformDefinitions.Types["scaleY"]): this; /** * Rotate the current staging sequence. * @param {number} rotation - The rotation of the transform. * @returns {this} The current Transform instance for method chaining. */ rotation(rotation: TransformDefinitions.Types["rotation"]): this; /** * Set the position of the current staging sequence. * @param {number} position - The position of the transform. * @returns {this} The current Transform instance for method chaining. */ position(position: TransformDefinitions.Types["position"]): this; /** * Set the opacity of the current staging sequence. * @param {number} opacity - The opacity of the transform. * @returns {this} The current Transform instance for method chaining. */ opacity(opacity: TransformDefinitions.Types["opacity"]): this; /** * Set the font color of the current staging sequence. * @param {string} fontColor - The font color of the transform. * @returns {this} The current Transform instance for method chaining. */ fontColor(fontColor: TransformDefinitions.Types["fontColor"]): this; } export {};