import { ComponentPropsWithoutRef, ReactNode, Ref } from 'react'; import { AppSurfaceHandle } from '../AppShell/appSurface/types'; /** * Window presentation: non-modal, draggable `docked` chat or modal `fullscreen` * {@link AppShell}. Restore keeps the docked offset; the next open after close * resets it. */ export type WindowState = "docked" | "fullscreen"; /** * Fixed chat window that expands into a fullscreen {@link AppShell}. Header and * chat nodes retain DOM, scroll, and in-flight state across presentations. Open * and presentation may each be controlled or uncontrolled; imperative * {@link AppSurfaceHandle} transitions use the same callbacks. */ export type WindowProps = Omit, "children" | "style"> & { /** Conversation whose DOM and React state persist across presentations. */ chat: ReactNode; /** Header whose DOM and React state persist across presentations. */ header?: ReactNode; /** Fullscreen navigation region. Not rendered while docked. */ rail?: ReactNode; /** Fullscreen artifact or canvas region. Not rendered while docked. */ artifact?: ReactNode; /** * Controlled open state. Omit for state seeded by {@link defaultOpen}. */ open?: boolean; /** Initial uncontrolled open state. Defaults to `true`. */ defaultOpen?: boolean; /** * Reports every open-state transition, including imperative and region-driven * changes. */ onOpenChange?: (open: boolean) => void; /** * Controlled docked/fullscreen state. Omit for state seeded by * {@link defaultState}. */ state?: WindowState; /** Initial uncontrolled presentation. Defaults to `"docked"`. */ defaultState?: WindowState; /** * Starts the fullscreen rail collapsed without a post-mount transition. * Defaults to `false`. */ defaultRailCollapsed?: boolean; /** * Starts the fullscreen artifact collapsed without a post-mount transition. * Defaults to `false`. */ defaultArtifactCollapsed?: boolean; /** * Reports every presentation transition, including imperative and * region-driven changes. */ onStateChange?: (state: WindowState) => void; /** * Receives the imperative {@link AppSurfaceHandle}. Inside the window, prefer * {@link useAppSurface}; `ref` forwards the root `
`. */ controlRef?: Ref; };