import type { CellData, CursorState, UnhandledSequence, TerminalCore, TerminalGraphicsState, TerminalImageData, TerminalResourceState } from "@wterm/core"; /** Maximum decoded bytes accepted for one direct Kitty image. */ export declare const MAX_IMAGE_BYTES: number; export interface GhosttyOptions { wasmPath?: string; scrollbackLimit?: number; foregroundColor?: string; backgroundColor?: string; /** Decoded Kitty image bytes per screen. Zero disables image support. */ imageStorageLimit?: number; } /** * Terminal core powered by libghostty built from source. Implements the * same `TerminalCore` interface as wterm's built-in Zig core, providing * full-featured VT emulation including proper Unicode grapheme handling, * all SGR attributes, terminal modes, and more. * * @example * ```ts * import { WTerm } from '@wterm/dom'; * import { GhosttyCore } from '@wterm/ghostty'; * * const core = await GhosttyCore.load(); * const term = new WTerm(el, { core }); * await term.init(); * ``` */ export declare class GhosttyCore implements TerminalCore { private wasm; private termPtr; private _options; private _foregroundRgb; private _backgroundRgb; private _viewportBufPtr; private _viewportBufSize; private _viewportView; private _viewportStale; private _cols; private _rows; private _scrollbackBufPtr; private _scrollbackBufSize; private _scrollbackView; private _scrollbackOffset; private _scrollbackLen; private _graphemeBufPtr; private _graphemeBufSize; private _hyperlinkBufPtr; private _hyperlinkBufSize; private _graphicsBufPtr; private _graphicsBufSize; private _graphicsState; private _disposed; private constructor(); /** * Load the ghostty-vt WASM binary and create a new `GhosttyCore`. * The returned core is ready to be passed as the `core` option to `WTerm`. */ static load(options?: GhosttyOptions): Promise; init(cols: number, rows: number): void; resize(cols: number, rows: number): void; writeString(str: string, afterChunk?: () => void): void; writeRaw(data: Uint8Array, afterChunk?: () => void): void; getCell(row: number, col: number): CellData; isDirtyRow(row: number): boolean; clearDirty(): void; getCols(): number; getRows(): number; getCursor(): CursorState; cursorKeysApp(): boolean; bracketedPaste(): boolean; usingAltScreen(): boolean; mouseTracking(): 0 | 1000 | 1002; mouseSgr(): boolean; focusEvents(): boolean; synchronizedOutput(): boolean; synchronizedOutputGeneration(): number; kittyKeyboardFlags(): number; getGraphicsState(): TerminalGraphicsState | null; getGraphicsImage(imageId: number, version: number): TerminalImageData | null; getResourceState(): TerminalResourceState; dispose(): void; private _deinitTerminal; getTitle(): string | null; getResponse(): string | null; getScrollbackCount(): number; getScrollbackDiscardedCount(): number; getScrollbackCell(offset: number, col: number): CellData; getScrollbackLineLen(offset: number): number; getUnhandledSequences(): UnhandledSequence[]; private _invalidate; private _decodeGrapheme; private _ensureGraphemeBuffer; private _ensureHyperlinkBuffer; private _readHyperlink; private _readGrapheme; private _readScrollbackGrapheme; private _allocViewportBuffer; /** * Decode one scrollback row into the shared buffer, at most once per row * per invalidation, and return its length. The renderer reads a row column * by column, so without this each cell would cost a page-list walk. */ private _ensureScrollbackLine; private _ensureViewport; } //# sourceMappingURL=ghostty-core.d.ts.map