refactor(es modules): modulize utils

This commit is contained in:
Azgaar 2022-06-26 19:20:31 +03:00
parent 11df349394
commit 12e1c9f334
45 changed files with 620 additions and 283 deletions

1
src/types/common.d.ts vendored Normal file
View file

@ -0,0 +1 @@
type UnknownObject = {[key: string]: unknown};

8
src/types/coordinates.d.ts vendored Normal file
View file

@ -0,0 +1,8 @@
interface IMapCoordinates {
latT: number;
latN: number;
latS: number;
lonT: number;
lonW: number;
lonE: number;
}

4
src/types/modules.d.ts vendored Normal file
View file

@ -0,0 +1,4 @@
declare module "lineclip" {
export function polygon(points: number[][], bbox: number[], result?: number[][]): number[][];
export function lineclip(points: number[][], bbox: number[]): number[][];
}

View file

@ -13,6 +13,9 @@ interface Window {
pack: IPack;
grig: IGrid;
d3: typeof d3;
graphHeight: number;
graphWidth: number;
mapCoordinates: IMapCoordinates;
}
interface Node {

3
src/types/point.d.ts vendored Normal file
View file

@ -0,0 +1,3 @@
type TPoint = [number, number];
type TPoints = TPoint[];