import { ComponentPropsWithoutRef, ReactNode, Ref } from 'react'; import { ArtifactWidth } from './AppShell.config'; import { AppSurfaceHandle, ArtifactPresentation, ShowArtifactOptions } from './appSurface/types'; export type { AppSurfaceHandle, ArtifactPresentation, ShowArtifactOptions, } from './appSurface/types'; export type { ArtifactWidth }; /** * @internal Controls AppShell regions for a composing Window. */ export type AppShellRegionControls = { showRail: () => void; hideRail: () => void; toggleRail: () => void; showArtifact: (options?: ShowArtifactOptions) => void; hideArtifact: () => void; toggleArtifact: (options?: ShowArtifactOptions) => void; }; /** * Full-size header/rail/chat/artifact layout. Chat stays inline; side regions * resize, yield to drawers by priority, and are controlled through * {@link AppSurfaceHandle}. */ export type AppShellProps = Omit, "children" | "style"> & { /** * Optional top region. Both drawers overlay it; the inline artifact begins * below it. */ header?: ReactNode; /** * Left region. Lowest collapse priority: yields to a drawer before the * artifact. */ rail?: ReactNode; /** * Required center region; always inline and absorbs yielded side space. */ chat: ReactNode; /** * Right region, resizable or drag-detachable into a drawer. It yields after * the rail. */ artifact?: ReactNode; /** * Initial artifact width preset. Dragging may resize it. Defaults to * `"regular"`. See {@link ArtifactWidth}. */ defaultArtifactWidth?: ArtifactWidth; /** * Starts the rail collapsed without a post-mount transition. Defaults to * `false`; the large artifact preset also collapses it independently. */ defaultRailCollapsed?: boolean; /** * Starts the artifact collapsed without a post-mount transition. Defaults to * `false`. */ defaultArtifactCollapsed?: boolean; /** * Receives {@link AppSurfaceHandle}. Inside the shell, prefer * {@link useAppSurface}; `ref` remains the root `
`. */ controlRef?: Ref; /** * @internal Receives region controls for a composing Window. */ regionControlRef?: Ref; /** * @internal Reports artifact presentation to a composing Window. */ onArtifactPresentationChange?: (presentation: ArtifactPresentation) => void; };