openskidata-format 14.0.0 → 16.0.0
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/dist/ElevationProfile.d.ts +1 -0
- package/dist/ElevationProfile.d.ts.map +1 -0
- package/dist/ElevationProfile.js +15 -24
- package/dist/ElevationProfile.js.map +1 -1
- package/dist/FeatureType.d.ts +1 -0
- package/dist/FeatureType.d.ts.map +1 -0
- package/dist/FeatureType.js +2 -5
- package/dist/FeatureType.js.map +1 -1
- package/dist/Lift.d.ts +10 -8
- package/dist/Lift.d.ts.map +1 -0
- package/dist/Lift.js +22 -29
- package/dist/Lift.js.map +1 -1
- package/dist/LiftNameFormatter.d.ts +2 -1
- package/dist/LiftNameFormatter.d.ts.map +1 -0
- package/dist/LiftNameFormatter.js +11 -14
- package/dist/LiftNameFormatter.js.map +1 -1
- package/dist/Place.d.ts +1 -0
- package/dist/Place.d.ts.map +1 -0
- package/dist/Place.js +1 -2
- package/dist/Run.d.ts +10 -9
- package/dist/Run.d.ts.map +1 -0
- package/dist/Run.js +23 -30
- package/dist/Run.js.map +1 -1
- package/dist/RunDifficultyConvention.d.ts +2 -1
- package/dist/RunDifficultyConvention.d.ts.map +1 -0
- package/dist/RunDifficultyConvention.js +10 -15
- package/dist/RunDifficultyConvention.js.map +1 -1
- package/dist/SkiArea.d.ts +11 -12
- package/dist/SkiArea.d.ts.map +1 -0
- package/dist/SkiArea.js +2 -5
- package/dist/SkiArea.js.map +1 -1
- package/dist/SlopeGradingScale.d.ts +3 -2
- package/dist/SlopeGradingScale.d.ts.map +1 -0
- package/dist/SlopeGradingScale.js +21 -26
- package/dist/SlopeGradingScale.js.map +1 -1
- package/dist/SnowCoverHistory.d.ts +1 -0
- package/dist/SnowCoverHistory.d.ts.map +1 -0
- package/dist/SnowCoverHistory.js +9 -8
- package/dist/SnowCoverHistory.js.map +1 -1
- package/dist/Source.d.ts +2 -14
- package/dist/Source.d.ts.map +1 -0
- package/dist/Source.js +7 -43
- package/dist/Source.js.map +1 -1
- package/dist/Spot.d.ts +6 -5
- package/dist/Spot.d.ts.map +1 -0
- package/dist/Spot.js +6 -9
- package/dist/Spot.js.map +1 -1
- package/dist/Status.d.ts +1 -0
- package/dist/Status.d.ts.map +1 -0
- package/dist/Status.js +2 -5
- package/dist/Status.js.map +1 -1
- package/dist/ViewportHint.d.ts +1 -0
- package/dist/ViewportHint.d.ts.map +1 -0
- package/dist/ViewportHint.js +4 -10
- package/dist/ViewportHint.js.map +1 -1
- package/dist/index.d.ts +15 -15
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +14 -18
- package/dist/index.js.map +1 -1
- package/dist/util/exhaustiveMatchingGuard.d.ts +1 -0
- package/dist/util/exhaustiveMatchingGuard.d.ts.map +1 -0
- package/dist/util/exhaustiveMatchingGuard.js +1 -5
- package/dist/util/exhaustiveMatchingGuard.js.map +1 -1
- package/package.json +35 -23
- package/dist/SkiPass.d.ts +0 -82
- package/dist/SkiPass.js +0 -3
- package/dist/SkiPass.js.map +0 -1
- package/dist/testUtils.d.ts +0 -2
- package/dist/testUtils.js +0 -7
- package/dist/testUtils.js.map +0 -1
- package/src/ElevationProfile.test.ts +0 -738
- package/src/ElevationProfile.ts +0 -452
- package/src/FeatureType.ts +0 -6
- package/src/Lift.test.ts +0 -195
- package/src/Lift.ts +0 -219
- package/src/LiftNameFormatter.ts +0 -116
- package/src/Place.ts +0 -11
- package/src/Run.ts +0 -242
- package/src/RunDifficultyConvention.test.ts +0 -79
- package/src/RunDifficultyConvention.ts +0 -335
- package/src/SkiArea.ts +0 -128
- package/src/SkiPass.ts +0 -89
- package/src/SlopeGradingScale.test.ts +0 -151
- package/src/SlopeGradingScale.ts +0 -96
- package/src/SnowCoverHistory.test.ts +0 -103
- package/src/SnowCoverHistory.ts +0 -107
- package/src/Source.test.ts +0 -50
- package/src/Source.ts +0 -72
- package/src/Spot.ts +0 -140
- package/src/Status.ts +0 -20
- package/src/ViewportHint.ts +0 -208
- package/src/index.ts +0 -15
- package/src/testUtils.ts +0 -5
- package/src/util/exhaustiveMatchingGuard.ts +0 -3
package/dist/ViewportHint.d.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ViewportHint.d.ts","sourceRoot":"","sources":["../src/ViewportHint.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,SAAS,CAAA;AAGlC;;;;;GAKG;AACH,MAAM,MAAM,YAAY,GAAG;IACzB,mEAAmE;IACnE,MAAM,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAExB;;;OAGG;IACH,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IAEtB,6DAA6D;IAC7D,kBAAkB,EAAE,MAAM,CAAA;IAE1B,mFAAmF;IACnF,mBAAmB,EAAE,MAAM,CAAA;IAE3B;;;;;OAKG;IACH,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,UAAU,EAAE,OAAO,CAAC,QAAQ,EAAE,GAC7B,YAAY,CA0Fd"}
|
package/dist/ViewportHint.js
CHANGED
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.computeViewportHint = computeViewportHint;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const distance_1 = tslib_1.__importDefault(require("@turf/distance"));
|
|
1
|
+
import distance from '@turf/distance';
|
|
6
2
|
/**
|
|
7
3
|
* Computes a ViewportHint from one or more GeoJSON geometries.
|
|
8
4
|
* All geometry types are accepted; elevation is read from the Z coordinate (defaults to 0).
|
|
9
5
|
* Throws if no coordinates are found.
|
|
10
6
|
*/
|
|
11
|
-
function computeViewportHint(geometries) {
|
|
7
|
+
export function computeViewportHint(geometries) {
|
|
12
8
|
// Collect all coordinates (for bbox + elevation stats) and consecutive segment pairs
|
|
13
9
|
// (for the downhill bearing calculation).
|
|
14
10
|
const allCoords = [];
|
|
@@ -37,11 +33,9 @@ function computeViewportHint(geometries) {
|
|
|
37
33
|
for (const [[lng0, lat0, elev0], [lng1, lat1, elev1]] of bearingSegments) {
|
|
38
34
|
if (elev0 === elev1)
|
|
39
35
|
continue;
|
|
40
|
-
const [fromLng, fromLat, toLng, toLat] = elev0 > elev1
|
|
41
|
-
? [lng0, lat0, lng1, lat1]
|
|
42
|
-
: [lng1, lat1, lng0, lat0];
|
|
36
|
+
const [fromLng, fromLat, toLng, toLat] = elev0 > elev1 ? [lng0, lat0, lng1, lat1] : [lng1, lat1, lng0, lat0];
|
|
43
37
|
const bear = greatCircleBearing(fromLat, fromLng, toLat, toLng);
|
|
44
|
-
const len = (
|
|
38
|
+
const len = distance([lng0, lat0], [lng1, lat1], { units: 'meters' });
|
|
45
39
|
const bearingRad = (bear * Math.PI) / 180;
|
|
46
40
|
sumSin += Math.sin(bearingRad) * len;
|
|
47
41
|
sumCos += Math.cos(bearingRad) * len;
|
package/dist/ViewportHint.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ViewportHint.js","sourceRoot":"","sources":["../src/ViewportHint.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ViewportHint.js","sourceRoot":"","sources":["../src/ViewportHint.ts"],"names":[],"mappings":"AACA,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AAiCrC;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,UAA8B;IAE9B,qFAAqF;IACrF,0CAA0C;IAC1C,MAAM,SAAS,GAA+B,EAAE,CAAA;IAChD,MAAM,eAAe,GAGf,EAAE,CAAA;IAER,KAAK,MAAM,IAAI,IAAI,UAAU,EAAE,CAAC;QAC9B,eAAe,CAAC,IAAI,EAAE,SAAS,EAAE,eAAe,CAAC,CAAA;IACnD,CAAC;IAED,IAAI,SAAS,CAAC,MAAM,KAAK,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,kEAAkE,CACnE,CAAA;IAEH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,GAAG,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,CAAA;IAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACrC,MAAM,CAAC,GACL,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAC1E,OAAO,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,GAAG,CAAA;AACzD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
export * from './ElevationProfile';
|
|
2
|
-
export * from './FeatureType';
|
|
3
|
-
export * from './Lift';
|
|
4
|
-
export * from './LiftNameFormatter';
|
|
5
|
-
export * from './Place';
|
|
6
|
-
export * from './Run';
|
|
7
|
-
export * from './RunDifficultyConvention';
|
|
8
|
-
export * from './SlopeGradingScale';
|
|
9
|
-
export * from './SkiArea';
|
|
10
|
-
export * from './
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './
|
|
13
|
-
export * from './
|
|
14
|
-
export * from './
|
|
15
|
-
|
|
1
|
+
export * from './ElevationProfile.js';
|
|
2
|
+
export * from './FeatureType.js';
|
|
3
|
+
export * from './Lift.js';
|
|
4
|
+
export * from './LiftNameFormatter.js';
|
|
5
|
+
export * from './Place.js';
|
|
6
|
+
export * from './Run.js';
|
|
7
|
+
export * from './RunDifficultyConvention.js';
|
|
8
|
+
export * from './SlopeGradingScale.js';
|
|
9
|
+
export * from './SkiArea.js';
|
|
10
|
+
export * from './SnowCoverHistory.js';
|
|
11
|
+
export * from './Source.js';
|
|
12
|
+
export * from './Spot.js';
|
|
13
|
+
export * from './Status.js';
|
|
14
|
+
export * from './ViewportHint.js';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -1,19 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
tslib_1.__exportStar(require("./Source"), exports);
|
|
16
|
-
tslib_1.__exportStar(require("./Spot"), exports);
|
|
17
|
-
tslib_1.__exportStar(require("./Status"), exports);
|
|
18
|
-
tslib_1.__exportStar(require("./ViewportHint"), exports);
|
|
1
|
+
export * from './ElevationProfile.js';
|
|
2
|
+
export * from './FeatureType.js';
|
|
3
|
+
export * from './Lift.js';
|
|
4
|
+
export * from './LiftNameFormatter.js';
|
|
5
|
+
export * from './Place.js';
|
|
6
|
+
export * from './Run.js';
|
|
7
|
+
export * from './RunDifficultyConvention.js';
|
|
8
|
+
export * from './SlopeGradingScale.js';
|
|
9
|
+
export * from './SkiArea.js';
|
|
10
|
+
export * from './SnowCoverHistory.js';
|
|
11
|
+
export * from './Source.js';
|
|
12
|
+
export * from './Spot.js';
|
|
13
|
+
export * from './Status.js';
|
|
14
|
+
export * from './ViewportHint.js';
|
|
19
15
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,kBAAkB,CAAA;AAChC,cAAc,WAAW,CAAA;AACzB,cAAc,wBAAwB,CAAA;AACtC,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,8BAA8B,CAAA;AAC5C,cAAc,wBAAwB,CAAA;AACtC,cAAc,cAAc,CAAA;AAC5B,cAAc,uBAAuB,CAAA;AACrC,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,mBAAmB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"exhaustiveMatchingGuard.d.ts","sourceRoot":"","sources":["../../src/util/exhaustiveMatchingGuard.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uBAAuB,UAAW,KAAK,KAAG,KAEtD,CAAA"}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.exhaustiveMatchingGuard = void 0;
|
|
4
|
-
const exhaustiveMatchingGuard = (value) => {
|
|
1
|
+
export const exhaustiveMatchingGuard = (value) => {
|
|
5
2
|
throw new Error(`Unhandled case: ${value}`);
|
|
6
3
|
};
|
|
7
|
-
exports.exhaustiveMatchingGuard = exhaustiveMatchingGuard;
|
|
8
4
|
//# sourceMappingURL=exhaustiveMatchingGuard.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exhaustiveMatchingGuard.js","sourceRoot":"","sources":["../../src/util/exhaustiveMatchingGuard.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"exhaustiveMatchingGuard.js","sourceRoot":"","sources":["../../src/util/exhaustiveMatchingGuard.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,KAAY,EAAS,EAAE;IAC7D,MAAM,IAAI,KAAK,CAAC,mBAAmB,KAAK,EAAE,CAAC,CAAA;AAC7C,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,20 +1,33 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openskidata-format",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "16.0.0",
|
|
4
4
|
"description": "Data format for OpenSkiMap.org",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"default": "./dist/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
7
15
|
"files": [
|
|
8
|
-
"dist"
|
|
9
|
-
"src"
|
|
16
|
+
"dist"
|
|
10
17
|
],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=24"
|
|
20
|
+
},
|
|
11
21
|
"scripts": {
|
|
12
22
|
"build": "rm -rf dist/ && tsc",
|
|
13
23
|
"prepare": "npm run build",
|
|
14
|
-
"release": "npm run
|
|
15
|
-
"test": "
|
|
16
|
-
"test:watch": "
|
|
17
|
-
"test:coverage": "
|
|
24
|
+
"release": "npm run build && npm publish",
|
|
25
|
+
"test": "vitest run",
|
|
26
|
+
"test:watch": "vitest",
|
|
27
|
+
"test:coverage": "vitest run --coverage",
|
|
28
|
+
"format": "prettier --write .",
|
|
29
|
+
"format:check": "prettier --check .",
|
|
30
|
+
"check-types": "tsc --project tsconfig.typecheck.json"
|
|
18
31
|
},
|
|
19
32
|
"repository": {
|
|
20
33
|
"type": "git",
|
|
@@ -26,20 +39,19 @@
|
|
|
26
39
|
"url": "https://github.com/russellporter/openskidata-format/issues"
|
|
27
40
|
},
|
|
28
41
|
"homepage": "https://github.com/russellporter/openskidata-format#readme",
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@types/geojson": "^7946.0.16",
|
|
31
|
-
"@types/jest": "^30.0.0",
|
|
32
|
-
"jest": "^30.2.0",
|
|
33
|
-
"ts-jest": "^29.4.6",
|
|
34
|
-
"typescript": "^5.9.3"
|
|
35
|
-
},
|
|
36
42
|
"dependencies": {
|
|
37
|
-
"@turf/boolean-point-in-polygon": "^7.
|
|
38
|
-
"@turf/center": "^7.
|
|
39
|
-
"@turf/distance": "^7.
|
|
40
|
-
"@turf/helpers": "^7.
|
|
41
|
-
"@turf/length": "^7.
|
|
42
|
-
"@turf/line-chunk": "^7.
|
|
43
|
-
"
|
|
43
|
+
"@turf/boolean-point-in-polygon": "^7.4.0",
|
|
44
|
+
"@turf/center": "^7.4.0",
|
|
45
|
+
"@turf/distance": "^7.4.0",
|
|
46
|
+
"@turf/helpers": "^7.4.0",
|
|
47
|
+
"@turf/length": "^7.4.0",
|
|
48
|
+
"@turf/line-chunk": "^7.4.0",
|
|
49
|
+
"@types/geojson": "^7946.0.16"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@types/node": "^24.13.3",
|
|
53
|
+
"prettier": "^3.9.6",
|
|
54
|
+
"typescript": "^7.0.2",
|
|
55
|
+
"vitest": "^5.0.0"
|
|
44
56
|
}
|
|
45
57
|
}
|
package/dist/SkiPass.d.ts
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import { Source } from './Source';
|
|
2
|
-
/** Stable identifier for a purchasable ski pass, e.g. "ikon-base". */
|
|
3
|
-
export type SkiPassID = string;
|
|
4
|
-
/** Stable identifier for a family of related ski passes, e.g. "ikon". */
|
|
5
|
-
export type SkiPassBrandID = string;
|
|
6
|
-
/**
|
|
7
|
-
* A ski area's membership of one purchasable ski pass.
|
|
8
|
-
*
|
|
9
|
-
* @property {SkiPassID} passID - Identifier of the ski pass.
|
|
10
|
-
* @property {string} passName - Display name of the ski pass.
|
|
11
|
-
* @property {SkiPassBrandID | null} brandID - Identifier of the pass's brand, or null for a standalone pass.
|
|
12
|
-
* @property {string | null} brandName - Display name of the pass's brand, or null for a standalone pass.
|
|
13
|
-
* @property {string | null} access - Access code, copied verbatim from the source, e.g. "5, 26, 27" or "U". The source documents these per pass in free text, so they are not parsed.
|
|
14
|
-
* @property {number | null} yearJoined - Year the ski area joined this pass, when the source records it.
|
|
15
|
-
* @property {Source[]} sources - Data sources.
|
|
16
|
-
*/
|
|
17
|
-
export type SkiPassMembership = {
|
|
18
|
-
passID: SkiPassID;
|
|
19
|
-
passName: string;
|
|
20
|
-
brandID: SkiPassBrandID | null;
|
|
21
|
-
brandName: string | null;
|
|
22
|
-
access: string | null;
|
|
23
|
-
yearJoined: number | null;
|
|
24
|
-
sources: Source[];
|
|
25
|
-
};
|
|
26
|
-
/**
|
|
27
|
-
* A family of related ski passes, used to group the purchasable passes in a catalogue.
|
|
28
|
-
*
|
|
29
|
-
* @property {SkiPassBrandID} id - Stable identifier for the brand.
|
|
30
|
-
* @property {string} name - Display name of the brand.
|
|
31
|
-
* @property {Source[]} sources - Data sources shared by the brand's passes.
|
|
32
|
-
*/
|
|
33
|
-
export type SkiPassBrand = {
|
|
34
|
-
type: 'skiPassBrand';
|
|
35
|
-
id: SkiPassBrandID;
|
|
36
|
-
name: string;
|
|
37
|
-
sources: Source[];
|
|
38
|
-
};
|
|
39
|
-
/**
|
|
40
|
-
* A multi-resort season pass.
|
|
41
|
-
*
|
|
42
|
-
* Unlike runs, lifts, ski areas and spots, a ski pass is not a geographic feature: it is a
|
|
43
|
-
* commercial product that covers a set of ski areas. The ski areas it covers each carry a
|
|
44
|
-
* matching `SkiPassMembership`.
|
|
45
|
-
*
|
|
46
|
-
* @property {SkiPassID} id - Unique identifier for the ski pass. Unlike a ski area ID, this is stable across runs.
|
|
47
|
-
* @property {string} name - Name of the ski pass.
|
|
48
|
-
* @property {SkiPassBrandID | null} brandID - Identifier of the pass's brand, or null for a standalone pass.
|
|
49
|
-
* @property {string | null} brandName - Display name of the pass's brand, or null for a standalone pass.
|
|
50
|
-
* @property {Source[]} sources - Data sources.
|
|
51
|
-
* @property {number} skiAreaCount - Number of ski areas this pass covers. Equal to the length of skiAreaIDs.
|
|
52
|
-
* @property {string[]} skiAreaIDs - IDs of the ski areas this pass covers, sorted, so that the order does not depend on anything outside this array.
|
|
53
|
-
* @property {SkiPassUnresolvedRosterEntry[]} unresolvedRosterEntries - Ski areas the source lists on this pass that could not be resolved to a ski area feature.
|
|
54
|
-
*/
|
|
55
|
-
export type SkiPass = {
|
|
56
|
-
type: 'skiPass';
|
|
57
|
-
id: SkiPassID;
|
|
58
|
-
name: string;
|
|
59
|
-
brandID: SkiPassBrandID | null;
|
|
60
|
-
brandName: string | null;
|
|
61
|
-
sources: Source[];
|
|
62
|
-
skiAreaCount: number;
|
|
63
|
-
skiAreaIDs: string[];
|
|
64
|
-
unresolvedRosterEntries: SkiPassUnresolvedRosterEntry[];
|
|
65
|
-
};
|
|
66
|
-
/** The complete non-geographic ski-pass dataset published alongside the ski-area data. */
|
|
67
|
-
export type SkiPassCatalog = {
|
|
68
|
-
brands: SkiPassBrand[];
|
|
69
|
-
passes: SkiPass[];
|
|
70
|
-
};
|
|
71
|
-
/**
|
|
72
|
-
* A ski area listed on a pass by the source, which has no corresponding ski area feature.
|
|
73
|
-
*
|
|
74
|
-
* @property {string} name - Ski area name as written by the source.
|
|
75
|
-
* @property {string} location - Location as written by the source, e.g. "U.S. - Colorado".
|
|
76
|
-
* @property {string} reason - Why the entry could not be resolved.
|
|
77
|
-
*/
|
|
78
|
-
export type SkiPassUnresolvedRosterEntry = {
|
|
79
|
-
name: string;
|
|
80
|
-
location: string;
|
|
81
|
-
reason: string;
|
|
82
|
-
};
|
package/dist/SkiPass.js
DELETED
package/dist/SkiPass.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SkiPass.js","sourceRoot":"","sources":["../src/SkiPass.ts"],"names":[],"mappings":""}
|
package/dist/testUtils.d.ts
DELETED
package/dist/testUtils.js
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.mockViewportHint = mockViewportHint;
|
|
4
|
-
function mockViewportHint() {
|
|
5
|
-
return { center: [0, 0], bearing: null, rotatedWidthMeters: 0, rotatedHeightMeters: 0, minCameraY: 0 };
|
|
6
|
-
}
|
|
7
|
-
//# sourceMappingURL=testUtils.js.map
|
package/dist/testUtils.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"testUtils.js","sourceRoot":"","sources":["../src/testUtils.ts"],"names":[],"mappings":";;AAEA,4CAEC;AAFD,SAAgB,gBAAgB;IAC9B,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,kBAAkB,EAAE,CAAC,EAAE,mBAAmB,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,CAAA;AACxG,CAAC"}
|