import type { IconName } from "@subframe/core";
import { KeysOfUnion, LookupByDiscriminate, RequiredKeys } from "helpers/ts-type-helpers";
/**
 * Nominal Id String Types
 */
export type NodeId = string;
export type EnumOptionId = string;
export type IconAssetId = string;
export type FontAssetId = string;
export type ImageAssetId = string;
export type SelectorId = string;
export type AllNominalIds = NodeId | EnumOptionId | IconAssetId | FontAssetId | ImageAssetId | SelectorId;
/**
 * Assets
 */
export interface BaseAsset {
    category: "asset";
    name: string;
}
export interface IconAsset extends BaseAsset {
    type: "icon";
    id: IconAssetId;
    value: Exclude<IconName, null>;
}
export interface FontAsset extends BaseAsset {
    type: "font";
    id: FontAssetId;
    name: string;
}
export interface ImageAsset extends BaseAsset {
    type: "image";
    id: ImageAssetId;
    value: string;
}
export type Asset = IconAsset | FontAsset | ImageAsset;
/**
 * Values
 */
interface BaseValue {
    category: "value";
}
export interface TextValue extends BaseValue {
    type: "text";
    value: string;
}
export interface NumberValue extends BaseValue {
    type: "number";
    value: number;
}
export interface BooleanValue extends BaseValue {
    type: "boolean";
    value: boolean;
}
export interface EnumValue extends BaseValue {
    type: "enum";
    value: EnumOptionId;
}
export interface IconValue extends BaseValue {
    type: "icon";
    value: IconAssetId | null;
}
export interface ImageValue extends BaseValue {
    type: "image";
    value: ImageAssetId | null;
}
type ReactNodeLike = any | undefined | null;
export interface SlotValue extends BaseValue {
    type: "slot";
    value: {
        node: SlotInstancePrimitive;
        componentId: string;
        children: ReactNodeLike;
    } | null;
}
export interface ColorValue extends BaseValue {
    type: "color";
    value: {
        r: number;
        g: number;
        b: number;
        a: number;
    };
}
export interface FontValue extends BaseValue {
    type: "font";
    value: {
        fontFamilyAssetId: FontAssetId;
        fontSize: number;
        lineHeight: number;
        fontWeight: FontWeightType;
    };
}
export interface CornerValue extends BaseValue {
    type: "corner";
    value: {
        radius: number;
    };
}
export declare const BORDER_STYLE_TYPE_VALUES: readonly ["solid", "dashed"];
export type BorderStyleType = (typeof BORDER_STYLE_TYPE_VALUES)[number];
export interface BorderValue extends BaseValue {
    type: "border";
    value: {
        borderStyle: BorderStyleType;
        borderColor: ColorValueOrAlias;
        borderSize: number;
    };
}
export interface ShadowLayer {
    x: number;
    y: number;
    blur: number;
    spread: number;
    color: ColorValue;
}
export interface ShadowValue extends BaseValue {
    type: "shadow";
    value: ShadowLayer[];
}
export interface SpacingValue extends BaseValue {
    type: "spacing";
    value: {
        amount: number;
    };
}
export type Value = TextValue | NumberValue | BooleanValue | EnumValue | IconValue | ImageValue | SlotValue | ColorValue | FontValue | CornerValue | BorderValue | SpacingValue;
/**
 * Tokens and Token Aliases
 */
interface BaseToken {
    category: "token";
    id: string;
    name: string;
}
interface BaseTokenAlias {
    category: "token-alias";
    tokenId: string;
}
export interface ColorTokenAlias extends BaseTokenAlias {
    type: "color";
}
export type ColorValueOrAlias = ColorValue | ColorTokenAlias;
export interface ColorTokenWithValue extends BaseToken {
    type: "color";
    value: ColorValue;
    valueDark?: ColorValue | ColorTokenAlias;
}
export interface ColorTokenWithAlias extends BaseToken {
    type: "color";
    value: ColorTokenAlias;
    valueDark?: ColorValue | ColorTokenAlias;
}
export type ColorToken = ColorTokenWithValue | ColorTokenWithAlias;
export declare const FONT_WEIGHT_TYPE_VALUES: readonly [100, 200, 300, 400, 500, 600, 700, 800, 900];
export type FontWeightType = (typeof FONT_WEIGHT_TYPE_VALUES)[number];
export interface FontTokenAlias extends BaseTokenAlias {
    type: "font";
}
export type FontValueOrAlias = FontValue | FontTokenAlias;
export interface FontTokenWithValue extends BaseToken {
    type: "font";
    value: FontValue;
}
export interface FontTokenWithAlias extends BaseToken {
    type: "font";
    value: FontTokenAlias;
}
export type FontToken = FontTokenWithValue | FontTokenWithAlias;
export interface FontStyle {
    fontFamily: string;
    fontSize: number;
    lineHeight: number;
    fontWeight: FontWeightType;
}
export interface BorderTokenAlias extends BaseTokenAlias {
    type: "border";
}
export type BorderValueOrAlias = BorderValue | BorderTokenAlias;
export interface BorderTokenWithValue extends BaseToken {
    type: "border";
    value: BorderValue;
}
export interface BorderTokenWithAlias extends BaseToken {
    type: "border";
    value: BorderTokenAlias;
}
export type BorderToken = BorderTokenWithValue | BorderTokenWithAlias;
export interface CornerTokenAlias extends BaseTokenAlias {
    type: "corner";
}
export type CornerValueOrAlias = CornerValue | CornerTokenAlias;
export interface CornerTokenWithValue extends BaseToken {
    type: "corner";
    value: CornerValue;
}
export interface CornerTokenWithAlias extends BaseToken {
    type: "corner";
    value: CornerTokenAlias;
}
export type CornerToken = CornerTokenWithValue | CornerTokenWithAlias;
export interface ShadowTokenAlias extends BaseTokenAlias {
    type: "shadow";
}
export type ShadowValueOrAlias = ShadowValue | ShadowTokenAlias;
export interface ShadowTokenWithValue extends BaseToken {
    type: "shadow";
    value: ShadowValue;
}
export interface ShadowTokenWithAlias extends BaseToken {
    type: "shadow";
    value: ShadowTokenAlias;
}
export type ShadowToken = ShadowTokenWithValue | ShadowTokenWithAlias;
export interface SpacingToken extends BaseToken {
    type: "spacing";
    value: SpacingValue;
}
export type Token = FontToken | ColorToken | BorderToken | CornerToken | ShadowToken | SpacingToken;
export type TokenWithValue = Exclude<Token, {
    value: TokenAlias;
}>;
export type TokenWithAlias = Exclude<Token, TokenWithValue>;
export type TokenAlias = FontTokenAlias | ColorTokenAlias | BorderTokenAlias | CornerTokenAlias | ShadowTokenAlias;
export type TokenValueOrAlias = Token["value"];
/**
 * Color Palettes
 */
