import { SerializedNodes, UserComponent } from '@ws-ui/craftjs-core';
import { FC } from 'react';
import { WebformState } from './webform-state';
import { TDatasourceTheme } from '../datasource-themes';
export type IWebFormMetadata = Partial<{
    v: string;
    datasources: datasources.ICreateDataSource[];
    states: WebformState[];
    defaultStates: string[];
    currentState?: string;
    styles: IWebFormStyleClass[];
    title: string;
}>;
interface IPage {
    name: string;
    id: string;
    components: SerializedNodes;
}
export interface IWebFormContent {
    components?: SerializedNodes;
    metadata?: IWebFormMetadata;
    pages?: IPage[];
}
export declare enum EWebFormStyleClassScope {
    LOCAL = "local",
    SHARED = "shared",
    THEME = "theme"
}
export interface IWebFormStyleClass {
    /**
     * Unique id for the class.
     */
    id: string;
    /**
     * Scope of the classe.
     * values: 'shared', 'theme', 'local'
     */
    scope: EWebFormStyleClassScope;
    /**
     * Name of the class
     */
    name: string;
    /**
     * content of the class.
     */
    content: string;
    /**
     * an id of the parent class. should be null if the class is not associated with any other class.
     */
    parentId: string | null;
    /**
     * An object of linked style classes.
     *
     * onDrop of the class on a component, if the component has a linked node,
     * it will be assigned a style class if it's type is declared in this object.
     *
     * key: represents the type of component to be associated with style class on drop.
     *
     * value: id of the associated style class.
     */
    children?: {
        [key: string]: string;
    };
    /**
     * defines the origin of the style class from which it was exported.
     */
    origin?: string;
}
export interface IComponentTemplate {
    rootNodeId: string;
    id: string;
    name?: string;
    nodes: SerializedNodes;
    icon?: string;
    styles?: IWebFormStyleClass[];
}
export interface IControlledFieldProps<T> {
    ref: any;
    label: string;
    isSmall: boolean;
    value: T;
    defaultValue: T;
    onChange: (value: T, error?: string) => any;
    onReset?: () => void;
}
export declare enum ESetting {
    GROUP = "group",
    TEXT_FIELD = "textfield",
    COLOR_PICKER = "colorpicker",
    LAYOUT = "layout",
    RADIOGROUP = "radiogroup",
    SELECT = "select",
    BORDERS = "borders",
    BORDER_RADIUS = "borderRadius",
    DIMENSIONS = "dimensions",
    COMBOBOX = "combobox",
    UNITFIELD = "unitfield",
    DATAGRID = "datagrid",
    CHECKBOX = "checkbox",
    NUMBER_FIELD = "number",
    FORMAT_FIELD = "format",
    DISPLAY = "display",
    BOXSHADOW = "boxshadow",
    CSSCLASS_SELECTOR = "cssClassSelector",
    CUSTOM_STYLE_PROPS_SELECTOR = "customStylePropertiesSelector",
    ICON_PICKER = "iconPicker",
    ASYNC_SELECT = "asyncSelect",
    DS_AUTO_SUGGEST = "dsAutoSuggest",
    POSITION = "position",
    BACKGROUND = "background",
    SELECTBOXLENGTH = "selectBoxLength",
    I18NFIELD = "i18nField",
    DATE_INTERVALS = "dateIntervals",
    SEARCH_MODE = "searchMode"
}
export interface I4DComponentInfo {
    displayName: string;
    icon?: FC<any>;
    exposed?: boolean;
    isCanvas?: boolean;
    events: webforms.EventMeta[];
    iconName?: string;
    tipKey?: string;
    kind?: string;
    datasources?: unknown;
    settings?: unknown;
    sanityCheck?: {
        keys: {
            name: string | Array<{
                name: string;
                isDatasource: boolean;
            }>;
            isDatasource: boolean;
            require: boolean;
        }[];
    };
    category?: string;
}
export type T4DComponent<T extends webforms.ComponentProps<any> = webforms.ComponentProps> = UserComponent<T> & {
    info: I4DComponentInfo;
};
export type TInspectorType = 'css' | 'datasource';
export interface IDatasourcedata {
    dataclass?: string;
    datasource?: string;
    namespace?: string;
    parent?: string;
    name: string;
}
export interface IInspector<T = string> {
    active: boolean;
    data?: T;
}
export type IInspectorState = {
    css: IInspector;
    datasource: IInspector<IDatasourcedata>;
};
export interface ITemplatedGroupItem {
    name: string;
    banner: string;
    description: string;
    data: IComponentTemplate;
}
export interface ITemplatedGroup {
    group: string;
    icon: string;
    tags: string[];
    link: string;
    components: ITemplatedGroupItem[];
}
export type ITemplateList = Record<string, {
    hide: boolean;
}>;
export interface ITemplatedComponent {
    selectedGroup: string;
    data: ITemplatedGroup[];
}
export interface IWebformEditorState {
    inspector: IInspectorState;
    components: IComponentTemplate[];
    templates: ITemplatedComponent;
    datasources: {
        theme: TDatasourceTheme;
    };
    flags: {
        [key: string]: any;
    };
    i18n: {
        current: string;
    };
}
export type TDatasourcesFilter = (datasources.ICreateDataSource['type'] | datasources.ICreateDataSourceScalar['dataType'] | 'objectFromArray')[];
export type TDatasourcesNotIn = {
    id: string;
    namespace?: string;
}[];
export type ISharedDatasourcesState = {
    state: 'loading' | 'loaded' | 'error';
    sources: {
        [key: string]: datasources.ICreateDataSource[];
    };
    error?: string;
};
export declare enum ETooltipBehavior {
    SHOW_AFTER_TIMEOUT = "show_after_timeout",
    HIDE_AFTER_TIMEOUT = "hide_after_timeout"
}
export declare enum EDisplayMode {
    AIRY = "airy",
    COMPACT = "neutral"
}
export declare enum ECustomStylePropsViewMode {
    GRID = "grid",
    COMPACT = "compact"
}
export {};
