import type { Properties } from "csstype"; export type CSSProperties = Properties & { layout?: "vbox" | "hbox" | "box" | "page-section"; }; type ContainerTags = "a" | "address" | "article" | "aside" | "blockquote" | "button" | "code" | "dd" | "div" | "dl" | "dt" | "form" | "footer" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "header" | "hgroup" | "label" | "li" | "main" | "nav" | "ol" | "p" | "pre" | "section" | "span" | "ul"; type CommonAttrKeys = "title" | "tabIndex" | "className" | "id" | "aria-label" | "aria-hidden" | "aria-labelledby" | "aria-describedby" | "role"; type PictureAttrKeys = "alt" | "loading" | CommonAttrKeys; type LinkAttrKeys = "href" | "target" | CommonAttrKeys; type TextAreaAttrKeys = "disabled" | "value" | "cols" | "rows" | "placeholder" | CommonAttrKeys; type InputAttrKeys = "disabled" | "value" | "defaultValue" | "name" | "autoComplete" | "checked" | "placeholder" | CommonAttrKeys; type ButtonAttrKeys = "disabled" | CommonAttrKeys; type Attrs = Partial>; export interface PictureElement { type: "img"; src: string; styles?: CSSProperties; attrs?: Attrs; } export type ImageElement = PictureElement; interface LinkTextElement { type: "text"; tag: "a"; value: string; styles?: CSSProperties; attrs?: Attrs; } interface ButtonTextElement { type: "text"; tag: "button"; value: string; styles?: CSSProperties; attrs?: Attrs; } interface GenericTextElement { type: "text"; /** * Default: "div" */ tag?: Exclude; value: string; styles?: CSSProperties; attrs?: Attrs; } export type TextElement = string | LinkTextElement | ButtonTextElement | GenericTextElement; interface LinkContainerElement { type: "box" | "vbox" | "hbox"; tag: "a"; children?: PlasmicElement | PlasmicElement[]; styles?: CSSProperties; attrs?: Attrs; } interface ButtonContainerElement { type: "box" | "vbox" | "hbox"; tag: "button"; children?: PlasmicElement | PlasmicElement[]; styles?: CSSProperties; attrs?: Attrs; } interface GenericContainerElement { type: "box" | "vbox" | "hbox" | "page-section"; /** * Default: "div" */ tag?: Exclude; children?: PlasmicElement | PlasmicElement[]; styles?: CSSProperties; attrs?: Attrs; } export type ContainerElement = LinkContainerElement | ButtonContainerElement | GenericContainerElement; export interface ButtonElement { type: "button"; value: string; styles?: CSSProperties; attrs?: Attrs; } interface InputElement { type: "input" | "password"; styles?: CSSProperties; attrs?: Attrs; } interface TextAreaElement { type: "textarea"; styles?: CSSProperties; attrs?: Attrs; } export type TextInputElement = InputElement | TextAreaElement; interface JsonElement { type: "json"; value: any; } export interface DefaultComponentElement

{ type: "default-component"; kind: "button" | "text-input"; /** * The name of the element in the tree */ elementName?: string; props?: { [prop in keyof Partial

]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[]; } & { [prop: string]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[]; }; styles?: CSSProperties; } export interface CodeComponentElement

{ type: "component"; /** * The registered component name */ name: string; /** * The name of the element in the tree */ elementName?: string; styles?: CSSProperties; props?: { [prop in keyof Partial

]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[]; } & { [prop: string]: number | string | boolean | null | undefined | JsonElement | PlasmicElement | PlasmicElement[]; }; } export type PlasmicElement = ImageElement | TextElement | ContainerElement | ButtonElement | TextInputElement | CodeComponentElement<{}> | DefaultComponentElement<{}>; export {};