Skip to content
This repository has been archived by the owner on Jan 27, 2021. It is now read-only.

Latest commit

 

History

History
397 lines (267 loc) · 17.7 KB

api.md

File metadata and controls

397 lines (267 loc) · 17.7 KB

Modules

TfLUnified/api

The TfLUnified/api module acts as an abstracton layer for accessing the various TfL APIs

Typedefs

ColorObj : Object

an object containing various colour codes

MetaMode : Object

a response object for detailing TfL transport Meta Modes

MetaSeverity : Object

a response object for detailing TfL severity codes

DateRanges : Object

an object containing a start and end date for date range serches

TfLUnified/api

The TfLUnified/api module acts as an abstracton layer for accessing the various TfL APIs

See: https://api.tfl.gov.uk/


TfLUnified/api.Color ⇐ TfLUnified

Kind: static class of TfLUnified/api
Extends: TfLUnified
See: http://content.tfl.gov.uk/tfl-colour-standards-issue04.pdf


Color~getLineColor(lineId) ⇒ ColorObj

gets the color of a line from its associated ID

Kind: inner method of Color
Returns: ColorObj - an object containing various colour codes in different formats
See: http://content.tfl.gov.uk/tfl-colour-standards-issue04.pdf

Param Type Description
lineId LineId | String a stirng containing the line id e.g. bakerloo, circle, ect

Color~getLineCMYKColor(lineId) ⇒ Objct

gets the cmyk color of a line from its associated ID

Kind: inner method of Color
Returns: Objct - an object containing the cmyk colour values for this line
See: http://content.tfl.gov.uk/tfl-colour-standards-issue04.pdf

Param Type Description
lineId LineId | String a stirng containing the line id e.g. bakerloo, circle, ect

Color~getLineRGBColor(lineId) ⇒ Object

gets the rgb color of a line from its associated ID

Kind: inner method of Color
Returns: Object - a rgb colour code for this line
See: http://content.tfl.gov.uk/tfl-colour-standards-issue04.pdf

Param Type Description
lineId LineId | String a stirng containing the line id e.g. bakerloo, circle, ect

Color~getLineHexColor(lineId) ⇒ String

gets the hex color of a line from its associated ID

Kind: inner method of Color
Returns: String - a hex colour code for this line
See: http://content.tfl.gov.uk/tfl-colour-standards-issue04.pdf

Param Type Description
lineId LineId | String a stirng containing the line id e.g. bakerloo, circle, ect

TfLUnified/api.Line ⇐ TfLUnified

Kind: static class of TfLUnified/api
Extends: TfLUnified
See: https://api.tfl.gov.uk


Line~listValidModes() ⇒ Array.<MetaMode>

Lists all of the valid line transportation modes [GET]

Kind: inner method of Line
Returns: Array.<MetaMode> - an array of objects contianing the transportation modes
See: https://api.tfl.gov.uk/swagger/ui/index.html?url=/swagger/docs/v1#!/Line/Line_MetaModes


Line~listSeverityCodes() ⇒ Array.<MetaSeverity>

Lists all of the valid line severity codes [GET]

Kind: inner method of Line
Returns: Array.<MetaSeverity> - an array of objects contianing the severity code
See: https://api.tfl.gov.uk/swagger/ui/index.html?url=/swagger/docs/v1#!/Line/Line_MetaSeverity


Line~listDisruptionCategories() ⇒ Array.<String>

Lists all of the valid line disruption categories [GET]

Kind: inner method of Line
Returns: Array.<String> - an array of strings contianing the disruption categories
See: https://api.tfl.gov.uk/swagger/ui/index.html?url=/swagger/docs/v1#!/Line/Line_MetaDisruptionCategories


Line~listServiceTypes() ⇒ Array.<String>

Lists all of the valid line service types [GET]

Kind: inner method of Line
Returns: Array.<String> - an array of strings contianing the service types
See: https://api.tfl.gov.uk/swagger/ui/index.html?url=/swagger/docs/v1#!/Line/Line_MetaServiceTypes


Line~getRoutesById(ids, [options]) ⇒ Array.<Object>

Gets information about the Routes supplied by ids [GET]

Kind: inner method of Line
Returns: Array.<Object> - an array of specified line information
See

Param Type Description
ids Array.<String> | String An array of line ids e.g. circle, northern, ect
[options] Object optional parameters to be added to the request
[options.serviceTypes] Array.<String> | String An array or string of line service types e.g. regular, night, ect
[options.direction] String a direction in which to sequence the stations can be either: inbound, outbound, all
[options.excludeCrowd] Boolean should crowd line disruptions be exlcuded from the request

Line~getRoutesByMode(modes, [options]) ⇒ Array.<Object>

Gets information about the Routes supplied by modes [GET]

Kind: inner method of Line
Returns: Array.<Object> - an array of specified line information
See

Param Type Description
modes Array.<String> | String An array of line modes e.g. tube, bus, ect
[options] Object optional parameters to be added to the request
[options.serviceTypes] Array.<String> | String An array or string of line service types e.g. regular, night, ect

Line~getRoutesByServiceType(types, [options]) ⇒ Array.<Object>

Gets information about the Routes supplied by modes [GET]

Kind: inner method of Line
Returns: Array.<Object> - an array of specified line information
See

Param Type Description
types Array.<String> | String An array of line service types e.g. regular, night, ect
[options] Object optional parameters to be added to the request

Line~getLineStatusById(ids, [options]) ⇒ Array.<Object>

Gets line status information using a lines id [GET]

Kind: inner method of Line
Returns: Array.<Object> - an array of specified line information
See: https://api.tfl.gov.uk/swagger/ui/index.html?url=/swagger/docs/v1#!/Line/Line_Status

Param Type Description
ids Array.<String> | String An array or a single string of line ids e.g. circle, northern, ect
[options] Object optional parameters to be added to the request
[options.detail] Boolean include details of any disruptions
[options.dateRange] DateRanges an object containing date ranges for getting line status for

Line~getLineStatusByMode(modes, [options]) ⇒ Array.<Object>

Gets line status information using a lines mode [GET]

Kind: inner method of Line
Returns: Array.<Object> - an array of specified line information
See

Param Type Description
modes Array.<String> | String An array or a single string of line modes e.g. tube, bus, ect
[options] Object optional parameters to be added to the request

TfLUnified/api.TfLUnified

Kind: static class of TfLUnified/api


new TfLUnified(options)

Param Type
options Object

ColorObj : Object

an object containing various colour codes

Kind: global typedef
Properties

Name Type Description
cmyk Object a cymk colour value
cmyk.c Number the cyan numerical amount
cmyk.m Number the majenta numerical amount
cmyk.y Number the yellow numerical amount
cmyk.k Number the key numerical amount
rgb RGB the rgb colour code as an { r: ) object
hex String the hex colour code

MetaMode : Object

a response object for detailing TfL transport Meta Modes

Kind: global typedef
Properties

Name Type
isTflService Boolean
isFarePaying Boolean
isScheduledService Boolean
modeName String

MetaSeverity : Object

a response object for detailing TfL severity codes

Kind: global typedef
Properties

Name Type
modeName String
severityLevel Number
description String

DateRanges : Object

an object containing a start and end date for date range serches

Kind: global typedef
Properties

Name Type Description
startDate Moment | Date | String a moment, native js date or ISO 8601 TZ time string
endDate Moment | Date | String a moment, native js date or ISO 8601 TZ time string