export type DataSourceStatus = "idle" | "loading" | "ready" | "error"; export interface DataSourceState { readonly status: DataSourceStatus; readonly data: T | undefined; readonly error: Error | undefined; } export interface DataSourceClock { setInterval(handler: () => void, intervalMs: number): unknown; clearInterval(handle: unknown): void; } export interface DataSourceOptions { intervalMs?: number; clock?: DataSourceClock; } export interface RefreshOptions { force?: boolean; } export interface DataSource { getState(): DataSourceState; subscribe(listener: (state: DataSourceState) => void): () => void; refresh(options?: RefreshOptions): Promise; startPolling(intervalMs?: number): void; stopPolling(): void; dispose(): void; } export declare function createDataSource(load: (signal: AbortSignal) => Promise, options?: DataSourceOptions): DataSource;