remove duplicate type definitions

This commit is contained in:
vcoppe
2024-04-16 13:59:00 +02:00
parent c1d27b1488
commit 3082462daa
2 changed files with 2 additions and 83 deletions

View File

@@ -1,4 +1,4 @@
import { GPXFileType, TrackSegmentType, TrackType } from "./types";
import { GPXFileAttributes, GPXFileType, Link, Metadata, TrackExtensions, TrackPoint, TrackSegmentType, TrackType, Waypoint } from "./types";
export class GPXFile {
attributes: GPXFileAttributes;
@@ -66,84 +66,3 @@ export class TrackSegment {
this.trkpt.reverse();
}
};
export type GPXFileAttributes = {
creator: string;
[key: string]: string;
};
export type Metadata = {
name?: string;
desc?: string;
author?: Author;
link?: Link;
time?: Date;
};
export type Link = {
attributes: LinkAttributes;
text?: string;
type?: string;
};
export type LinkAttributes = {
href: string;
};
export type Waypoint = {
attributes: Coordinates;
ele?: number;
time?: Date;
name?: string;
cmt?: string;
desc?: string;
link?: Link;
sym?: string;
type?: string;
};
export type Coordinates = {
lat: number;
lon: number;
};
export type TrackExtensions = {
'gpx_style:line'?: LineStyleExtension;
};
export type LineStyleExtension = {
color?: string;
opacity?: number;
weight?: number;
};
export type TrackPoint = {
attributes: Coordinates;
ele?: number;
time?: Date;
extensions?: TrackPointExtensions;
};
export type TrackPointExtensions = {
'gpxtpx:TrackPointExtension'?: TrackPointExtension;
'gpxpx:PowerExtension'?: PowerExtension;
};
export type TrackPointExtension = {
'gpxtpx:hr'?: number;
'gpxtpx:cad'?: number;
'gpxtpx:atemp'?: number;
'gpxtpx:Extensions'?: {
surface?: string;
};
}
export type PowerExtension = {
'gpxpx:PowerInWatts'?: number;
}
export type Author = {
name?: string;
email?: string;
link?: Link;
};

View File

@@ -1,4 +1,4 @@
export * from './gpx';
export { parseGPX } from './io';
export { parseGPX, buildGPX } from './io';