UNPKG

reactronic-dom

Version:

Reactronic DOM - Transactional Reactive Front-End Development Framework

57 lines (56 loc) 2.79 kB
import { Monitor, LoggingOptions, Item, CollectionReader } from 'reactronic'; export declare type Callback<E = unknown> = (element: E) => void; export declare type Render<E = unknown, M = unknown, R = void> = (element: E, node: RxNode<E, M, R>) => R; export declare type AsyncRender<E = unknown, M = unknown> = (element: E, node: RxNode<E, M, Promise<void>>) => Promise<void>; export declare const enum Priority { SyncP0 = 0, AsyncP1 = 1, AsyncP2 = 2 } export declare abstract class RxNode<E = any, M = unknown, R = void> { static frameDuration: number; abstract readonly name: string; abstract readonly factory: NodeFactory<E>; abstract readonly inline: boolean; abstract readonly triggers: unknown; abstract readonly renderer: Render<E, M, R>; abstract readonly wrapper: Render<E, M, R> | undefined; abstract readonly monitor?: Monitor; abstract readonly throttling?: number; abstract readonly logging?: Partial<LoggingOptions>; abstract readonly priority: Priority; abstract readonly shuffle: boolean; abstract model?: M; abstract readonly level: number; abstract readonly parent: RxNode; abstract readonly children: CollectionReader<RxNode>; abstract readonly item: Item<RxNode> | undefined; abstract readonly stamp: number; abstract readonly element?: E; render(): R; get isInitialRendering(): boolean; abstract wrapBy(renderer: Render<E, M, R> | undefined): this; static launch(render: () => void): void; static get current(): RxNode; static shuffleChildrenRendering(shuffle: boolean): void; static renderChildrenThenDo(action: (error: unknown) => void): void; static forAllNodesDo<E>(action: (e: E) => void): void; static emit<E = undefined, M = unknown, R = void>(name: string, triggers: unknown, inline: boolean, renderer: Render<E, M, R>, priority?: Priority, monitor?: Monitor, throttling?: number, logging?: Partial<LoggingOptions>, factory?: NodeFactory<E>): RxNode<E, M, R>; static getDefaultLoggingOptions(): LoggingOptions | undefined; static setDefaultLoggingOptions(logging?: LoggingOptions): void; } export declare class NodeFactory<E> { static readonly default: NodeFactory<any>; readonly name: string; readonly strict: boolean; constructor(name: string, strict: boolean); initialize(node: RxNode<E>, element: E | undefined): void; finalize(node: RxNode<E>, isLeader: boolean): boolean; arrange(node: RxNode<E>, strict: boolean): void; render(node: RxNode<E>): void | Promise<void>; } export declare class StaticNodeFactory<E> extends NodeFactory<E> { readonly element: E; constructor(name: string, sequential: boolean, element: E); initialize(node: RxNode<E>, element: E | undefined): void; }