import { type StyledLine } from './styled-line.js';
import { type ReactNode } from 'react';
import * as dom from './dom.js';
import { type InkOptions } from './components/AppContext.js';
import ResizeObserver, { ResizeObserverEntry } from './resize-observer.js';
import { Selection } from './selection.js';
/**
Performance metrics for a render operation.
*/
export type RenderMetrics = {
    /**
    Time spent rendering in milliseconds.
    */
    renderTime: number;
    /**
    Output string for the frame.
    */
    output: string;
    /**
    Static output string for the frame.
    */
    staticOutput?: string;
};
export type Options = {
    stdout: NodeJS.WriteStream;
    stdin: NodeJS.ReadStream;
    stderr: NodeJS.WriteStream;
    debug: boolean;
    exitOnCtrlC: boolean;
    patchConsole: boolean;
    onRender?: (metrics: RenderMetrics) => void;
    isScreenReaderEnabled?: boolean;
    waitUntilExit?: () => Promise<void>;
    maxFps?: number;
    alternateBuffer?: boolean;
    alternateBufferAlreadyActive?: boolean;
    isAlternateBufferEnabled?: boolean;
    stickyHeadersInBackbuffer?: boolean;
    incrementalRendering?: boolean;
    debugRainbow?: boolean;
    animatedScroll?: boolean;
    animationInterval?: number;
    backbufferUpdateDelay?: number;
    maxScrollbackLength?: number;
    forceScrollToBottomOnBackbufferRefresh?: boolean;
    selectionStyle?: (line: StyledLine, index: number) => void;
    standardReactLayoutTiming?: boolean;
    renderProcess?: boolean;
    terminalBuffer?: boolean;
    cacheToStyledCharacters?: boolean;
    trackSelection?: boolean;
};
export default class Ink {
    readonly rootNode: dom.DOMElement;
    private readonly options;
    private readonly log;
    private readonly throttledLog;
    private readonly isScreenReaderEnabled;
    private readonly selection;
    private readonly terminalBuffer?;
    private optionsState;
    private isUnmounted;
    private lastOutput;
    private lastOutputHeight;
    private lastCursorPosition?;
    private readonly container;
    private node;
    private fullStaticOutput;
    private exitPromise?;
    private restoreConsole?;
    private readonly unsubscribeResize?;
    private readonly unsubscribeSelection?;
    private frameIndex;
    constructor(options: Options);
    resized: () => void;
    getSelection(): Selection;
    resolveExitPromise: () => void;
    rejectExitPromise: (reason?: Error) => void;
    unsubscribeExit: () => void;
    calculateLayout: () => void;
    calculateLayoutAndTriggerObservers(node: dom.DOMElement, observerEntries: Map<ResizeObserver, ResizeObserverEntry[]>): void;
    onRender: () => Promise<void>;
    recalculateLayout(): void;
    onRerender: () => void;
    setOptions: (options: Partial<InkOptions>) => void;
    render(node: ReactNode): void;
    writeToStdout(data: string): void;
    writeToStderr(data: string): void;
    unmount(error?: Error | number | null): void;
    waitUntilExit(): Promise<void>;
    dumpCurrentFrame(filename: string): void;
    startRecording(filename: string): void;
    stopRecording(): void;
    clear(): void;
    patchConsole(): void;
    private renderWithTerminalBuffer;
    private renderDebug;
    private renderCi;
    private renderAlternateBuffer;
    private renderScreenReader;
    private renderFullTerminal;
    /**
     * The goal is to remove this method making terminal buffer required.
     */
    private renderLegacy;
    private markAllTextNodesDirty;
    private callOnRender;
}