export interface ColorPalette {
    category: "color-palette";
    id: string;
    name: string;
    values: ColorTokenWithValue[];
}
/**
 * Styles
 */
export interface SpacingAbsolute {
    type: "absolute";
    value: number;
}
export interface SpacingFill {
    type: "fill";
}
export type SpacingData = SpacingAbsolute | SpacingFill;
export interface LayoutData {
    direction: "horizontal" | "vertical";
    spacing: SpacingData;
    wrap?: boolean;
}
export interface AlignmentData {
    mainAxis: AlignmentValue;
    crossAxis: AlignmentValue;
}
export type AlignmentValue = "start" | "center" | "end";
export type SizeValue = {
    type: "hug";
    maxSize?: number;
    minSize?: number;
} | {
    type: "fill";
    maxSize?: number;
    minSize?: number;
} | {
    type: "absolute";
    value: number;
};
export interface SizeData {
    height: SizeValue;
    width: SizeValue;
}
export interface SizeDataWithParentDirection extends SizeData {
    parentDirection: LayoutData["direction"];
}
export interface PaddingData {
    top: number;
    right: number;
    bottom: number;
    left: number;
}
export interface BackgroundData {
    color: ColorValueOrAlias;
}
export declare const BORDER_SIDES_TYPE_VALUES: readonly ["all", "top", "right", "bottom", "left"];
export type BorderSidesType = (typeof BORDER_SIDES_TYPE_VALUES)[number];
export interface BorderData {
    value: BorderValueOrAlias;
    sides: BorderSidesType;
}
export interface CornerData {
    value: CornerValueOrAlias;
}
export interface ShadowData {
    value: ShadowValueOrAlias;
}
/**
 * Overrides
 */
