mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
44 lines
1.2 KiB
TypeScript
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;
|
|
}
|
|
}
|