@protorians/widgets
Version:
Create your web user interfaces with widgets
41 lines (40 loc) • 3.1 kB
TypeScript
import type { IEngine, IAttributes, IWidgetNode, IStateStack, IContext, IPropStack, IChildrenSupported, IChildren, IGlobalEventMap, ICallable, IGlobalAttributes, IStyleDeclaration, IGlobalEventPayload, IStringToken, IPrimitive, ISignalableCallbackMap, IStyleSheetDeclarations, IGlobalEventCallableMap } from "../types/index.js";
import { ToggleOption, ObjectElevation, Displaying } from "../enums.js";
export declare class Manticore<E extends HTMLElement, A extends IAttributes> implements IEngine<E, A> {
readonly widget: IWidgetNode<E, A>;
get element(): E | undefined;
constructor(widget: IWidgetNode<E, A>);
clear(widget: IWidgetNode<E, A>): this;
remove(widget: IWidgetNode<E, A>): this;
enable(widget: IWidgetNode<E, A>): this;
disable(widget: IWidgetNode<E, A>): this;
lock(widget: IWidgetNode<E, A>): this;
unlock(widget: IWidgetNode<E, A>): this;
trigger(widget: IWidgetNode<E, A>, type: keyof IGlobalEventMap): this;
computedStyle(widget: IWidgetNode<E, A>, token: keyof IStyleDeclaration): string | undefined;
hide(widget: IWidgetNode<E, A>): this;
show(widget: IWidgetNode<E, A>, display?: Displaying): this;
focus(widget: IWidgetNode<E, A>): this;
blur(widget: IWidgetNode<E, A>): this;
toggle(widget: IWidgetNode<E, A>, option?: ToggleOption): this;
data(widget: IWidgetNode<E, A>, dataset: IGlobalAttributes): this;
attribute(widget: IWidgetNode<E, A>, attributes: Partial<A>): this;
attributeLess(widget: IWidgetNode<E, A>, attributes: IGlobalAttributes): this;
content(widget: IWidgetNode<E, A>, children: IChildren<IChildrenSupported>): this;
style(widget: IWidgetNode<E, A>, declaration: IStyleSheetDeclarations): this;
className(widget: IWidgetNode<E, A>, token: IStringToken): this;
removeClassName(widget: IWidgetNode<E, A>, token: IStringToken): this;
clearClassName(widget: IWidgetNode<E, A>): this;
replaceClassName(widget: IWidgetNode<E, A>, oldToken: IStringToken, token: IStringToken): this;
value(widget: IWidgetNode<E, A>, data: IPrimitive): this;
html(widget: IWidgetNode<E, A>, data: string): this;
listens(widget: IWidgetNode<E, A>, listeners: Partial<IGlobalEventCallableMap<E, A>>): this;
listen<T extends keyof IGlobalEventMap>(widget: IWidgetNode<E, A>, type: T, callback: ICallable<E, A, IGlobalEventPayload<T>>, options?: boolean | AddEventListenerOptions): this;
ons(widget: IWidgetNode<E, A>, listeners: Partial<IGlobalEventCallableMap<E, A>>): this;
on<T extends keyof IGlobalEventMap>(widget: IWidgetNode<E, A>, type: T, callback: ICallable<E, A, IGlobalEventPayload<T>> | null): this;
detachEvent<T extends keyof IGlobalEventMap>(widget: IWidgetNode<E, A>, type: T): this;
signals(widget: IWidgetNode<E, A>, signals: Partial<ISignalableCallbackMap<E, A>>): this;
stase(widget: IWidgetNode<E, A>, state: boolean): this;
elevate(widget: IWidgetNode<E, A>, elevation: ObjectElevation): this;
render<P extends IPropStack, S extends IStateStack>(widget: IWidgetNode<E, A>, context: IContext<P, S>): E | undefined;
}