-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
This seems to work for me, but I'm a TypeScript beginner and am probably doing a lot of things wrong:
// Modified from https://github.com/patrick-steele-idem/morphdom/pull/113/commits/0b6b2e87b5f1b193c40c4c64f25938846ccd4039
declare module "nanomorph" {
interface NanomorphOptions {
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;
}
namespace nanomorph {
}
function nanomorph(
fromNode: Node,
toNode: Node | string,
options?: NanomorphOptions
): void;
export default nanomorph; // Added "default" here.
}
real-alexei, typoerr, bfulop, gone and bcb
Metadata
Metadata
Assignees
Labels
No labels