Skip to main content

JSEDITORAPI_TS_PREAMBLE

Constant JSEDITORAPI_TS_PREAMBLE 

Source
pub const JSEDITORAPI_TS_PREAMBLE: &str = "/**\n * Fresh Editor TypeScript Plugin API\n *\n * This file provides type definitions for the Fresh editor\'s TypeScript plugin system.\n * Plugins have access to the global `editor` object which provides methods to:\n * - Query editor state (buffers, cursors, viewports)\n * - Modify buffer content (insert, delete text)\n * - Add visual decorations (overlays, highlighting)\n * - Interact with the editor UI (status messages, prompts)\n *\n * AUTO-GENERATED FILE - DO NOT EDIT MANUALLY\n * Generated by fresh-plugin-api-macros + ts-rs from JsEditorApi impl\n */\n\n/**\n * Get the editor API instance.\n * Plugins must call this at the top of their file to get a scoped editor object.\n */\ndeclare function getEditor(): EditorAPI;\n\n/** Handle for a cancellable async operation */\ninterface ProcessHandle<T> extends PromiseLike<T> {\n  /** Promise that resolves to the result when complete */\n  readonly result: Promise<T>;\n  /** Cancel/kill the operation. Returns true if cancelled, false if already completed */\n  kill(): Promise<boolean>;\n}\n\n/** Buffer identifier */\ntype BufferId = number;\n\n/** Split identifier */\ntype SplitId = number;\n\n";
Expand description

TypeScript preamble (header, getEditor, ProcessHandle, BufferId, SplitId)

Combine with ts-rs types and EDITOR_API to create fresh.d.ts