interface BaseOverride {
    type: NodeType["type"];
    category: "override";
}
export interface StackOverride extends BaseOverride {
    type: "stack";
    data: Partial<Pick<StackPrimitive, "alignment" | "className" | "padding" | "paddingType" | "background" | "border" | "corner" | "shadow" | "layout" | "isVisible" | "size">>;
}
export interface TextOverride extends BaseOverride {
    type: "text";
    data: Partial<Pick<TextPrimitive, "className" | "fontStyle" | "fontColor" | "isVisible" | "size" | "textStyle" | "textAlignment">>;
}
export interface IconOverride extends BaseOverride {
    type: "icon";
    data: Partial<Pick<IconPrimitive, "className" | "fontStyle" | "color" | "isVisible">>;
}
export interface LoaderOverride extends BaseOverride {
    type: "loader";
    data: Partial<Pick<LoaderPrimitive, "className" | "fontStyle" | "color" | "isVisible">>;
}
export interface TableOverride extends BaseOverride {
    type: "table";
    data: Partial<Pick<TableNode, "className" | "padding" | "background" | "border" | "corner" | "shadow" | "isVisible" | "size">>;
}
export interface TableHeadOverride extends BaseOverride {
    type: "table-head";
    data: Partial<Pick<TableHeadNode, "className" | "background" | "border" | "isVisible">>;
}
export interface TableBodyOverride extends BaseOverride {
    type: "table-body";
    data: Partial<Pick<TableBodyNode, "className" | "background" | "border" | "isVisible">>;
}
export interface TableRowOverride extends BaseOverride {
    type: "table-row";
    data: Partial<Pick<TableRowNode, "className" | "background" | "border" | "isVisible">>;
}
export interface InputOverride extends BaseOverride {
    type: "input";
    data: Partial<Pick<InputPrimitive, "className" | "padding" | "background" | "border" | "corner" | "shadow" | "fontStyle" | "fontColor" | "isVisible" | "size">>;
}
export interface TextareaOverride extends BaseOverride {
    type: "textarea";
    data: Partial<Pick<InputPrimitive, "className" | "padding" | "background" | "border" | "corner" | "shadow" | "fontStyle" | "fontColor" | "isVisible" | "size">>;
}
export interface ImageOverride extends BaseOverride {
    type: "image";
    data: Partial<Pick<ImagePrimitive, "size" | "className" | "isVisible">>;
}
export interface CustomOverride extends BaseOverride {
    type: "custom";
    data: Partial<Pick<CustomComponentInstance, "size" | "className" | "isVisible">>;
}
export interface AreaChartOverride extends BaseOverride {
    type: "area-chart";
    data: Partial<Pick<AreaChartNode, "size" | "className" | "isVisible">>;
}
export interface BarChartOverride extends BaseOverride {
    type: "bar-chart";
    data: Partial<Pick<BarChartNode, "size" | "className" | "isVisible">>;
}
export interface LineChartOverride extends BaseOverride {
    type: "line-chart";
    data: Partial<Pick<LineChartNode, "size" | "className" | "isVisible">>;
}
export interface PieChartOverride extends BaseOverride {
    type: "pie-chart";
    data: Partial<Pick<PieChartNode, "size" | "className" | "isVisible">>;
}
export type Override = StackOverride | TextOverride | IconOverride | InputOverride | TextareaOverride | ImageOverride | CustomOverride | LoaderOverride | TableOverride | TableHeadOverride | TableBodyOverride | TableRowOverride | AreaChartOverride | BarChartOverride | LineChartOverride | PieChartOverride;
export type OverrideType = Override["type"];
export type OverrideDataKey = KeysOfUnion<Override["data"]>;
export type OverrideLookupByType<T extends OverrideType> = LookupByDiscriminate<Override, "type", T>;
export type NodeTypeWithOverrides = Extract<NodeType, {
    type: Override["type"];
}>;
/**
 * Selectors
 */
export interface InteractionOverrides {
    default: OverridesNodeMap;
    hover?: OverridesNodeMap;
    active?: OverridesNodeMap;
    focusWithin?: OverridesNodeMap;
}
export type InteractionType = keyof InteractionOverrides;
export declare const INTERACTION_TYPES: ("default" | "hover" | "active" | "focusWithin")[];
export type OverridesNodeMap = {
    [nodeId: NodeId]: Override;
};
export interface Selector {
    id: SelectorId;
    category: "selector";
    instanceProps: InstancePropsOnlyVariantValues;
    overrides: InteractionOverrides;
}
export type SelectorsMap = {
    [selectorId: SelectorId]: Selector;
};
export interface AllSelectors {
    base: SelectorsMap;
    extra: SelectorsMap;
}
export interface Selectors {
    default: AllSelectors;
    mobile?: AllSelectors;
}
export type DeviceType = keyof Selectors;
export declare const DEVICE_TYPES: ("default" | "mobile")[];
export type SelectorData = {
    selectorId: SelectorId;
    interactionType: InteractionType;
    deviceType: DeviceType;
};
/**
 * Popovers
 */
export type PopoverPlacementDirection = "top-start" | "top" | "top-end" | "right-start" | "right" | "right-end" | "bottom-start" | "bottom" | "bottom-end" | "left-start" | "left" | "left-end";
export declare const POPOVER_PLACEMENT_DIRECTION_TYPES: ("top" | "right" | "bottom" | "left" | "top-start" | "top-end" | "right-start" | "right-end" | "bottom-start" | "bottom-end" | "left-start" | "left-end")[];
export interface PopoverPlacement {
    direction: PopoverPlacementDirection;
    offset: number;
}
interface BasePopover {
    id: string;
    category: "popover";
    popoverRootNodeId: NodeId;
    placement: PopoverPlacement;
}
export interface HoverPopover extends BasePopover {
    type: "hover";
}
export interface ClickPopover extends BasePopover {
    type: "click";
}
export interface DropdownPopover extends BasePopover {
    type: "dropdown";
}
export interface TooltipPopover extends BasePopover {
    type: "tooltip";
}
export type PopoverType = HoverPopover | ClickPopover | DropdownPopover | TooltipPopover;
/**
 * Nodes
 */
