import { type Component, Container } from "@earendil-works/pi-tui";
/**
 * Roles that participate in pi's chat spacing contract.
 *
 * Assistant turns own their leading whitespace internally, and tool rows attach
 * directly under the assistant/tool-call row they belong to. User-like rows get
 * one blank line when they are not the first row in the transcript.
 */
export type ChatTranscriptRole = "assistant" | "thinking" | "tool" | "user" | "custom" | "notice" | "system" | "summary";
export interface ChatTranscriptEntryLike {
    readonly role: ChatTranscriptRole;
}
export type ChatTranscriptRenderer<TEntry extends ChatTranscriptEntryLike> = (entry: TEntry) => Component;
export declare function addChatTranscriptEntry(container: Container, component: Component, role: ChatTranscriptRole): void;
/**
 * Reusable pi chat transcript scaffold for extension surfaces.
 *
 * This intentionally mirrors InteractiveMode.addMessageToChat spacing without
 * coupling consumers to a full AgentSession. Extension UIs can bring their own
 * message model while still rendering inside the same Container/Spacer rhythm
 * as the main chat.
 */
export declare class ChatTranscriptComponent<TEntry extends ChatTranscriptEntryLike> implements Component {
    private readonly entries;
    private readonly renderEntry;
    constructor(entries: readonly TEntry[], renderEntry: ChatTranscriptRenderer<TEntry>);
    render(width: number): string[];
    invalidate(): void;
}
/**
 * Sticky-bottom, scrollable viewport for chat-like component stacks.
 *
 * Pi's main interactive chat gets terminal scrollback for free. Extension
 * overlays render into a fixed rectangle, so they need an explicit viewport
 * with the same sticky-bottom default plus keyboard and mouse history controls.
 */
export declare class ScrollableComponentViewport implements Component {
    private components;
    private visibleRows;
    private scrollFromBottom;
    private lastLineCount;
    private lastWidth;
    private maxScroll;
    setComponents(components: readonly Component[]): void;
    setVisibleRows(rows: number): void;
    getScrollFromBottom(): number;
    getMaxScroll(): number;
    scrollToBottom(): void;
    scrollToTop(): void;
    scrollBy(deltaRows: number): void;
    handleInput(data: string): boolean;
    render(width: number): string[];
    invalidate(): void;
    private pageSize;
    private clampScroll;
}
export declare class ScrollableChatTranscriptComponent<TEntry extends ChatTranscriptEntryLike> implements Component {
    private readonly viewport;
    private readonly transcript;
    constructor(entries: readonly TEntry[], renderEntry: ChatTranscriptRenderer<TEntry>);
    setVisibleRows(rows: number): void;
    handleInput(data: string): boolean;
    render(width: number): string[];
    invalidate(): void;
    getScrollFromBottom(): number;
    getMaxScroll(): number;
    scrollToBottom(): void;
}
//# sourceMappingURL=chat-transcript.d.ts.map