/** Set on each element a streaming patch inserts, for one entrance animation. */ export declare const STREAMED_IN_ATTRIBUTE = "data-agent-native-streamed-in"; /** * Entrance motion for streamed-in elements. Only the outermost new element * animates; its new descendants arrive with it. Where frames are drafted * (`createDraftOutlines`), the draft times each reveal instead. */ export declare const STREAMED_IN_CSS = "\n@keyframes agent-native-streamed-in {\n from { opacity: 0; transform: translateY(6px); filter: blur(2px); }\n to { opacity: 1; transform: none; filter: none; }\n}\n[data-agent-native-streamed-in] {\n animation: agent-native-streamed-in 320ms cubic-bezier(0.2, 0, 0, 1) both;\n}\n[data-agent-native-drafting] [data-agent-native-streamed-in] { animation: none; }\n@media (prefers-reduced-motion: reduce) {\n [data-agent-native-streamed-in] { animation: none; }\n}\n"; /** * Patches `target`'s children to match `source` in place. Nodes that match * by position and tag are kept, so text grows inside elements already on * screen and nothing replays its entrance; new elements get `markAttribute` * and are passed to `onInsert`. A kept element that `keepChildren` claims * has its attributes synced but its children left alone, for content another * renderer owns, such as a React portal's slot. * * With `ownership`, only the nodes the stream inserted are compared or * removed, and an attribute changes only while it still holds the value the * stream gave it. A runtime working on the result (Alpine's `x-for` clones, * `x-text`, `x-show`'s style, `:class`) is not in the source, so a positional * comparison would otherwise overwrite or delete its work. * * This function is serialized into sandboxed preview frames with * `Function.prototype.toString`, so it must not reference anything outside * its own body. */ export interface StreamOwnership { /** Nodes the stream inserted. */ nodes: WeakSet; /** The attributes the stream last gave each element it owns. */ attributes: WeakMap>; } export declare function morphChildren(target: Node, source: Node, markAttribute: string, onInsert?: (element: Element) => void, keepChildren?: (element: Element) => boolean, ownership?: StreamOwnership): void;