import { assetSchema as AssetSchema } from '@shotstack/schemas/zod';
import { audioAssetSchema as AudioAssetSchema } from '@shotstack/schemas/zod';
import { captionAssetSchema as CaptionAssetSchema } from '@shotstack/schemas/zod';
import { clipSchema as ClipSchema } from '@shotstack/schemas/zod';
import { components } from '@shotstack/schemas';
import { cropSchema as CropSchema } from '@shotstack/schemas/zod';
import { editSchema as EditSchema } from '@shotstack/schemas/zod';
import { htmlAssetSchema as HtmlAssetSchema } from '@shotstack/schemas/zod';
import { imageAssetSchema as ImageAssetSchema } from '@shotstack/schemas/zod';
import { imageToVideoAssetSchema as ImageToVideoAssetSchema } from '@shotstack/schemas/zod';
import { lumaAssetSchema as LumaAssetSchema } from '@shotstack/schemas/zod';
import { offsetSchema as OffsetSchema } from '@shotstack/schemas/zod';
import { outputSchema as OutputSchema } from '@shotstack/schemas/zod';
import * as pixi from 'pixi.js';
import { richTextAssetSchema as RichTextAssetSchema } from '@shotstack/schemas/zod';
import { shapeAssetSchema as ShapeAssetSchema } from '@shotstack/schemas/zod';
import { textAssetSchema as TextAssetSchema } from '@shotstack/schemas/zod';
import { textToImageAssetSchema as TextToImageAssetSchema } from '@shotstack/schemas/zod';
import { textToSpeechAssetSchema as TextToSpeechAssetSchema } from '@shotstack/schemas/zod';
import { timelineSchema as TimelineSchema } from '@shotstack/schemas/zod';
import { trackSchema as TrackSchema } from '@shotstack/schemas/zod';
import { transformationSchema as TransformationSchema } from '@shotstack/schemas/zod';
import { transitionSchema as TransitionSchema } from '@shotstack/schemas/zod';
import { tweenSchema } from '@shotstack/schemas/zod';
import { videoAssetSchema as VideoAssetSchema } from '@shotstack/schemas/zod';
import { z } from 'zod';

export declare type Asset = components["schemas"]["Asset"];

export { AssetSchema }

export declare class AssetToolbar {
    private container;
    private ui;
    private unsubscribe;
    constructor(ui: UIController);
    setPosition(screenX: number, screenY: number): void;
    mount(parent: HTMLElement): void;
    private render;
    private setupEventListeners;
    dispose(): void;
}

export declare type AudioAsset = components["schemas"]["AudioAsset"];

export { AudioAssetSchema }

declare type BackgroundChangeCallback = (color: string) => void;

/**
 * Abstract base class for toolbars providing shared lifecycle, popup management,
 * and UI helper methods.
 */
declare abstract class BaseToolbar {
    protected container: HTMLDivElement | null;
    protected edit: Edit;
    protected selectedTrackIdx: number;
    protected selectedClipIdx: number;
    protected clickOutsideHandler: ((e: MouseEvent) => void) | null;
    constructor(edit: Edit);
    /**
     * Mount the toolbar to a parent element.
     * Subclasses must implement to build their specific HTML structure.
     */
    abstract mount(parent: HTMLElement): void;
    /**
     * Show the toolbar for a specific clip.
     * Subclasses can override to add custom behavior.
     */
    show(trackIndex: number, clipIndex: number): void;
    /**
     * Hide the toolbar.
     */
    hide(): void;
    /**
     * Dispose the toolbar and clean up resources.
     * Subclasses should call super.dispose() and then null their own references.
     */
    dispose(): void;
    /**
     * Check if a popup is currently visible (handles both CSS class and inline style patterns).
     */
    protected isPopupOpen(popup: HTMLElement | null): boolean;
    /**
     * Toggle a popup's visibility, closing all others first.
     * Uses CSS class-based visibility. Optional callback fires when popup opens.
     */
    protected togglePopup(popup: HTMLElement | null, onOpen?: () => void): void;
    /**
     * Close all popups.
     * Uses CSS class-based visibility.
     */
    protected closeAllPopups(): void;
    /**
     * Set up a document click handler to close popups when clicking outside.
     */
    protected setupOutsideClickHandler(): void;
    /**
     * Create a slider input handler with value display update.
     */
    protected createSliderHandler(slider: HTMLInputElement | null, valueDisplay: HTMLSpanElement | null, callback: (value: number) => void, formatter?: (value: number) => string): void;
    /**
     * Set active state on a button element.
     */
    protected setButtonActive(btn: HTMLElement | null, active: boolean): void;
    /**
     * Sync UI state with current clip configuration.
     * Subclasses must implement.
     */
    protected abstract syncState(): void;
    /**
     * Get the list of popup elements for popup management.
     * Subclasses must implement.
     */
    protected abstract getPopupList(): (HTMLElement | null)[];
}

/**
 * Payload passed to button click handlers.
 */
export declare interface ButtonClickPayload {
    /** Current playback position in seconds */
    position: number;
    /** Currently selected clip, if any */
    selectedClip: {
        trackIndex: number;
        clipIndex: number;
    } | null;
}

export declare class Canvas {
    private static extensionsRegistered;
    private viewportSize;
    private readonly edit;
    /** Container for interactive overlays (handles, guides). Renders above content. */
    readonly overlayContainer: pixi.Container;
    private viewportContainer?;
    private editBackground?;
    private viewportMask?;
    private container?;
    private background?;
    private timeline?;
    private uiController;
    private alignmentGuides;
    private minZoom;
    private maxZoom;
    private currentZoom;
    private onTickBound;
    private onBackgroundClickBound;
    private onWheelBound;
    private canvasRoot;
    constructor(edit: Edit);
    load(): Promise<void>;
    private setupTouchHandling;
    private onWheel;
    centerEdit(): void;
    zoomToFit(padding?: number): void;
    resize(): void;
    setZoom(zoom: number): void;
    getZoom(): number;
    /**
     * Sync overlay container and toolbar positions after content transforms change.
     * Single point of update for all position-dependent UI elements.
     */
    private syncContentTransforms;
    /**
     * Get the pixel bounds of the canvas content (edit area) within the viewport.
     * Used for positioning toolbars adjacent to the canvas content.
     */
    getContentBounds(): {
        left: number;
        right: number;
        top: number;
        bottom: number;
    };
    registerTimeline(timeline: Timeline): void;
    /**
     * Get the viewport container for coordinate transforms.
     * Used by selection handles, export coordinator, and other components
     * that need to convert between viewport and world coordinates.
     */
    getViewportContainer(): pixi.Container;
    /**
     * Update the edit background and viewport mask when size changes.
     * Called from Edit when output size is changed.
     */
    updateViewportForSize(width: number, height: number, backgroundColor: string): void;
    /**
     * Subscribe to Edit events for visual synchronization.
     * Canvas reacts to these events to update PIXI visuals.
     */
    private subscribeToEditEvents;
    private onPlayerAddedToTrack;
    private onPlayerMovedBetweenTracks;
    private onPlayerRemovedFromTrack;
    private onTrackContainerRemoved;
    private onViewportSizeChanged;
    private onViewportNeedsZoomToFit;
    private registerExtensions;
    private configureApplication;
    private onTick;
    private configureStage;
    private onBackgroundClick;
    pauseTicker(): void;
    resumeTicker(): void;
    dispose(): void;
}