interface BaseNode {
    className?: string;
    category: "primitive";
    id: NodeId;
    name: string;
    parentId?: NodeId;
    isVisible: boolean;
}
export interface IconPrimitive extends BaseNode {
    type: "icon";
    icon: IconValueOrPropDefinitionInstance;
    color: ColorValueOrAlias;
    fontStyle: FontValueOrAlias;
    popover?: PopoverType;
}
export declare const CONTAINER_TYPE_VALUES: readonly ["navbar", "sidebar"];
export type ContainerType = (typeof CONTAINER_TYPE_VALUES)[number];
type ContainerPaddingType = {
    type: "container";
};
export type GridPaddingType = {
    type: "grid";
    columns: number[];
};
export interface GridPosition {
    row: number;
    rowSize: number;
    column: number;
    columnSize: number;
}
export type GridPositionMap = {
    [nodeId: NodeId]: GridPosition;
};
export interface TwelveColumnGridPaddingType {
    type: "twelve-column-grid";
    positions: GridPositionMap;
}
export type PaddingType = ContainerPaddingType | GridPaddingType | TwelveColumnGridPaddingType;
export declare const NUM_GRID_COLUMNS = 12;
export type OverflowType = "visible" | "hidden";
interface HasChildren {
    layout: LayoutData;
    alignment: AlignmentData;
    childrenIds: NodeId[];
}
export interface SlotData {
    propDefinitionId: string;
}
export interface StackPrimitive extends BaseNode, HasChildren {
    type: "stack";
    size: SizeData;
    padding: PaddingData;
    background: BackgroundData | null;
    border: BorderData | null;
    corner: CornerData | null;
    shadow: ShadowData | null;
    slotData: SlotData | null;
    containerType: ContainerType | null;
    paddingType: PaddingType | null;
    popover?: PopoverType;
    overflow: OverflowType;
}
export type NodeThatCanHaveSlots = Extract<NodeType, {
    slotData: SlotData | null;
}>;
export type NodeWithSlot = NodeThatCanHaveSlots & {
    slotData: SlotData;
};
export type StackAsPageSection = StackPrimitive & {
    paddingType: ContainerPaddingType | GridPaddingType;
};
export type StackAsGrid = StackPrimitive & {
    paddingType: GridPaddingType;
};
export type StackAsTwelveColumnGrid = StackPrimitive & {
    paddingType: TwelveColumnGridPaddingType;
};
export type TextWhitespaceWrapType = {
    type: "wrap";
    ellipsis: {
        numLines: number;
    } | null;
    breakWords: boolean;
    whitespace: "pre-wrap" | null;
};
export type TextWhitespaceNoWrapType = {
    type: "nowrap";
};
export type TextWhitespaceType = TextWhitespaceWrapType | TextWhitespaceNoWrapType;
export interface TextStyleType {
    underline: boolean;
}
export declare const TEXT_ALIGN_TYPES: readonly ["left", "right", "center"];
export type TextAlignType = (typeof TEXT_ALIGN_TYPES)[number];
export type TextAlignmentType = {
    align: TextAlignType;
};
export interface TextPrimitive extends BaseNode {
    type: "text";
    text: TextValueOrPropDefinitionInstance | NumberPropDefinitionInstance;
    size: SizeData;
    fontStyle: FontValueOrAlias;
    fontColor: ColorValueOrAlias;
    textStyle: TextStyleType;
    whitespace: TextWhitespaceType;
    textAlignment: TextAlignmentType;
    popover?: PopoverType;
}
export declare const IMAGE_DISPLAY_TYPES: readonly ["none", "avatar"];
export type ImageDisplayType = (typeof IMAGE_DISPLAY_TYPES)[number];
export interface ImagePrimitive extends BaseNode {
    type: "image";
    displayType: ImageDisplayType;
    src: ImageValueOrPropDefinitionInstance;
    size: SizeData;
    popover?: PopoverType;
}
export interface SlotInstancePrimitive extends BaseNode, HasChildren {
    type: "slot-instance";
    slotPropDefinitionId: string;
}
export interface PopoverRootNode extends BaseNode, HasChildren {
    type: "popover-root";
    anchorNodeId: NodeId;
}
export interface InputPrimitive extends BaseNode {
    type: "input";
    placeholder: TextValueOrPropDefinitionInstance;
    size: SizeData;
    fontStyle: FontValueOrAlias;
    fontColor: ColorValueOrAlias;
    padding: PaddingData;
    background: BackgroundData | null;
    border: BorderData | null;
    corner: CornerData | null;
    shadow: ShadowData | null;
    popover?: PopoverType;
}
export interface TextareaPrimitive extends BaseNode {
    type: "textarea";
    placeholder: TextValueOrPropDefinitionInstance;
    size: SizeData;
    fontStyle: FontValueOrAlias;
    fontColor: ColorValueOrAlias;
    padding: PaddingData;
    background: BackgroundData | null;
    border: BorderData | null;
    corner: CornerData | null;
    shadow: ShadowData | null;
    popover?: PopoverType;
}
export interface CustomComponentInstance extends BaseNode, HasChildren {
    type: "custom";
    componentId: string;
    instanceProps: InstanceProps;
    size: Partial<SizeData> | null;
    popover?: PopoverType;
}
export interface LoaderPrimitive extends BaseNode {
    type: "loader";
    color: ColorValueOrAlias;
    fontStyle: FontValueOrAlias;
    popover?: PopoverType;
}
export interface TableNode extends BaseNode, HasChildren {
    type: "table";
    size: SizeData;
    padding: PaddingData;
    background: BackgroundData | null;
    border: BorderData | null;
    corner: CornerData | null;
    shadow: ShadowData | null;
    slotData: SlotData | null;
}
export interface TableHeadNode extends BaseNode, HasChildren {
    type: "table-head";
    background: BackgroundData | null;
    border: BorderData | null;
    slotData: SlotData | null;
}
export interface TableBodyNode extends BaseNode, HasChildren {
    type: "table-body";
    background: BackgroundData | null;
    border: BorderData | null;
    slotData: SlotData | null;
}
export interface TableRowNode extends BaseNode, HasChildren {
    type: "table-row";
    background: BackgroundData | null;
    border: BorderData | null;
    slotData: SlotData | null;
}
export interface AreaChartNode extends BaseNode {
    type: "area-chart";
    size: SizeData;
}
export interface BarChartNode extends BaseNode {
    type: "bar-chart";
    size: SizeData;
}
export interface LineChartNode extends BaseNode {
    type: "line-chart";
    size: SizeData;
}
export interface PieChartNode extends BaseNode {
    type: "pie-chart";
    size: SizeData;
}
export type ChartNode = AreaChartNode | BarChartNode | LineChartNode | PieChartNode;
export type NodeType = IconPrimitive | StackPrimitive | TextPrimitive | ImagePrimitive | SlotInstancePrimitive | PopoverRootNode | InputPrimitive | TextareaPrimitive | CustomComponentInstance | LoaderPrimitive | TableNode | TableHeadNode | TableBodyNode | TableRowNode | AreaChartNode | BarChartNode | LineChartNode | PieChartNode;
export type NodeTypeWithChildren = Extract<NodeType, {
    childrenIds: NodeId[];
}>;
export type NodeTypeWithoutChildren = Exclude<NodeType, NodeTypeWithChildren>;
export type NodeTypeCanHavePopover = Extract<NodeType, {
    popover?: PopoverType;
}>;
export type NodeTypeCannotHavePopover = Exclude<NodeType, {
    popover?: PopoverType;
}>;
export type NodeTypeWithPopover = NodeType & {
    popover: PopoverType;
};
export type NodeTypeNotRenderable = SlotInstancePrimitive | PopoverRootNode;
export type NodeTypeRenderable = Exclude<NodeType, NodeTypeNotRenderable>;
/**
 * Custom Component Definitions
 */
