import { Screen, Theme } from '@janbox/storefront-ui/theme'; import { SerializedNodes } from '../../types'; import { EditorResources } from '../types'; import { CopilotHandler, NodeRegistry } from '../../ai'; export type EditorMode = 'full' | 'compact'; export type EditorHandlers = { close: () => void; submit: (abc: SerializedNodes) => void | Promise; upload: (file: File) => string | Promise; saveTheme?: (theme: Theme) => void | Promise; /** Enables the AI Copilot panel. Everything it yields is treated as untrusted input. */ copilot?: CopilotHandler; }; export type EditorState = { theme: Theme; handlers: Readonly; screen: Screen; action?: string; /** Tài nguyên edit-time do consumer cấp. Truyền một lần lúc init, bất biến. */ resources?: EditorResources; /** Registry of core and consumer node schemas, set once at init. Readers fall back to `CORE_REGISTRY`. */ nodeRegistry?: NodeRegistry; }; type MutableEditorState = Pick; type EditorStateValue = EditorState & { setState: (partial: Partial) => void; }; export declare const useEditor: (initialState?: EditorState) => EditorStateValue; export {};