DefinitelyTyped/types/ns-api/index.d.ts

44 lines
1.2 KiB
TypeScript

// Type definitions for ns-api 2.0
// Project: https://github.com/fvdm/nodejs-ns-api#readme
// Definitions by: Sander Koenders <https://github.com/Archcry>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = nsApi;
declare function nsApi(conf: nsApi.Configuration): nsApi;
interface nsApi {
/**
* Vertrektijden - departure times
*
* @param station - Station ID
*/
vertrektijden(station: string, callback: (err: string, data: {}) => void): void;
/**
* Reisadvies - travel advise
*/
reisadvies(params: {}, callback: (err: string, data: {}) => void): void;
/** Prijzen - tariffs */
prijzen(params: {}, callback: (err: any, data: {}) => void): void;
/**
* List available stations
*
* @param [treeKey] - Group by this key
*/
stations(treeKey: string, callback: (err: string, data: {}) => void): void;
stations(callback: (err: string, data: {}) => void): void;
/** List disruptions */
storingen(params: {}, callback: (err: string, data: {}) => void): void;
}
declare namespace nsApi {
interface Configuration {
username: string;
password: string;
timeout?: number;
}
}