@cimo/jsmvcfw
Version:
Javascript mvc framework. Light, fast and secure.
43 lines (42 loc) • 1.19 kB
TypeScript
export interface IvirtualNode {
tag: string;
propertyObject: {
[key: string]: TvirtualNodeProperty;
};
childrenList: Array<IvirtualNode | string>;
key?: string;
}
export interface IvariableBind<T> {
state: T;
listener(callback: (value: T) => void): void;
}
export interface IvariableHook<T> {
state: T;
setState: (value: T) => void;
}
export interface IvariableEffect {
(groupObject: {
list: string[];
action: () => void;
}[]): void;
}
export interface Icontroller {
elementHookObject: Record<string, Element | Element[]>;
variable(): void;
variableEffect(watch: IvariableEffect): void;
view(): IvirtualNode;
event(): void;
subControllerList(): Icontroller[];
rendered(): void;
destroy(): void;
}
export interface Iroute {
title: string;
path: string;
controller(): Icontroller;
}
export interface IcallbackObserver {
(el: HTMLElement, mutation: MutationRecord): void;
}
export type TvirtualNodeProperty = string | number | boolean | (string | IvirtualNode)[] | ((event: Event) => void) | null | undefined;
export type TvirtualNodeChildren = IvirtualNode | string | number;