/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import type { RequestOptions, TaskDetails } from '@elaraai/e3-api-client'; import { type PreviewControls } from './preview-controls.js'; import type { LogMatches } from './VirtualizedLogViewer.js'; type ViewMode = 'output' | 'logs'; export interface DataTaskPreviewProps { apiUrl: string; repo: string; workspace: string; task: string; requestOptions?: RequestOptions; /** Initially selected tab, when `view` is not given. Default 'output'. */ initialView?: ViewMode; /** The tab, controlled (#1120): the preview shows it, and tells * `onViewChange` of a switch rather than making it. */ view?: ViewMode; /** Told the tab the preview's switch picks. */ onViewChange?: (view: ViewMode) => void; /** The tabs this preview offers; omitted or empty, both. One left, no switch shows, and a tab left out is never drawn. */ views?: readonly ViewMode[]; /** Max output bytes to render inline (above → download button). Default 200KB. */ sizeLimit?: number; /** `false` draws no band — no Output/Logs switch; no key search, size or * Download above the output (#1120), nor its tree's Collapse all and * Expand all; and no tabs, search or Copy above the log, which fills the * view (#1209). Default `true`. */ toolbar?: boolean; /** The output's key search, controlled: see {@link DatasetPreviewProps.search}. */ search?: string; /** Told the text of the output's own search box: see {@link DatasetPreviewProps.onSearchChange}. */ onSearchChange?: (search: string) => void; /** The log's stream, controlled (#1209): the log's tabs show it, and tell * `onLogStreamChange` of a click rather than switching. */ logStream?: 'stdout' | 'stderr'; /** Told the stream the log's tabs pick. */ onLogStreamChange?: (stream: 'stdout' | 'stderr') => void; /** The log's search, controlled (#1209): the log draws no search box, * count or chevrons of its own, marks the text's matches in any case and * scrolls to the first; `''` clears. */ logSearch?: string; /** Told the text of the log's own search box as it is edited, unless * `logSearch` is given. */ onLogSearchChange?: (search: string) => void; /** Told the log's match shown (from 0) and how many there are whenever * either changes, for the host's "3/17" (#1209). */ onLogMatchesChange?: (matches: LogMatches) => void; /** The handle a host's own controls act through, made with * `usePreviewControls` (#1209). */ controls?: PreviewControls; /** The task's details, when the host holds them: the preview reads them * from the host rather than the server. */ details?: TaskDetails; /** How often the output's status is polled, in milliseconds: see * {@link DatasetPreviewProps.pollInterval}. Default 30 000. */ statusPollInterval?: number; /** How often the log is polled while it changes, in milliseconds: * see `TaskLogsProps.pollInterval`. Default 1000. */ logPollInterval?: number; /** The longest the log waits between polls while nothing changes, in * milliseconds: see `TaskLogsProps.pollBackoff`. Default 5000. */ logPollBackoff?: number; } export declare const DataTaskPreview: import("react").MemoExoticComponent<({ apiUrl, repo, workspace, task, requestOptions, initialView, view, onViewChange, views, sizeLimit, toolbar, search, onSearchChange, logStream, onLogStreamChange, logSearch, onLogSearchChange, onLogMatchesChange, controls, details, statusPollInterval, logPollInterval, logPollBackoff, }: DataTaskPreviewProps) => import("react/jsx-runtime").JSX.Element>; export {}; //# sourceMappingURL=DataTaskPreview.d.ts.map