import Async from "typescene-async"; import { ActionHandler, EventHandlerCtor } from "./DOMEvents"; import Component from "./Component"; /** Interface that describes a renderable component */ export interface RenderableComponent { /** Property that contains (or resolves to) the actual output */ out: ComponentRenderOutput; /** Animation(s) to be played during the lifetime of this component on screen */ animations: Component.Animations; /** False while this component's output still has to be rendered */ isRendered: boolean; /** Flag that can be used for duck typing */ isRenderableComponent: boolean; } /** Encapsulates output generated by a component's render method */ export declare abstract class ComponentRenderOutput { /** Create the output wrapper for given component and target element */ constructor(component: Component, element: ElementT); /** The component that generated the output */ component: Component; /** Reference to the actual output (e.g. DOM element) */ element: ElementT; /** References to other (sub) elements, depending on component type; initially undefined but may contain multiple sub elements by name */ elements: { [name: string]: ElementT; }; /** Reference to element that should be used to register event handlers, if different from main element (otherwise undefined) */ liveElement: ElementT; /** Data used by the rendering implementation (e.g. for keeping track of animation status) */ data: any; /** Flag that can be used for duck typing */ isComponentOutput: boolean; } /** Encapsulates HTML output generated by a component's render method */ export declare class ComponentRenderHtmlOutput extends ComponentRenderOutput { } /** Interface that describes a renderable component that outputs HTML */ export interface RenderableHtmlComponent extends RenderableComponent { } /** Event data that is emitted when a component updates its output */ export interface ComponentRenderEvent { /** The component that has been rendered */ component: RenderableComponent; /** The output generated by the component */ out: ComponentRenderOutput; } /** Signal that is emitted when a component updates its rendered output */ export interface ComponentRenderSignal extends Async.CustomSignalClass, Async.Signal>> { } /** [implementation] */ export interface RenderHandler extends ActionHandler, ComponentRenderSignal> { } /** Constructor for a component render event handler */ export declare var RenderHandler: EventHandlerCtor, RenderHandler>; export default ComponentRenderOutput;