From 3082462daa3135fe6cf6e7de47d794aaeaab55f4 Mon Sep 17 00:00:00 2001 From: vcoppe Date: Tue, 16 Apr 2024 13:59:00 +0200 Subject: [PATCH] remove duplicate type definitions --- gpx/src/gpx.ts | 83 +----------------------------------------------- gpx/src/index.ts | 2 +- 2 files changed, 2 insertions(+), 83 deletions(-) diff --git a/gpx/src/gpx.ts b/gpx/src/gpx.ts index 630e0f54..0f33e59f 100644 --- a/gpx/src/gpx.ts +++ b/gpx/src/gpx.ts @@ -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; @@ -65,85 +65,4 @@ export class TrackSegment { reverse(): void { 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; }; \ No newline at end of file diff --git a/gpx/src/index.ts b/gpx/src/index.ts index 2035fd3e..6fccb04e 100644 --- a/gpx/src/index.ts +++ b/gpx/src/index.ts @@ -1,4 +1,4 @@ export * from './gpx'; -export { parseGPX } from './io'; +export { parseGPX, buildGPX } from './io';