UNPKG

morphdom

Version:

Morph a DOM tree to another DOM tree (no virtual DOM needed)

20 lines (17 loc) 621 B
interface MorphDomOptions { getNodeKey?: (node: Node) => any; onBeforeNodeAdded?: (node: Node) => Node; onNodeAdded?: (node: Node) => Node; onBeforeElUpdated?: (fromEl: HTMLElement, toEl: HTMLElement) => boolean; onElUpdated?: (el: HTMLElement) => void; onBeforeNodeDiscarded?: (node: Node) => boolean; onNodeDiscarded?: (node: Node) => void; onBeforeElChildrenUpdated?: (fromEl: HTMLElement, toEl: HTMLElement) => boolean; childrenOnly?: boolean; } declare function morphdom( fromNode: Node, toNode: Node | string, options?: MorphDomOptions, ): void; export = morphdom;