@kepler.gl/types 3.2.5 → 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 +2 -0
- package/package.json +1 -1
- package/reducers.d.ts +12 -3
- package/types.d.ts +20 -0
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
package/reducers.d.ts
CHANGED
|
@@ -2,7 +2,16 @@
|
|
|
2
2
|
// Copyright contributors to the kepler.gl project
|
|
3
3
|
|
|
4
4
|
import {Field, Millisecond} from './types';
|
|
5
|
-
|
|
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
|
+
};
|
|
14
|
+
import type {ExportResolutionOption} from '@kepler.gl/constants';
|
|
6
15
|
|
|
7
16
|
export type MapState = {
|
|
8
17
|
pitch: number;
|
|
@@ -371,8 +380,8 @@ export type BaseMapStyle = {
|
|
|
371
380
|
};
|
|
372
381
|
|
|
373
382
|
export declare type ExportImage = {
|
|
374
|
-
ratio:
|
|
375
|
-
resolution:
|
|
383
|
+
ratio: EXPORT_IMG_RATIOS;
|
|
384
|
+
resolution: ExportResolutionOption;
|
|
376
385
|
legend: boolean;
|
|
377
386
|
mapH: number;
|
|
378
387
|
mapW: number;
|
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
|