export as namespace hyperapp /** @namespace [VDOM] */ /** The VDOM representation of an Element. * * @memberOf [VDOM] */ export interface VNode { nodeName: string attributes?: Attributes children: Array key: string } /** A Component is a function that returns a custom VNode or View. * * @memberOf [VDOM] */ export interface Component { (attributes: Attributes, children: Array): | VNode | View } /** * Possibles children types */ export type Children = VNode | string | number | null /** The soft way to create a VNode. * @param name An element name or a Component function * @param attributes Any valid HTML atributes, events, styles, and meta data * @param children The children of the VNode * @returns A VNode tree. * * @memberOf [VDOM] */ export function h( nodeName: Component | string, attributes?: Attributes, ...children: Array ): VNode /** @namespace [App] */ /** The result of an action. * * @memberOf [App] */ export type ActionResult = Partial | Promise | null | void /** The interface for a single action implementation. * * @memberOf [App] */ export type ActionType = ( data?: any ) => | ((state: State, actions: Actions) => ActionResult) | ActionResult /** The interface for the actions tree implementation. * * @memberOf [App] */ export type ActionsType = { [P in keyof Actions]: | ActionType | ActionsType } /** The view function describes the application UI as a tree of VNodes. * @returns A VNode tree. * @memberOf [App] */ export interface View { (state: State, actions: Actions): VNode } /** The app() call creates and renders a new application. * * @param state The state object. * @param actions The actions object implementation. * @param view The view function. * @param container The DOM element where the app will be rendered to. * @returns The actions wired to the application. * @memberOf [App] */ export function app( state: State, actions: ActionsType, view: View, container: Element | null ): Actions /** @namespace [JSX] */ declare global { namespace JSX { interface Element extends VNode {} interface IntrinsicElements { [elemName: string]: any } } }