This repository has been archived by the owner on Mar 9, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathindex.d.ts
97 lines (78 loc) · 2.42 KB
/
index.d.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/// <reference types="geojson" />
export interface SpatialReference {
}
export interface SpatialReferenceWkid extends SpatialReference {
wkid?: number;
latestWkid?: number;
vcsWkid?: number;
latestVcsWkid?: number;
}
export interface SpatialReferenceWkt extends SpatialReference {
wkt?: string;
latestWkt?: string;
}
export interface Geometry {
spatialReference?: SpatialReference;
}
export interface HasZM {
hasZ?: boolean;
hasM?: boolean;
}
export interface Point extends Geometry {
x: number;
y: number;
z?: number;
m?: number;
}
export interface Polyline extends HasZM, Geometry {
paths: number[][][];
}
export interface Polygon extends HasZM, Geometry {
rings: number[][][];
}
export interface Multipoint extends HasZM, Geometry {
points: number[][];
}
export interface Envelope extends Geometry {
xmin: number;
xmax: number;
ymin: number;
ymax: number;
zmin?: number;
zmax?: number;
mmin?: number;
mmax?: number;
}
export interface Feature {
geometry: Geometry;
attributes: any;
}
export interface Field {
name: string;
type: string;
alias?: string;
length?: number;
}
export type esriGeometryType = "esriGeometryPoint" | "esriGeometryMultipoint" | "esriGeometryPolyline" |
"esriGeometryPolygon" | "esriGeometryEnvelope";
export interface FeatureSet extends HasZM {
objectIdFieldName?: string; // optional
globalIdFieldName?: string; // optional
displayFieldName?: string; // optional
geometryType?: esriGeometryType; // for feature layers only
spatialReference?: SpatialReference; // for feature layers only.
fields?: Field[];
features: Feature[];
}
export interface ParseOptions {
sr?: number;
idAttribute?: string;
}
export interface ConvertOptions {
idAttribute?: string;
}
export function parse<T extends Geometry>(json: T, options?: ParseOptions): GeoJSON.GeometryObject;
export function parse<T extends GeoJSON.GeometryObject>(json: Feature, options?: ParseOptions): GeoJSON.Feature<T>;
export function convert<T extends GeoJSON.GeometryObject>(geoJSON: GeoJSON.FeatureCollection<T>, options?: ConvertOptions): FeatureSet;
export function convert<T extends GeoJSON.GeometryObject>(geoJSON: GeoJSON.Feature<T>, options?: ConvertOptions): Feature;
export function convert<T extends GeoJSON.GeometryObject>(geoJSON: T, options?: ConvertOptions): Geometry;