@web-atoms/core-docs
Version:
77 lines • 3.02 kB
TypeScript
import Bind from "./Bind";
import { IClassOf, IDisposable } from "./types";
export interface IAttributes {
[key: string]: string | number | null | any;
}
export declare class RootObject {
get vsProps(): {
[k in keyof this]?: this[k] | Bind;
} | {
[k: string]: any;
} | {};
addEventListener(name: string, handler: EventListenerOrEventListenerObject): IDisposable;
appendChild(e: any): void;
dispatchEvent(evt: Event): void;
}
declare global {
namespace JSX {
interface ElementAttributesProperty {
vsProps: any;
}
type HtmlPartial<T> = {
[k in keyof T]?: {
[tx in keyof T[k]]?: T[k][tx] | any;
} | {
eventClick?: any;
eventBlur?: any;
eventFocus?: any;
eventKeydown?: any;
eventKeyup?: any;
eventKeypress?: any;
text?: string | any;
[key: string]: any;
};
};
type IAllHtmlElements = HtmlPartial<HTMLElementTagNameMap>;
interface IntrinsicElements extends IAllHtmlElements {
}
}
}
export declare type IMergedControl<T, T1> = {
[P in keyof (T & T1)]?: (T & T1)[P];
} & {
vsProps: {
[P in keyof (T & T1)]?: (T & T1)[P];
};
};
export declare type NodeFactory = (a?: any, ...nodes: XNode[]) => XNode;
export declare type AttachedNode = (n: any) => {
[key: string]: any;
};
export declare const xnodeSymbol: unique symbol;
export default class XNode {
name: string | Function;
attributes: IAttributes;
children: XNode[] | XNode[][] | any[];
isProperty?: boolean;
isTemplate?: boolean;
static classes: {
[key: string]: any;
};
static attach<T, T1 extends HTMLElementTagNameMap, K extends keyof T1>(n: IClassOf<T>, tag: K): new (...a: any[]) => IMergedControl<T, T1[K]>;
static attach<T, T1>(n: IClassOf<T>, tag: (a?: Partial<T1>, ...nodes: XNode[]) => XNode): new (...a: any[]) => IMergedControl<T, T1>;
static prepare<T>(n: any, isProperty?: boolean, isTemplate?: boolean): ((attributes: Partial<T>, ...nodes: XNode[]) => XNode);
static attached: (name: string) => AttachedNode;
static getClass(fullTypeName: string, assemblyName: string): any;
static factory: (name: any, isProperty: any, isTemplate: any) => (a?: any, ...nodes: any[]) => XNode;
/**
* Declares Root Namespace and Assembly. You can use return function to
* to declare the type
* @param ns Root Namespace
*/
static namespace(ns: string, assemblyName: string): (type: string, isTemplate?: boolean) => (c: any) => void;
static create(name: string | Function, attributes: IAttributes, ...children: Array<XNode | XNode[] | any>): XNode;
constructor(name: string | Function, attributes: IAttributes, children: XNode[] | XNode[][] | any[], isProperty?: boolean, isTemplate?: boolean);
toString(): string;
}
//# sourceMappingURL=XNode.d.ts.map