(command: FoldCommand)
| 29 | type FoldCommand = 'foldCode' | 'unfoldCode' | 'foldAll' | 'unfoldAll' |
| 30 | |
| 31 | async function runFoldCommand(command: FoldCommand): Promise<void> { |
| 32 | const view = useStore.getState().editorViewRef |
| 33 | if (!view) return |
| 34 | const foldModule = await import('@codemirror/language') |
| 35 | foldModule[command](view) |
| 36 | view.focus() |
| 37 | } |
| 38 | |
| 39 | export interface Command { |
| 40 | /** Stable identifier — used as React key and for analytics. */ |