export interface ComponentDisplayOptions {
    width: number | "auto";
    height: number | "auto";
    overflow?: boolean;
}
interface ComponentDefinitionBase {
    category: "component-definition";
    id: string;
    name: string;
    nodes: NodeMap;
    rootNodeId?: NodeId;
    defaultSelectorId: SelectorId;
    selectors: Selectors;
    propDefinitions: PropDefinition[];
    displayOptions: ComponentDisplayOptions;
    duplicatedFromComponentId?: string;
    isBuiltIn: boolean;
}
interface CompoundComponentDefinitionBase extends ComponentDefinitionBase {
    parentComponentId: string;
    nonDeletable?: boolean;
}
export interface CustomComponentDefinition extends ComponentDefinitionBase {
    type: "custom";
    pageOptions?: PageOptions;
    compoundComponentIds: string[];
}
/**
 * Compound Components
 */
export interface CustomCompoundComponentDefinition extends CompoundComponentDefinitionBase {
    type: "custom-compound";
}
/**
 * Pages
 */
export type PageLayout = {
    type: "default" | "dialog" | "drawer";
};
export interface PageOptions {
    layout: PageLayout | null;
}
export type CustomPageComponentDefinition = RequiredKeys<CustomComponentDefinition, "pageOptions">;
export interface PageLayoutComponentDefinition extends ComponentDefinitionBase {
    type: "page-layout";
    pageOptions: Omit<PageOptions, "layout"> & {
        layout: null;
    };
}
export type PageComponentDefinition = CustomPageComponentDefinition | PageLayoutComponentDefinition;
/**
 * Buttons
 */
export interface ButtonComponentDefinition extends ComponentDefinitionBase {
    type: "button";
}
/**
 * Tables
 */
export interface TableComponentDefinition extends ComponentDefinitionBase {
    type: "table";
    compoundComponents: {
        headerRowDefinitionId: string;
        headerCellDefinitionId: string;
        rowDefinitionId: string;
        cellDefinitionId: string;
    };
}
export interface TableHeaderRowComponentDefinition extends CompoundComponentDefinitionBase {
    type: "table-header-row";
}
export interface TableHeaderCellComponentDefinition extends CompoundComponentDefinitionBase {
    type: "table-header-cell";
}
export interface TableRowComponentDefinition extends CompoundComponentDefinitionBase {
    type: "table-row";
}
export interface TableCellComponentDefinition extends CompoundComponentDefinitionBase {
    type: "table-cell";
}
/**
 * Collapsible
 */
export interface CollapsibleComponentDefinition extends ComponentDefinitionBase {
    type: "collapsible";
    compoundComponents: {
        triggerDefinitionId: string;
        contentDefinitionId: string;
        chevronDefinitionId: string;
    };
}
export interface CollapsibleTriggerComponentDefinition extends CompoundComponentDefinitionBase {
    type: "collapsible-trigger";
}
export interface CollapsibleContentComponentDefinition extends CompoundComponentDefinitionBase {
    type: "collapsible-content";
}
export interface CollapsibleChevronComponentDefinition extends CompoundComponentDefinitionBase {
    type: "collapsible-chevron";
}
/**
 * Dropdown Menu
 */
export interface DropdownMenuComponentDefinition extends ComponentDefinitionBase {
    type: "dropdown-menu";
    compoundComponents: {
        itemDefinitionId: string;
    };
}
export interface DropdownMenuItemComponentDefinition extends CompoundComponentDefinitionBase {
    type: "dropdown-menu-item";
}
/**
 * Navbar
 */
