import { type SceneDocumentData, type SceneFragmentInstance, type FragmentManagedTarget, type FragmentManagedValue, type JsonValue } from "@skenora/contracts"; import type { ScenePatch } from "../model/types.js"; import { type SceneMutationContext, type SceneMutationResult } from "../inspection/mutations.js"; import { type SceneFragmentSelection } from "./variants.js"; import type { PlanSceneFragmentInsertionOptions, SceneFragmentInsertionContext, SceneFragmentIdentityMapping } from "./types.js"; export interface PlanSceneFragmentInstanceOptions extends PlanSceneFragmentInsertionOptions { readonly instanceId: string; readonly templateId: string; readonly templateRevision: string; readonly selection?: SceneFragmentSelection; } export type SceneFragmentInstancePlan = SceneMutationResult & { readonly instance?: SceneFragmentInstance; }; /** Only assembles the known insertion grammar. Resource bindings are already present. */ export declare function assembleInsertion(document: Readonly, patch: ScenePatch, wrapperId: string): SceneDocumentData; export declare function planSceneFragmentInstanceInsertion(input: unknown, context: SceneFragmentInsertionContext, options: PlanSceneFragmentInstanceOptions): SceneFragmentInstancePlan; export interface SceneFragmentMergeConflict { readonly target: FragmentManagedTarget; readonly path: readonly string[]; readonly reason: "concurrent-change" | "external-reference" | "identity-collision"; readonly base?: JsonValue; readonly local?: JsonValue; readonly template?: JsonValue; } export interface SceneFragmentMergeResolution { readonly target: FragmentManagedTarget; readonly path: readonly string[]; readonly choice: "local" | "template"; } export interface SceneFragmentUpgradeOptions { readonly templateRevision: string; readonly resourceBindings: Readonly>; readonly selection?: SceneFragmentSelection; readonly viewportEffects?: "reject" | "preserve-world"; readonly resolutions?: readonly SceneFragmentMergeResolution[]; } export type SceneFragmentUpgradePlan = SceneFragmentInstancePlan & { readonly conflicts: readonly SceneFragmentMergeConflict[]; }; /** B/L/N merge using the persisted baseline, never an inferred historical template. */ export declare function planSceneFragmentInstanceUpgrade(input: unknown, instanceId: string, context: SceneFragmentInsertionContext, options: SceneFragmentUpgradeOptions): SceneFragmentUpgradePlan; export declare function planSceneFragmentInstanceDetach(instanceId: string, context: SceneMutationContext): SceneMutationResult; /** Adopt existing independent content only with an exactly reproduced template baseline and ID mapping. */ export declare function planSceneFragmentInstanceAdoption(input: unknown, context: SceneFragmentInsertionContext, options: PlanSceneFragmentInstanceOptions, evidence: { readonly baseline: readonly FragmentManagedValue[]; readonly idMap: readonly SceneFragmentIdentityMapping[]; }): SceneFragmentInstancePlan; //# sourceMappingURL=instances.d.ts.map