import { CompilerOptions } from '@typespec/compiler'; import { PlaygroundSample } from '../types.js'; export interface PlaygroundState { /** Emitter to use */ emitter?: string; /** Emitter options */ compilerOptions?: CompilerOptions; /** Raw tspconfig.yaml content. Source of truth for the compiler configuration. */ tspconfig?: string; /** Sample to use */ sampleName?: string; /** Selected viewer */ selectedViewer?: string; /** Internal state of viewers */ viewerState?: Record; /** TypeSpec content */ content?: string; } export interface UsePlaygroundStateProps { /** List of available libraries */ readonly libraries: readonly string[]; /** Samples available */ samples?: Record; /** Playground state (controlled) */ playgroundState?: PlaygroundState; /** Default playground state if leaving this unmanaged */ defaultPlaygroundState?: PlaygroundState; /** Callback when playground state changes */ onPlaygroundStateChange?: (state: PlaygroundState) => void; /** * Default emitter to use if not provided in defaultPlaygroundState. * @deprecated Use defaultPlaygroundState.emitter instead */ defaultEmitter?: string; /** Default content if not provided in defaultPlaygroundState */ defaultContent?: string; } export interface PlaygroundStateResult { selectedEmitter: string; compilerOptions: CompilerOptions; /** Raw tspconfig.yaml content (source of truth for the configuration). */ tspconfig: string; selectedSampleName: string; selectedViewer?: string; viewerState: Record; content: string; onSelectedEmitterChange: (emitter: string) => void; onCompilerOptionsChange: (compilerOptions: CompilerOptions) => void; onTspconfigChange: (tspconfig: string) => void; onSelectedSampleNameChange: (sampleName: string) => void; onSelectedViewerChange: (selectedViewer: string) => void; onViewerStateChange: (viewerState: Record) => void; onContentChange: (content: string) => void; playgroundState: PlaygroundState; setPlaygroundState: (state: PlaygroundState) => void; } export declare function usePlaygroundState({ libraries, samples, playgroundState: controlledPlaygroundState, defaultPlaygroundState, onPlaygroundStateChange, defaultEmitter, defaultContent, }: UsePlaygroundStateProps): PlaygroundStateResult; //# sourceMappingURL=use-playground-state.d.ts.map