UNPKG

piral-elm

Version:

Plugin for integrating Elm components in Piral.

19 lines (18 loc) 714 B
import { createConverter } from './lib/converter'; export interface HtmlComponent<TProps> { component: { mount(element: HTMLElement, props: TProps, ctx: any, locals: any): void; update?(element: HTMLElement, props: TProps, ctx: any, locals: any): void; unmount?(element: HTMLElement, locals: any): void; }; type: 'html'; } export interface ElmConverter { (...params: Parameters<ReturnType<typeof createConverter>>): HtmlComponent<any>; } export declare function createElmConverter(...params: Parameters<typeof createConverter>): { from: ElmConverter; Extension: string; }; declare const fromElm: ElmConverter, ElmExtension: string; export { fromElm, ElmExtension };