UNPKG

@statezero/core

Version:

The type-safe frontend client for StateZero - connect directly to your backend models with zero boilerplate

44 lines (43 loc) 1.63 kB
export class ModelStore { constructor(modelClass: any, fetchFn: any, initialGroundTruth?: null, initialOperations?: null, options?: {}); modelClass: any; fetchFn: any; groundTruthArray: never[]; operationsMap: Map<any, any>; isSyncing: boolean; pruneThreshold: any; modelCache: Cache; _lastRenderedData: Map<any, any>; renderCallbacks: Set<any>; registerRenderCallback(callback: any): () => boolean; /** * Load operations from data and add them to the operations map, * reusing existing operations from the registry if they exist */ _loadOperations(operationsData: any): void; get cacheKey(): string; onHydrated(): void; setCache(result: any): void; clearCache(): void; updateCache(items: any, requestedPks: any): void; get operations(): any[]; get pkField(): any; addOperation(operation: any): void; updateOperation(operation: any): boolean; confirm(operation: any): void; reject(operation: any): void; setOperations(operations?: any[]): void; setGroundTruth(groundTruth: any): void; getGroundTruth(): never[]; get groundTruthPks(): never[]; addToGroundTruth(instances: any): void; _filteredOperations(pks: any, operations: any): any; _filteredGroundTruth(pks: any, groundTruthArray: any): Map<any, any>; applyOperation(operation: any, currentInstances: any): any; getTrimmedOperations(): any[]; getInflightOperations(): any[]; prune(): void; render(pks?: null, optimistic?: boolean): any[]; sync(pks?: null): Promise<void>; } import { Cache } from '../cache/cache.js';