import { ObjectValues, ObjectMap, FlowAnyFunction, FlowAnyObject } from '../private_utils'; import Sdk from '../sdk'; import { TableId, TableData } from '../types/table'; import { FieldId } from '../types/field'; import { RecordId } from '../types/record'; import { ViewId } from '../types/view'; import { AirtableInterface } from '../types/airtable_interface'; import AbstractModelWithAsyncData from './abstract_model_with_async_data'; import Record from './record'; import ViewDataStore from './view_data_store'; import { ChangedPathsForType } from './base'; export declare const WatchableRecordStoreKeys: Readonly<{ records: "records"; recordIds: "recordIds"; cellValues: "cellValues"; }>; /** * The string case is to accommodate prefix keys * * @internal */ export declare type WatchableRecordStoreKey = ObjectValues | string; /** * One RecordStore exists per table, and contains all the record data associated with that table. * Table itself is for schema information only, so isn't the appropriate place for this data. * * @internal */ declare class RecordStore extends AbstractModelWithAsyncData { static _className: string; static _isWatchableKey(key: string): boolean; static _shouldLoadDataForKey(key: WatchableRecordStoreKey): boolean; readonly tableId: TableId; _recordModelsById: ObjectMap; readonly _primaryFieldId: FieldId; readonly _airtableInterface: AirtableInterface; readonly _viewDataStoresByViewId: ObjectMap; _areCellValuesLoadedByFieldId: ObjectMap; _pendingCellValuesLoadPromiseByFieldId: ObjectMap> | undefined>; _cellValuesRetainCountByFieldId: ObjectMap; constructor(sdk: Sdk, tableId: TableId); getViewDataStore(viewId: ViewId): ViewDataStore; watch(keys: WatchableRecordStoreKey | ReadonlyArray, callback: FlowAnyFunction, context?: FlowAnyObject | null): Array; unwatch(keys: WatchableRecordStoreKey | ReadonlyArray, callback: FlowAnyFunction, context?: FlowAnyObject | null): Array; _getFieldIdsToLoadFromWatchableKeys(keys: Array): Array; get _dataOrNullIfDeleted(): TableData | null; _onChangeIsDataLoaded(): void; /** * The records in this table. The order is arbitrary since records are * only ordered in the context of a specific view. */ get records(): Array; /** * The record IDs in this table. The order is arbitrary since records are * only ordered in the context of a specific view. */ get recordIds(): Array; getRecordByIdIfExists(recordId: string): Record | null; __onDataDeletion(): void; /** * Record metadata means record IDs, createdTime, and commentCount are loaded. * Record metadata must be loaded before creating, deleting, or updating records. */ get isRecordMetadataLoaded(): boolean; loadRecordMetadataAsync(): Promise; unloadRecordMetadata(): void; _getFieldIdForCausingRecordMetadataToLoad(): FieldId; areCellValuesLoadedForFieldId(fieldId: FieldId): boolean; loadCellValuesInFieldIdsAsync(fieldIds: Array): Promise; _loadCellValuesInFieldIdsAsync(fieldIds: Array): Promise>; unloadCellValuesInFieldIds(fieldIds: Array): void; _unloadCellValuesInFieldIds(fieldIds: Array): void; _loadDataAsync(): Promise>; _unloadData(): void; _afterUnloadDataOrUnloadCellValuesInFieldIds(unloadedFieldIds?: Array): void; triggerOnChangeForDirtyPaths(dirtyPaths: ChangedPathsForType): void; } /** @internal */ export default RecordStore;