trackswap 0.2.3 → 0.2.4
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/README.md +20 -0
- package/dist/FIT/base.d.ts +30 -0
- package/dist/FIT/decoder.d.ts +48 -0
- package/dist/FIT/encoder.d.ts +96 -0
- package/dist/FIT/encoderCourse.d.ts +45 -0
- package/dist/FIT/encoderWorkout.d.ts +45 -0
- package/dist/FIT/health.d.ts +195 -7
- package/dist/FIT/index.d.ts +1 -1
- package/dist/FIT/mesg.d.ts +3 -0
- package/dist/FIT/middleware.d.ts +15 -0
- package/dist/FIT/plugins.d.ts +9 -0
- package/dist/FIT/processor.d.ts +24 -0
- package/dist/FIT/types/checksum_type.d.ts +6 -0
- package/dist/FIT/types/date_time_type.d.ts +3 -0
- package/dist/FIT/types/file.d.ts +63 -0
- package/dist/FIT/types/file_flags_type.d.ts +9 -0
- package/dist/FIT/types/local_date_time_type.d.ts +3 -0
- package/dist/FIT/types/mesg_count_type.d.ts +6 -0
- package/dist/FIT/types/mesg_num.d.ts +369 -0
- package/dist/FIT/types/message_index_type.d.ts +6591 -0
- package/dist/FIT/types/sport.d.ts +44 -44
- package/dist/FIT/types.d.ts +509 -0
- package/dist/GPX/base.d.ts +24 -0
- package/dist/GPX/converters.d.ts +44 -0
- package/dist/GPX/decoder.d.ts +66 -0
- package/dist/GPX/encoder.d.ts +109 -0
- package/dist/GPX/middleware.d.ts +9 -0
- package/dist/GPX/processor.d.ts +18 -0
- package/dist/GPX/types.d.ts +138 -0
- package/dist/TCX/base.d.ts +33 -0
- package/dist/TCX/converters.d.ts +33 -0
- package/dist/TCX/decoder.d.ts +54 -0
- package/dist/TCX/encoder.d.ts +116 -0
- package/dist/TCX/middleware.d.ts +12 -0
- package/dist/TCX/processor.d.ts +30 -0
- package/dist/TCX/types.d.ts +13 -0
- package/dist/TrackSwap.d.ts +4 -0
- package/dist/activity/base.d.ts +54 -0
- package/dist/activity/converters.d.ts +57 -0
- package/dist/activity/encoders.d.ts +34 -0
- package/dist/activity/metrics/MetricsCalculator.d.ts +30 -0
- package/dist/activity/processor.d.ts +31 -0
- package/dist/core/base.d.ts +46 -0
- package/dist/core/builtin-adapters.d.ts +1 -0
- package/dist/core/xml-utils.d.ts +24 -0
- package/dist/errors.d.ts +1 -1
- package/dist/fit-debug.d.ts +3 -0
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.js +29 -29
- package/dist/types.d.ts +102 -1
- package/dist/util.d.ts +9 -0
- package/package.json +4 -3
package/dist/GPX/base.d.ts
CHANGED
|
@@ -1,16 +1,40 @@
|
|
|
1
1
|
import { IPlugin, IConverterPlugin, IMiddlewarePlugin, BaseConverter, BaseMiddleware } from "../core/base.js";
|
|
2
2
|
import { DecoderContext, GPX11Type } from "./types.js";
|
|
3
|
+
/**
|
|
4
|
+
* GPX plugin interface (inherits generic plugin interface)
|
|
5
|
+
*/
|
|
3
6
|
export interface IGPXPlugin extends IPlugin<DecoderContext> {
|
|
4
7
|
}
|
|
8
|
+
/**
|
|
9
|
+
* GPX converter plugin interface (inherits generic converter interface)
|
|
10
|
+
*/
|
|
5
11
|
export interface IGPXConverterPlugin extends IConverterPlugin<DecoderContext> {
|
|
6
12
|
}
|
|
13
|
+
/**
|
|
14
|
+
* GPX middleware plugin interface (inherits generic middleware interface)
|
|
15
|
+
*/
|
|
7
16
|
export interface IGPXMiddlewarePlugin extends IMiddlewarePlugin<DecoderContext, GPX11Type> {
|
|
8
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* GPX base converter abstract class (inherits generic base converter)
|
|
20
|
+
*/
|
|
9
21
|
export declare abstract class BaseGPXConverter extends BaseConverter<DecoderContext> implements IGPXConverterPlugin {
|
|
22
|
+
/**
|
|
23
|
+
* Parse GPX coordinate values (latitude/longitude)
|
|
24
|
+
*/
|
|
10
25
|
protected parseCoordinate(value: string | number | undefined): number | undefined;
|
|
26
|
+
/**
|
|
27
|
+
* Parse GPX time format
|
|
28
|
+
*/
|
|
11
29
|
protected parseGPXTime(value: string | undefined): Date | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* Extract numeric attributes (common GPX processing approach)
|
|
32
|
+
*/
|
|
12
33
|
protected extractNumericAttributes<U extends Record<string, any>>(ast: any, target: U, mapping: Record<string, keyof U>): void;
|
|
13
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* GPX base middleware abstract class (inherits generic base middleware)
|
|
37
|
+
*/
|
|
14
38
|
export declare abstract class BaseGPXMiddleware extends BaseMiddleware<DecoderContext, GPX11Type> implements IGPXMiddlewarePlugin {
|
|
15
39
|
onError(error: Error, context: DecoderContext): Promise<void>;
|
|
16
40
|
}
|
package/dist/GPX/converters.d.ts
CHANGED
|
@@ -1,62 +1,106 @@
|
|
|
1
1
|
import { BaseGPXConverter } from "./base.js";
|
|
2
2
|
import { TokenAST, ExtensionsType } from "../types.js";
|
|
3
3
|
import { BoundsType, CopyrightType, EmailType, LinkType, MetadataType, PersonType, RteType, TrksegType, TrkType, WptType, DecoderContext } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* WPT converter
|
|
6
|
+
*/
|
|
4
7
|
export declare class WptConverter extends BaseGPXConverter {
|
|
5
8
|
name: string;
|
|
6
9
|
supportedTags: string[];
|
|
7
10
|
version: string;
|
|
8
11
|
convert(ast: TokenAST, context: DecoderContext): WptType | undefined;
|
|
12
|
+
/**
|
|
13
|
+
* Maps extension fields from the extensions object to the point object.
|
|
14
|
+
* This is necessary because the extensions converter flattens the extensions
|
|
15
|
+
* into a single object, but the point object expects them as separate fields.
|
|
16
|
+
*/
|
|
9
17
|
private mapExtensionsToPoint;
|
|
10
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Route converter
|
|
21
|
+
*/
|
|
11
22
|
export declare class RteConverter extends BaseGPXConverter {
|
|
12
23
|
name: string;
|
|
13
24
|
supportedTags: string[];
|
|
14
25
|
convert(ast: TokenAST, context: DecoderContext): RteType | undefined;
|
|
15
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Track converter
|
|
29
|
+
*/
|
|
16
30
|
export declare class TrkConverter extends BaseGPXConverter {
|
|
17
31
|
name: string;
|
|
18
32
|
supportedTags: string[];
|
|
19
33
|
convert(ast: TokenAST, context: DecoderContext): TrkType | undefined;
|
|
20
34
|
}
|
|
35
|
+
/**
|
|
36
|
+
* Track Segment converter
|
|
37
|
+
*/
|
|
21
38
|
export declare class TrksegConverter extends BaseGPXConverter {
|
|
22
39
|
name: string;
|
|
23
40
|
supportedTags: string[];
|
|
24
41
|
convert(ast: TokenAST, context: DecoderContext): TrksegType | undefined;
|
|
25
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* Link converter
|
|
45
|
+
*/
|
|
26
46
|
export declare class LinkConverter extends BaseGPXConverter {
|
|
27
47
|
name: string;
|
|
28
48
|
supportedTags: string[];
|
|
29
49
|
convert(ast: TokenAST, context: DecoderContext): LinkType | undefined;
|
|
30
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Metadata converter
|
|
53
|
+
*/
|
|
31
54
|
export declare class MetadataConverter extends BaseGPXConverter {
|
|
32
55
|
name: string;
|
|
33
56
|
supportedTags: string[];
|
|
34
57
|
convert(ast: TokenAST, context: DecoderContext): MetadataType | undefined;
|
|
35
58
|
}
|
|
59
|
+
/**
|
|
60
|
+
* Person converter
|
|
61
|
+
*/
|
|
36
62
|
export declare class PersonConverter extends BaseGPXConverter {
|
|
37
63
|
name: string;
|
|
38
64
|
supportedTags: string[];
|
|
39
65
|
convert(ast: TokenAST, context: DecoderContext): PersonType | undefined;
|
|
40
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Email converter
|
|
69
|
+
*/
|
|
41
70
|
export declare class EmailConverter extends BaseGPXConverter {
|
|
42
71
|
name: string;
|
|
43
72
|
supportedTags: string[];
|
|
44
73
|
convert(ast: TokenAST, context: DecoderContext): EmailType | undefined;
|
|
45
74
|
}
|
|
75
|
+
/**
|
|
76
|
+
* Copyright converter
|
|
77
|
+
*/
|
|
46
78
|
export declare class CopyrightConverter extends BaseGPXConverter {
|
|
47
79
|
name: string;
|
|
48
80
|
supportedTags: string[];
|
|
49
81
|
convert(ast: TokenAST, context: DecoderContext): CopyrightType | undefined;
|
|
50
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Bounds converter
|
|
85
|
+
*/
|
|
51
86
|
export declare class BoundsConverter extends BaseGPXConverter {
|
|
52
87
|
name: string;
|
|
53
88
|
supportedTags: string[];
|
|
54
89
|
convert(ast: TokenAST, context: DecoderContext): BoundsType | undefined;
|
|
55
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Extensions converter
|
|
93
|
+
*/
|
|
56
94
|
export declare class ExtensionsConverter extends BaseGPXConverter {
|
|
57
95
|
name: string;
|
|
58
96
|
supportedTags: string[];
|
|
59
97
|
convert(ast: TokenAST, context: DecoderContext): ExtensionsType | undefined;
|
|
98
|
+
/**
|
|
99
|
+
* Flatten extension element, extracting all leaf nodes
|
|
100
|
+
*/
|
|
60
101
|
private flattenExtensionElement;
|
|
102
|
+
/**
|
|
103
|
+
* Parse extension value, trying to convert to appropriate type
|
|
104
|
+
*/
|
|
61
105
|
private parseExtensionValue;
|
|
62
106
|
}
|
package/dist/GPX/decoder.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { ExtensionsType, TokenAST } from "../types.js";
|
|
2
2
|
import { IGPXConverterPlugin, IGPXMiddlewarePlugin } from "./base.js";
|
|
3
3
|
import { GPX11Type } from "./types.js";
|
|
4
|
+
/**
|
|
5
|
+
* GPX decoder main class
|
|
6
|
+
*/
|
|
4
7
|
export declare class GPXDecoder {
|
|
5
8
|
private converterPlugins;
|
|
6
9
|
private registeredPlugins;
|
|
@@ -9,32 +12,95 @@ export declare class GPXDecoder {
|
|
|
9
12
|
private initialized;
|
|
10
13
|
private defaultConvertersRegistered;
|
|
11
14
|
constructor();
|
|
15
|
+
/**
|
|
16
|
+
* Initialize pipeline - register fixed core processors
|
|
17
|
+
*/
|
|
12
18
|
private initializePipeline;
|
|
19
|
+
/**
|
|
20
|
+
* Auto-register default converters - handle standard GPX tags
|
|
21
|
+
*/
|
|
13
22
|
private registerDefaultConverters;
|
|
23
|
+
/**
|
|
24
|
+
* Add converter for specified tag, sorted by priority
|
|
25
|
+
*/
|
|
14
26
|
private addConverterForTag;
|
|
27
|
+
/**
|
|
28
|
+
* Register converter plugin
|
|
29
|
+
*/
|
|
15
30
|
registerConverter(plugin: IGPXConverterPlugin): Promise<void>;
|
|
31
|
+
/**
|
|
32
|
+
* Register middleware plugin - the real extension point
|
|
33
|
+
*/
|
|
16
34
|
registerMiddleware(plugin: IGPXMiddlewarePlugin): Promise<void>;
|
|
35
|
+
/**
|
|
36
|
+
* Get converter (returns highest priority one)
|
|
37
|
+
*/
|
|
17
38
|
getConverter(tag: string): IGPXConverterPlugin | undefined;
|
|
39
|
+
/**
|
|
40
|
+
* Get all converters for specified tag (sorted by priority)
|
|
41
|
+
*/
|
|
18
42
|
getAllConverters(tag: string): IGPXConverterPlugin[];
|
|
43
|
+
/**
|
|
44
|
+
* Remove converter
|
|
45
|
+
*/
|
|
19
46
|
unregisterConverter(pluginName: string): void;
|
|
47
|
+
/**
|
|
48
|
+
* Remove middleware
|
|
49
|
+
*/
|
|
20
50
|
unregisterMiddleware(name: string): void;
|
|
51
|
+
/**
|
|
52
|
+
* List all registered converter tags
|
|
53
|
+
*/
|
|
21
54
|
listConverters(): string[];
|
|
55
|
+
/**
|
|
56
|
+
* List all registered converter plugins
|
|
57
|
+
*/
|
|
22
58
|
listConverterPlugins(): string[];
|
|
59
|
+
/**
|
|
60
|
+
* List all registered middleware
|
|
61
|
+
*/
|
|
23
62
|
listMiddlewares(): string[];
|
|
63
|
+
/**
|
|
64
|
+
* List core processors (read-only)
|
|
65
|
+
*/
|
|
24
66
|
listProcessors(): string[];
|
|
67
|
+
/**
|
|
68
|
+
* Get converter details for tag (including priority information)
|
|
69
|
+
*/
|
|
25
70
|
getConverterDetails(tag?: string): Record<string, Array<{
|
|
26
71
|
name: string;
|
|
27
72
|
priority: number;
|
|
28
73
|
}>>;
|
|
74
|
+
/**
|
|
75
|
+
* Get middleware details (including supported hooks)
|
|
76
|
+
*/
|
|
29
77
|
getMiddlewareDetails(): Array<{
|
|
30
78
|
name: string;
|
|
31
79
|
hooks: string[];
|
|
32
80
|
}>;
|
|
81
|
+
/**
|
|
82
|
+
* Initialize decoder
|
|
83
|
+
*/
|
|
33
84
|
initialize(): Promise<void>;
|
|
85
|
+
/**
|
|
86
|
+
* Destroy decoder
|
|
87
|
+
*/
|
|
34
88
|
destroy(): Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Create decode context
|
|
91
|
+
*/
|
|
35
92
|
private createContext;
|
|
93
|
+
/**
|
|
94
|
+
* Execute middleware hook
|
|
95
|
+
*/
|
|
36
96
|
private executeMiddlewareHook;
|
|
97
|
+
/**
|
|
98
|
+
* Main parse method - fixed pipeline + flexible middleware
|
|
99
|
+
*/
|
|
37
100
|
parserByBuffer(buffer: Buffer): Promise<GPX11Type | undefined>;
|
|
101
|
+
/**
|
|
102
|
+
* Convert Extensions (backward compatibility)
|
|
103
|
+
*/
|
|
38
104
|
convertExtensions(extensionsAST: TokenAST): ExtensionsType;
|
|
39
105
|
}
|
|
40
106
|
declare const _default: {
|
package/dist/GPX/encoder.d.ts
CHANGED
|
@@ -1,42 +1,151 @@
|
|
|
1
1
|
import { GPX11Type } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* GPX encoder - encodes GPX11Type data to GPX XML format
|
|
4
|
+
*/
|
|
2
5
|
export declare class GPXEncoder {
|
|
3
6
|
private compact;
|
|
7
|
+
/**
|
|
8
|
+
* Constructor
|
|
9
|
+
* @param options Encoder options
|
|
10
|
+
*/
|
|
4
11
|
constructor(options?: {
|
|
5
12
|
compact?: boolean;
|
|
6
13
|
});
|
|
14
|
+
/**
|
|
15
|
+
* Encode GPX data to Buffer
|
|
16
|
+
*/
|
|
7
17
|
encode(gpxData: GPX11Type): Promise<Buffer>;
|
|
18
|
+
/**
|
|
19
|
+
* Encode GPX data to XML string
|
|
20
|
+
*/
|
|
8
21
|
encodeToString(gpxData: GPX11Type): string;
|
|
22
|
+
/**
|
|
23
|
+
* Build complete GPX XML
|
|
24
|
+
*/
|
|
9
25
|
private buildGPXXML;
|
|
26
|
+
/**
|
|
27
|
+
* Compress XML string, remove redundant newlines and spaces
|
|
28
|
+
*/
|
|
10
29
|
private compressXML;
|
|
30
|
+
/**
|
|
31
|
+
* Build XML header
|
|
32
|
+
*/
|
|
11
33
|
private buildXMLHeader;
|
|
34
|
+
/**
|
|
35
|
+
* Build GPX content
|
|
36
|
+
*/
|
|
12
37
|
private buildGPXContent;
|
|
38
|
+
/**
|
|
39
|
+
* Build metadata element
|
|
40
|
+
*/
|
|
13
41
|
private buildMetadata;
|
|
42
|
+
/**
|
|
43
|
+
* Build author element
|
|
44
|
+
*/
|
|
14
45
|
private buildAuthor;
|
|
46
|
+
/**
|
|
47
|
+
* Build copyright element
|
|
48
|
+
*/
|
|
15
49
|
private buildCopyright;
|
|
50
|
+
/**
|
|
51
|
+
* Build bounds element
|
|
52
|
+
*/
|
|
16
53
|
private buildBounds;
|
|
54
|
+
/**
|
|
55
|
+
* Build waypoint element
|
|
56
|
+
*/
|
|
17
57
|
private buildWaypoint;
|
|
58
|
+
/**
|
|
59
|
+
* Add standard waypoint elements
|
|
60
|
+
*/
|
|
18
61
|
private addStandardWaypointElements;
|
|
62
|
+
/**
|
|
63
|
+
* Build rte element
|
|
64
|
+
*/
|
|
19
65
|
private buildRoute;
|
|
66
|
+
/**
|
|
67
|
+
* Build track element
|
|
68
|
+
*/
|
|
20
69
|
private buildTrack;
|
|
70
|
+
/**
|
|
71
|
+
* Build track segment element
|
|
72
|
+
*/
|
|
21
73
|
private buildTrackSegment;
|
|
74
|
+
/**
|
|
75
|
+
* Add common elements for route and track
|
|
76
|
+
*/
|
|
22
77
|
private addRouteTrackCommonElements;
|
|
78
|
+
/**
|
|
79
|
+
* Process point extension attributes
|
|
80
|
+
*/
|
|
23
81
|
private processPointExtensions;
|
|
82
|
+
/**
|
|
83
|
+
* Build TrackPoint extension
|
|
84
|
+
*/
|
|
24
85
|
private buildTrackPointExtension;
|
|
86
|
+
/**
|
|
87
|
+
* Build Power extension
|
|
88
|
+
*/
|
|
25
89
|
private buildPowerExtension;
|
|
90
|
+
/**
|
|
91
|
+
* Build GPX extensions
|
|
92
|
+
*/
|
|
26
93
|
private buildGpxExtensions;
|
|
94
|
+
/**
|
|
95
|
+
* Build extensions element
|
|
96
|
+
*/
|
|
27
97
|
private buildExtensions;
|
|
98
|
+
/**
|
|
99
|
+
* Recursively build extension content
|
|
100
|
+
*/
|
|
28
101
|
private buildExtensionContent;
|
|
102
|
+
/**
|
|
103
|
+
* Build link element
|
|
104
|
+
*/
|
|
29
105
|
private buildLink;
|
|
106
|
+
/**
|
|
107
|
+
* Add multiple link elements
|
|
108
|
+
*/
|
|
30
109
|
private addLinks;
|
|
110
|
+
/**
|
|
111
|
+
* Build time element
|
|
112
|
+
*/
|
|
31
113
|
private buildTimeElement;
|
|
114
|
+
/**
|
|
115
|
+
* Add optional element
|
|
116
|
+
*/
|
|
32
117
|
private addOptionalElement;
|
|
118
|
+
/**
|
|
119
|
+
* Validate coordinate validity
|
|
120
|
+
*/
|
|
33
121
|
private isValidCoordinate;
|
|
122
|
+
/**
|
|
123
|
+
* Format coordinate
|
|
124
|
+
*/
|
|
34
125
|
private formatCoordinate;
|
|
126
|
+
/**
|
|
127
|
+
* Format elevation
|
|
128
|
+
*/
|
|
35
129
|
private formatElevation;
|
|
130
|
+
/**
|
|
131
|
+
* Round number
|
|
132
|
+
*/
|
|
36
133
|
private roundTo;
|
|
134
|
+
/**
|
|
135
|
+
* XML escape
|
|
136
|
+
*/
|
|
37
137
|
private escapeXML;
|
|
138
|
+
/**
|
|
139
|
+
* XML attribute value escape (specifically for safe escaping of attribute values)
|
|
140
|
+
*/
|
|
38
141
|
private escapeXMLAttribute;
|
|
142
|
+
/**
|
|
143
|
+
* Deep clone
|
|
144
|
+
*/
|
|
39
145
|
private deepClone;
|
|
146
|
+
/**
|
|
147
|
+
* @deprecated Use encode() instead
|
|
148
|
+
*/
|
|
40
149
|
encoder(node: GPX11Type): Promise<Buffer>;
|
|
41
150
|
}
|
|
42
151
|
declare const _default: {
|
package/dist/GPX/middleware.d.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { Token, TokenAST } from "../types";
|
|
2
2
|
import { BaseGPXMiddleware } from "./base";
|
|
3
3
|
import { DecoderContext } from "./types";
|
|
4
|
+
/**
|
|
5
|
+
* Performance monitoring middleware
|
|
6
|
+
*/
|
|
4
7
|
export declare class PerformanceMiddleware extends BaseGPXMiddleware {
|
|
5
8
|
name: string;
|
|
6
9
|
description: string;
|
|
@@ -9,10 +12,16 @@ export declare class PerformanceMiddleware extends BaseGPXMiddleware {
|
|
|
9
12
|
onComplete(result: any, context: DecoderContext): Promise<any>;
|
|
10
13
|
private countNodes;
|
|
11
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Validation middleware
|
|
17
|
+
*/
|
|
12
18
|
export declare class ValidationMiddleware extends BaseGPXMiddleware {
|
|
13
19
|
name: string;
|
|
14
20
|
description: string;
|
|
15
21
|
onComplete(result: any, context: DecoderContext): Promise<any>;
|
|
16
22
|
private validateGPX;
|
|
17
23
|
}
|
|
24
|
+
/**
|
|
25
|
+
* Register all default middleware
|
|
26
|
+
*/
|
|
18
27
|
export declare function registerDefaultMiddlewares(decoder: any): Promise<void>;
|
package/dist/GPX/processor.d.ts
CHANGED
|
@@ -1,22 +1,37 @@
|
|
|
1
1
|
import { DecoderContext } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Pipeline stages
|
|
4
|
+
*/
|
|
2
5
|
export declare enum PipelineStage {
|
|
3
6
|
TOKENIZE = "tokenize",
|
|
4
7
|
AST_GENERATE = "ast_generate",
|
|
5
8
|
CONVERT = "convert",
|
|
6
9
|
COMPLETE = "complete"
|
|
7
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Pipeline processor
|
|
13
|
+
*/
|
|
8
14
|
export interface IPipelineProcessor {
|
|
9
15
|
stage: PipelineStage;
|
|
10
16
|
process(context: DecoderContext): Promise<DecoderContext>;
|
|
11
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* Tokenize processor, converts xml to tokens
|
|
20
|
+
*/
|
|
12
21
|
export declare class TokenizeProcessor implements IPipelineProcessor {
|
|
13
22
|
stage: PipelineStage;
|
|
14
23
|
process(context: DecoderContext): Promise<DecoderContext>;
|
|
15
24
|
}
|
|
25
|
+
/**
|
|
26
|
+
* AST generation processor
|
|
27
|
+
*/
|
|
16
28
|
export declare class AstGenerateProcessor implements IPipelineProcessor {
|
|
17
29
|
stage: PipelineStage;
|
|
18
30
|
process(context: DecoderContext): Promise<DecoderContext>;
|
|
19
31
|
}
|
|
32
|
+
/**
|
|
33
|
+
* Conversion processor
|
|
34
|
+
*/
|
|
20
35
|
export declare class ConvertProcessor implements IPipelineProcessor {
|
|
21
36
|
private getConverter;
|
|
22
37
|
stage: PipelineStage;
|
|
@@ -24,6 +39,9 @@ export declare class ConvertProcessor implements IPipelineProcessor {
|
|
|
24
39
|
process(context: DecoderContext): Promise<DecoderContext>;
|
|
25
40
|
private assignResult;
|
|
26
41
|
}
|
|
42
|
+
/**
|
|
43
|
+
* Complete processor
|
|
44
|
+
*/
|
|
27
45
|
export declare class CompleteProcessor implements IPipelineProcessor {
|
|
28
46
|
stage: PipelineStage;
|
|
29
47
|
process(context: DecoderContext): Promise<DecoderContext>;
|
package/dist/GPX/types.d.ts
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { DegreesType, ExtensionsType, LatitudeType, LongitudeType, Token, TokenAST } from "../types.js";
|
|
2
2
|
import { IProcessingContext } from "../core/base.js";
|
|
3
|
+
/**
|
|
4
|
+
* Two lat/lon pairs defining the extent of an element.
|
|
5
|
+
*/
|
|
3
6
|
export interface BoundsType {
|
|
4
7
|
minlat?: LatitudeType;
|
|
5
8
|
minlon?: LongitudeType;
|
|
@@ -20,14 +23,35 @@ export interface EmailType {
|
|
|
20
23
|
id?: string;
|
|
21
24
|
domain?: string;
|
|
22
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Type of GPS fix. none means GPS had no fix. To signify "the fix info is unknown, leave out fixType entirely. pps = military signal used
|
|
28
|
+
*/
|
|
23
29
|
type FixType = "none" | "2d" | "3d" | "dgps" | "pps" | string;
|
|
24
30
|
export type LinkType = {
|
|
31
|
+
/**
|
|
32
|
+
* URL of hyperlink.
|
|
33
|
+
*/
|
|
25
34
|
href?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Text of hyperlink.
|
|
37
|
+
*/
|
|
26
38
|
text?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Mime type of content (image/jpeg)
|
|
41
|
+
*/
|
|
27
42
|
type?: string;
|
|
28
43
|
};
|
|
44
|
+
/**
|
|
45
|
+
* GPX 1.1 version type
|
|
46
|
+
*/
|
|
29
47
|
export interface GPX11Type {
|
|
48
|
+
/**
|
|
49
|
+
* gpx version 1.1
|
|
50
|
+
*/
|
|
30
51
|
version?: string;
|
|
52
|
+
/**
|
|
53
|
+
* You must include the name or URL of the software that created your GPX document. This allows others to inform the creator of a GPX instance document that fails to validate.
|
|
54
|
+
*/
|
|
31
55
|
creator?: string;
|
|
32
56
|
xmlns?: string;
|
|
33
57
|
"xmlns:gte"?: string;
|
|
@@ -40,54 +64,168 @@ export interface GPX11Type {
|
|
|
40
64
|
extensions?: any;
|
|
41
65
|
[key: string]: any | undefined;
|
|
42
66
|
}
|
|
67
|
+
/**
|
|
68
|
+
* Metadata about the file.
|
|
69
|
+
*/
|
|
43
70
|
export interface MetadataType {
|
|
71
|
+
/**
|
|
72
|
+
* The name of the GPX file.
|
|
73
|
+
*/
|
|
44
74
|
name?: string;
|
|
75
|
+
/**
|
|
76
|
+
* A description of the contents of the GPX file.
|
|
77
|
+
*/
|
|
45
78
|
desc?: string;
|
|
79
|
+
/**
|
|
80
|
+
* The person or organization who created the GPX file.
|
|
81
|
+
*/
|
|
46
82
|
author?: PersonType;
|
|
83
|
+
/**
|
|
84
|
+
* Copyright and license information governing use of the file.
|
|
85
|
+
*/
|
|
47
86
|
copyright?: CopyrightType;
|
|
87
|
+
/**
|
|
88
|
+
* URLs associated with the location described in the file.
|
|
89
|
+
*/
|
|
48
90
|
link?: LinkType[];
|
|
91
|
+
/**
|
|
92
|
+
* The creation date of the file.
|
|
93
|
+
*/
|
|
49
94
|
time?: Date;
|
|
95
|
+
/**
|
|
96
|
+
* Keywords associated with the file. Search engines or databases can use this information to classify the data.
|
|
97
|
+
*/
|
|
50
98
|
keywords?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Minimum and maximum coordinates which describe the extent of the coordinates in the file.
|
|
101
|
+
*/
|
|
51
102
|
bounds?: BoundsType;
|
|
52
103
|
extensions?: ExtensionsType;
|
|
53
104
|
[key: string]: any;
|
|
54
105
|
}
|
|
106
|
+
/**
|
|
107
|
+
* A list of waypoints.
|
|
108
|
+
*/
|
|
55
109
|
export interface WptType {
|
|
56
110
|
lat?: LatitudeType;
|
|
57
111
|
lon?: LongitudeType;
|
|
112
|
+
/**
|
|
113
|
+
* Elevation (in meters) of the point.
|
|
114
|
+
*/
|
|
58
115
|
ele?: number;
|
|
116
|
+
/**
|
|
117
|
+
* Creation/modification timestamp for element. Date and time in are in Univeral Coordinated Time (UTC), not local time! Conforms to ISO 8601 specification for date/time representation. Fractional seconds are allowed for millisecond timing in tracklogs.
|
|
118
|
+
*/
|
|
59
119
|
time?: Date;
|
|
120
|
+
/**
|
|
121
|
+
* Instantaneous speed at the point (meters per second)
|
|
122
|
+
*/
|
|
60
123
|
speed?: number;
|
|
124
|
+
/**
|
|
125
|
+
* Instantaneous course at the point (degrees, true north)
|
|
126
|
+
*/
|
|
61
127
|
course?: number;
|
|
128
|
+
/**
|
|
129
|
+
* Magnetic variation (in degrees) at the point
|
|
130
|
+
*/
|
|
62
131
|
magvar?: DegreesType;
|
|
132
|
+
/**
|
|
133
|
+
* Height (in meters) of geoid (mean sea level) above WGS84 earth ellipsoid. As defined in NMEA GGA message.
|
|
134
|
+
*/
|
|
63
135
|
geoidheight?: number;
|
|
136
|
+
/**
|
|
137
|
+
* The GPS name of the waypoint. This field will be transferred to and from the GPS. GPX does not place restrictions on the length of this field or the characters contained in it. It is up to the receiving application to validate the field before sending it to the GPS.
|
|
138
|
+
*/
|
|
64
139
|
name?: string;
|
|
140
|
+
/**
|
|
141
|
+
* GPS waypoint comment. Sent to GPS as comment.
|
|
142
|
+
*/
|
|
65
143
|
cmt?: string;
|
|
144
|
+
/**
|
|
145
|
+
* A text description of the element. Holds additional information about the element intended for the user, not the GPS.
|
|
146
|
+
*/
|
|
66
147
|
desc?: string;
|
|
148
|
+
/**
|
|
149
|
+
* Source of data. Included to give user some idea of reliability and accuracy of data. "Garmin eTrex", "USGS quad Boston North", e.g.
|
|
150
|
+
*/
|
|
67
151
|
src?: string;
|
|
152
|
+
/**
|
|
153
|
+
* Link to additional information about the waypoint.
|
|
154
|
+
*/
|
|
68
155
|
link?: LinkType[];
|
|
156
|
+
/**
|
|
157
|
+
* Text of GPS symbol name. For interchange with other programs, use the exact spelling of the symbol as displayed on the GPS. If the GPS abbreviates words, spell them out.
|
|
158
|
+
*/
|
|
69
159
|
sym?: string;
|
|
160
|
+
/**
|
|
161
|
+
* Type (classification) of the waypoint.
|
|
162
|
+
*/
|
|
70
163
|
type?: string;
|
|
71
164
|
fix?: FixType;
|
|
165
|
+
/**
|
|
166
|
+
* Number of satellites used to calculate the GPX fix.
|
|
167
|
+
*/
|
|
72
168
|
sat?: number;
|
|
169
|
+
/**
|
|
170
|
+
* Horizontal dilution of precision.
|
|
171
|
+
*/
|
|
73
172
|
hdop?: number;
|
|
173
|
+
/**
|
|
174
|
+
* Vertical dilution of precision.
|
|
175
|
+
*/
|
|
74
176
|
vdop?: number;
|
|
177
|
+
/**
|
|
178
|
+
* Position dilution of precision.
|
|
179
|
+
*/
|
|
75
180
|
pdop?: number;
|
|
181
|
+
/**
|
|
182
|
+
* Number of seconds since last DGPS update.
|
|
183
|
+
*/
|
|
76
184
|
ageofdgpsdata?: number;
|
|
185
|
+
/**
|
|
186
|
+
* ID of DGPS station used in differential correction.
|
|
187
|
+
*/
|
|
77
188
|
dgpsid?: DegreesType;
|
|
189
|
+
/**
|
|
190
|
+
* You can add extend GPX by adding your own elements from another schema here.
|
|
191
|
+
*/
|
|
78
192
|
extensions?: ExtensionsType;
|
|
79
193
|
power?: number;
|
|
80
194
|
heartRate?: number;
|
|
81
195
|
cadence?: number;
|
|
82
196
|
}
|
|
197
|
+
/**
|
|
198
|
+
* A list of route points.
|
|
199
|
+
*/
|
|
83
200
|
type RteptType = WptType;
|
|
84
201
|
export interface RteType {
|
|
202
|
+
/**
|
|
203
|
+
* GPS name of route.
|
|
204
|
+
*/
|
|
85
205
|
name?: string;
|
|
206
|
+
/**
|
|
207
|
+
* GPS comment for route.
|
|
208
|
+
*/
|
|
86
209
|
cmt?: string;
|
|
210
|
+
/**
|
|
211
|
+
* Text description of route for user. Not sent to GPS.
|
|
212
|
+
*/
|
|
87
213
|
desc?: string;
|
|
214
|
+
/**
|
|
215
|
+
* Source of data. Included to give user some idea of reliability and accuracy of data.
|
|
216
|
+
*/
|
|
88
217
|
src?: string;
|
|
218
|
+
/**
|
|
219
|
+
* Links to external information about the route.
|
|
220
|
+
*/
|
|
89
221
|
link?: LinkType[];
|
|
222
|
+
/**
|
|
223
|
+
* GPS route number.
|
|
224
|
+
*/
|
|
90
225
|
number?: number;
|
|
226
|
+
/**
|
|
227
|
+
* Type (classification) of route.
|
|
228
|
+
*/
|
|
91
229
|
type?: string;
|
|
92
230
|
extensions?: ExtensionsType;
|
|
93
231
|
rtept?: RteptType[];
|