n_a_types 3.0.4 → 3.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/V3.ts +119 -97
- package/package.json +1 -4
package/V3.ts
CHANGED
|
@@ -1,104 +1,17 @@
|
|
|
1
1
|
export const API_VERSION = 3;
|
|
2
|
-
export type Section = Guidebook['sections'][number];
|
|
3
|
-
export type Area = Section['areas'][number];
|
|
4
|
-
export type ClimbImageGroup = Area['climbImageGroups'][number];
|
|
5
|
-
export type Climb = Area['climbs'][number];
|
|
6
2
|
export type Coord = { x: number, y: number };
|
|
7
|
-
export type POI = Guidebook['parkingInfo'][number];
|
|
8
3
|
export type LatLong = { latitude: number, longitude: number }
|
|
9
4
|
export type TrailPolyline = LatLong[]
|
|
10
5
|
export type ClimbType = 'TRAD' | 'SPORT' | 'BOULDER' | 'ICE' | 'TOPROPE'
|
|
11
6
|
export type StarRating = "ONE" | "TWO" | "THREE" | "FOUR";
|
|
7
|
+
export type AreaSwipeDirection = 'LEFT_TO_RIGHT' | 'RIGHT_TO_LEFT'
|
|
12
8
|
|
|
13
9
|
///GUIDEBOOK FETCH
|
|
14
10
|
export type Guidebook = {
|
|
15
11
|
digitalVersionPublished: boolean,
|
|
16
12
|
apiVersion: number,
|
|
17
13
|
images: string[],
|
|
18
|
-
sections:
|
|
19
|
-
areas: ({
|
|
20
|
-
climbImageGroups: ({
|
|
21
|
-
climbPaths: ({
|
|
22
|
-
climb: {
|
|
23
|
-
id: number;
|
|
24
|
-
areaClimbNumber: number;
|
|
25
|
-
climbType: ClimbType | null;
|
|
26
|
-
grade: string | null;
|
|
27
|
-
} | null;
|
|
28
|
-
id: number;
|
|
29
|
-
climbId: number | null;
|
|
30
|
-
climbImageGroupId: number | null;
|
|
31
|
-
climbVariation: number;
|
|
32
|
-
climbTopoImageSVGPathCoords: Coord[];
|
|
33
|
-
})[];
|
|
34
|
-
climbs: {
|
|
35
|
-
id: number;
|
|
36
|
-
areaClimbNumber: number;
|
|
37
|
-
}[];
|
|
38
|
-
id: number;
|
|
39
|
-
image: string;
|
|
40
|
-
areaId: number | null;
|
|
41
|
-
areaName: string;
|
|
42
|
-
sortOrder: number | null;
|
|
43
|
-
anchors: Coord[];
|
|
44
|
-
})[];
|
|
45
|
-
climbs: ({
|
|
46
|
-
climbImageGroups: ({
|
|
47
|
-
climbPaths: {
|
|
48
|
-
id: number;
|
|
49
|
-
climbId: number | null;
|
|
50
|
-
climbImageGroupId: number | null;
|
|
51
|
-
climbVariation: number;
|
|
52
|
-
climbTopoImageSVGPathCoords: Coord[];
|
|
53
|
-
}[];
|
|
54
|
-
id: number;
|
|
55
|
-
image: string;
|
|
56
|
-
areaId: number | null;
|
|
57
|
-
areaName: string;
|
|
58
|
-
sortOrder: number | null;
|
|
59
|
-
anchors: Coord[];
|
|
60
|
-
})[];
|
|
61
|
-
id: number;
|
|
62
|
-
climbName: string;
|
|
63
|
-
areaClimbNumber: number;
|
|
64
|
-
description: string | null;
|
|
65
|
-
firstAscent: string | null;
|
|
66
|
-
height: string | null;
|
|
67
|
-
areaId: number | null;
|
|
68
|
-
starRating: StarRating | null;
|
|
69
|
-
areaName: string;
|
|
70
|
-
climbType: ClimbType | null;
|
|
71
|
-
grade: string | null;
|
|
72
|
-
beta: string | null;
|
|
73
|
-
extras: string | null;
|
|
74
|
-
descent: string | null;
|
|
75
|
-
approach: string | null;
|
|
76
|
-
pitches: string | null;
|
|
77
|
-
variations: string | null;
|
|
78
|
-
protection: string | null;
|
|
79
|
-
guidebookId: number | null;
|
|
80
|
-
topo3DUrl: string | null;
|
|
81
|
-
overviewImageURL: string | null;
|
|
82
|
-
})[];
|
|
83
|
-
areaName: string;
|
|
84
|
-
sectionAreaNumber: number;
|
|
85
|
-
sectionName: string;
|
|
86
|
-
id: number;
|
|
87
|
-
sectionId: number | null;
|
|
88
|
-
guidebookId: number;
|
|
89
|
-
pano: string;
|
|
90
|
-
latitude: number | null;
|
|
91
|
-
longitude: number | null;
|
|
92
|
-
overview: string | null;
|
|
93
|
-
directions: string | null;
|
|
94
|
-
approach: string | null;
|
|
95
|
-
aspect: string | null;
|
|
96
|
-
})[];
|
|
97
|
-
sectionName: string;
|
|
98
|
-
guidebookId: number | null;
|
|
99
|
-
bookSectionNumber: number;
|
|
100
|
-
id: number;
|
|
101
|
-
})[];
|
|
14
|
+
sections: Section[];
|
|
102
15
|
id: number;
|
|
103
16
|
title: string;
|
|
104
17
|
author: string;
|
|
@@ -109,14 +22,123 @@ export type Guidebook = {
|
|
|
109
22
|
heroImage: string;
|
|
110
23
|
state: string;
|
|
111
24
|
accessTrailPolylines: TrailPolyline[];
|
|
112
|
-
parkingInfo:
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
25
|
+
parkingInfo: POI[]
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type Section = {
|
|
29
|
+
areas: Area[];
|
|
30
|
+
sectionName: string;
|
|
31
|
+
guidebookId: number | null;
|
|
32
|
+
bookSectionNumber: number;
|
|
33
|
+
id: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type Area = {
|
|
37
|
+
climbImageGroups: ClimbImageGroup[];
|
|
38
|
+
climbs: Climb[];
|
|
39
|
+
areaName: string;
|
|
40
|
+
sectionAreaNumber: number;
|
|
41
|
+
sectionName: string;
|
|
42
|
+
id: number;
|
|
43
|
+
sectionId: number | null;
|
|
44
|
+
guidebookId: number;
|
|
45
|
+
pano: string;
|
|
46
|
+
latitude: number | null;
|
|
47
|
+
longitude: number | null;
|
|
48
|
+
overview: string | null;
|
|
49
|
+
directions: string | null;
|
|
50
|
+
approach: string | null;
|
|
51
|
+
aspect: string | null;
|
|
52
|
+
swipeDirection: AreaSwipeDirection
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type ClimbImageGroup = {
|
|
56
|
+
climbPaths: ({
|
|
57
|
+
climb: {
|
|
58
|
+
id: number;
|
|
59
|
+
areaClimbNumber: number;
|
|
60
|
+
climbType: ClimbType | null;
|
|
61
|
+
grade: string | null;
|
|
62
|
+
} | null;
|
|
63
|
+
id: number;
|
|
64
|
+
climbId: number | null;
|
|
65
|
+
climbImageGroupId: number | null;
|
|
66
|
+
climbVariation: number;
|
|
67
|
+
climbTopoImageSVGPathCoords: Coord[];
|
|
68
|
+
})[];
|
|
69
|
+
climbs: {
|
|
70
|
+
id: number;
|
|
71
|
+
areaClimbNumber: number;
|
|
72
|
+
}[];
|
|
73
|
+
id: number;
|
|
74
|
+
image: string;
|
|
75
|
+
areaId: number | null;
|
|
76
|
+
areaName: string;
|
|
77
|
+
sortOrder: number | null;
|
|
78
|
+
anchors: Coord[];
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export type Climb = {
|
|
82
|
+
primaryClimbImageGroup?: ({
|
|
83
|
+
climbPaths: {
|
|
84
|
+
id: number;
|
|
85
|
+
climbId: number | null;
|
|
86
|
+
climbImageGroupId: number | null;
|
|
87
|
+
climbVariation: number;
|
|
88
|
+
climbTopoImageSVGPathCoords: Coord[];
|
|
89
|
+
}[];
|
|
90
|
+
id: number;
|
|
91
|
+
image: string;
|
|
92
|
+
areaId: number | null;
|
|
93
|
+
areaName: string;
|
|
94
|
+
sortOrder: number | null;
|
|
95
|
+
anchors: Coord[];
|
|
96
|
+
}),
|
|
97
|
+
climbImageGroups: ({
|
|
98
|
+
climbPaths: {
|
|
99
|
+
id: number;
|
|
100
|
+
climbId: number | null;
|
|
101
|
+
climbImageGroupId: number | null;
|
|
102
|
+
climbVariation: number;
|
|
103
|
+
climbTopoImageSVGPathCoords: Coord[];
|
|
104
|
+
}[];
|
|
105
|
+
id: number;
|
|
106
|
+
image: string;
|
|
107
|
+
areaId: number | null;
|
|
108
|
+
areaName: string;
|
|
109
|
+
sortOrder: number | null;
|
|
110
|
+
anchors: Coord[];
|
|
111
|
+
})[];
|
|
112
|
+
id: number;
|
|
113
|
+
climbName: string;
|
|
114
|
+
areaClimbNumber: number;
|
|
115
|
+
description: string | null;
|
|
116
|
+
firstAscent: string | null;
|
|
117
|
+
height: string | null;
|
|
118
|
+
areaId: number | null;
|
|
119
|
+
starRating: StarRating | null;
|
|
120
|
+
areaName: string;
|
|
121
|
+
climbType: ClimbType | null;
|
|
122
|
+
grade: string | null;
|
|
123
|
+
beta: string | null;
|
|
124
|
+
extras: string | null;
|
|
125
|
+
descent: string | null;
|
|
126
|
+
approach: string | null;
|
|
127
|
+
pitches: string | null;
|
|
128
|
+
variations: string | null;
|
|
129
|
+
protection: string | null;
|
|
130
|
+
guidebookId: number | null;
|
|
131
|
+
topo3DUrl: string | null;
|
|
132
|
+
overviewImageURL: string | null;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export type POI = {
|
|
136
|
+
id: string;
|
|
137
|
+
image: string | null;
|
|
138
|
+
description: string;
|
|
139
|
+
latitude: number;
|
|
140
|
+
longitude: number;
|
|
141
|
+
guidebookId: number | null;
|
|
120
142
|
}
|
|
121
143
|
|
|
122
144
|
///PRODUCT DATA FETCH
|
package/package.json
CHANGED