import HaikuComponent from '../HaikuComponent';
import { CurveDefinition } from './Curve';
import { DomRect, LayoutSpec } from './Layout';
export declare type PrimitiveType = string | number | object | boolean | null;
/**
 * Allowed state types, including function return type for timeline functions,
 * state getter and setter.
 */
export declare type BytecodeStateType = PrimitiveType | PrimitiveType[];
/**
 * `BytecodeSummonable` defines functions that can be called on timeline
 * property value
 */
export declare type BytecodeSummonable = ((param: any) => BytecodeStateType);
/**
 * All possible types for timeline property value
 */
export declare type BytecodeInjectable = BytecodeStateType | BytecodeSummonable;
/**
 * Haiku bytecode element tree. eg. <div><svg>...</svg></div>.
 * `source` and `identifier` are rarely used.
 */
export interface BytecodeNode {
    elementName: string;
    attributes: {
        [attribute: string]: any;
        style?: {
            [key in string]: PrimitiveType;
        };
        /**
         * @deprecated
         */
        source?: string;
        identifier?: string;
    };
    layout?: LayoutSpec;
    /**
     * @deprecated
     */
    rect?: DomRect;
    children: (BytecodeNode | string)[];
}
/**
 * Haiku bytecode state.
 */
export interface BytecodeState {
    value: BytecodeStateType;
    type?: string;
    access?: string;
    edited?: boolean;
    getter?: () => BytecodeStateType;
    setter?: (param: BytecodeStateType) => void;
}
/**
 * Haiku bytecode state list.
 */
export interface BytecodeStates {
    [stateName: string]: BytecodeState;
}
/**
 * Haiku bytecode function `handler` for an specific `eventSelectors`.
 */
export interface BytecodeEventHandler {
    [eventSelectors: string]: {
        handler: (target?: any, event?: any) => void;
    };
}
/**
 * Tuples of `elementName` and `BytecodeEventHandler`.
 */
export interface BytecodeEventHandlers {
    [elementName: string]: BytecodeEventHandler;
}
/**
 * Value of an element property in a given frame.
 */
export interface BytecodeTimelineValue {
    value: BytecodeInjectable;
    edited?: boolean;
    curve?: CurveDefinition;
}
/**
 * Map `frameNum` to a to a `BytecodeTimelineValue`.
 */
export interface BytecodeTimelineProperty {
    [frameNum: string]: BytecodeTimelineValue;
}
/**
 * Map `propertyName` to a `BytecodeTimelineProperty`
 */
export interface BytecodeTimelineProperties {
    [propertyName: string]: BytecodeTimelineProperty;
}
/**
 * Tuples of `haikuId` and `BytecodeTimelineProperties`.
 */
export interface BytecodeTimeline {
    [haikuId: string]: BytecodeTimelineProperties;
}
/**
 * Tuples of `timelineName` and `BytecodeTimeline`.
 */
export interface BytecodeTimelines {
    [timelineId: string]: BytecodeTimeline;
}
/**
 * Haiku bytecode metadata.
 */
export interface BytecodeMetadata {
    folder?: string;
    uuid: string;
    /**
     * @deprecated as of 3.2.20
     */
    player?: string;
    type: string;
    name?: string;
    relpath: string;
    core?: string;
    version?: string;
    username?: string;
    organization?: string;
    project?: string;
    branch?: string;
    title?: string;
}
export declare type ComponentEventHandler = (component: HaikuComponent) => void;
/**
 * Bytecode options.
 */
export interface BytecodeOptions {
    seed?: string;
    timestamp?: number;
    automount?: boolean;
    autoplay?: boolean;
    hotEditingMode?: boolean;
    forceFlush?: boolean;
    freeze?: boolean;
    loop?: boolean;
    frame?: (() => void);
    clock?: object;
    sizing?: string;
    alwaysComputeSizing?: boolean;
    preserve3d?: string;
    contextMenu?: string;
    position?: string;
    overflowX?: string;
    overflowY?: string;
    overflow?: string;
    mixpanel?: string;
    useWebkitPrefix?: boolean;
    interactionMode?: number;
    referenceUniqueness?: string;
    states?: object;
    eventHandlers?: object;
    timelines?: object;
    vanities?: object;
    children?: PrimitiveType[];
    placeholder?: object;
    onHaikuComponentWillInitialize?: ComponentEventHandler;
    onHaikuComponentDidInitialize?: ComponentEventHandler;
    onHaikuComponentDidMount?: ComponentEventHandler;
    onHaikuComponentWillUnmount?: ComponentEventHandler;
}
/**
 * Bytecode definition. Properties are *rarely* used.
 */
export interface HaikuBytecode {
    template: BytecodeNode | string;
    states?: BytecodeStates;
    eventHandlers?: BytecodeEventHandlers;
    timelines: BytecodeTimelines;
    metadata?: BytecodeMetadata;
    /**
     * @deprecated as of 3.2.20
     */
    properties?: any[];
    options?: BytecodeOptions;
}
