chore: better types

pull/18058/head
paoloricciuti 5 months ago
parent 4440cec525
commit 0b3d17986e

@ -27,7 +27,7 @@ import { get_parent_node, remove_child } from '../dom/operations.js';
* @property {(element: TElement | TFragment)=>TNode | null} getFirstChild - Return the first child of the element, or null if it has no children. This should work for both elements and fragments
* @property {(element: TElement | TFragment)=>TNode | null} getLastChild - Return the last child of the element, or null if it has no children. This should work for both elements and fragments
* @property {(node: TElement | TTextNode | TComment)=>TNode | null} getNextSibling - Return the next sibling of the node, or null if it has no next sibling
* @property {(parent: TElement | TFragment, element: TNode, anchor: TNode | null)=>void} insert - Insert the element into the parent before the anchor (if the anchor is null, insert at the end). This should work for both elements and fragments as parents. If `element` is a fragment, all of it's children should be inserted, not the fragment itself. If the element already has a parent, it should be removed from it's current parent before being inserted into the new parent.
* @property {(parent: TElement | TFragment, element: TNode, anchor: TElement | TTextNode | TComment | null)=>void} insert - Insert the element into the parent before the anchor (if the anchor is null, insert at the end). This should work for both elements and fragments as parents. If `element` is a fragment, all of it's children should be inserted, not the fragment itself. If the element already has a parent, it should be removed from it's current parent before being inserted into the new parent.
* @property {(node: TElement | TTextNode | TComment)=>void} remove - Remove the node from the tree
* @property {(element: TElement | TTextNode | TComment)=>TNode | null} getParent - Return the parent of the element, or null if it has no parent
* @property {(target: TElement, type: string, handler: any, options?: any)=>void} addEventListener - Add an event listener of the given type and handler to the target node, with optional options

@ -2642,7 +2642,7 @@ declare module 'svelte/renderer' {
/**
* - Insert the element into the parent before the anchor (if the anchor is null, insert at the end). This should work for both elements and fragments as parents. If `element` is a fragment, all of it's children should be inserted, not the fragment itself. If the element already has a parent, it should be removed from it's current parent before being inserted into the new parent.
*/
insert: (parent: TElement | TFragment, element: TNode, anchor: TNode | null) => void;
insert: (parent: TElement | TFragment, element: TNode, anchor: TElement | TTextNode | TComment | null) => void;
/**
* - Remove the node from the tree
*/

Loading…
Cancel
Save