s2-tools
Version:
A collection of geospatial tools primarily designed for WGS84, Web Mercator, and S2.
89 lines • 2.32 kB
TypeScript
/**
* NOTE:
* The files associated with GTFS-Fares V1 are:
* - fare_attributes.txt
* - fare_rules.txt
*
* The files associated with GTFS-Fares V2 are:
* - fare_media.txt
* - fare_products.txt
* - fare_leg_rules.txt
* - fare_transfer_rules.txt
*/
/**
*
* Indicates when the fare must be paid:
* - 0 = On board
* - 1 = Before boarding
*/
export declare enum GTFSPaymentMethod {
OnBoard = 0,
PreBoard = 1
}
/**
* Transfers can be:
* - 0 = No transfers permitted
* - 1 = One transfer
* - 2 = Two transfers
* - '' (empty string) = Unlimited transfers
*/
export type GTFSTransfersType = 0 | 1 | 2 | '';
/**
* # Fare Attributes (GTFS-Fares V1)
*
* **Optional** - But required if using GTFS-Fares V1 approach.
* Defines basic fare information such as price, currency, and transfer limits.
*/
export declare class GTFSFareAttribute {
/**
* **Required**
* Identifies a fare class.
*/
id: string;
/**
* **Required**
* Fare price in the currency specified by `currencyType`.
*/
price: number;
/**
* **Required**
* Currency code (e.g., "USD", "EUR").
*/
currencyType: string;
/**
* **Required**
* When the fare must be paid.
* - 0 = Paid on board
* - 1 = Must be paid before boarding
*/
paymentMethod: GTFSPaymentMethod;
/**
* **Required**
* Number of transfers permitted on this fare.
* - 0 = No transfers
* - 1 = One transfer
* - 2 = Two transfers
* - '' (empty) = Unlimited transfers
*/
transfers: GTFSTransfersType;
/**
* **Conditionally Required**
* Agency for the specified fare.
* Required if multiple agencies exist in `agency.txt`.
*/
agencyId?: string;
/**
* **Optional**
* Length of time in seconds before a transfer (or this fare) expires.
* When transfers=0, may indicate ticket validity duration or be empty.
*/
transferDuration?: number;
/** @param data - the parsed GTFS CSV data */
constructor(data: Record<string, string>);
}
/**
* @param input - the input string to parse from
* @returns - an array of GTFSFareAttributes
*/
export declare function parseGTFSFareAttributes(input: string): Record<string, GTFSFareAttribute>;
//# sourceMappingURL=fareAttributes.d.ts.map