charton API / @chart-on/core / index / RestDataSourceOptions
Interface: RestDataSourceOptions
Defined in: packages/core/src/data/adapters.ts:126
Options for the REST data source: how to build a history URL, how to map the JSON response to bars, the known symbols, and the request init and fetch to use.
Properties
fetch?
optionalfetch?: {(input,init?):Promise<Response>; (input,init?):Promise<Response>; }
Defined in: packages/core/src/data/adapters.ts:135
Defaults to the global fetch.
Call Signature
(
input,init?):Promise<Response>
Parameters
input
URL | RequestInfo
init?
RequestInit
Returns
Promise<Response>
Call Signature
(
input,init?):Promise<Response>
Parameters
input
string | URL | Request
init?
RequestInit
Returns
Promise<Response>
init?
optionalinit?:RequestInit
Defined in: packages/core/src/data/adapters.ts:133
symbols?
optionalsymbols?:SymbolInfo[] | ((symbol) =>Promise<SymbolInfo>)
Defined in: packages/core/src/data/adapters.ts:132
Known symbols (enables search), or a resolver; defaults to { symbol, name: symbol }.
Methods
map()
map(
json,request):Bar[] |BarsResult
Defined in: packages/core/src/data/adapters.ts:130
Turn the parsed JSON response into bars. A bare array leaves atStart unknown.
Parameters
json
unknown
request
Returns
Bar[] | BarsResult
url()
url(
symbol,interval,request):string
Defined in: packages/core/src/data/adapters.ts:128
URL for a history request.
Parameters
symbol
interval
request
Returns
string