/** * Main thread snapshot implementation that runs in the main thread. * * This is the mirror of background's {@link BackgroundSnapshotInstance}: */ import type { Worklet, WorkletRefImpl } from '@lynx-js/react/worklet-runtime/bindings'; import type { Snapshot } from './definition.js'; import type { PlatformInfo } from './platformInfo.js'; import type { SerializedSnapshotInstance } from './types.js'; export declare const snapshotInstanceManager: { nextId: number; values: Map; clear(): void; }; export declare let snapshotCreatorMap: Record string>; /** * The runtime instance of a {@link Snapshot} on the main thread that manages * the actual elements and handles updates to dynamic parts. * * This class is designed to be compatible with Preact's {@link ContainerNode} * interface for Preact's renderer to operate upon. */ export declare class SnapshotInstance { type: string; __id: number; __snapshot_def: Snapshot; __elements?: FiberElement[] | undefined; __element_root?: FiberElement | undefined; __values?: unknown[] | undefined; __current_slot_index: number; __worklet_ref_set?: Set | Worklet>; __listItemPlatformInfo?: PlatformInfo; __extraProps?: Record | undefined; constructor(type: string, id?: number); ensureElements(): void; unRenderElements(): void; takeElements(): SnapshotInstance; tearDown(): void; private __parent; private __firstChild; private __lastChild; private __previousSibling; private __nextSibling; get parentNode(): SnapshotInstance | null; get nextSibling(): SnapshotInstance | null; contains(child: SnapshotInstance): boolean; get childNodes(): SnapshotInstance[]; __insertBefore(node: SnapshotInstance, beforeNode?: SnapshotInstance): void; __removeChild(node: SnapshotInstance): void; insertBefore(newNode: SnapshotInstance, existingNode?: SnapshotInstance): void; removeChild(child: SnapshotInstance): void; removeChildren(start?: SnapshotInstance | null): void; setAttribute(key: string | number, value: any): void; toJSON(): Omit & { children: SnapshotInstance[] | undefined; }; callUpdateIfNotDirectOrDeepEqual(index: number, oldValue: any, newValue: any): void; }