diff --git a/types/mithril/index.d.ts b/types/mithril/index.d.ts index 79706617e8..32f3976e2e 100644 --- a/types/mithril/index.d.ts +++ b/types/mithril/index.d.ts @@ -36,13 +36,13 @@ declare namespace Mithril { oninit?(this: State, vnode: Vnode): any; /** The oncreate hook is called after a DOM element is created and attached to the document. */ oncreate?(this: State, vnode: VnodeDOM): any; - /** The onbeforeupdate hook is called before a vnode is diffed in a update. */ - onbeforeremove?(this: State, vnode: VnodeDOM): Promise | void; - /** The onupdate hook is called after a DOM element is updated, while attached to the document. */ - onremove?(this: State, vnode: VnodeDOM): any; /** The onbeforeremove hook is called before a DOM element is detached from the document. If a Promise is returned, Mithril only detaches the DOM element after the promise completes. */ - onbeforeupdate?(this: State, vnode: Vnode, old: VnodeDOM): boolean | void; + onbeforeremove?(this: State, vnode: VnodeDOM): Promise | void; /** The onremove hook is called before a DOM element is removed from the document. */ + onremove?(this: State, vnode: VnodeDOM): any; + /** The onbeforeupdate hook is called before a vnode is diffed in a update. */ + onbeforeupdate?(this: State, vnode: Vnode, old: VnodeDOM): boolean | void; + /** The onupdate hook is called after a DOM element is updated, while attached to the document. */ onupdate?(this: State, vnode: VnodeDOM): any; /** WORKAROUND: TypeScript 2.4 does not allow extending an interface with all-optional properties. */ [_: number]: any; @@ -225,13 +225,13 @@ declare namespace Mithril { oninit?(vnode: Vnode): any; /** The oncreate hook is called after a DOM element is created and attached to the document. */ oncreate?(vnode: VnodeDOM): any; - /** The onbeforeupdate hook is called before a vnode is diffed in a update. */ - onbeforeremove?(vnode: VnodeDOM): Promise | void; - /** The onupdate hook is called after a DOM element is updated, while attached to the document. */ - onremove?(vnode: VnodeDOM): any; /** The onbeforeremove hook is called before a DOM element is detached from the document. If a Promise is returned, Mithril only detaches the DOM element after the promise completes. */ - onbeforeupdate?(vnode: Vnode, old: VnodeDOM): boolean | void; + onbeforeremove?(vnode: VnodeDOM): Promise | void; /** The onremove hook is called before a DOM element is removed from the document. */ + onremove?(vnode: VnodeDOM): any; + /** The onbeforeupdate hook is called before a vnode is diffed in a update. */ + onbeforeupdate?(vnode: Vnode, old: VnodeDOM): boolean | void; + /** The onupdate hook is called after a DOM element is updated, while attached to the document. */ onupdate?(vnode: VnodeDOM): any; /** Creates a view out of virtual elements. */ view(vnode: Vnode): Children | null | void;