import type { YooEditor, YooptaPathIndex } from '@yoopta/editor'; import type { CodeElement, CodeElementProps } from '../types'; import { type FormatCodeOptions } from '../utils/prettier'; type CodeElementOptions = { text?: string; props?: CodeElementProps; }; type InsertCodeOptions = CodeElementOptions & { at?: YooptaPathIndex; focus?: boolean; }; export type BeautifyCodeResult = { success: boolean; error?: string; }; export type CodeCommandsType = { buildCodeElements: (editor: YooEditor, options?: Partial) => CodeElement; insertCode: (editor: YooEditor, options?: Partial) => void; deleteCode: (editor: YooEditor, blockId: string) => void; updateCodeTheme: (editor: YooEditor, blockId: string, theme: CodeElementProps['theme']) => void; updateCodeLanguage: (editor: YooEditor, blockId: string, language: CodeElementProps['language']) => void; /** Formats the code string and returns the result (does not modify editor) */ prettifyCode: (editor: YooEditor, code: string, language: string, options?: FormatCodeOptions) => Promise<{ formatted: string; success: boolean; error?: string; }>; /** Beautifies the code in the specified block (modifies editor content) */ beautifyCode: (editor: YooEditor, blockId: string, options?: FormatCodeOptions) => Promise; /** Checks if a language supports formatting */ isLanguageSupported: (language: string) => boolean; }; export declare const CodeCommands: CodeCommandsType; export {}; //# sourceMappingURL=code-commands.d.ts.map