/**
 * Interface for PixiJS-based overlays that render on the canvas.
 * Used for interactive elements like selection handles, alignment guides, etc.
 */
export declare interface CanvasOverlayRegistration {
    /** Mount to PixiJS container */
    mount(container: pixi.Container, app: pixi.Application): void;
    /** Called each frame to update state */
    update(deltaTime: number, elapsed: number): void;
    /** Called each frame to render */
    draw(): void;
    /** Clean up resources */
    dispose(): void;
}

export declare class CanvasToolbar {
    private container;
    private edit;
    private currentWidth;
    private currentHeight;
    private currentFps;
    private currentBgColor;
    private resolutionPopup;
    private backgroundPopup;
    private fpsPopup;
    private variablesPopup;
    private resolutionBtn;
    private backgroundBtn;
    private fpsBtn;
    private variablesBtn;
    private variablesList;
    private variablesEmpty;
    private resolutionLabel;
    private fpsLabel;
    private bgColorDot;
    private customWidthInput;
    private customHeightInput;
    private colorInput;
    private resolutionChangeCallback;
    private fpsChangeCallback;
    private backgroundChangeCallback;
    private clickOutsideHandler;
    private showMergeFields;
    private maxPixels?;
    constructor(edit?: Edit, options?: CanvasToolbarOptions);
    /** Check if given dimensions exceed the configured pixel limit */
    private isOverLimit;
    /** Get the edit as ShotstackEdit if it has merge field capabilities */
    private getShotstackEdit;
    setPosition(screenX: number, screenY: number): void;
    mount(parent: HTMLElement): void;
    private setupEventListeners;
    private togglePopup;
    private closeAllPopups;
    private handleResolutionSelect;
    private handleCustomSizeChange;
    private handleFpsSelect;
    private handleColorChange;
    private updateResolutionLabel;
    private updateFpsLabel;
    private updateColorPreview;
    private updateActiveStates;
    private renderVariablesList;
    private addVariable;
    setResolution(width: number, height: number): void;
    /** Update warning state for inputs when loaded resolution exceeds configured limit */
    private updateConstraintWarning;
    setFps(fps: number): void;
    setBackground(color: string): void;
    onResolutionChange(callback: ResolutionChangeCallback): void;
    onFpsChange(callback: FpsChangeCallback): void;
    onBackgroundChange(callback: BackgroundChangeCallback): void;
    dispose(): void;
}

declare interface CanvasToolbarOptions {
    mergeFields?: boolean;
    /** Maximum total pixels allowed for custom resolution input. Omit for unlimited. */
    maxPixels?: number;
}

export declare type CaptionAsset = components["schemas"]["CaptionAsset"];

export { CaptionAssetSchema }

export declare type ChromaKey = components["schemas"]["ChromaKey"];

export declare type Clip = components["schemas"]["Clip"];

export declare type ClipAnchor = Clip["position"];

/** Clip info for interactions */
declare interface ClipInfo {
    trackIndex: number;
    clipIndex: number;
    config: ResolvedClip;
}

export declare type ClipLocation = {
    trackIndex: number;
    clipIndex: number;
};

/**
 * Reference to a clip from the document (source of truth).
 * Contains original timing values like "auto", "end", and alias references.
 * Used in public SDK events so consumers see the document state.
 */
export declare type ClipReference = ClipLocation & {
    clip: Clip;
};

/** Custom clip renderer interface */
declare interface ClipRenderer {
    /** Render custom content inside clip element */
    render(clip: ResolvedClip, element: HTMLElement): void;
    /** Optional cleanup when clip is removed */
    dispose?(element: HTMLElement): void;
}

export { ClipSchema }

/**
 * Toolbar for clip-level properties (timing, linking).
 * Shows compact timing controls for start and length with:
 * - Click-to-cycle mode badges
 * - Scrubbable time values (drag to adjust)
 * - Keyboard increment/decrement (arrow keys)
 */
export declare class ClipToolbar extends BaseToolbar {
    private startControl;
    private lengthControl;
    private editChangedListener;
    mount(parent: HTMLElement): void;
    private setupEventListeners;
    private mountComponents;
    private applyTimingUpdate;
    protected syncState(): void;
    protected getPopupList(): (HTMLElement | null)[];
    dispose(): void;
}

export declare class Controls {
    private edit;
    private seekDistance;
    private seekDistanceLarge;
    private frameTime;
    constructor(timeline: Edit);
    load(): Promise<void>;
    private shouldIgnoreKeyboardEvent;
    private handleKeyDown;
    private handleKeyUp;
}

export declare type Crop = components["schemas"]["Crop"];

export { CropSchema }

export declare type Destination = components["schemas"]["Destinations"];

