/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type UseQueryResult } from '@tanstack/react-query'; import type { RequestOptions } from '@elaraai/e3-api-client'; import { type EastTypeValue } from '@elaraai/east'; import type { QueryOverrides } from './types.js'; /** * How often a dataset's status is polled unless asked otherwise: every half * minute. The status — the dataset's hash, type and size — is what a preview * reads its value by, so a preview follows a change within this long, which * a host showing a value as it changes shortens (`pollInterval`). */ export declare const DATASET_STATUS_POLL_MS = 30000; export interface DatasetStatus { path: string; type: EastTypeValue; /** "unassigned" | "null" | "value" */ refType: string; hash: string | null; sizeBytes: number | null; } export interface UseDatasetStatusOptions { requestOptions?: RequestOptions; /** How often the status is polled, in milliseconds * (default {@link DATASET_STATUS_POLL_MS}) */ pollInterval?: number; queryOverrides?: QueryOverrides; } /** * Lightweight status fetch — hash, type, size. No value bytes. Polled every * {@link DATASET_STATUS_POLL_MS} unless `options.pollInterval` says * otherwise, each poll one request attempt: its next poll is its retry. * * @param apiUrl - Base URL of the e3 API server * @param repo - Repository name * @param workspace - Workspace name; nothing is read while `null` * @param datasetPath - The dataset's dotted path; nothing is read while `null` * @param options - The requests' options, the poll's interval and react-query overrides * @returns The query of the status */ export declare function useDatasetStatus(apiUrl: string, repo: string, workspace: string | null, datasetPath: string | null, options?: UseDatasetStatusOptions): UseQueryResult; //# sourceMappingURL=useDatasetStatus.d.ts.map