import { LayoutNode, LayoutEngine, LayoutEngineOptions, StackNode, StackOptions, StackAlignment, FrameNode, FrameOptions, Alignment, PaddingNode, PaddingOptions, InsetsInput, DecorationOptions, ZStackNode, ZStackOptions, Rect, SpacerNode, SpacerOptions, ProposedSize, LayoutDebugStats } from '@liquid-dom/layout'; import { DomLeaf, DomLeafSizing } from '@liquid-dom/layout/dom'; import { C as Container, G as Glass$1, e as Group, g as StackingContext, H as Html$1, S as Scene, i as Transform$1, j as ContainerInit, h as SurfaceProfile, a as SpecularWidth, f as RgbaColor, k as GlassInit } from './events-CKVs_a7L.js'; type SceneNode = Container | Glass$1 | Group | StackingContext | Html$1; type UiParent = LayoutScene | UiNode; /** Any node accepted by the layout UI tree. */ type LayoutUiNode = HStack | VStack | Frame | Padding | Overlay | Background | ZStack | Transform | GlassContainer | Glass | Html | Spacer; /** Constructor options for {@link LayoutScene}. */ type LayoutSceneOptions = Omit & { /** Optional root node to attach immediately. */ root?: LayoutUiNode; }; /** Kind of layout UI invalidation emitted by {@link LayoutScene}. */ type LayoutSceneInvalidationKind = 'layout' | 'frame'; /** Invalidation emitted when layout UI nodes are mutated imperatively. */ type LayoutSceneInvalidation = { /** Whether the mutation requires a layout pass or only a new frame. */ kind: LayoutSceneInvalidationKind; /** Optional source node for mutations that came from the layout UI tree. */ node?: LayoutUiNode; /** Optional low-level invalidation detail. */ cause?: unknown; }; /** Listener registered with {@link LayoutScene.addInvalidationListener}. */ type LayoutSceneInvalidationListener = (invalidation: LayoutSceneInvalidation) => void; /** Constructor options for {@link GlassContainer}. */ type GlassContainerOptions = Omit; /** Constructor options for {@link Glass}. */ type GlassOptions = Omit; /** Constructor options for {@link Html}. */ type HtmlOptions = { /** Final opacity used when compositing this HTML node into the rendered scene. */ opacity?: number; /** Content blur radius in CSS pixels applied when compositing this HTML node. */ blur?: number; /** Scene draw order among sibling scene or glass HTML nodes. */ zIndex?: number; /** Measured content element rendered inside the layout-owned scene HTML host. */ element?: HTMLElement | null; /** DOM measurement mode used by the default DOM measurement path. */ sizing?: DomLeafSizing; }; /** Unit-space origin for a layout transform. `{ x: 0, y: 0 }` is top-left and `{ x: 0.5, y: 0.5 }` is center. */ type UnitPoint = { x: number; y: number; }; /** Constructor options for {@link Transform}. */ type TransformOptions = Omit, 'origin'> & { /** Transform origin as a unit point in the layout node's measured bounds. */ origin?: UnitPoint; }; /** * Base class for nodes in the liquid-glass layout UI tree. */ declare abstract class UiNode { /** Node owned by the @liquid-dom/layout engine. */ readonly layoutNode: Layout; /** Scene graph node owned by the liquid-glass renderer, when this node has one. */ readonly sceneNode: SceneRef; _parent: UiParent | null; protected readonly _children: LayoutUiNode[]; protected constructor(layoutNode: Layout, sceneNode: SceneRef); /** UI children in layout order. */ get children(): readonly LayoutUiNode[]; /** Adds a child node, reparenting it from any previous UI parent. */ add(child: T): T; /** Detaches this node from its current UI parent. */ remove(): void; _detachChild(child: LayoutUiNode): void; _applyLayoutTree(): void; protected addChild(child: T): T; _emitInvalidation(invalidation: LayoutSceneInvalidation): void; protected invalidateLayout(cause?: unknown): void; protected invalidateFrame(cause?: unknown): void; protected assertCanAddChild(_child: LayoutUiNode): void; protected attachChildScene(child: LayoutUiNode): void; protected applyLayoutRect(rect: Rect): void; } /** * Base class for layout nodes that accept exactly one child. */ declare abstract class SingleChildUiNode extends UiNode { add(child: T): T; protected assertCanAddChild(child: LayoutUiNode): void; } /** * Root owner for a layout UI tree, @liquid-dom/layout engine, and raw liquid-glass scene. */ declare class LayoutScene { /** Raw scene consumed by {@link import('./renderer').Renderer}. */ readonly scene: Scene; /** Layout engine used to measure and place the UI tree. */ readonly engine: LayoutEngine; private _root; private readonly invalidationListeners; constructor(options?: LayoutSceneOptions); /** Current root UI node, if one is attached. */ get root(): LayoutUiNode | null; /** Adds a listener for UI mutations that require layout or rendering work. */ addInvalidationListener(listener: LayoutSceneInvalidationListener): () => void; /** Adds the root UI node, replacing no existing root. */ add(child: T): T; /** Runs layout and applies the resulting geometry to the mirrored scene graph. */ layout(proposal: ProposedSize): LayoutDebugStats; /** Returns the @liquid-dom/layout engine's most recent debug stats. */ getDebugStats(): LayoutDebugStats; /** Detaches the root and disposes the layout engine. */ dispose(): void; _detachChild(child: LayoutUiNode): void; _emitInvalidation(invalidation: LayoutSceneInvalidation): void; } /** * Horizontal stack layout backed by a transform-only scene group. */ declare class HStack extends UiNode { constructor(options?: StackOptions); get spacing(): number; set spacing(value: number); get alignment(): StackAlignment; set alignment(value: StackAlignment); } /** * Vertical stack layout backed by a transform-only scene group. */ declare class VStack extends UiNode { constructor(options?: StackOptions); get spacing(): number; set spacing(value: number); get alignment(): StackAlignment; set alignment(value: StackAlignment); } /** * Z-stack layout backed by a local stacking context. */ declare class ZStack extends UiNode { private readonly sceneSlots; constructor(options?: ZStackOptions); get alignment(): Alignment; set alignment(value: Alignment); _detachChild(child: LayoutUiNode): void; protected addChild(child: T): T; protected attachChildScene(child: LayoutUiNode): void; private syncSlotZIndices; } /** * Frame layout backed by a transform-only scene group. */ declare class Frame extends SingleChildUiNode { constructor(options?: FrameOptions); get width(): number | undefined; set width(value: number | undefined); get height(): number | undefined; set height(value: number | undefined); get minWidth(): number | undefined; set minWidth(value: number | undefined); get minHeight(): number | undefined; set minHeight(value: number | undefined); get idealWidth(): number | undefined; set idealWidth(value: number | undefined); get idealHeight(): number | undefined; set idealHeight(value: number | undefined); get maxWidth(): FrameNode['maxWidth']; set maxWidth(value: FrameNode['maxWidth']); get maxHeight(): FrameNode['maxHeight']; set maxHeight(value: FrameNode['maxHeight']); get alignment(): Alignment; set alignment(value: Alignment); } /** * Padding layout backed by a transform-only scene group. */ declare class Padding extends SingleChildUiNode { constructor(options?: PaddingOptions); get insets(): InsetsInput; set insets(value: InsetsInput); } declare abstract class DecorationUiNode extends UiNode { private readonly sceneOrder; private readonly emptyContent; private readonly emptyDecoration; private readonly contentSlot; private readonly decorationSlot; private content; private decoration; protected constructor(layoutNode: LayoutNode, sceneOrder: 'background' | 'overlay'); add(child: T): T; /** Replaces the content child. */ setContent(child: T): T; /** Replaces the decoration child. */ setDecoration(child: T): T; get alignment(): Alignment; set alignment(value: Alignment); _detachChild(child: LayoutUiNode): void; private replaceSlot; private syncLayoutSlots; private syncSceneSlots; private syncSlotZIndices; } /** * Background decoration layout backed by a local stacking context. */ declare class Background extends DecorationUiNode { constructor(options?: DecorationOptions); } /** * Overlay decoration layout backed by a local stacking context. */ declare class Overlay extends DecorationUiNode { constructor(options?: DecorationOptions); } /** * Layout pass-through node that contributes an explicit scene transform. */ declare class Transform extends SingleChildUiNode { private _x; private _y; private _scaleX; private _scaleY; private _rotation; private _origin; constructor(options?: TransformOptions); get x(): number; set x(value: number); get y(): number; set y(value: number); get scaleX(): number; set scaleX(value: number); get scaleY(): number; set scaleY(value: number); get rotation(): number; set rotation(value: number); get origin(): UnitPoint; set origin(value: UnitPoint); protected applyLayoutRect(rect: Rect): void; private syncSceneTransform; } /** * Liquid-glass container view backed by a scene {@link SceneContainer}. */ declare class GlassContainer extends SingleChildUiNode { constructor(options?: GlassContainerOptions); get opacity(): number; set opacity(value: number); get spacing(): number; set spacing(value: number); get blur(): number; set blur(value: number); get bezelWidth(): number; set bezelWidth(value: number); get thickness(): number; set thickness(value: number); get displacementFactor(): number; set displacementFactor(value: number); get displacementBlur(): number; set displacementBlur(value: number); get normalDivergenceBlendPower(): number; set normalDivergenceBlendPower(value: number); get normalDivergenceBlendEnabled(): boolean; set normalDivergenceBlendEnabled(value: boolean); get ior(): number; set ior(value: number); get contentIor(): number; set contentIor(value: number); get contentDepth(): number; set contentDepth(value: number); get dispersion(): number; set dispersion(value: number); get surfaceProfile(): SurfaceProfile; set surfaceProfile(value: SurfaceProfile); get lightDirection(): number; set lightDirection(value: number); get specularStrength(): number; set specularStrength(value: number); get specularWidth(): SpecularWidth; set specularWidth(value: SpecularWidth); get specularFalloff(): number; set specularFalloff(value: number); get oppositeSpecularStrength(): number; set oppositeSpecularStrength(value: number); get specularSharpness(): number; set specularSharpness(value: number); get specularOpacity(): number; set specularOpacity(value: number); get reflectionOffset(): number; set reflectionOffset(value: number); get tint(): RgbaColor; set tint(value: RgbaColor); get shadowColor(): RgbaColor; set shadowColor(value: RgbaColor); get shadowOffsetX(): number; set shadowOffsetX(value: number); get shadowOffsetY(): number; set shadowOffsetY(value: number); get shadowBlur(): number; set shadowBlur(value: number); get shadowSpread(): number; set shadowSpread(value: number); get debugDisplacement(): boolean; set debugDisplacement(value: boolean); get zIndex(): number; set zIndex(value: number); } /** * Liquid-glass shape view backed by a scene {@link SceneGlass}. */ declare class Glass extends SingleChildUiNode { constructor(options?: GlassOptions); get cornerRadius(): number; set cornerRadius(value: number); get cornerSmoothing(): number; set cornerSmoothing(value: number); get pointerEvents(): boolean; set pointerEvents(value: boolean); get zIndex(): number; set zIndex(value: number); protected applyLayoutRect(rect: Rect): void; } /** * DOM-backed HTML view backed by a measured layout leaf and scene {@link SceneHtml}. */ declare class Html extends UiNode { private readonly ownedElement; constructor(options?: HtmlOptions); add(_child: T): T; /** DOM measurement sizing mode. */ get sizing(): DomLeafSizing; set sizing(value: DomLeafSizing | undefined); get opacity(): number; set opacity(value: number); get blur(): number; set blur(value: number); get zIndex(): number; set zIndex(value: number); get element(): HTMLElement | null; set element(value: HTMLElement | null); /** Replaces the measured content element inside the layout-owned scene host. */ setElement(element: HTMLElement | null): void; protected applyLayoutRect(rect: Rect): void; } /** * Layout-only spacer leaf. It has no liquid-glass scene node. */ declare class Spacer extends UiNode { constructor(options?: SpacerOptions); add(_child: T): T; get minLength(): number; set minLength(value: number); } export { Background, Frame, Glass, GlassContainer, type GlassContainerOptions, type GlassOptions, HStack, Html, type HtmlOptions, LayoutScene, type LayoutSceneInvalidation, type LayoutSceneInvalidationKind, type LayoutSceneInvalidationListener, type LayoutSceneOptions, type LayoutUiNode, Overlay, Padding, Spacer, Transform, type TransformOptions, type UnitPoint, VStack, ZStack };