@kepler.gl/types 3.2.6 → 3.3.0-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/layers.d.ts CHANGED
@@ -427,6 +427,7 @@ export type LayerCallbacks = {
427
427
  }
428
428
  ) => void;
429
429
  onRedrawNeeded?: (idx: number) => void;
430
+ onFitBounds?: (idx: number, bounds: [number, number, number, number]) => void;
430
431
  };
431
432
 
432
433
  export type BindedLayerCallbacks = {
@@ -438,6 +439,7 @@ export type BindedLayerCallbacks = {
438
439
  coordinate?: [number, number]
439
440
  ) => void;
440
441
  onRedrawNeeded?: () => void;
442
+ onFitBounds?: (bounds: [number, number, number, number]) => void;
441
443
  };
442
444
 
443
445
  export type VisualChannelAggregation = 'colorAggregation' | 'sizeAggregation';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kepler.gl/types",
3
3
  "author": "Shan He <shan@uber.com>",
4
- "version": "3.2.6",
4
+ "version": "3.3.0-alpha.0",
5
5
  "description": "kepler.gl types used by kepler.gl components, actions and reducers",
6
6
  "license": "MIT",
7
7
  "types": "index.d.ts",
package/reducers.d.ts CHANGED
@@ -2,7 +2,15 @@
2
2
  // Copyright contributors to the kepler.gl project
3
3
 
4
4
  import {Field, Millisecond} from './types';
5
- import type {MapViewState} from '@deck.gl/core/typed';
5
+ type MapViewState = {
6
+ latitude: number;
7
+ longitude: number;
8
+ zoom: number;
9
+ bearing?: number;
10
+ pitch?: number;
11
+ transitionDuration?: number;
12
+ transitionInterpolator?: object;
13
+ };
6
14
  import type {ExportResolutionOption} from '@kepler.gl/constants';
7
15
 
8
16
  export type MapState = {
@@ -607,4 +615,4 @@ export type TypedFilter =
607
615
  | TypedTimeRangeFilter
608
616
  | TypedSelectFilter
609
617
  | TypedMultiSelectFilter
610
- | TypedPolygonFilter;
618
+ | TypedPolygonFilter;
package/types.d.ts CHANGED
@@ -6,6 +6,26 @@ export type RGBAColor = [number, number, number, number];
6
6
  export type HexColor = string; // this is the best typescript can do at the moment
7
7
  export type Millisecond = number;
8
8
 
9
+ /**
10
+ * Deck.gl picking info with relaxed layer generics for compatibility with DeckGL React callbacks.
11
+ * deck.gl 9's DeckGL component infers callback parameter types that are structurally incompatible
12
+ * with `PickingInfo` from `@deck.gl/core` (missing `color`/`pixelRatio`, different `Layer` generic).
13
+ */
14
+ export type PickInfo<DataT = any> = {
15
+ layer?: {id: string; state?: Record<string, any>} | null;
16
+ sourceLayer?: {id: string} | null;
17
+ viewport?: {width?: number; height?: number} | null;
18
+ index: number;
19
+ picked?: boolean;
20
+ object?: DataT;
21
+ x: number;
22
+ y: number;
23
+ pixel?: [number, number];
24
+ coordinate?: number[];
25
+ color?: Uint8Array | null;
26
+ pixelRatio?: number;
27
+ };
28
+
9
29
  export type ValueOf<T> = T[keyof T];
10
30
 
11
31
  export type Merge<A, B> = {[K in keyof A]: K extends keyof B ? B[K] : A[K]} & B extends infer O