import * as _alins from 'alins'; import { IAttributes, IElement, mount, ref, reactive, watch, computed, IRefData } from 'alins'; export { appended, computed, created, mount, mounted, reactive, ref, removed, watch } from 'alins'; declare type IValueCond = (() => T) | IRefData; declare type IBoolCond = IValueCond; declare type IElements = IElement | IElement[]; declare type IDomGenerator = () => IElements; declare function join(ts: TemplateStringsArray, ...reactions: any[]): any[]; declare const DomNames: readonly ["a", "div", "h1", "h2", "h3", "h4", "h5", "h6", "button", "canvas", "code", "pre", "table", "th", "td", "tr", "video", "audio", "ol", "select", "option", "p", "i", "iframe", "img", "input", "label", "ul", "li", "span", "textarea", "form", "br", "tbody", "abbr", "article", "aside", "b", "base", "bdi", "bdo", "blockquote", "caption", "cite", "del", "details", "dialog", "em", "embed", "figure", "footer", "header", "hr", "menu", "nav", "noscript", "object", "progress", "section", "slot", "small", "strong", "sub", "summary", "sup", "template", "title", "var"]; declare type TDomName = typeof DomNames[number]; interface IDom { (name: TDomName, attributes?: IAttributes, children?: (any[])): IElements; (name: string, attributes?: IAttributes, children?: (any[])): IElements; } declare type IDoms = { [tagName in TDomName]: (attributes?: IAttributes, children?: (any[])) => IElements; }; declare const Dom: IDom & IDoms; declare type IComponentFn = (attributes: IAttributes, children: any[]) => IElements; declare function Component(fn: IComponentFn, attributes?: IAttributes | (any[]), children?: (any[]) | any): IElements; /** If(()=>a.v === 1, ()=>Dom.div(1) ElseIf(()=>a.v === 2, ()=>Dom.div(2)) Else(()=>Dom.div('else')) ) */ declare function If(condition: IBoolCond, generator: IDomGenerator, ...items: any[][]): any; declare function ElseIf(condition: IBoolCond, generator: IDomGenerator): (IBoolCond | IDomGenerator)[]; declare function Else(generator: IDomGenerator): IDomGenerator[]; /** Switch(a, Case(1, ()=>Dom.div('a is 1')), Case(2, ()=>Dom.div('a is 2')), Default(()=>Dom.div('default') ) */ declare type ICaseItem = [any, IDomGenerator]; declare function Switch(condition: IValueCond, ...cases: ICaseItem[]): void | _alins.IGeneralElement; declare function Case(value: any, generator: IDomGenerator): ICaseItem; declare function Default(generator: IDomGenerator): ICaseItem; declare function Async(promise: Promise, generator: (data: T) => IElements): _alins.ITrueElement; declare function For(data: T[], generator: (item: T, index: number) => IElements): _alins.IFragment | _alins.ITextNode> | _alins.IGeneralElement[]; declare function Show(condition: IBoolCond, element: IElements): IElements; declare const alins: { mount: typeof mount; ref: typeof ref; reactive: typeof reactive; watch: typeof watch; computed: typeof computed; If: typeof If; ElseIf: typeof ElseIf; Else: typeof Else; Switch: typeof Switch; Case: typeof Case; Default: typeof Default; For: typeof For; Async: typeof Async; Show: typeof Show; Dom: IDom & IDoms; Component: typeof Component; created: (v: (dom: IElement) => void) => void; appended: (v: (dom: IElement) => void) => void; mounted: (v: (dom: IElement) => void | ((dom: IElement) => void)) => void; removed: (v: (dom: IElement) => void) => void; }; export { Async, Case, Component, Default, Dom, Else, ElseIf, For, If, Show, Switch, TDomName, alins, join };