n_a_types 3.0.0 → 3.0.1

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.
Files changed (2) hide show
  1. package/index.ts +142 -1
  2. package/package.json +2 -2
package/index.ts CHANGED
@@ -1,2 +1,143 @@
1
- export { Guidebook, Section, Area, Climb, ClimbImageGroup, Coord, POI, LatLong, TrailPolyline, StarRating } from '../src/server/V3/types';
2
1
 
2
+
3
+ export type Section = Guidebook['sections'][number];
4
+ export type Area = Section['areas'][number];
5
+ export type ClimbImageGroup = Area['climbImageGroups'][number];
6
+ export type Climb = Area['climbs'][number];
7
+
8
+ export type Coord = { x: number, y: number };
9
+ export type POI = Guidebook['parkingInfo'][number];
10
+
11
+ export type LatLong = { latitude: number, longitude: number }
12
+ export type TrailPolyline = LatLong[]
13
+
14
+ export type ClimbType = 'TRAD' | 'SPORT' | 'BOULDER' | 'ICE' | 'TOPROPE'
15
+
16
+
17
+ const API_VERSION_CONST = 3 as const;
18
+
19
+ export type StarRating = "ONE" | "TWO" | "THREE" | "FOUR";
20
+
21
+ ///GUIDEBOOK FETCH
22
+ export type Guidebook = {
23
+ apiVersion: typeof API_VERSION_CONST,
24
+ images: string[],
25
+ sections: ({
26
+ areas: ({
27
+ climbImageGroups: ({
28
+ climbPaths: ({
29
+ climb: {
30
+ id: number;
31
+ areaClimbNumber: number;
32
+ climbType: ClimbType | null;
33
+ grade: string | null;
34
+ } | null;
35
+ id: number;
36
+ climbId: number | null;
37
+ climbImageGroupId: number | null;
38
+ climbVariation: number;
39
+ climbTopoImageSVGPathCoords: Coord[];
40
+ })[];
41
+ climbs: {
42
+ id: number;
43
+ areaClimbNumber: number;
44
+ }[];
45
+ id: number;
46
+ image: string;
47
+ areaId: number | null;
48
+ areaName: string;
49
+ sortOrder: number | null;
50
+ anchors: Coord[];
51
+ })[];
52
+ climbs: ({
53
+ climbImageGroups: ({
54
+ climbPaths: {
55
+ id: number;
56
+ climbId: number | null;
57
+ climbImageGroupId: number | null;
58
+ climbVariation: number;
59
+ climbTopoImageSVGPathCoords: Coord[];
60
+ }[];
61
+ id: number;
62
+ image: string;
63
+ areaId: number | null;
64
+ areaName: string;
65
+ sortOrder: number | null;
66
+ anchors: Coord[];
67
+ })[];
68
+ id: number;
69
+ climbName: string;
70
+ areaClimbNumber: number;
71
+ description: string | null;
72
+ firstAscent: string | null;
73
+ height: string | null;
74
+ areaId: number | null;
75
+ starRating: StarRating | null;
76
+ areaName: string;
77
+ climbType: ClimbType | null;
78
+ grade: string | null;
79
+ beta: string | null;
80
+ extras: string | null;
81
+ descent: string | null;
82
+ approach: string | null;
83
+ pitches: string | null;
84
+ variations: string | null;
85
+ protection: string | null;
86
+ guidebookId: number | null;
87
+ topo3DUrl: string | null;
88
+ overviewImageURL: string | null;
89
+ })[];
90
+ areaName: string;
91
+ sectionAreaNumber: number;
92
+ sectionName: string;
93
+ id: number;
94
+ sectionId: number | null;
95
+ guidebookId: number;
96
+ pano: string;
97
+ latitude: number | null;
98
+ longitude: number | null;
99
+ overview: string | null;
100
+ directions: string | null;
101
+ approach: string | null;
102
+ aspect: string | null;
103
+ })[];
104
+ sectionName: string;
105
+ guidebookId: number | null;
106
+ bookSectionNumber: number;
107
+ id: number;
108
+ })[];
109
+ id: number;
110
+ title: string;
111
+ author: string;
112
+ coverImage: string;
113
+ description: string;
114
+ isFreeSampleGuidebook: boolean;
115
+ version: number;
116
+ heroImage: string;
117
+ state: string;
118
+ accessTrailPolylines: TrailPolyline[];
119
+ parkingInfo: {
120
+ id: string;
121
+ image: string | null;
122
+ description: string;
123
+ latitude: number;
124
+ longitude: number;
125
+ guidebookId: number | null;
126
+ }[]
127
+ }
128
+
129
+ ///PRODUCT DATA FETCH
130
+ export type GuidebookProductData = {
131
+ guidebooks: {
132
+ id: number;
133
+ title: string;
134
+ author: string;
135
+ coverImage: string;
136
+ description: string;
137
+ isFreeSampleGuidebook: boolean;
138
+ version: number;
139
+ heroImage: string;
140
+ state: string;
141
+ accessTrailPolylines: TrailPolyline[];
142
+ }[], apiVersion: typeof API_VERSION_CONST;
143
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n_a_types",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "types",
5
5
  "main": "index.ts",
6
6
  "scripts": {
@@ -8,4 +8,4 @@
8
8
  },
9
9
  "author": "",
10
10
  "license": "ISC"
11
- }
11
+ }