import * as PIXI from "pixi.js"; import { z } from "zod"; import { Clip } from "../clip"; /** * Zod schema for serialized timeline transitions. */ export declare const TransitionSchema: z.ZodObject<{ id: z.ZodString; startClipId: z.ZodString; endClipId: z.ZodString; inDuration: z.ZodNumber; outDuration: z.ZodNumber; transitionId: z.ZodString; provider: z.ZodString; properties: z.ZodArray, "many">; }, "strip", z.ZodTypeAny, { properties: [string, any][]; id: string; provider: string; startClipId: string; endClipId: string; inDuration: number; outDuration: number; transitionId: string; }, { properties: [string, any][]; id: string; provider: string; startClipId: string; endClipId: string; inDuration: number; outDuration: number; transitionId: string; }>; /** * Constructor options for {@link Transition}. */ export interface TransitionOptions { startClipId: string; endClipId: string; inDuration: number; outDuration: number; transitionId: string; properties?: Record; } /** * Represents a transition between two neighboring clips on a layer. */ export declare class Transition { private id; private name; private readonly transitionId; private provider; private startClipId; private endClipId; private startClip; private endClip; private inDuration; private outDuration; private renderTexture1; private renderTexture2; private sprite; private transitionFilter; private transitionData; private readonly inputTextures; private propertyMap; private readonly tempProperties?; private layerId; private initialized; /** * Creates a transition wrapper from transition metadata and participating clip IDs. * * @param options Transition creation options. */ constructor(options: TransitionOptions); /** * Resolves clip references, transition data, textures, and render resources for this transition. * * @param layerId ID of the layer that owns the transition. * @returns Nothing. */ init(layerId: string): void; private createInputTextures; private createRendererTexture; /** * Updates a transition property value. * * @param propertyName Name of the transition property to update. * @param value New property value. * @returns Nothing. */ setProperty(propertyName: string, value: any): void; /** * Returns a transition property value. * * @param propertyName Name of the transition property to read. * @returns The property value, or `undefined` if the property is unavailable. */ getProperty(propertyName: string): any; /** * Returns the unique instance ID of this transition. * * @returns The transition instance ID. */ getId(): string; /** * Returns the library transition ID used to create this instance. * * @returns The transition definition ID. */ getTransitionId(): string; /** * Returns the provider identifier of the transition definition. * * @returns The provider ID. */ getProvider(): string; /** * Recalculates in and out durations so they remain valid for the surrounding clips and nearby transitions. * * @returns Nothing. */ updateDuration(): void; /** * Sets the portion of the transition that overlaps the outgoing clip. * * @param inDuration Duration, in seconds, contributed by the start clip. * @returns Nothing. */ setInDuration(inDuration: number): void; /** * Returns the overlap duration contributed by the start clip. * * @returns The in duration, in seconds. */ getInDuration(): number; /** * Sets the portion of the transition that overlaps the incoming clip. * * @param outDuration Duration, in seconds, contributed by the end clip. * @returns Nothing. */ setOutDuration(outDuration: number): void; /** * Returns the overlap duration contributed by the end clip. * * @returns The out duration, in seconds. */ getOutDuration(): number; /** * Overrides the display name of the transition instance. * * @param name Name to assign. * @returns Nothing. */ setName(name: string): void; /** * Returns the display name of this transition. * * @returns The transition name. */ getName(): string; /** * Rebinds the transition to a different outgoing clip. * * @param startClipId Clip ID that should become the start clip. * @returns Nothing. */ setStartClipId(startClipId: string): void; /** * Returns the outgoing clip ID. * * @returns The start clip ID. */ getStartClipId(): string; /** * Rebinds the transition to a different incoming clip. * * @param endClipId Clip ID that should become the end clip. * @returns Nothing. */ setEndClipId(endClipId: string): void; /** * Returns the incoming clip ID. * * @returns The end clip ID. */ getEndClipId(): string; /** * Returns the sprite used to display the rendered transition. * * @returns The transition sprite. */ getSprite(): PIXI.Sprite; /** * Returns the outgoing clip instance. * * @returns The start clip. */ getStartClip(): Clip>; /** * Returns the incoming clip instance. * * @returns The end clip. */ getEndClip(): Clip>; private getRenderer; /** * Lifecycle hook called when playback starts. * * @param currentTime Current timeline time, in seconds. * @returns A promise that resolves after the hook completes. */ onPlay(currentTime: number): Promise; /** * Lifecycle hook called when playback pauses. * * @param currentTime Current timeline time, in seconds. * @returns Nothing. */ onPause(currentTime: number): void; /** * Recreates transition render textures for a new render size. * * @param width New render width, in pixels. * @param height New render height, in pixels. * @returns Nothing. */ onResize(width: number, height: number): void; /** * Computes normalized transition progress for the specified timeline time. * * @param currentTime Timeline time, in seconds. * @returns Transition progress clamped to the `[0, 1]` range. */ getTransitionProgress(currentTime: number): number; /** * Renders the two source clips into the transition textures for the specified frame. * * @param currentTime Timeline time, in seconds. * @returns Nothing. */ render(currentTime: number): void; /** * Lifecycle hook called after transition rendering completes for a frame. * * @param currentTime Timeline time, in seconds. * @returns Nothing. */ postRender(currentTime: number): void; /** * Releases all render resources and detaches this transition from its clips. * * @returns Nothing. */ destroy(): void; /** * Updates transition uniforms for the specified timeline time. * * @param currentTime Timeline time, in seconds. * @returns Nothing. */ update(currentTime: number): void; /** * Serializes this transition instance. * * @returns The serialized transition payload. */ serialize(): { properties: [string, any][]; id: string; provider: string; startClipId: string; endClipId: string; inDuration: number; outDuration: number; transitionId: string; }; /** * Creates a transition instance from serialized data. * * @param data Serialized transition payload. * @returns The deserialized transition instance. */ static deserialize(data: object): Transition; }