diff --git a/types/d3-fetch/d3-fetch-tests.ts b/types/d3-fetch/d3-fetch-tests.ts index 9c88ed8674..1dfff0e04f 100644 --- a/types/d3-fetch/d3-fetch-tests.ts +++ b/types/d3-fetch/d3-fetch-tests.ts @@ -1,4 +1,5 @@ import * as d3Fetch from 'd3-fetch'; +import { DSVParsedArray, DSVRowString, DSVRowAny } from 'd3-dsv'; interface MyType { foo: string; @@ -13,10 +14,26 @@ promise = d3Fetch.blob(url); promise = d3Fetch.blob(url, init); promise = d3Fetch.buffer(url); promise = d3Fetch.buffer(url, init); - promise = d3Fetch.image(url); promise = d3Fetch.image(url, init); promise = d3Fetch.json(url); promise = d3Fetch.json(url, init); -let myString: Promise = d3Fetch.text(url); + +let myString: Promise; +myString = d3Fetch.text(url); myString = d3Fetch.text(url, init); + +const parseRow = (d: {}) => { + const myType: MyType = { foo: 'foo' }; + return myType; +}; +let promise2: Promise>; +promise2 = d3Fetch.csv(url); +promise2 = d3Fetch.csv(url, init); +promise2 = d3Fetch.csv(url, init, parseRow); +promise2 = d3Fetch.dsv(';', url); +promise2 = d3Fetch.dsv(';', url, init); +promise2 = d3Fetch.dsv(';', url, init, parseRow); +promise2 = d3Fetch.tsv(url); +promise2 = d3Fetch.tsv(url, init); +promise2 = d3Fetch.tsv(url, init, parseRow);