export interface NavbarComponentDefinition extends ComponentDefinitionBase {
    type: "navbar";
    compoundComponents: {
        itemDefinitionId: string;
    };
}
export interface NavbarItemComponentDefinition extends CompoundComponentDefinitionBase {
    type: "navbar-item";
}
/**
 * Sidebar
 */
export interface SidebarComponentDefinition extends ComponentDefinitionBase {
    type: "sidebar";
    compoundComponents: {
        itemDefinitionId: string;
    };
}
export interface SidebarItemComponentDefinition extends CompoundComponentDefinitionBase {
    type: "sidebar-item";
}
/**
 * Switch / Toggles
 */
export interface SwitchComponentDefinition extends ComponentDefinitionBase {
    type: "switch";
    compoundComponents: {
        thumbDefinitionId: string;
    };
}
export interface SwitchThumbComponentDefinition extends CompoundComponentDefinitionBase {
    type: "switch-thumb";
}
/**
 * Radio Group
 */
export interface RadioGroupComponentDefinition extends ComponentDefinitionBase {
    type: "radio-group";
    compoundComponents: {
        itemDefinitionId: string;
    };
}
export interface RadioGroupItemComponentDefinition extends CompoundComponentDefinitionBase {
    type: "radio-group-item";
}
/**
 * Toggle Group
 */
export interface ToggleGroupComponentDefinition extends ComponentDefinitionBase {
    type: "toggle-group";
    compoundComponents: {
        itemDefinitionId: string;
    };
}
export interface ToggleGroupItemComponentDefinition extends CompoundComponentDefinitionBase {
    type: "toggle-group-item";
}
/**
 * Checkbox
 */
export interface CheckboxComponentDefinition extends ComponentDefinitionBase {
    type: "checkbox";
}
/**
 * Input Group
 */
export interface InputGroupComponentDefinition extends ComponentDefinitionBase {
    type: "input-group";
    compoundComponents: {
        inputDefinitionId: string;
    };
}
export interface TextareaGroupComponentDefinition extends ComponentDefinitionBase {
    type: "textarea-group";
    compoundComponents: {
        inputDefinitionId: string;
    };
}
export interface InputGroupInputComponentDefinition extends CompoundComponentDefinitionBase {
    type: "input-group-input";
}
export interface TextareaGroupInputComponentDefinition extends CompoundComponentDefinitionBase {
    type: "textarea-group-input";
}
/**
 * Copy to Clipboard
 */
export interface CopyToClipboardComponentDefinition extends ComponentDefinitionBase {
    type: "copy-to-clipboard";
}
/**
 * Slider
 */
export interface SliderComponentDefinition extends ComponentDefinitionBase {
    type: "slider";
    compoundComponents: {
        trackDefinitionId: string;
        rangeDefintionId: string;
        thumbDefinitionId: string;
    };
}
export interface SliderTrackComponentDefinition extends CompoundComponentDefinitionBase {
    type: "slider-track";
}
export interface SliderRangeComponentDefinition extends CompoundComponentDefinitionBase {
    type: "slider-range";
}
export interface SliderThumbComponentDefinition extends CompoundComponentDefinitionBase {
    type: "slider-thumb";
}
/**
 * Area chart
 */
export interface AreaChartComponentDefinition extends ComponentDefinitionBase {
    type: "area-chart";
    compoundComponents: object;
}
/**
 * Line chart
 */
export interface LineChartComponentDefinition extends ComponentDefinitionBase {
    type: "line-chart";
    compoundComponents: object;
}
/**
 * Bar chart
 */
export interface BarChartComponentDefinition extends ComponentDefinitionBase {
    type: "bar-chart";
    compoundComponents: object;
}
/**
 * Pie chart
 */
export interface PieChartComponentDefinition extends ComponentDefinitionBase {
    type: "pie-chart";
    compoundComponents: object;
}
/**
 * Select
 */
export interface SelectComponentDefinition extends ComponentDefinitionBase {
    type: "select";
    compoundComponents: {
        triggerDefinitionId: string;
        valueDefinitionId: string;
        contentDefinitionId: string;
        itemDefinitionId: string;
        itemTextDefinitionId: string;
    };
}
export interface SelectTriggerComponentDefinition extends CompoundComponentDefinitionBase {
    type: "select-trigger";
}
export interface SelectValueComponentDefinition extends CompoundComponentDefinitionBase {
    type: "select-value";
}
export interface SelectContentComponentDefinition extends CompoundComponentDefinitionBase {
    type: "select-content";
}
export interface SelectItemComponentDefinition extends CompoundComponentDefinitionBase {
    type: "select-item";
}
export interface SelectItemTextComponentDefinition extends CompoundComponentDefinitionBase {
    type: "select-item-text";
}
/**
 * Progress
 */
export interface ProgressComponentDefinition extends ComponentDefinitionBase {
    type: "progress";
    compoundComponents: {
        indicatorDefinitionId: string;
    };
}
export interface ProgressIndicatorComponentDefinition extends CompoundComponentDefinitionBase {
    type: "progress-indicator";
}
/**
 * Skeleton (loading)
 */
export interface SkeletonComponentDefinition extends ComponentDefinitionBase {
    type: "skeleton";
}
/**
 * Dialogs / Modals
 */
