UNPKG

itowns

Version:

A JS/WebGL framework for 3D geospatial data visualization

38 lines (37 loc) 1.05 kB
declare const UPDATE_STATE: { readonly IDLE: 0; readonly PENDING: 1; readonly ERROR: 2; readonly DEFINITIVE_ERROR: 3; readonly FINISHED: 4; }; export type UpdateState = (typeof UPDATE_STATE)[keyof typeof UPDATE_STATE]; /** * LayerUpdateState is the update state of a layer, for a given object * (e.g. tile). * It stores information to allow smart update decisions, and especially * network error handling. */ declare class LayerUpdateState { errorCount: number; failureParams: { lowestLevelError: number; }; private state; private lastErrorTimestamp; constructor(); hasFinished(): boolean; canTryUpdate(timestamp?: number): boolean; secondsUntilNextTry(): number; newTry(): void; success(): void; noMoreUpdatePossible(): void; noData(failureParams: { targetLevel: number; }): void; failure(timestamp: number, definitive: boolean, failureParams: { targetLevel: number; }): void; inError(): boolean; } export default LayerUpdateState;