import type { SourceEditScope } from './inspect.js'; import type { NodeModel, PageModel } from './store.js'; /** * The smallest unit that connects DOMs rendered multiple times from one source. * - Within the registry component, importPath is used as scope. * - Other screen DOMs use structural paths within the same route. * - If the editing range is shared, not only the style but also text/props/visibility are the same. * It is immediately reflected in all source instances. * - When the runtime state needs to be maintained for each screen, the user selects the instance range. */ export declare const SHARED_SOURCE_PATCH_KEYS: readonly ["type", "widthMode", "width", "heightMode", "height", "gap", "padding", "justify", "alignItems", "fill", "radius", "borderWidth", "borderColor", "opacity", "fontSize", "fontWeight", "color", "textAlign", "hidden", "text", "componentName", "componentProps", "childrenText", "domAttributes", "domStyle"]; export type SharedSourcePatchKey = (typeof SHARED_SOURCE_PATCH_KEYS)[number]; export type SharedSourcePatch = Partial>; /** Where an edit to a shared component's instance is written; one vocabulary with the source operations. */ export type SharedSourceEditScope = SourceEditScope; export interface SharedSourceFrameSummary { id: string; name: string; } export interface SharedSourceImpact { sourceKey: string; frames: SharedSourceFrameSummary[]; nodeCount: number; } /** In the edit patch, copy only fields that can be safely shared in the actual source style. */ export declare function pickSharedSourcePatch(partial: Partial): SharedSourcePatch; export declare function cloneSharedSourcePatch(patch: SharedSourcePatch): SharedSourcePatch; export declare function hasSharedSourcePatch(patch: SharedSourcePatch): boolean; /** A safe CSS representation of a shared patch that can be immediately injected into a frozen DOM preview. */ export declare function sharedSourcePatchCssDeclarations(patch: SharedSourcePatch): Record; /** Page-only fallback scope. When a component scope is found, it is replaced in the corresponding subtree. */ export declare function sharedPageScope(page: Pick): string; /** * Provides a reproducible sourceKey to the DOM tree. * Do not globally connect with the same tag/testid and be sure to * Includes component/page scope + parent structure path + identical sibling occurrences. */ export declare function bindSharedSourceTree(root: NodeModel, page: PageModel): void; export declare function visitSourceNodes(root: NodeModel, visit: (node: NodeModel) => void): void; /** How many frames and layers the sourceKey actually connects to. Used to display the UI influence range. */ export declare function sharedSourceImpact(pages: readonly PageModel[], sourceKey: string): SharedSourceImpact; export declare function applySharedSourceOverrides(root: NodeModel, overrides: ReadonlyMap): void;