typing for Arbitrary Delimiters

https://github.com/mbostock/d3/wiki/CSV#arbitrary-delimiters
This commit is contained in:
hansrwindhoff
2015-04-20 11:32:59 -06:00
parent 1957eb54fb
commit 08ae0b1793

17
d3/d3.d.ts vendored
View File

@@ -371,6 +371,12 @@ declare module D3 {
* Request a comma-separated values (CSV) file.
*/
csv: Dsv;
/**
* Request an arbitrary char-separated values file parser, like semicolon or what ever
*/
dsv: Dsv;
/**
* Request a tab-separated values (TSV) file
*/
@@ -708,6 +714,17 @@ declare module D3 {
*/
(url: string, callback?: (error: any, response: any[]) => void ): Xhr;
/**
* Arbitrary Delimiters:
* Constructs a new parser for the given delimiter and mime type. For example, to parse values separated by "|", the vertical bar character, use:
* var dsv = d3.dsv("|", "text/plain");
*
* returns the new parser
*
* @param separator seperator character
* @param contentType
*/
(separator: string, contentType:string): (url: string, callback?: (error: any, response: any[]) => void )=> Xhr;
/**
* Parse a delimited string into objects using the header row.
*
* @param string delimited formatted string to parse