export declare const DestinationSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
    provider: z.ZodLiteral<"shotstack">;
    exclude: z.ZodOptional<z.ZodBoolean>;
}, z.core.$strip>, z.ZodObject<{
    provider: z.ZodLiteral<"mux">;
    options: z.ZodOptional<z.ZodObject<{
        playbackPolicy: z.ZodOptional<z.ZodArray<z.ZodEnum<{
            public: "public";
            signed: "signed";
        }>>>;
        passthrough: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    provider: z.ZodLiteral<"s3">;
    options: z.ZodOptional<z.ZodObject<{
        region: z.ZodString;
        bucket: z.ZodString;
        prefix: z.ZodOptional<z.ZodString>;
        filename: z.ZodOptional<z.ZodString>;
        acl: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    provider: z.ZodLiteral<"google-cloud-storage">;
    options: z.ZodOptional<z.ZodObject<{
        bucket: z.ZodString;
        prefix: z.ZodOptional<z.ZodString>;
        filename: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    provider: z.ZodLiteral<"google-drive">;
    options: z.ZodObject<{
        folderId: z.ZodString;
        filename: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>;
}, z.core.$strip>, z.ZodObject<{
    provider: z.ZodLiteral<"vimeo">;
    options: z.ZodOptional<z.ZodObject<{
        name: z.ZodOptional<z.ZodString>;
        description: z.ZodOptional<z.ZodString>;
        privacy: z.ZodOptional<z.ZodObject<{
            view: z.ZodOptional<z.ZodEnum<{
                anybody: "anybody";
                nobody: "nobody";
                contacts: "contacts";
                password: "password";
                unlisted: "unlisted";
            }>>;
            embed: z.ZodOptional<z.ZodEnum<{
                public: "public";
                private: "private";
                whitelist: "whitelist";
            }>>;
            comments: z.ZodOptional<z.ZodEnum<{
                anybody: "anybody";
                nobody: "nobody";
                contacts: "contacts";
            }>>;
            download: z.ZodOptional<z.ZodBoolean>;
            add: z.ZodOptional<z.ZodBoolean>;
        }, z.core.$strip>>;
        folderUri: z.ZodOptional<z.ZodString>;
    }, z.core.$strip>>;
}, z.core.$strip>, z.ZodObject<{
    provider: z.ZodLiteral<"tiktok">;
    options: z.ZodOptional<z.ZodObject<{
        title: z.ZodOptional<z.ZodString>;
        privacyLevel: z.ZodOptional<z.ZodEnum<{
            public: "public";
            friends: "friends";
            private: "private";
        }>>;
        disableDuet: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
        disableStitch: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
        disableComment: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
    }, z.core.$strip>>;
}, z.core.$strip>], "provider">;

export declare class Edit {
    private static readonly MAX_HISTORY_SIZE;
    private document;
    private backgroundColor;
    private tracks;
    playbackTime: Seconds;
    totalDuration: Seconds;
    isPlaying: boolean;
    private get clips();
    private canvas;
    private timingManager;
    private lumaMaskController;
    private playerReconciler;
    private outputSettings;
    private selectionManager;
    private commandHistory;
    private commandIndex;
    private commandQueue;
    private clipsToDispose;
    private clipErrors;
    private playerByClipId;
    private fontMetadata;
    private isBatchingEvents;
    private syncCorrectionCount;
    private isExporting;
    private lastResolved;
    /**
     * Create an Edit instance from a template configuration.
     */
    constructor(template: Edit_2);
    /**
     * Load the edit session.
     */
    load(): Promise<void>;
    /**
     * Initialize runtime from the document.
     */
    private initializeFromDocument;
    play(): void;
    pause(): void;
    seek(target: Seconds): void;
    stop(): void;
    /**
     * Reload the edit with a new configuration (hot-reload).
     */
    loadEdit(edit: Edit_2): Promise<void>;
    private loadSoundtrack;
    getEdit(): Edit_2;
    /**
     * Validates an edit configuration.
     */
    validateEdit(edit: unknown): {
        valid: boolean;
        errors: Array<{
            path: string;
            message: string;
        }>;
    };
    addClip(trackIdx: number, clip: Clip): void | Promise<void>;
    getClip(trackIdx: number, clipIdx: number): Clip | null;
    /**
     * Clear the error for a deleted clip and shift indices for remaining errors.
     */
    private clearClipErrorAndShift;
    deleteClip(trackIdx: number, clipIdx: number): Promise<void>;
    splitClip(trackIndex: number, clipIndex: number, splitTime: number): Promise<void>;
    addTrack(trackIdx: number, track: Track): Promise<void>;
    getTrack(trackIdx: number): Track | null;
    deleteTrack(trackIdx: number): void;
    undo(): Promise<void>;
    redo(): Promise<void>;
    /**
     * Add a command to history without executing it.
     */
    private addCommandToHistory;
    updateClip(trackIdx: number, clipIdx: number, updates: Partial<Clip>): Promise<void>;
    /**
     * Handle command result - only add to history if successful.
     */
    private handleCommandResult;
    /**
     * Detects merge field placeholders in the raw edit before substitution.
     */
    private detectMergeFieldBindings;
    /**
     * Recursively walks an object to find merge field placeholders.
     */
    private detectBindingsInObject;
    /**
     * Checks if edit has structural changes requiring full reload.
     *
     * TODO: Expand granular path to handle more cases:
     * - Clip add/remove: Use existing addClip()/deleteClip() commands
     * - Soundtrack changes: Add/remove AudioPlayer via commands
     * - Font changes: Load new fonts incrementally
     * - Merge field changes: Re-resolve affected clips
     */
    private hasStructuralChanges;
    /**
     * Transfers existing clip IDs from the current document to the new edit configuration.
     */
    private preserveClipIdsForGranularUpdate;
    /**
     * Applies granular changes without full reload.
     * @param newEdit - The new edit configuration
     * @param oldTracks - The old tracks (captured before document update)
     * @param oldOutput - The old output settings (captured before document update)
     */
    private applyGranularChanges;
    private queueDisposeClip;
    /**
     * Remove fonts from timeline.fonts that are no longer referenced by any clip.
     */
    private cleanupUnusedFonts;
    /**
     * Extract the filename (without extension) from a font URL.
     */
    private extractFilenameFromUrl;
    private disposeClip;
    private unloadClipAssets;
    private movePlayerToTrackContainer;
    private addPlayer;
    setOutputSize(width: number, height: number): Promise<void>;
    setOutputFps(fps: number): Promise<void>;
    getOutputFps(): number;
    setOutputFormat(format: string): Promise<void>;
    getOutputFormat(): string;
    setOutputDestinations(destinations: Destination[]): Promise<void>;
    getOutputDestinations(): Destination[];
    setOutputResolution(resolution: string): Promise<void>;
    getOutputResolution(): string | undefined;
    setOutputAspectRatio(aspectRatio: string): Promise<void>;
    getOutputAspectRatio(): string | undefined;
    getTimelineFonts(): Array<{
        src: string;
    }>;
    setTimelineBackground(color: string): Promise<void>;
    private setTimelineBackgroundInternal;
    getTimelineBackground(): string;
    /** Map of asset src → original asset type (for reliable luma detachment during undo) */
    private originalAssetTypes;
    /**
     * Find the luma clip attached to a content clip via timing match.
     */
    private findAttachedLumaPlayer;
    /**
     * Attach a luma mask to a specific clip.
     */
    attachLumaToClip(trackIndex: number, clipIndex: number, lumaSrc: string): Promise<void>;
    /**
     * Detach the luma mask from a clip.
     */
    detachLumaFromClip(trackIndex: number, clipIndex: number): Promise<void>;
    /**
     * Get the luma mask attached to a clip, if any.
     */
    getClipLuma(trackIndex: number, clipIndex: number): {
        src: string;
        clipIndex: number;
    } | null;
    /**
     * Check if a clip has a luma mask attached.
     */
    hasLumaMask(trackIndex: number, clipIndex: number): boolean;
    /**
     * Find the content clip that best matches a luma (by temporal overlap).
     */
    private findBestContentMatch;
    private setupIntentListeners;
}

declare type Edit_2 = components["schemas"]["Edit"];

/** Configuration for defining an edit - the structure passed to EditSession */
export declare type EditConfig = Edit_2;

export declare const EditEvent: {
    readonly PlaybackPlay: "playback:play";
    readonly PlaybackPause: "playback:pause";
    readonly TimelineUpdated: "timeline:updated";
    readonly TimelineBackgroundChanged: "timeline:backgroundChanged";
    readonly ClipAdded: "clip:added";
    readonly ClipSplit: "clip:split";
    readonly ClipSelected: "clip:selected";
    readonly ClipUpdated: "clip:updated";
    readonly ClipDeleted: "clip:deleted";
    readonly ClipRestored: "clip:restored";
    readonly ClipCopied: "clip:copied";
    readonly ClipLoadFailed: "clip:loadFailed";
    readonly ClipUnresolved: "clip:unresolved";
    readonly SelectionCleared: "selection:cleared";
    readonly EditChanged: "edit:changed";
    readonly EditUndo: "edit:undo";
    readonly EditRedo: "edit:redo";
    readonly TrackAdded: "track:added";
    readonly TrackRemoved: "track:removed";
    readonly DurationChanged: "duration:changed";
    readonly OutputResized: "output:resized";
    readonly OutputResolutionChanged: "output:resolutionChanged";
    readonly OutputAspectRatioChanged: "output:aspectRatioChanged";
    readonly OutputFpsChanged: "output:fpsChanged";
    readonly OutputFormatChanged: "output:formatChanged";
    readonly OutputDestinationsChanged: "output:destinationsChanged";
    readonly MergeFieldRegistered: "mergefield:registered";
    readonly MergeFieldUpdated: "mergefield:updated";
    readonly MergeFieldRemoved: "mergefield:removed";
    readonly MergeFieldChanged: "mergefield:changed";
    readonly MergeFieldApplied: "mergefield:applied";
    readonly TranscriptionProgress: "transcription:progress";
    readonly TranscriptionCompleted: "transcription:completed";
    readonly TranscriptionFailed: "transcription:failed";
    readonly LumaAttached: "luma:attached";
    readonly LumaDetached: "luma:detached";
};

export declare type EditEventMap = {
    [EditEvent.PlaybackPlay]: void;
    [EditEvent.PlaybackPause]: void;
    /** Contains the document (source of truth) with original timing values like "auto", "end" */
    [EditEvent.TimelineUpdated]: {
        current: Edit_2;
    };
    [EditEvent.TimelineBackgroundChanged]: {
        color: string;
    };
    [EditEvent.ClipAdded]: ClipLocation;
    [EditEvent.ClipSplit]: {
        trackIndex: number;
        originalClipIndex: number;
        newClipIndex: number;
    };
    [EditEvent.ClipSelected]: ClipReference;
    [EditEvent.ClipUpdated]: {
        previous: ClipReference;
        current: ClipReference;
    };
    [EditEvent.ClipDeleted]: ClipLocation;
    [EditEvent.ClipRestored]: ClipLocation;
    [EditEvent.ClipCopied]: ClipLocation;
    [EditEvent.ClipLoadFailed]: ClipLocation & {
        error: string;
        assetType: string;
    };
    [EditEvent.ClipUnresolved]: ClipLocation & {
        assetType: string;
        clipId: string;
    };
    [EditEvent.SelectionCleared]: void;
    [EditEvent.EditChanged]: {
        source: string;
        timestamp: number;
    };
    [EditEvent.EditUndo]: {
        command: string;
    };
    [EditEvent.EditRedo]: {
        command: string;
    };
    [EditEvent.TrackAdded]: {
        trackIndex: number;
        totalTracks: number;
    };
    [EditEvent.TrackRemoved]: {
        trackIndex: number;
    };
    [EditEvent.DurationChanged]: {
        duration: number;
    };
    [EditEvent.OutputResized]: {
        width: number;
        height: number;
    };
    [EditEvent.OutputResolutionChanged]: {
        resolution: Output["resolution"];
    };
    [EditEvent.OutputAspectRatioChanged]: {
        aspectRatio: Output["aspectRatio"];
    };
    [EditEvent.OutputFpsChanged]: {
        fps: number;
    };
    [EditEvent.OutputFormatChanged]: {
        format: Output["format"];
    };
    [EditEvent.OutputDestinationsChanged]: {
        destinations: Destination[];
    };
    [EditEvent.MergeFieldRegistered]: {
        field: MergeField_2;
    };
    [EditEvent.MergeFieldUpdated]: {
        field: MergeField_2;
    };
    [EditEvent.MergeFieldRemoved]: ClipLocation & {
        propertyPath: string;
        fieldName: string | null;
    };
    [EditEvent.MergeFieldChanged]: {
        fields: MergeField_2[];
    };
    [EditEvent.MergeFieldApplied]: ClipLocation & {
        propertyPath: string;
        fieldName: string;
    };
    [EditEvent.TranscriptionProgress]: {
        clipAlias: string;
        message?: string;
    };
    [EditEvent.TranscriptionCompleted]: {
        clipAlias: string;
        cueCount: number;
    };
    [EditEvent.TranscriptionFailed]: {
        clipAlias: string;
        error: string;
    };
    [EditEvent.LumaAttached]: ClipLocation & {
        lumaSrc: string;
        lumaClipIndex: number;
    };
    [EditEvent.LumaDetached]: ClipLocation;
};

export declare type EditEventName = (typeof EditEvent)[keyof typeof EditEvent];

export { EditSchema }

declare abstract class Entity {
    private readonly container;
    constructor();
    abstract load(): Promise<void>;
}

/** SDK-extended CaptionAsset with stroke, width, height, alignment */
export declare type ExtendedCaptionAsset = CaptionAsset & {
    stroke?: {
        width: number;
        color: string;
    };
    width?: number;
    height?: number;
    alignment?: {
        horizontal?: "left" | "center" | "right";
        vertical?: "top" | "center" | "bottom";
    };
};

export declare type Font = components["schemas"]["Font"];

declare type FpsChangeCallback = (fps: number) => void;

export declare const HexColorSchema: z.ZodString;

export declare type HtmlAsset = components["schemas"]["HtmlAsset"];

export declare type HtmlAssetPosition = NonNullable<HtmlAsset["position"]>;

export { HtmlAssetSchema }

export declare type ImageAsset = components["schemas"]["ImageAsset"];

export { ImageAssetSchema }

export declare type ImageToVideoAsset = components["schemas"]["ImageToVideoAsset"];

export { ImageToVideoAssetSchema }

/**
 * Inspector displays performance stats as an HTML overlay.
 * Shows FPS, memory, playback health, and clip statistics.
 */
export declare class Inspector {
    private container;
    private animationFrameId;
    private lastFrameTime;
    private edit;
    private fpsEl;
    private playbackEl;
    private frameStatsEl;
    private frameSparklineEl;
    private jankEl;
    private heapEl;
    private heapSparklineEl;
    private clipsEl;
    private historySamples;
    private readonly maxSamples;
    private lastSampleTime;
    private readonly sampleInterval;
    private frameTimes;
    private readonly frameTimeWindow;
    private readonly jankThreshold;
    constructor(edit: Edit);
    /**
     * Mount the inspector to a parent element.
     * @param parent - The parent element to append the inspector to
     */
    mount(parent: HTMLElement): void;
    private startUpdateLoop;
    private update;
    private trackFrameTime;
    private getFrameStats;
    private getFrameTimeSparkline;
    private addHistorySample;
    private getJsHeapSparkline;
    private render;
    private getMemoryInfo;
    private bytesToMegabytes;
    dispose(): void;
}

declare type Keyframe_2 = Tween;
export { Keyframe_2 as Keyframe }

export declare type LumaAsset = components["schemas"]["LumaAsset"];

export { LumaAssetSchema }

export declare class MediaToolbar extends BaseToolbar {
    private showMergeFields;
    private assetType;
    constructor(edit: Edit, options?: MediaToolbarOptions);
    /** Get the edit as ShotstackEdit if it has merge field capabilities */
    private getShotstackEdit;
    private currentFit;
    private currentVolume;
    private transitionPanel;
    private effectPanel;
    private opacitySlider;
    private scaleSlider;
    private fitBtn;
    private opacityBtn;
    private scaleBtn;
    private volumeBtn;
    private transitionBtn;
    private effectBtn;
    private advancedBtn;
    private audioFadeBtn;
    private fitPopup;
    private opacityPopup;
    private scalePopup;
    private volumePopup;
    private transitionPopup;
    private effectPopup;
    private advancedPopup;
    private audioFadePopup;
    private fitLabel;
    private volumeSlider;
    private volumeValue;
    private volumeDisplayInput;
    private volumeSection;
    private visualSection;
    private audioSection;
    private dynamicToggle;
    private dynamicPanel;
    private dynamicInput;
    private audioFadeEffect;
    private isDynamicSource;
    private dynamicFieldName;
    private originalSrc;
    private abortController;
    mount(parent: HTMLElement): void;
    /**
     * Mount composite UI components into their placeholder elements.
     */
    private mountCompositeComponents;
    private setupEventListeners;
    private togglePopupByName;
    protected closeAllPopups(): void;
    protected getPopupList(): (HTMLElement | null)[];
    protected syncState(): void;
    private handleFitChange;
    private handleOpacityChange;
    private handleScaleChange;
    private handleVolumeChange;
    /**
     * Parse and commit the value from the volume text input.
     */
    private commitVolumeInputValue;
    /**
     * Revert the volume text input to match the current slider value.
     */
    private revertVolumeInputValue;
    /**
     * Parse user input, strip non-numeric chars, clamp to 0-100.
     */
    private parseVolumeInputValue;
    private applyTransitionUpdate;
    private applyEffect;
    private handleAudioFadeSelect;
    private applyAudioFade;
    private updateAudioFadeUI;
    private applyClipUpdate;
    private setupDynamicSourceHandlers;
    private applyDynamicUrl;
    private showUrlError;
    private clearUrlError;
    private clearDynamicSource;
    private updateDynamicSourceUI;
    private updateFitDisplay;
    private updateOpacityDisplay;
    private updateScaleDisplay;
    private updateVolumeDisplay;
    private updateFitActiveState;
    /**
     * Show the toolbar for a specific clip.
     * Derives assetType from the clip's asset configuration.
     */
    show(trackIndex: number, clipIndex: number): void;
    dispose(): void;
}

declare interface MediaToolbarOptions {
    mergeFields?: boolean;
}

export declare type MergeField = components["schemas"]["MergeField"];

/**
 * Merge field types for the Shotstack Studio SDK.
 *
 * Merge fields allow dynamic content substitution using {{ FIELD_NAME }} syntax.
 * Values are replaced at render time, enabling template-based video generation.
 */
/**
 * A merge field definition used throughout the SDK.
 */
declare interface MergeField_2 {
    /** Field identifier (uppercase convention: MY_FIELD) */
    name: string;
    /** Default value used for preview when no runtime value is provided */
    defaultValue: string;
    /** Optional description for UI display */
    description?: string;
}

export declare interface NumericKeyframe {
    start: number;
    length: number;
    from: number;
    to: number;
    interpolation?: Tween["interpolation"];
    easing?: Tween["easing"];
}

export declare type Offset = components["schemas"]["Offset"];

export { OffsetSchema }

export declare type Output = components["schemas"]["Output"];

export declare const OutputAspectRatioSchema: z.ZodOptional<z.ZodEnum<{
    "16:9": "16:9";
    "9:16": "9:16";
    "1:1": "1:1";
    "4:3": "4:3";
    "4:5": "4:5";
}>>;

export declare const OutputFormatSchema: z.ZodEnum<{
    mp4: "mp4";
    gif: "gif";
    mp3: "mp3";
    jpg: "jpg";
    png: "png";
    bmp: "bmp";
}>;

export declare const OutputFpsSchema: z.ZodUnion<readonly [z.ZodLiteral<12>, z.ZodLiteral<15>, z.ZodLiteral<23.976>, z.ZodLiteral<24>, z.ZodLiteral<25>, z.ZodLiteral<29.97>, z.ZodLiteral<30>, z.ZodLiteral<48>, z.ZodLiteral<50>, z.ZodLiteral<59.94>, z.ZodLiteral<60>]>;

export declare const OutputResolutionSchema: z.ZodOptional<z.ZodEnum<{
    preview: "preview";
    mobile: "mobile";
    sd: "sd";
    hd: "hd";
    1080: "1080";
    "4k": "4k";
}>>;

export { OutputSchema }

export declare const OutputSizeSchema: z.ZodObject<{
    width: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>;
    height: z.ZodOptional<z.ZodUnion<readonly [z.ZodPipe<z.ZodTransform<unknown, unknown>, z.ZodNumber>, z.ZodString]>>;
}, z.core.$strip>;

declare type ResolutionChangeCallback = (width: number, height: number) => void;

declare type ResolvedClip = Omit<Clip, "start" | "length"> & {
    id: string;
    start: Seconds;
    length: Seconds;
};

export declare type RichTextAsset = components["schemas"]["RichTextAsset"];

export { RichTextAssetSchema }

export declare class RichTextToolbar extends BaseToolbar {
    private showMergeFields;
    private fontPopup;
    private fontPreview;
    private fontPicker;
    private sizeInput;
    private sizePopup;
    private weightDropdown;
    private weightPopup;
    private weightPreview;
    private spacingPopup;
    private spacingPanel;
    private anchorTopBtn;
    private anchorMiddleBtn;
    private anchorBottomBtn;
    private alignIcon;
    private transformBtn;
    private underlineBtn;
    private linethroughBtn;
    private textEditPopup;
    private textEditArea;
    private textEditDebounceTimer;
    private autocompletePopup;
    private autocompleteItems;
    private autocompleteVisible;
    private autocompleteFilter;
    private autocompleteStartPos;
    private selectedAutocompleteIndex;
    private borderPopup;
    private borderWidthSlider;
    private borderWidthValue;
    private borderColorInput;
    private borderOpacitySlider;
    private borderOpacityValue;
    private borderRadiusSlider;
    private borderRadiusValue;
    private backgroundPopup;
    private backgroundColorPicker;
    private paddingPopup;
    private paddingTopSlider;
    private paddingTopValue;
    private paddingRightSlider;
    private paddingRightValue;
    private paddingBottomSlider;
    private paddingBottomValue;
    private paddingLeftSlider;
    private paddingLeftValue;
    private fontColorPopup;
    private fontColorPicker;
    private colorDisplay;
    private animationPopup;
    private animationDurationSlider;
    private animationDurationValue;
    private animationStyleSection;
    private animationDirectionSection;
    private pendingAnimationDuration;
    private animationDurationThrottle;
    private transitionPopup;
    private transitionPanel;
    private effectPopup;
    private effectPanel;
    private stylePopup;
    private stylePanel;
    private boundHandleClick;
    constructor(edit: Edit, options?: RichTextToolbarOptions);
    private getShotstackEdit;
    mount(parent: HTMLElement): void;
    private handleClick;
    private getCurrentAsset;
    private updateSize;
    private static readonly FONT_WEIGHTS;
    private static readonly CHECKMARK_SVG;
    /** Single source of truth for weight normalization - handles string, number, or object */
    private normalizeWeight;
    private getWeightName;
    private toggleWeightPopup;
    /** Build popup once at mount - uses event delegation (no per-item listeners) */
    private buildWeightPopup;
    /** Update active state without rebuilding DOM */
    private updateWeightPopupState;
    private setFontWeight;
    private toggleSizePopup;
    /** Build popup once at mount - uses event delegation (no per-item listeners) */
    private buildSizePopup;
    /** Update active state without rebuilding DOM */
    private updateSizePopupState;
    private applyManualSize;
    private toggleSpacingPopup;
    private toggleAnimationPopup;
    private toggleFontColorPopup;
    private toggleFontPopup;
    private toggleTextEditPopup;
    private debouncedApplyTextEdit;
    private applyTextEdit;
    private checkAutocomplete;
    private showAutocomplete;
    private hideAutocomplete;
    private insertVariable;
    private insertSelectedVariable;
    private getFilteredFieldCount;
    private buildFontPicker;
    private getDisplayName;
    private selectFont;
    private updateVerticalAlign;
    private cycleAlignment;
    private updateAlignment;
    private updateAlignIcon;
    private cycleTransform;
    private toggleUnderline;
    private toggleLinethrough;
    private updateBorderProperty;
    private updateShadowProperty;
    private updateAnimationProperty;
    private updateAnimationSections;
    private updateBackgroundProperty;
    private updatePaddingProperty;
    private updateFontColorProperty;
    private updateClipProperty;
    private applyClipUpdate;
    protected getPopupList(): (HTMLElement | null)[];
    protected syncState(): void;
    dispose(): void;
}

declare interface RichTextToolbarOptions {
    mergeFields?: boolean;
}

/**
 * A number representing time in seconds.
 * Used at API/configuration boundaries where users specify timing.
 */
declare type Seconds = number & {
    readonly [SecondsSymbol]: typeof SecondsSymbol;
};

declare const SecondsSymbol: unique symbol;

export declare class SelectionHandles implements CanvasOverlayRegistration {
    private edit;
    private container;
    private outline;
    private handles;
    private edgeHandles;
    private app;
    private positionBuilder;
    private selectedPlayer;
    private selectedClipId;
    private selectedTrackIndex;
    private selectedClipIndex;
    private isHovering;
    private isDragging;
    private dragOffset;
    private scaleDirection;
    private edgeDragDirection;
    private edgeDragStart;
    private originalDimensions;
    private isRotating;
    private rotationStart;
    private initialRotation;
    private rotationCorner;
    private initialClipConfiguration;
    private onClipSelectedBound;
    private onSelectionClearedBound;
    private onPointerDownBound;
    private onPointerMoveBound;
    private onPointerUpBound;
    constructor(edit: Edit);
    mount(parent: pixi.Container, app: pixi.Application): void;
    update(_deltaTime: number, _elapsed: number): void;
    draw(): void;
    dispose(): void;
    private onClipSelected;
    private onSelectionCleared;
    private syncToPlayer;
    private drawOutline;
    private drawHandles;
    private drawEdgeHandles;
    private getUIScale;
    private onPointerDown;
    private onPointerMove;
    private onPointerUp;
    private startDrag;
    private handleDrag;
    private startCornerResize;
    private handleCornerResize;
    private startEdgeResize;
    private handleEdgeResize;
    private startRotation;
    private handleRotation;
    private captureOriginalDimensions;
    private getContentCenter;
    private getRotationCorner;
    private getCornerResizeCursor;
    private updateHoverState;
    private resetDragState;
    private hasStateChanged;
}

export declare type ShapeAsset = components["schemas"]["ShapeAsset"];

export { ShapeAssetSchema }

export declare type Soundtrack = components["schemas"]["Soundtrack"];

export declare type TextAsset = components["schemas"]["TextAsset"];

export { TextAssetSchema }

export declare type TextToImageAsset = components["schemas"]["TextToImageAsset"];

export { TextToImageAssetSchema }

export declare class TextToolbar extends BaseToolbar {
    private textEditBtn;
    private textEditPopup;
    private textEditArea;
    private textEditDebounceTimer;
    private sizeInput;
    private sizePopup;
    private fontBtn;
    private fontPopup;
    private fontPreview;
    private boldBtn;
    private fontColorBtn;
    private fontColorPopup;
    private fontColorInput;
    private colorDisplay;
    private spacingBtn;
    private spacingPopup;
    private spacingPanel;
    private anchorTopBtn;
    private anchorMiddleBtn;
    private anchorBottomBtn;
    private alignBtn;
    private alignIcon;
    private backgroundBtn;
    private backgroundPopup;
    private bgColorInput;
    private bgOpacitySlider;
    private bgOpacityValue;
    private strokeBtn;
    private strokePopup;
    private strokeWidthSlider;
    private strokeWidthValue;
    private strokeColorInput;
    private transitionBtn;
    private transitionPopup;
    private transitionPanel;
    private effectBtn;
    private effectPopup;
    private effectPanel;
    private boundHandleClick;
    private getShotstackEdit;
    mount(parent: HTMLElement): void;
    private bindElements;
    private setupEventListeners;
    private mountCompositePanels;
    private handleClick;
    protected getPopupList(): (HTMLElement | null)[];
    private buildFontPopup;
    private buildSizePopup;
    private getCurrentAsset;
    private updateAssetProperty;
    private debouncedApplyTextEdit;
    private adjustSize;
    private setSize;
    private applyManualSize;
    private setFont;
    private updateFontActiveState;
    private toggleBold;
    private handleFontColorChange;
    private setVerticalAnchor;
    private updateAnchorActiveState;
    private cycleAlignment;
    private updateAlignmentIcon;
    private handleBackgroundChange;
    private handleStrokeChange;
    private applyClipUpdate;
    protected syncState(): void;
    dispose(): void;
}

export declare type TextToSpeechAsset = components["schemas"]["TextToSpeechAsset"];

export { TextToSpeechAssetSchema }

export declare class Timeline {
    private readonly edit;
    readonly element: HTMLElement;
    private readonly container;
    private readonly stateManager;
    private features;
    private clipRenderers;
    private thumbnailGenerator;
    private mediaThumbnailRenderer;
    private toolbar;
    private rulerTracksWrapper;
    private ruler;
    private trackList;
    private playhead;
    private playheadGhost;
    private feedbackLayer;
    private interactionController;
    private animationFrameId;
    private isRenderLoopActive;
    private lastFrameTime;
    private isInteracting;
    private isLoaded;
    private thumbnailRenderPending;
    private readonly handleTimelineUpdated;
    private readonly handlePlaybackPlay;
    private readonly handlePlaybackPause;
    private readonly handleClipSelected;
    private readonly handleClipLoadFailed;
    private readonly handleClipUpdated;
    private readonly handleRulerMouseMove;
    constructor(edit: Edit, container: HTMLElement, options?: TimelineOptions);
    /** Initialize and mount the timeline */
    load(): Promise<void>;
    /** Render/draw component to DOM (called each frame after update) */
    draw(): void;
    /** Clean up and unmount the timeline */
    dispose(): void;
    private setupEventListeners;
    private removeEventListeners;
    /** Start continuous render loop (during playback or interaction) */
    private startRenderLoop;
    /** Stop continuous render loop */
    private stopRenderLoop;
    /** Animation frame callback */
    private tick;
    /** Request a single render (used when idle and data changes) */
    private requestRender;
    /** Mark interaction as started (enables render loop) */
    beginInteraction(): void;
    /** Mark interaction as ended (may stop render loop) */
    endInteraction(): void;
    private buildComponents;
    private disposeComponents;
    setZoom(pixelsPerSecond: number): void;
    zoomIn(): void;
    zoomOut(): void;
    scrollTo(time: Seconds): void;
    /** Recalculate size from container and re-render */
    resize(): void;
    selectClip(trackIndex: number, clipIndex: number): void;
    clearSelection(): void;
    enableFeature(feature: keyof TimelineFeatures): void;
    disableFeature(feature: keyof TimelineFeatures): void;
    registerClipRenderer(type: string, renderer: ClipRenderer): void;
    getEdit(): Edit;
    findClipAtPosition(x: number, y: number): ClipInfo | null;
}

/** Feature toggles for Timeline */
export declare interface TimelineFeatures {
    /** Show toolbar with playback controls */
    toolbar?: boolean;
    /** Show time ruler */
    ruler?: boolean;
    /** Show playhead indicator */
    playhead?: boolean;
    /** Enable snap-to-grid/clips */
    snap?: boolean;
    /** Show timing intent badges on clips */
    badges?: boolean;
    /** Enable multi-select with shift/ctrl+click */
    multiSelect?: boolean;
}

/** Interaction configuration */
declare interface TimelineInteractionConfig {
    /** Minimum pixels to move before starting drag */
    dragThreshold?: number;
    /** Snap distance in pixels */
    snapThreshold?: number;
    /** Width of resize zone at clip edges */
    resizeZone?: number;
    /** Callback to request timeline re-render */
    onRequestRender?: () => void;
}

/** Configuration options for Timeline */
export declare interface TimelineOptions {
    /** Feature toggles */
    features?: TimelineFeatures;
    /** Interaction configuration */
    interaction?: TimelineInteractionConfig;
    /** Initial pixels per second (zoom level) */
    pixelsPerSecond?: number;
    /** Track height in pixels */
    trackHeight?: number;
}

export { TimelineSchema }

export declare interface TimelineTheme {
    timeline: {
        background: number;
        divider: number;
        toolbar: {
            background: number;
            surface: number;
            hover: number;
            active: number;
            divider: number;
            icon: number;
            text: number;
            height: number;
        };
        ruler: {
            background: number;
            text: number;
            markers: number;
            height: number;
        };
        tracks: {
            surface: number;
            surfaceAlt: number;
            border: number;
            height: number;
        };
        clips: {
            video: number;
            audio: number;
            image: number;
            text: number;
            "rich-text": number;
            shape: number;
            html: number;
            luma: number;
            default: number;
            selected: number;
            radius: number;
        };
        playhead: number;
        snapGuide: number;
        dropZone: number;
        trackInsertion: number;
    };
}

export declare interface TimelineThemeInput {
    timeline: {
        background: string;
        divider: string;
        toolbar: {
            background: string;
            surface: string;
            hover: string;
            active: string;
            divider: string;
            icon: string;
            text: string;
            height?: number;
        };
        ruler: {
            background: string;
            text: string;
            markers: string;
            height?: number;
        };
        tracks: {
            surface: string;
            surfaceAlt: string;
            border: string;
            height?: number;
        };
        clips: {
            video: string;
            audio: string;
            image: string;
            text: string;
            shape: string;
            html: string;
            luma: string;
            default: string;
            selected: string;
            radius?: number;
        };
        playhead: string;
        snapGuide: string;
        dropZone: string;
        trackInsertion: string;
    };
}

export declare type TitleAsset = components["schemas"]["TitleAsset"];

/**
 * Configuration for a toolbar button.
 */
export declare interface ToolbarButtonConfig {
    /** Unique identifier for the button (used in event names) */
    id: string;
    /** SVG icon markup */
    icon: string;
    /** Tooltip text shown on hover */
    tooltip: string;
    /** Whether to show a divider before this button */
    dividerBefore?: boolean;
}

export declare type Track = components["schemas"]["Track"];

export { TrackSchema }

export declare class TranscriptionIndicator extends Entity {
    private background;
    private spinner;
    private statusText;
    private spinnerAngle;
    private isVisible;
    private currentMessage;
    load(): Promise<void>;
    show(message: string): void;
    hide(): void;
    getIsVisible(): boolean;
    update(deltaTime: number, _elapsed: number): void;
    private redraw;
    setPosition(x: number, y: number): void;
    getWidth(): number;
    dispose(): void;
}

export declare type Transformation = components["schemas"]["Transformation"];

export { TransformationSchema }

export declare type Transition = components["schemas"]["Transition"];

export { TransitionSchema }

export declare type Tween = components["schemas"]["Tween"];

export { tweenSchema as KeyframeSchema }
export { tweenSchema as TweenSchema }

/**
 * Controller for managing UI elements (toolbars, utilities) separately from Canvas.
 *
 * This enables:
 * - Pure preview mode (Canvas without UI)
 * - Custom toolbar registration
 * - Optional UI element loading
 *
 * @example
 * ```typescript
 * // Standard setup with all toolbars
 * const ui = UIController.create(edit, canvas, { mergeFields: true });
 *
 * // Minimal setup for custom toolbars
 * const ui = UIController.minimal(edit, canvas);
 * ui.registerToolbar('text', new CustomTextToolbar(edit));
 * ```
 */
export declare class UIController {
    private toolbars;
    private utilities;
    private canvasOverlays;
    private container;
    private canvas;
    private isDisposed;
    /** Whether merge fields UI is enabled (Variables panel, autocomplete) */
    readonly mergeFieldsEnabled: boolean;
    /** Whether selection handles are enabled for drag/resize/rotate */
    private readonly selectionHandlesEnabled;
    /** Maximum total pixels for resolution picker (undefined = unlimited) */
    private readonly maxPixels?;
    private clipToolbar;
    private toolbarMode;
    private currentAssetType;
    private currentTrackIndex;
    private currentClipIndex;
    private onKeyDownBound;
    private modeButtonHandlers;
    private buttonRegistry;
    private buttonEvents;
    private assetToolbar;
    private canvasToolbar;
    /**
     * Create a UIController with all standard toolbars pre-registered.
     * This is the recommended way to create a UIController for most use cases.
     *
     * @param edit - The Edit instance
     * @param canvas - The Canvas instance
     * @param options - Configuration options
     * @returns A fully configured UIController
     *
     * @example
     * ```typescript
     * const ui = UIController.create(edit, canvas, { mergeFields: true });
     * ui.registerButton({ id: "text", icon: "...", tooltip: "Add Text" });
     * ui.on("button:text", ({ position }) => { ... });
     * ```
     */
    static create(edit: Edit, canvas: Canvas, options?: UIControllerOptions): UIController;
    /**
     * Create a minimal UIController without pre-registered toolbars.
     * Use this when you want full control over which toolbars are registered.
     *
     * @param edit - The Edit instance
     * @param canvas - Optional Canvas instance
     * @returns A minimal UIController ready for custom configuration
     *
     * @example
     * ```typescript
     * const ui = UIController.minimal(edit, canvas);
     * ui.registerToolbar('text', new CustomTextToolbar(edit));
     * ui.registerToolbar('video', new CustomVideoToolbar(edit));
     * ```
     */
    static minimal(edit: Edit, canvas?: Canvas): UIController;
    /**
     * Private constructor - use UIController.create() or UIController.minimal() instead.
     */
    private constructor();
    private readonly edit;
    /**
     * Subscribe to edit events. Called by factory methods.
     */
    private subscribeToEvents;
    /**
     * Register all standard toolbars. Called by create() factory.
     */
    private registerStandardToolbars;
    /**
     * Register a toolbar for one or more asset types.
     * When a clip of that type is selected, the toolbar will be shown.
     *
     * @param assetTypes - Single type or array of types (e.g., 'text', ['video', 'image'])
     * @param toolbar - The toolbar component implementing UIRegistration
     * @returns this (for chaining)
     */
    registerToolbar(assetTypes: string | string[], toolbar: UIRegistration): this;
    /**
     * Register a utility component (Inspector, TranscriptionIndicator, etc.).
     * Utilities are mounted but not tied to clip selection.
     *
     * @param component - The utility component implementing UIRegistration
     * @returns this (for chaining)
     */
    registerUtility(component: UIRegistration): this;
    /**
     * Register a PixiJS-based canvas overlay (SelectionHandles, AlignmentGuides, etc.).
     * Overlays render on the canvas and receive update/draw calls each frame.
     *
     * @param overlay - The overlay component implementing CanvasOverlayRegistration
     * @returns this (for chaining)
     */
    registerCanvasOverlay(overlay: CanvasOverlayRegistration): this;
    /**
     * Mount all registered UI components to a container.
     * Should be called after all registrations are complete.
     *
     * @param container - The DOM element to mount UI components into
     */
    mount(container: HTMLElement): void;
    /**
     * Update all canvas overlays. Called by Canvas each tick.
     */
    updateOverlays(deltaTime: number, elapsed: number): void;
    /**
     * Update toolbar positions to be adjacent to the canvas content.
     * Uses position: fixed with screen coordinates for complete independence from parent CSS.
     * Called by Canvas after zoom, pan, or resize operations.
     */
    updateToolbarPositions(): void;
    /**
     * Dispose all registered UI components and clean up event listeners.
     */
    dispose(): void;
    /**
     * Get the toolbar registered for a specific asset type.
     */
    getToolbar(assetType: string): UIRegistration | undefined;
    /**
     * Check if a toolbar is registered for an asset type.
     */
    hasToolbar(assetType: string): boolean;
    /**
     * Register a toolbar button.
     * Buttons appear in the left toolbar and trigger events when clicked.
     *
     * @example
     * ```typescript
     * ui.registerButton({
     *   id: "text",
     *   icon: `<svg>...</svg>`,
     *   tooltip: "Add Text"
     * });
     *
     * ui.on("button:text", ({ position }) => {
     *   edit.addTrack(0, { clips: [{ ... }] });
     * });
     * ```
     *
     * @param config - Button configuration
     * @returns this (for chaining)
     */
    registerButton(config: ToolbarButtonConfig): this;
    /**
     * Unregister a toolbar button.
     *
     * @param id - Button ID to remove
     * @returns this (for chaining)
     */
    unregisterButton(id: string): this;
    /**
     * Get all registered toolbar buttons.
     */
    getButtons(): ToolbarButtonConfig[];
    /**
     * Subscribe to a button click event.
     *
     * @example
     * ```typescript
     * ui.on("button:text", ({ position, selectedClip }) => {
     *   console.log("Text button clicked at position:", position);
     * });
     * ```
     *
     * @param event - Event name in format `button:${buttonId}`
     * @param handler - Callback function
     * @returns Unsubscribe function
     */
    on<K extends `button:${string}`>(event: K, handler: (payload: ButtonClickPayload) => void): () => void;
    /**
     * Unsubscribe from a button click event.
     */
    off<K extends `button:${string}`>(event: K, handler: (payload: ButtonClickPayload) => void): void;
    /**
     * Set the toolbar mode and update visibility accordingly.
     * @param mode - "asset" shows asset-specific toolbar, "clip" shows ClipToolbar
     */
    private setToolbarMode;
    /**
     * Hide all registered toolbars.
     */
    private hideAllToolbars;
    /**
     * Update toolbar visibility based on current mode and selection.
     */
    private updateToolbarVisibility;
    /**
     * Check if any toolbar is currently visible (clip is selected).
     */
    private hasVisibleToolbar;
    /**
     * Check if an input element is focused (to avoid intercepting typing).
     */
    private isInputFocused;
    /**
     * Handle backtick (`) key to toggle between asset and clip mode.
     * Backtick is the video editor convention for mode/view toggling (Premiere, After Effects).
     */
    private onKeyDown;
    private onClipSelected;
    private onSelectionCleared;
}

/**
 * Options for UIController configuration.
 */
export declare interface UIControllerOptions {
    /** Enable selection handles for drag/resize/rotate interactions. Default: true */
    selectionHandles?: boolean;
    /** Enable merge fields UI (Variables panel, autocomplete). Default: false (vanilla video editor) */
    mergeFields?: boolean;
    /** Maximum total pixels allowed for resolution picker input. Omit for unlimited. */
    maxPixels?: number;
}

/**
 * Interface for HTML/DOM UI components that can be registered with UIController.
 * Toolbars, inspectors, and other UI elements should implement this interface.
 */
export declare interface UIRegistration {
    /** Mount the component to a parent container */
    mount(container: HTMLElement): void;
    /** Show the component for a specific clip (optional - utilities may not need this) */
    show?(trackIndex: number, clipIndex: number): void;
    /** Hide the component */
    hide?(): void;
    /** Clean up resources */
    dispose(): void;
}

export declare const VERSION: string;

export declare type VideoAsset = components["schemas"]["VideoAsset"];

export { VideoAssetSchema }

export declare class VideoExporter {
    private readonly edit;
    private readonly canvas;
    private readonly app;
    private isExporting;
    private videoProcessor;
    private audioProcessor;
    private progressUI;
    private exportCommand;
    constructor(edit: Edit, canvas: Canvas);
    export(filename?: string, fps?: number): Promise<void>;
    private processFrames;
    private handleKeyDown;
    dispose(): void;
    private prepareConfig;
    private saveEditState;
    private restoreEditState;
    private isVideoPlayer;
    private waitForPendingTranscriptions;
}

export { }
