UNPKG

trackswap

Version:

A powerful and flexible GPX parser and encoder library for Node.js and TypeScript. TrackSwap provides comprehensive support for GPX 1.1 format with advanced features like plugin system, middleware support, and optimized performance.

17 lines (16 loc) 1.02 kB
import { IPlugin, IConverterPlugin, IMiddlewarePlugin, BaseConverter, BaseMiddleware } from "../core/base.js"; import { DecoderContext, GPX11Type } from "./types.js"; export interface IGPXPlugin extends IPlugin<DecoderContext> { } export interface IGPXConverterPlugin extends IConverterPlugin<DecoderContext> { } export interface IGPXMiddlewarePlugin extends IMiddlewarePlugin<DecoderContext, GPX11Type> { } export declare abstract class BaseGPXConverter extends BaseConverter<DecoderContext> implements IGPXConverterPlugin { protected parseCoordinate(value: string | number | undefined): number | undefined; protected parseGPXTime(value: string | undefined): Date | undefined; protected extractNumericAttributes<U extends Record<string, any>>(ast: any, target: U, mapping: Record<string, keyof U>): void; } export declare abstract class BaseGPXMiddleware extends BaseMiddleware<DecoderContext, GPX11Type> implements IGPXMiddlewarePlugin { onError(error: Error, context: DecoderContext): Promise<void>; }