Skip to content

Kepler.gl is a powerful open source geospatial analysis tool for large-scale data sets.

[fix] Stronger AnimationConfig types (#2356)

Igor Dykhta5a9fa5bd2f90
diff --git a/src/types/reducers.d.ts b/src/types/reducers.d.ts
index aa4ee2ef7..f69690473 100644
--- a/src/types/reducers.d.ts
+++ b/src/types/reducers.d.ts
@@ -197,6 +197,10 @@ export type SplitMapLayers = {[key: string]: boolean};
export type SplitMap = {
layers: SplitMapLayers;
};
+
+/** See "Locale aware formats" at https://momentjs.com/docs/#/parsing/string-format/ */
+export type AnimationConfigTimeFormat = 'L' | 'L LT' | 'L LTS';
+
export type AnimationConfig = {
domain: number[] | null;
currentTime: number | null;
@@ -205,9 +209,9 @@ export type AnimationConfig = {
isAnimating?: boolean;
timeSteps?: null | number[];
// auto generated based on time domain
- defaultTimeFormat?: string | null;
+ defaultTimeFormat: AnimationTimeFormat | null;
// custom ui input
- timeFormat?: string | null;
+ timeFormat?: AnimationTimeFormat | null;
// custom ui input
timezone?: string | null;
// hide or show control