import { CountHandler, FetchHandler, FilterValue, GristData, SortersConfig } from './types.js'; export interface DataConsumer extends EventTarget { data: any; _data: GristData; /** The mode the records are drawn in now - a grist's narrow mode while it is narrow. */ readonly shownMode: 'GRID' | 'LIST' | 'CARD' | 'REPORT'; checkDirties(): void; fetchHandler?: FetchHandler; countHandler?: CountHandler; /** The counts the filter choices show - set by the provider from `countHandler`. */ counts?: Record>; filters?: FilterValue[]; sorters?: SortersConfig; searchMode?: string; searchText?: string; /** A malformed address must be shown as an error, never read as an unfiltered list. */ allowFetch?: boolean; showSpinner(): void; hideSpinner(): void; /** The fetch threw. Without this the grid kept its old rows or showed "nothing", and said nothing. */ fetchFailed?(error: unknown): void; /** The fetch answered. Clears a previous failure. */ fetchSucceeded?(): void; }