@glandais/vcyclist-engine 4.2.1 → 5.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/index.mjs ADDED
@@ -0,0 +1,70 @@
1
+ // GENERATED by `./gradlew :codegen:generateTsFacade` — do not edit.
2
+ //
3
+ // Kotlin/JS emits a UMD bundle that preserves the package namespace, so the module has
4
+ // exactly one top-level export, `io`. This unwraps it once so consumers can write
5
+ // `import { enhance } from '@glandais/vcyclist-engine'`.
6
+ import * as bundle from './vcyclist-engine.js';
7
+
8
+ // `.js` in a package without "type": "module" is CommonJS, so an ESM `import *` yields
9
+ // `{ default, 'module.exports' }` and the namespace hangs off `default`. Reading `bundle.io`
10
+ // directly finds undefined, and every export below silently becomes undefined with it.
11
+ const root = bundle.default ?? bundle;
12
+ const ns = root.io?.github?.glandais?.engine ?? root;
13
+
14
+ export const parseGpxWaypoints = ns.parseGpxWaypoints;
15
+ export const parseGpx = ns.parseGpx;
16
+ export const parseGpxTracks = ns.parseGpxTracks;
17
+ export const parseGpxSegments = ns.parseGpxSegments;
18
+ export const parseGpxTracksOnly = ns.parseGpxTracksOnly;
19
+ export const parseGpxRoutesOnly = ns.parseGpxRoutesOnly;
20
+ export const writeGpxTracks = ns.writeGpxTracks;
21
+ export const pathSize = ns.pathSize;
22
+ export const pathTotalDistance = ns.pathTotalDistance;
23
+ export const pathDurationMs = ns.pathDurationMs;
24
+ export const pathElevationGain = ns.pathElevationGain;
25
+ export const pathElevationLoss = ns.pathElevationLoss;
26
+ export const pathElevationGainFiltered = ns.pathElevationGainFiltered;
27
+ export const pathElevationLossFiltered = ns.pathElevationLossFiltered;
28
+ export const pathReportedElevationGain = ns.pathReportedElevationGain;
29
+ export const pathReportedElevationLoss = ns.pathReportedElevationLoss;
30
+ export const pointAt = ns.pointAt;
31
+ export const writeGpx = ns.writeGpx;
32
+ export const writeGpxAt = ns.writeGpxAt;
33
+ export const enhance = ns.enhance;
34
+ export const enhanceWithCourse = ns.enhanceWithCourse;
35
+ export const getField = ns.getField;
36
+ export const fieldDefinitions = ns.fieldDefinitions;
37
+ export const pathLatitudeDeg = ns.pathLatitudeDeg;
38
+ export const pathLongitudeDeg = ns.pathLongitudeDeg;
39
+ export const pathToCsv = ns.pathToCsv;
40
+ export const pathToJson = ns.pathToJson;
41
+ export const pathToFit = ns.pathToFit;
42
+ export const pathsToFit = ns.pathsToFit;
43
+ export const dominantHeadwindAzimuth = ns.dominantHeadwindAzimuth;
44
+ export const dominantHeadwindAzimuthOfTracks = ns.dominantHeadwindAzimuthOfTracks;
45
+ export const detectClimbs = ns.detectClimbs;
46
+ export const detectClimbsWithOptions = ns.detectClimbsWithOptions;
47
+ export const analyzeRacingLine = ns.analyzeRacingLine;
48
+
49
+ export const climbDefaults = Object.freeze({
50
+ minMinClimbElevationM: 10,
51
+ maxMinClimbElevationM: 35,
52
+ minClimbElevationRatio: 100,
53
+ minGradePercent: 3,
54
+ maxDiffRealGrade: 1.3,
55
+ booster: 1.3,
56
+ maxAnalysisPoints: 3000,
57
+ });
58
+
59
+ export const csvDefaults = Object.freeze({
60
+ separator: ',',
61
+ unitsInHeader: true,
62
+ decimals: null,
63
+ lineSeparator: '\n',
64
+ });
65
+
66
+ export const jsonDefaults = Object.freeze({
67
+ pretty: false,
68
+ decimals: null,
69
+ includeMeta: true,
70
+ });
@@ -156,20 +156,20 @@ if (typeof String.prototype.startsWith === 'undefined') {
156
156
  initMetadataForClass(AbstractMutableList, 'AbstractMutableList', VOID, AbstractMutableCollection, [KtList, Collection, MutableIterable]);
157
157
  initMetadataForClass(AbstractMap, 'AbstractMap', VOID, VOID, [KtMap]);
158
158
  initMetadataForClass(AbstractMutableMap, 'AbstractMutableMap', VOID, AbstractMap, [KtMap]);
159
- initMetadataForClass(AbstractMutableSet, 'AbstractMutableSet', VOID, AbstractMutableCollection, [Collection, MutableIterable, KtSet]);
159
+ initMetadataForClass(AbstractMutableSet, 'AbstractMutableSet', VOID, AbstractMutableCollection, [KtSet, Collection, MutableIterable]);
160
160
  initMetadataForCompanion(Companion_2);
161
161
  initMetadataForInterface(RandomAccess, 'RandomAccess');
162
162
  initMetadataForClass(ArrayList, 'ArrayList', ArrayList_init_$Create$, AbstractMutableList, [KtList, Collection, MutableIterable, RandomAccess]);
163
163
  initMetadataForClass(HashMap, 'HashMap', HashMap_init_$Create$, AbstractMutableMap, [KtMap]);
164
- initMetadataForClass(HashMapKeys, 'HashMapKeys', VOID, AbstractMutableSet, [Collection, MutableIterable, KtSet]);
164
+ initMetadataForClass(HashMapKeys, 'HashMapKeys', VOID, AbstractMutableSet, [KtSet, Collection, MutableIterable]);
165
165
  initMetadataForClass(HashMapValues, 'HashMapValues', VOID, AbstractMutableCollection, [Collection, MutableIterable]);
166
- initMetadataForClass(HashMapEntrySetBase, 'HashMapEntrySetBase', VOID, AbstractMutableSet, [Collection, MutableIterable, KtSet]);
166
+ initMetadataForClass(HashMapEntrySetBase, 'HashMapEntrySetBase', VOID, AbstractMutableSet, [KtSet, Collection, MutableIterable]);
167
167
  initMetadataForClass(HashMapEntrySet, 'HashMapEntrySet', VOID, HashMapEntrySetBase);
168
168
  initMetadataForClass(HashMapKeysDefault$iterator$1);
169
169
  initMetadataForClass(HashMapKeysDefault, 'HashMapKeysDefault', VOID, AbstractMutableSet);
170
170
  initMetadataForClass(HashMapValuesDefault$iterator$1);
171
171
  initMetadataForClass(HashMapValuesDefault, 'HashMapValuesDefault', VOID, AbstractMutableCollection);
172
- initMetadataForClass(HashSet, 'HashSet', HashSet_init_$Create$, AbstractMutableSet, [Collection, MutableIterable, KtSet]);
172
+ initMetadataForClass(HashSet, 'HashSet', HashSet_init_$Create$, AbstractMutableSet, [KtSet, Collection, MutableIterable]);
173
173
  initMetadataForCompanion(Companion_3);
174
174
  initMetadataForClass(Itr, 'Itr');
175
175
  initMetadataForClass(KeysItr, 'KeysItr', VOID, Itr);
@@ -214,7 +214,7 @@ if (typeof String.prototype.startsWith === 'undefined') {
214
214
  initMetadataForInterface(InternalMap, 'InternalMap');
215
215
  initMetadataForClass(InternalHashMap, 'InternalHashMap', InternalHashMap_init_$Create$, VOID, [InternalMap]);
216
216
  initMetadataForClass(LinkedHashMap, 'LinkedHashMap', LinkedHashMap_init_$Create$, HashMap, [KtMap]);
217
- initMetadataForClass(LinkedHashSet, 'LinkedHashSet', LinkedHashSet_init_$Create$, HashSet, [Collection, MutableIterable, KtSet]);
217
+ initMetadataForClass(LinkedHashSet, 'LinkedHashSet', LinkedHashSet_init_$Create$, HashSet, [KtSet, Collection, MutableIterable]);
218
218
  initMetadataForInterface(Continuation, 'Continuation');
219
219
  initMetadataForClass(InterceptedCoroutine, 'InterceptedCoroutine', VOID, VOID, [Continuation]);
220
220
  initMetadataForClass(CoroutineImpl, 'CoroutineImpl', VOID, InterceptedCoroutine, [Continuation]);
@@ -522,6 +522,16 @@ if (typeof String.prototype.startsWith === 'undefined') {
522
522
  return toMutableList(_this__u8e3s4);
523
523
  }
524
524
  }
525
+ function toSet(_this__u8e3s4) {
526
+ switch (_this__u8e3s4.length) {
527
+ case 0:
528
+ return emptySet();
529
+ case 1:
530
+ return setOf(_this__u8e3s4[0]);
531
+ default:
532
+ return toCollection(_this__u8e3s4, LinkedHashSet_init_$Create$_0(mapCapacity(_this__u8e3s4.length)));
533
+ }
534
+ }
525
535
  function toMutableList(_this__u8e3s4) {
526
536
  var list = ArrayList_init_$Create$_0(_this__u8e3s4.length);
527
537
  var inductionVariable = 0;
@@ -533,6 +543,16 @@ if (typeof String.prototype.startsWith === 'undefined') {
533
543
  }
534
544
  return list;
535
545
  }
546
+ function toCollection(_this__u8e3s4, destination) {
547
+ var inductionVariable = 0;
548
+ var last = _this__u8e3s4.length;
549
+ while (inductionVariable < last) {
550
+ var item = _this__u8e3s4[inductionVariable];
551
+ inductionVariable = inductionVariable + 1 | 0;
552
+ destination.add_utx5q5_k$(item);
553
+ }
554
+ return destination;
555
+ }
536
556
  function single(_this__u8e3s4) {
537
557
  var tmp;
538
558
  switch (_this__u8e3s4.length) {
@@ -549,26 +569,6 @@ if (typeof String.prototype.startsWith === 'undefined') {
549
569
  function contains_1(_this__u8e3s4, element) {
550
570
  return indexOf_0(_this__u8e3s4, element) >= 0;
551
571
  }
552
- function toSet(_this__u8e3s4) {
553
- switch (_this__u8e3s4.length) {
554
- case 0:
555
- return emptySet();
556
- case 1:
557
- return setOf(_this__u8e3s4[0]);
558
- default:
559
- return toCollection(_this__u8e3s4, LinkedHashSet_init_$Create$_0(mapCapacity(_this__u8e3s4.length)));
560
- }
561
- }
562
- function toCollection(_this__u8e3s4, destination) {
563
- var inductionVariable = 0;
564
- var last = _this__u8e3s4.length;
565
- while (inductionVariable < last) {
566
- var item = _this__u8e3s4[inductionVariable];
567
- inductionVariable = inductionVariable + 1 | 0;
568
- destination.add_utx5q5_k$(item);
569
- }
570
- return destination;
571
- }
572
572
  function indexOf_0(_this__u8e3s4, element) {
573
573
  var inductionVariable = 0;
574
574
  var last = _this__u8e3s4.length - 1 | 0;
@@ -647,6 +647,22 @@ if (typeof String.prototype.startsWith === 'undefined') {
647
647
  }
648
648
  return optimizeReadOnlySet(toCollection_0(_this__u8e3s4, LinkedHashSet_init_$Create$()));
649
649
  }
650
+ function sorted(_this__u8e3s4) {
651
+ if (isInterface(_this__u8e3s4, Collection)) {
652
+ if (_this__u8e3s4.get_size_woubt6_k$() <= 1)
653
+ return toList_1(_this__u8e3s4);
654
+ // Inline function 'kotlin.collections.toTypedArray' call
655
+ var tmp = copyToArray(_this__u8e3s4);
656
+ // Inline function 'kotlin.apply' call
657
+ var this_0 = isArray(tmp) ? tmp : THROW_CCE();
658
+ sort_0(this_0);
659
+ return asList(this_0);
660
+ }
661
+ // Inline function 'kotlin.apply' call
662
+ var this_1 = toMutableList_1(_this__u8e3s4);
663
+ sort_1(this_1);
664
+ return this_1;
665
+ }
650
666
  function toList_1(_this__u8e3s4) {
651
667
  if (isInterface(_this__u8e3s4, Collection)) {
652
668
  var tmp;
@@ -758,22 +774,6 @@ if (typeof String.prototype.startsWith === 'undefined') {
758
774
  }
759
775
  return result;
760
776
  }
761
- function sorted(_this__u8e3s4) {
762
- if (isInterface(_this__u8e3s4, Collection)) {
763
- if (_this__u8e3s4.get_size_woubt6_k$() <= 1)
764
- return toList_1(_this__u8e3s4);
765
- // Inline function 'kotlin.collections.toTypedArray' call
766
- var tmp = copyToArray(_this__u8e3s4);
767
- // Inline function 'kotlin.apply' call
768
- var this_0 = isArray(tmp) ? tmp : THROW_CCE();
769
- sort_0(this_0);
770
- return asList(this_0);
771
- }
772
- // Inline function 'kotlin.apply' call
773
- var this_1 = toMutableList_1(_this__u8e3s4);
774
- sort_1(this_1);
775
- return this_1;
776
- }
777
777
  function toCollection_0(_this__u8e3s4, destination) {
778
778
  var _iterator__ex2g4s = _this__u8e3s4.iterator_jk1svi_k$();
779
779
  while (_iterator__ex2g4s.hasNext_bitz1p_k$()) {