api-railway
Version:
Api wrapper for api.railwayapi.site
32 lines (31 loc) • 1.45 kB
TypeScript
import { Client } from "./index.js";
import type { StationCode, StationGeneralInfo, StationInfo } from "./types.js";
export default class Stations {
private readonly baseUrl;
private readonly headers;
constructor(client: Client);
getStationParts(stationCode: StationCode): {
url: string;
headers?: Record<string, string>;
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
params: Record<string, string>;
body: BodyInit | null;
};
getStation(stationCode: StationCode): Promise<[Error] | [undefined, import("./types.js").ApiError | StationInfo]>;
getStationsLikeCodeParts(stationCode: StationCode, limit?: number): {
url: string;
headers?: Record<string, string>;
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
params: Record<string, string>;
body: BodyInit | null;
};
getStationsLikeCode(stationCode: StationCode, limit?: number): Promise<[Error] | [undefined, import("./types.js").ApiError | StationGeneralInfo[]]>;
getStationsLikeQueryParts(q: string, limit?: number): {
url: string;
headers?: Record<string, string>;
method?: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
params: Record<string, string>;
body: BodyInit | null;
};
getStationsLikeQuery(q: string, limit?: number): Promise<[Error] | [undefined, import("./types.js").ApiError | StationGeneralInfo[]]>;
}