export interface DialogComponentDefinition extends ComponentDefinitionBase {
    type: "dialog";
    compoundComponents: {
        contentDefinitionId: string;
    };
}
export interface DialogContentComponentDefinition extends CompoundComponentDefinitionBase {
    type: "dialog-content";
}
/**
 * Fullscreen Dialogs / Modals
 */
export interface FullScreenDialogComponentDefinition extends ComponentDefinitionBase {
    type: "fullscreen-dialog";
}
/**
 * Drawers
 */
export interface DrawerComponentDefinition extends ComponentDefinitionBase {
    type: "drawer";
    compoundComponents: {
        contentDefinitionId: string;
    };
}
export interface DrawerContentComponentDefinition extends CompoundComponentDefinitionBase {
    type: "drawer-content";
}
export type ComponentDefinition = CustomComponentDefinition | CustomCompoundComponentDefinition | PageLayoutComponentDefinition | ButtonComponentDefinition | TableComponentDefinition | TableHeaderRowComponentDefinition | TableHeaderCellComponentDefinition | TableRowComponentDefinition | TableCellComponentDefinition | CollapsibleComponentDefinition | CollapsibleTriggerComponentDefinition | CollapsibleContentComponentDefinition | CollapsibleChevronComponentDefinition | DropdownMenuComponentDefinition | DropdownMenuItemComponentDefinition | NavbarComponentDefinition | NavbarItemComponentDefinition | SidebarComponentDefinition | SidebarItemComponentDefinition | SwitchComponentDefinition | SwitchThumbComponentDefinition | RadioGroupComponentDefinition | RadioGroupItemComponentDefinition | ToggleGroupComponentDefinition | ToggleGroupItemComponentDefinition | CheckboxComponentDefinition | InputGroupComponentDefinition | TextareaGroupComponentDefinition | InputGroupInputComponentDefinition | TextareaGroupInputComponentDefinition | CopyToClipboardComponentDefinition | ProgressComponentDefinition | ProgressIndicatorComponentDefinition | SliderComponentDefinition | SliderTrackComponentDefinition | SliderRangeComponentDefinition | SliderThumbComponentDefinition | SelectComponentDefinition | SelectContentComponentDefinition | SelectTriggerComponentDefinition | SelectValueComponentDefinition | SelectItemComponentDefinition | SelectItemTextComponentDefinition | SkeletonComponentDefinition | DialogComponentDefinition | DialogContentComponentDefinition | FullScreenDialogComponentDefinition | DrawerComponentDefinition | DrawerContentComponentDefinition | AreaChartComponentDefinition | LineChartComponentDefinition | PieChartComponentDefinition | BarChartComponentDefinition;
export type ComponentDefinitionType = ComponentDefinition["type"];
export type CompoundComponentDefinition = Extract<ComponentDefinition, CompoundComponentDefinitionBase>;
export type CompoundComponentDefinitionType = CompoundComponentDefinition["type"];
export type NonCompoundComponentDefinition = Exclude<ComponentDefinition, CompoundComponentDefinition>;
export type NonCompoundComponentDefinitionType = NonCompoundComponentDefinition["type"];
export type NonPageComponentDefinition = Exclude<ComponentDefinition, PageComponentDefinition>;
export type ComponentDefinitionMap = {
    [definitionId: string]: ComponentDefinition;
};
export type ComponentDefinitionCategory = "page" | "component" | "page-layout" | "compound-component";
/**
 * Component Instances
 */
export type InstanceProps = {
    [propDefinitionId: string]: ValueOrPropDefinitionInstance;
};
export type InstancePropsOnlyValues = {
    [propDefinitionId: string]: PropDefinitionValidValues;
};
export type InstancePropsOnlyVariantValues = {
    [propDefinitionId: string]: VariantPropDefinitionValue;
};
export type NodeMap = {
    [nodeId: NodeId]: NodeType;
};
/**
 * Prop Definitions – what prop is this component exposing?
 * Prop Definition Instance – which prop definition is this referring to?
 * Prop Value - what value is this prop definition?
 */
