Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

gtfs-types

k-yle1.1kMIT5.1.0TypeScript support: included

🚂 Typescript definitions for the GTFS Standard

gtfs, types, typescript

readme

gtfs-types

Build Status npm version

This package exposes TypeScript type definitions for the GTFS Standard and the GTFS Realtime Standard.

Usage

Install the package from npm:

npm install -D gtfs-types

Usage:

import { Route } from "gtfs-types";

const myRoute: Route = {
  route_id: "abc123",
  route_short_name: "24",
  route_long_name: "Crofton Downs to Box Hill",
};

If you use typescript 3.8+ you can also use the type-only import syntax:

import type { Route } from "gtfs-types";

For a list of all types, see the src folder.

changelog

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[Unreleased]

5.1.0 (2025-04-03)

  • add NonStringDataTypes as a runtime-level export

5.0.0 (2025-03-13)

  • mark many realtime properties as optional
  • add table-to-schema map and primary key map
  • fix types for realtime service alerts
  • add a type aliases for each kind of ID
  • fix two typos in enum values
  • add many new tables based on the latest version of the spec

4.0.0 (2024-05-18)

  • fix: convert stop_time_update to an array. The previous definition was not correct.

3.0.0 (2023-08-23)

2.3.0 (2023-08-23)

  • feat: add GTFS v3 types

2.2.0 (2021-08-31)

  • feat: add types for Realtime Service Alerts

2.1.0 (2021-08-14)

  • fix: Trip, StopTime, Shapes, Frequencies: Make some fields optional

2.0.0 (2021-07-27)

  • feat: add new properties like continuous_pickup and platform_code
  • 💥 BREAKING CHANGE: mark some properties as optional as per the GTFS spec

1.0.2 (2020-08-27)

  • feat: export vehicle-types
  • chore: add unit tests

1.0.1 (2020-05-13)

  • fix: unknown enum

1.0.0 (2020-05-13)

  • Initial release