-
Notifications
You must be signed in to change notification settings - Fork 2
/
types.ts
45 lines (38 loc) · 894 Bytes
/
types.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import { GeoJSON } from 'geojson';
export type GeoJSONTypeSet = Set<GeoJSON['type']>;
export interface HintIssue {
from: number;
to: number;
node?: Node;
severity: 'error';
message: string;
}
export interface Ctx {
issues: HintIssue[];
valid: Array<undefined | HintIssue[]>;
}
export const GEOJSON_FEATURE_TYPE = new Set<GeoJSON['type']>(['Feature']);
export const GEOJSON_GEOMETRY_TYPES = new Set<GeoJSON['type']>([
'Point',
'MultiPoint',
'Polygon',
'MultiPolygon',
'LineString',
'MultiLineString',
'GeometryCollection',
]);
export const GEOJSON_GEOMETRY_TYPES_EX_GEOMETRY_COLLECTION = new Set<
GeoJSON['type']
>([
'Point',
'MultiPoint',
'Polygon',
'MultiPolygon',
'LineString',
'MultiLineString',
]);
export const GEOJSON_TYPES = new Set<GeoJSON['type']>(
Array.from(GEOJSON_GEOMETRY_TYPES).concat([
'Feature',
'FeatureCollection',
]));