Use base type in ko.virtualElements interface

The knockout `virtualElements` API accepts all types of DOM nodes, not just HTML elements.

For example, I was trying to insert a text node (from `document.createTextNode`), and it was seen as invalid.
This commit is contained in:
Brian Dukes 2014-04-11 10:43:57 -05:00
parent f0259b1232
commit b500036887

View File

@ -173,14 +173,14 @@ interface KnockoutMemoization {
interface KnockoutVirtualElement {}
interface KnockoutVirtualElements {
allowedBindings: { [bindingName: string]: boolean; };
allowedBindings: { [bindingName: string]: boolean; };
emptyNode(node: KnockoutVirtualElement ): void;
firstChild(node: KnockoutVirtualElement ): KnockoutVirtualElement;
insertAfter( container: KnockoutVirtualElement, nodeToInsert: HTMLElement, insertAfter: HTMLElement ): void;
nextSibling(node: KnockoutVirtualElement): HTMLElement;
prepend(node: KnockoutVirtualElement, toInsert: HTMLElement ): void;
setDomNodeChildren(node: KnockoutVirtualElement, newChildren: { length: number;[index: number]: HTMLElement; } ): void;
childNodes(node: KnockoutVirtualElement ): HTMLElement[];
insertAfter( container: KnockoutVirtualElement, nodeToInsert: Node, insertAfter: Node ): void;
nextSibling(node: KnockoutVirtualElement): Node;
prepend(node: KnockoutVirtualElement, toInsert: Node ): void;
setDomNodeChildren(node: KnockoutVirtualElement, newChildren: { length: number;[index: number]: Node; } ): void;
childNodes(node: KnockoutVirtualElement ): Node[];
}
interface KnockoutExtenders {