/**
 * SmartCanvas API
 *
 * Entry point for the SmartCanvas SDK. Creates and manages the canvas element,
 * handles configuration, and coordinates between the ActionEngine and UI.
 */
import type { ExperimentClient } from './experiments/types';
import type { OverlayRecipeFetcher } from './overlays/fetcher';
import type { ActionHandler, AppearanceConfig, RenderProps } from './render/types';
import type { SmartCanvasRuntime } from './runtime';
import { type SmartCanvasElement } from './SmartCanvasElement';
import type { TelemetryClient } from './telemetry/types';
import type { CanvasThemeConfig } from './theme';
import type { CanvasConfigFetcher, CanvasConfigResponse } from './types';
export interface SmartCanvasIntegrations {
    experiments?: ExperimentClient;
    telemetry?: TelemetryClient;
}
export interface SmartCanvasConfig {
    target?: HTMLElement;
    defaultOpen?: boolean;
    tokens?: Record<string, string>;
    fetcher?: CanvasConfigFetcher;
    configUri?: string;
    configUriFeatureKey?: string;
    fetchCredentials?: RequestCredentials;
    overlayFetcher?: OverlayRecipeFetcher;
    overlayConfigUri?: string;
    overlayConfigFeatureKey?: string;
    overlayFetchCredentials?: RequestCredentials;
    pollIntervalMs?: number;
    integrations?: SmartCanvasIntegrations;
    antiFlicker?: boolean | {
        timeout?: number;
        className?: string;
    };
    editorUrl?: string;
    /**
     * v2 Runtime instance.
     * Required for action execution. If not provided, actions will not be applied.
     */
    runtime?: SmartCanvasRuntime;
    appearance?: AppearanceConfig;
    renderProps?: RenderProps;
    actionHandlers?: ActionHandler;
    /** Workspace-level theme for 3-layer inheritance (defaults → workspace → config) */
    workspaceTheme?: CanvasThemeConfig;
}
/**
 * Handle for interacting with a SmartCanvas instance.
 */
export interface SmartCanvasHandle {
    el: SmartCanvasElement;
    open(): void;
    close(): void;
    destroy(): void;
    setTokens(tokens: Record<string, string>): void;
    /**
     * Get the current config.
     */
    getConfig(): Promise<CanvasConfigResponse>;
    /**
     * Enable or disable the canvas.
     * When disabled, all actions are reverted.
     */
    setEnabled(enabled: boolean): Promise<void>;
    setOverrideFetcher(fetcher: CanvasConfigFetcher): void;
    registerTelemetryProperties(properties: Record<string, unknown>): void;
    getSessionId(): string | undefined;
    startSessionRecording(): void;
    /** Track a custom event. Returns true if telemetry is available and event was sent. */
    track(eventName: string, properties?: Record<string, unknown>): boolean;
    /**
     * v2 Runtime instance for context, events, state, and decisions.
     */
    runtime?: SmartCanvasRuntime;
}
export declare const createSmartCanvas: (config?: SmartCanvasConfig) => Promise<SmartCanvasHandle>;
declare global {
    interface Window {
        SmartCanvas?: {
            create(config?: SmartCanvasConfig): Promise<SmartCanvasHandle>;
        };
    }
}
export { getAntiFlickerSnippet } from './antiFlicker';
