heatmap.js: Remove Point type

Inline type that is used in only one place.
This commit is contained in:
Rhys van der Waerden 2017-11-20 22:15:10 +11:00
parent f07f6a8da9
commit 3a88a0abc4

View File

@ -159,7 +159,7 @@ export class Heatmap<V extends string, X extends string, Y extends string> {
* // get the value at x=10, y=10
* heatmapInstance.getValueAt({ x: 10, y: 10 }); // returns 100
*/
getValueAt(point: Point<'x', 'y'>): number;
getValueAt(point: { x: number, y: number }): number;
/**
* Returns a persistable and reimportable (with setData) JSON object.
@ -305,12 +305,6 @@ export interface HeatmapOverlayConfiguration<
lngField?: TLong;
}
/**
* A position in the heatmap.
*/
export type Point<X extends string, Y extends string> =
Record<X | Y, number>;
/**
* A single data point on a heatmap. The interface of the data point can be
* overridden by providing alternative values for `xKey` and `yKey` in the
@ -320,8 +314,7 @@ export type DataPoint<
V extends string = 'value',
X extends string = 'x',
Y extends string = 'y',
> =
Record<V, number> & Point<X, Y>;
> = Record<V | X | Y, number>;
/**
* Type of data returned by `Heatmap#hello`, which ignores custom `xField`,