import type { Style } from "../../core/types.js"; import type { TLogMinimapDensityBucket } from "../components/TLogMinimap.js"; import type { TLogViewVisibleLink } from "../components/TLogView.js"; import type { TLogLinkAction } from "./use-tlog-link-controller.js"; export type TLogPluginSeverity = "error" | "warning" | "info"; export type TLogPluginLinkSource = "osc8" | "url" | "plugin"; export type TLogPluginVisualSegment = Readonly<{ text: string; cells: number; style?: Style; href?: string; }>; export type TLogViewExternalLink = Readonly<{ id: string; href: string; text: string; absoluteLineIndex: number; lineIndex: number; startCell: number; endCell: number; source: TLogPluginLinkSource; pluginName?: string; data?: unknown; }>; export type TLogViewExternalMarker = Readonly<{ id: string; absoluteLineIndex: number; lineIndex: number; visualRow: number; estimated?: boolean; current?: boolean; label?: string; severity?: TLogPluginSeverity; source: string; data?: unknown; }>; export type TLogViewPluginLineMarker = Readonly<{ id?: string | number; label?: string; severity?: TLogPluginSeverity; estimated?: boolean; data?: unknown; }>; export type TLogViewPluginLineLink = Readonly<{ id?: string | number; href: string; text: string; startCell: number; endCell: number; source?: TLogPluginLinkSource; data?: unknown; }>; export type TLogViewPluginLineMetadata = Readonly<{ level?: TLogPluginSeverity; markers?: readonly TLogViewPluginLineMarker[]; externalLinks?: readonly TLogViewPluginLineLink[]; data?: unknown; }>; export type TLogParsedOsc8Link = Readonly<{ href: string; text: string; startCell: number; endCell: number; }>; export type TLogViewPluginParseLineContext = Readonly<{ lineIndex: number; absoluteLineIndex: number; lineKey: string | number; text: string; plainText: string; osc8Links: readonly TLogParsedOsc8Link[]; }>; export type TLogViewPluginDecorateSegmentsContext = Readonly<{ lineIndex: number; absoluteLineIndex: number; text: string; plainText: string; metadata: TLogViewPluginLineMetadata | null; segments: readonly TLogPluginVisualSegment[]; }>; export type TLogViewPluginIndexedLine = Readonly<{ lineIndex: number; absoluteLineIndex: number; lineKey: string | number; text: string; plainText: string; osc8Links: readonly TLogParsedOsc8Link[]; externalLinks: readonly TLogViewExternalLink[]; results: readonly Readonly<{ pluginName: string; metadata: TLogViewPluginLineMetadata; }>[]; }>; export type TLogViewPluginMarkerContext = Readonly<{ lines: readonly TLogViewPluginIndexedLine[]; currentMatchLineIndex: number | null; totalVisualRows: number; estimateVisualRow: (lineIndex: number) => number; getMetadata: (line: TLogViewPluginIndexedLine, pluginName: string) => TLogViewPluginLineMetadata | null; }>; export type TLogViewPluginDensityContext = TLogViewPluginMarkerContext; export type TLogViewPlugin = Readonly<{ name: string; parseLine?: (ctx: TLogViewPluginParseLineContext) => TLogViewPluginLineMetadata | void; decorateSegments?: (ctx: TLogViewPluginDecorateSegmentsContext) => readonly TLogPluginVisualSegment[] | void; getMarkers?: (ctx: TLogViewPluginMarkerContext) => readonly TLogViewExternalMarker[] | void; getDensityBuckets?: (ctx: TLogViewPluginDensityContext) => readonly TLogMinimapDensityBucket[] | void; onLinkAction?: (action: TLogLinkAction) => void; }>; export type TLogLevelPluginOptions = Readonly<{ errorPattern?: RegExp; warningPattern?: RegExp; infoPattern?: RegExp; includeInfo?: boolean; bucketCount?: number; }>; export type TLogUrlPluginOptions = Readonly<{ pattern?: RegExp; allowFileUrls?: boolean; }>; export declare function stripTLogAnsiText(text: string): string; export declare function parseTLogAnnotatedText(text: string): Readonly<{ plainText: string; osc8Links: readonly TLogParsedOsc8Link[]; }>; export declare function detectTLogUrls(text: string, options?: TLogUrlPluginOptions): readonly TLogViewPluginLineLink[]; export declare function detectTLogLevel(text: string, options?: TLogLevelPluginOptions): TLogPluginSeverity | null; export declare function createTLogDensityBucketsFromMarkers(markers: readonly TLogViewExternalMarker[], totalVisualRows: number, bucketCount?: number): readonly TLogMinimapDensityBucket[]; export declare function getTLogPluginMetadata(line: TLogViewPluginIndexedLine, pluginName: string): TLogViewPluginLineMetadata | null; export declare function dispatchTLogPluginLinkAction(plugins: readonly TLogViewPlugin[] | undefined, action: TLogLinkAction): void; export declare function createTLogLevelPlugin(options?: TLogLevelPluginOptions): TLogViewPlugin; export declare function createTLogOsc8LinkPlugin(): TLogViewPlugin; export declare function createTLogUrlPlugin(options?: TLogUrlPluginOptions): TLogViewPlugin; export declare function createTLogLinkActionPlugin(options: { name: string; onAction: (action: TLogLinkAction) => void; }): TLogViewPlugin; export declare function toTLogExternalLinkFromVisibleLink(link: Pick, idPrefix?: string): TLogViewExternalLink; export declare function createTLogLineMatcherPlugin(options: { name: string; pattern: RegExp | string; severity?: TLogPluginSeverity; label?: string; }): TLogViewPlugin;