···1010type PairOfNodes<N extends Node> = [N, N]
1111type PairOfMatchingElements<E extends Element> = Branded<PairOfNodes<E>, "MatchingElementPair">
12121313+/**
1414+ * Configuration options for morphing operations.
1515+ */
1316export interface Options {
1717+ /**
1818+ * When `true`, preserves modified form inputs during morphing.
1919+ * This prevents user-entered data from being overwritten.
2020+ * @default false
2121+ */
1422 preserveModified?: boolean
2323+2424+ /**
2525+ * Called before a node is visited during morphing.
2626+ * @param fromNode The existing node in the DOM
2727+ * @param toNode The new node to morph to
2828+ * @returns `false` to skip morphing this node, `true` to continue
2929+ */
1530 beforeNodeVisited?: (fromNode: Node, toNode: Node) => boolean
3131+3232+ /**
3333+ * Called after a node has been visited and morphed.
3434+ * @param fromNode The morphed node in the DOM
3535+ * @param toNode The source node that was morphed from
3636+ */
1637 afterNodeVisited?: (fromNode: Node, toNode: Node) => void
3838+3939+ /**
4040+ * Called before a new node is added to the DOM.
4141+ * @param parent The parent node where the child will be added
4242+ * @param node The node to be added
4343+ * @param insertionPoint The node before which the new node will be inserted, or `null` to append
4444+ * @returns `false` to prevent adding the node, `true` to continue
4545+ */
1746 beforeNodeAdded?: (parent: ParentNode, node: Node, insertionPoint: ChildNode | null) => boolean
4747+4848+ /**
4949+ * Called after a node has been added to the DOM.
5050+ * @param node The node that was added
5151+ */
1852 afterNodeAdded?: (node: Node) => void
5353+5454+ /**
5555+ * Called before a node is removed from the DOM.
5656+ * @param node The node to be removed
5757+ * @returns `false` to prevent removal, `true` to continue
5858+ */
1959 beforeNodeRemoved?: (node: Node) => boolean
6060+6161+ /**
6262+ * Called after a node has been removed from the DOM.
6363+ * @param node The node that was removed
6464+ */
2065 afterNodeRemoved?: (node: Node) => void
6666+6767+ /**
6868+ * Called before an attribute is updated on an element.
6969+ * @param element The element whose attribute will be updated
7070+ * @param attributeName The name of the attribute
7171+ * @param newValue The new value for the attribute, or `null` if being removed
7272+ * @returns `false` to prevent the update, `true` to continue
7373+ */
2174 beforeAttributeUpdated?: (element: Element, attributeName: string, newValue: string | null) => boolean
7575+7676+ /**
7777+ * Called after an attribute has been updated on an element.
7878+ * @param element The element whose attribute was updated
7979+ * @param attributeName The name of the attribute
8080+ * @param previousValue The previous value of the attribute, or `null` if it didn't exist
8181+ */
2282 afterAttributeUpdated?: (element: Element, attributeName: string, previousValue: string | null) => void
8383+8484+ /**
8585+ * Called before an element's children are visited during morphing.
8686+ * @param parent The parent node whose children will be visited
8787+ * @returns `false` to skip visiting children, `true` to continue
8888+ */
2389 beforeChildrenVisited?: (parent: ParentNode) => boolean
9090+9191+ /**
9292+ * Called after an element's children have been visited and morphed.
9393+ * @param parent The parent node whose children were visited
9494+ */
2495 afterChildrenVisited?: (parent: ParentNode) => void
2596}
2697