import { Dimension } from './Dimension.js';
import { EventDefinitionLoose } from './event.js';
import { Margin } from './Margin.js';
import { Padding } from './Padding.js';
import { DynamicPath6, EntityWithBindings6 } from './shared.js';
export interface WidgetProps4and5 {
    type: string;
    widgetId: string;
    children?: WidgetProps4and5[];
    leftColumn?: number;
    rightColumn?: number;
    topRow: number;
    bottomRow: number;
    snapColumns?: number;
    snapRows?: number;
    minHeight?: number;
    [key: string]: unknown;
}
interface WidgetRowCols6 {
    leftColumn?: number;
    rightColumn?: number;
    topRow: number;
    bottomRow: number;
    snapColumns?: number;
    snapRows?: number;
    minHeight?: number;
}
export interface WidgetProps6 extends WidgetRowCols6, EntityWithBindings6 {
    type: string;
    widgetId: string;
    widgetName: string;
    parentId?: string;
    children?: WidgetProps6[];
    detachFromLayout?: boolean;
    [key: string]: unknown;
    noContainerOffset?: boolean;
    noPad?: boolean;
    containerStyle?: 'none' | 'card' | string;
}
type GridLayoutProps = {
    gridColumns: number;
};
export type WidgetPosition = {
    left: Dimension<'gridUnit'>;
    top: Dimension<'gridUnit'>;
    width: Dimension<'gridUnit' | 'fitContent' | 'fillParent' | 'px'>;
    height: Dimension<'gridUnit' | 'fitContent' | 'fillParent' | 'px'>;
    minHeight?: Dimension<'gridUnit' | 'px'>;
    maxHeight?: Dimension<'gridUnit' | 'px'>;
    minWidth?: Dimension<'px'>;
    maxWidth?: Dimension<'px'>;
    padding?: Padding;
    margin?: Margin;
} & Partial<GridLayoutProps>;
type WidgetVStackProperties = {
    spacing?: Dimension<'gridUnit' | 'px'>;
};
export type WidgetProps7 = EntityWithBindings6 & WidgetPosition & WidgetVStackProperties & {
    type: string;
    widgetId: string;
    widgetName: string;
    parentId?: string;
    children?: WidgetProps7[];
    [key: string]: unknown;
};
export type WidgetProps8 = WidgetProps7;
export declare enum ApiResponseType {
    SYNC = "SYNC",
    STREAM = "STREAM"
}
export interface ApiInfo6 extends EntityWithBindings6 {
    id: string;
    onSuccess?: unknown[];
    onError?: unknown[];
    onCancel?: unknown[];
    onMessage?: unknown[];
    responseType?: ApiResponseType;
}
export interface PageDSL4and5 extends WidgetProps4and5 {
    version: 4 | 5;
}
export type AppTimer6 = {
    id: string;
    name: string;
    startOnPageLoad: boolean;
    intervalMs: number;
    steps: unknown[];
    createdAt: number;
    dynamicTriggerPathList?: DynamicPath6[];
};
export declare enum AppStateVarPersistence6 {
    TEMPORARY = "Temporary",
    LOCAL_STORAGE = "Local Storage"
}
export type AppStateVar6 = {
    id: string;
    name: string;
    defaultValue: string;
    createdAt: number;
    persistance: AppStateVarPersistence6;
} & EntityWithBindings6;
export type CodeModeAppStateVar = {
    id: string;
    name: string;
    defaultValue: string;
    createdAt: number;
    persistence: AppStateVarPersistence6;
} & EntityWithBindings6;
export interface CachedData6 {
    apiNames?: string[];
    apiDeps?: Record<string, string[]>;
    pageLoadActions?: {
        apiNames: string[];
        apiDeps: Record<string, string[]>;
    };
}
export type EmbedProperty8 = {
    id: string;
    name: string;
    defaultValue: string;
    createdAt: number;
    onChange?: unknown[];
} & EntityWithBindings6;
export interface PageDSL6 extends WidgetProps6 {
    version: 6;
    timers?: {
        timerMap: Record<AppTimer6['id'], AppTimer6>;
    };
    stateVars?: {
        stateVarMap: Record<AppStateVar6['id'], AppStateVar6>;
    };
    apis?: {
        apiMap?: {
            [key: string]: ApiInfo6;
        };
    };
    cachedData?: CachedData6;
}
export type PageDSL7 = WidgetProps7 & {
    version: 7;
    timers: {
        timerMap: Record<AppTimer6['id'], AppTimer6>;
    };
    stateVars: {
        stateVarMap: Record<AppStateVar6['id'], AppStateVar6>;
    };
    apis: {
        apiMap: Record<ApiInfo6['id'], ApiInfo6>;
    };
    cachedData?: CachedData6;
};
export type PageDSL8 = WidgetProps8 & {
    version: 8;
    timers: {
        timerMap: Record<AppTimer6['id'], AppTimer6>;
    };
    stateVars: {
        stateVarMap: Record<AppStateVar6['id'], AppStateVar6>;
    };
    apis: {
        apiMap: Record<ApiInfo6['id'], ApiInfo6>;
    };
    cachedData?: CachedData6;
    embedding?: {
        propertyMap: Record<EmbedProperty8['id'], EmbedProperty8>;
        triggerableEvents?: Record<string, boolean>;
        emittedEvents?: Record<string, boolean>;
    };
    minWidth?: Dimension<'px'>;
    maxWidth?: Dimension<'px'>;
    onPageLoad?: unknown[];
    layoutVersion?: number;
    events?: {
        eventMap: Record<string, EventDefinitionLoose>;
    };
};
export type WidgetProps = WidgetProps8;
export type AnyPageDSL = PageDSL4and5 | PageDSL6 | PageDSL7 | PageDSL8;
export type PageDSLWithBackwardsCompatibility = AnyPageDSL;
export type PageDSL = PageDSL8;
export interface Layout<T = PageDSL> {
    id: string;
    dsl: T;
    updated: string;
    actionUpdates: Record<string, unknown>[];
    layoutOnLoadActions: Record<string, unknown>[];
    messages: Record<string, unknown>[];
    userPermissions: Record<string, unknown>[];
}
export interface ILayoutDto {
    id: string;
    dsl: PageDSL;
    actionUpdates: Record<string, unknown>[];
    layoutOnLoadActions: Record<string, unknown>[];
    messages: Record<string, unknown>[];
    userPermissions: Record<string, unknown>[];
    updated: Date;
}
export interface ILayout<T = PageDSL> {
    id: string;
    dsl: T;
}
export {};
//# sourceMappingURL=layout.d.ts.map