UNPKG

@tmlmobilidade/types

Version:

This package provides shared Zod validation schemas and their corresponding TypeScript types for use across projects. All types are automatically inferred from the schemas to ensure full type safety and reduce maintenance overhead.

37 lines (36 loc) 1.37 kB
/** * Represents a shape in the GTFS format. * A shape is a sequence of points that defines the path of a transit vehicle. * It is used to represent the physical route that a vehicle follows, including * the latitude and longitude of each point, the sequence of the points, and * the distance traveled along the shape. */ export interface GTFS_Shape { shape_dist_traveled: number; shape_id: string; shape_pt_lat: number; shape_pt_lon: number; shape_pt_sequence: number; } /** * Represents a raw shape in the GTFS format. * This interface is used to parse raw data from GTFS files, * where fields may be optional or represented as strings. * It is typically used for data ingestion before validation * and transformation into the `GTFS_Shape` format. */ export interface GTFS_Shape_Raw { shape_dist_traveled?: string; shape_id: string; shape_pt_lat?: string; shape_pt_lon?: string; shape_pt_sequence?: string; } /** * Validates and transforms a raw GTFS Shape into the GTFS_Shape format. * This function checks the types of fields, converts boolean strings to boolean values, * and ensures that required fields are present. * @param rawData The raw Shape data to validate and transform. * @returns A validated GTFS_Shape object. */ export declare function validateGtfsShape(rawData: GTFS_Shape_Raw): GTFS_Shape;