-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinterfaces.ts
70 lines (58 loc) · 1.33 KB
/
interfaces.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
export type FlagType = "prideFlag" | "transFlag" | "nonbinaryFlag"
export type Coord = number[]
export type Coords = Coord[]
export interface OSMWaySource {
type: "OSMway",
wayID: number
}
export interface RawCoordSource {
type: "RawCoords",
coords: Coords,
}
export interface OSMNodeSource {
type: "OSMnodes",
nodes: number[]
}
export interface Source {
type: "news" | "official" | "proposal" | "photo" | "streetview" | "in person"
date: string
url?: string
}
export interface GeoData {
coords: Coords,
length: number // in meter
}
export interface Crossing {
id: number
name: string
bezirk?: number
comment?: string
hidden?: boolean
officialName?: string
set?: string
type: FlagType
sources: Source[]
geosource: OSMWaySource | OSMNodeSource | RawCoordSource,
geo?: GeoData
}
export interface Tags {
[key: string]: string;
}
export interface OverpassElement {
id: number
tags: Tags
}
export interface OverPassNode extends OverpassElement {
type: "node"
lat: number
lon: number
}
export interface OverpassWay extends OverpassElement {
type: "way"
nodes: number[] // corresponding to OverPassNode.id
}
export interface OverPassResponse {
version: number
generator: string
elements: (OverPassNode | OverpassWay)[]
}