UNPKG

vasille

Version:

The first Developer eXperience Orientated front-end framework (core library).

43 lines (42 loc) 2 kB
import { TextNode as AbstractTextNode, DebugNode as AbstractDebugNode, Tag as AbstractTag, Runner as IRunner, IValue } from "../../index.js"; export type AttrType<T> = IValue<T | string | null> | T | string | null | undefined; export type StyleType<T> = T | number | number[] | IValue<string | number | number[]>; export interface TagOptions { attr?: Record<string, AttrType<number | boolean>>; class?: (string | IValue<string> | Record<string, boolean | IValue<boolean>>)[]; style?: Record<string, StyleType<string>>; events?: Record<string, (...args: unknown[]) => unknown>; bind?: Record<string, any>; slot?: (ctx: Tag) => void; callback?: (node: Element) => void; } export declare class TextNode extends AbstractTextNode<Node, Element, TagOptions> { readonly runner: Runner; protected node: Text; compose(): void; destroy(): void; protected findFirstChild(): Node; } export declare class DebugNode extends AbstractDebugNode<Node, Element, TagOptions> { readonly runner: Runner; protected node: Comment; compose(): void; destroy(): void; protected findFirstChild(): Node | Element | undefined; } export declare class Tag extends AbstractTag<Node, Element, TagOptions> { readonly runner: Runner; compose(): void; destroy(): void; protected applyOptions(options: TagOptions): void; } export declare class Runner implements IRunner<Node, Element, TagOptions> { readonly debugUi: boolean; readonly document: Document; constructor(debugUi: boolean, document: Document); insertBefore(node: Node, before: Element | Node): void; appendChild(node: Element, child: Element | Node): void; textNode(text: unknown): AbstractTextNode<Node, Element, TagOptions>; debugNode(text: IValue<unknown>): AbstractDebugNode<Node, Element, TagOptions>; tag(tagName: string, input: TagOptions, cb?: ((ctx: AbstractTag<Node, Element, TagOptions>) => void) | undefined): AbstractTag<Node, Element, TagOptions>; }