interface BasePropDefinition {
    category: "prop-definition";
    id: string;
    name: string;
    nonEditable?: boolean;
}
export interface IconPropDefinition extends BasePropDefinition {
    type: "icon";
    defaultValue: IconValue;
}
export interface TextPropDefinition extends BasePropDefinition {
    type: "text";
    defaultValue: TextValue;
}
export interface NumberPropDefinition extends BasePropDefinition {
    type: "number";
    defaultValue: NumberValue;
}
export interface EnumOption {
    category: "enum-option";
    id: EnumOptionId;
    value: string;
    nonEditable?: boolean;
}
export interface EnumPropDefinition extends BasePropDefinition {
    type: "enum";
    enumOptions: EnumOption[];
    defaultValue: EnumValue;
}
export type FrozenEnumPropDefinition = Omit<EnumPropDefinition, "enumOptions"> & {
    enumOptions: readonly EnumOption[];
};
export interface BooleanPropDefinition extends BasePropDefinition {
    type: "boolean";
    defaultValue: BooleanValue;
}
export interface ImagePropDefinition extends BasePropDefinition {
    type: "image";
    defaultValue: ImageValue;
}
export interface SlotPropDefinition extends BasePropDefinition {
    type: "slot";
    nodeId: NodeId;
    componentId: string;
    defaultValue?: SlotValue;
}
export type PropDefinition = IconPropDefinition | TextPropDefinition | NumberPropDefinition | EnumPropDefinition | BooleanPropDefinition | ImagePropDefinition | SlotPropDefinition;
export type PropDefinitionType = PropDefinition["type"];
export type VariantPropDefinition = EnumPropDefinition | BooleanPropDefinition;
export type FrozenVariantPropDefinition = FrozenEnumPropDefinition | BooleanPropDefinition;
export type NonVariantPropDefinition = Exclude<PropDefinition, VariantPropDefinition>;
export type VariantPropDefinitionValue = EnumValue | BooleanValue;
interface BasePropDefinitionInstance {
    category: "prop-definition-instance";
    id: string;
    propDefinitionId: string;
}
export interface IconPropDefinitionInstance extends BasePropDefinitionInstance {
    type: "icon";
}
export interface TextPropDefinitionInstance extends BasePropDefinitionInstance {
    type: "text";
}
export interface NumberPropDefinitionInstance extends BasePropDefinitionInstance {
    type: "number";
}
export interface ImagePropDefinitionInstance extends BasePropDefinitionInstance {
    type: "image";
}
export interface SlotPropDefinitionInstance extends BasePropDefinitionInstance {
    type: "slot";
}
export type PropDefinitionInstance = IconPropDefinitionInstance | TextPropDefinitionInstance | NumberPropDefinitionInstance | ImagePropDefinitionInstance | SlotPropDefinitionInstance;
/**
 * Value Or PropDefinitionInstance
 */
export type IconValueOrPropDefinitionInstance = IconPropDefinitionInstance | IconValue;
export type TextValueOrPropDefinitionInstance = TextPropDefinitionInstance | TextValue;
export type NumberValueOrPropDefinitionInstance = NumberPropDefinitionInstance | NumberValue;
export type EnumValueOrPropDefinitionInstance = EnumValue;
export type BooleanValueOrPropDefinitionInstance = BooleanValue;
export type ImageValueOrPropDefinitionInstance = ImagePropDefinitionInstance | ImageValue;
export type SlotValueOrPropDefinitionInstance = SlotPropDefinitionInstance | SlotValue;
export type ValueOrPropDefinitionInstance = IconValueOrPropDefinitionInstance | TextValueOrPropDefinitionInstance | NumberValueOrPropDefinitionInstance | BooleanValueOrPropDefinitionInstance | ImageValueOrPropDefinitionInstance | EnumValueOrPropDefinitionInstance | SlotValueOrPropDefinitionInstance;
export type PropDefinitionValidValues = Exclude<ValueOrPropDefinitionInstance, {
    category: "prop-definition-instance";
}>;
type DiscriminateUnion<T, K extends keyof T, V extends T[K]> = T extends Record<K, V> ? T : never;
type MapDiscriminatedUnion<T extends Record<K, string>, K extends keyof T> = {
    [V in T[K]]: DiscriminateUnion<T, K, V>;
};
export type ValueOrPropDefinitionInstanceMap = MapDiscriminatedUnion<Value, "type">;
/**
 * Collections
 */
export declare const COLLECTION_TYPES: readonly ["page-section", "component"];
export interface Collection {
    category: "collection";
    type: (typeof COLLECTION_TYPES)[number];
    id: string;
    name: string;
    componentIds: string[];
}
/**
 * Releases
 */
export type ThemeStyleType = "light" | "dark";
interface BaseRelease {
    id: string;
    category: "release";
    assets: {
        imageAssets: ImageAsset[];
        fontAssets: FontAsset[];
        iconAssets: IconAsset[];
    };
    tokens: {
        themeStyle: ThemeStyleType;
        colorPalettes: ColorPalette[];
        nonPaletteColorTokens: ColorToken[];
        fontTokens: FontToken[];
        borderTokens: BorderToken[];
        cornerTokens: CornerToken[];
        shadowTokens: ShadowToken[];
        spacingTokens: SpacingToken[];
    };
    componentIds: string[];
    componentsMap: {
        [id: string]: ComponentDefinition;
    };
    collections: Collection[];
}
export interface Release extends BaseRelease {
    type: "released";
    version: number;
    releasedAt: number;
    name: string;
}
export interface DraftRelease extends BaseRelease {
    type: "draft";
}
export type AnyRelease = Release | DraftRelease;
/**
 * Code gen
 */
export declare const CODE_GEN_CSS_TYPE_OPTIONS: readonly ["tailwind", "scss-with-modules"];
export type CodeGenCSSType = (typeof CODE_GEN_CSS_TYPE_OPTIONS)[number];
/**
 * Projects
 */
export interface Project {
    category: "project";
    draftRelease: DraftRelease;
    releases: Release[];
    preferences: {
        codeGenCSS: CodeGenCSSType;
    };
    schemaVersion: 1;
}
/**
 * AI-related (HACK)
 */
export interface PageSuggestion {
    name: string;
    description: string;
}
export declare enum PlanType {
    Free = "free",
    Pro = "pro",
    Team = "team",
    Custom = "custom"
}
export interface UserMetaData {
    avatar_url?: string;
    name?: string;
    custom_claims?: {
        hd?: string;
    };
}
export {};
//# sourceMappingURL=types.d.ts.map