/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import type { RequestOptions } from '@elaraai/e3-api-client'; import { type Formatters } from '@elaraai/east-ui-components'; import { type PreviewControls } from './preview-controls.js'; export interface DatasetPreviewProps { apiUrl: string; repo: string; workspace: string | null; /** Dotted path string, e.g. "inputs.threshold". */ path: string | null; requestOptions?: RequestOptions; /** Max bytes to fetch + render inline. Above this → download button. */ sizeLimit?: number; /** How often the dataset's status is polled, in milliseconds, which says * when its value changed. Default 30 000 (`DATASET_STATUS_POLL_MS`). */ pollInterval?: number; /** When set, leaf edits / inserts / removes / tag switches write back to * this dataset path (for mutable inputs). Task outputs stay read-only. */ editable?: boolean; /** `false` draws no band above the value — no key search, size or * Download — for a host that draws them in its own header (#1120), and * no Collapse all and Expand all above the tree (#1209). A value too * large to show keeps its Download, which is the body. Default `true`. */ toolbar?: boolean; /** The key search, controlled: the host draws its input, and the preview * draws no search box of its own. The text is read in the key search's * grammar and scrolled to its first match; `''` clears (#1120). */ search?: string; /** Told the text of the preview's own search box as it is edited, unless * `search` is given. */ onSearchChange?: (search: string) => void; /** The handle a host's own Collapse all and Expand all act on the tree * through, made with `usePreviewControls` (#1209). */ controls?: PreviewControls; } /** * Human-readable byte size, shared with the paged preview — its digits in the * app's locale (#850). * * @param bytes - The size in bytes * @param words - The formatters; the runtime locale's when omitted * @returns `512 B`, `1.5 KB` or `2.25 MB` (`1,5 KB` in `de-DE`) */ export declare function formatSize(bytes: number, words?: Formatters): string; /** Download trigger with its own in-flight state, shared with the paged preview. */ export declare function DownloadButton({ onClick, label }: { onClick: () => void; label?: string; }): import("react/jsx-runtime").JSX.Element; export declare const DatasetPreview: import("react").MemoExoticComponent<({ apiUrl, repo, workspace, path, requestOptions, sizeLimit, pollInterval, editable, toolbar, search, onSearchChange, controls, }: DatasetPreviewProps) => import("react/jsx-runtime").JSX.Element>; //# sourceMappingURL=DatasetPreview.d.ts.map