@types/d3-fetch
Advanced tools
Comparing version 1.1.4 to 1.1.5
// Type definitions for d3-fetch 1.1 | ||
// Project: https://d3js.org/d3-fetch/ | ||
// Definitions by: Hugues Stefanski <https://github.com/ledragon> | ||
// denisname <https://github.com/denisname> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
@@ -9,3 +10,3 @@ // TypeScript Version: 2.3 | ||
import { DSVParsedArray, DSVRowString } from 'd3-dsv'; | ||
import { DSVParsedArray, DSVRowArray, DSVRowString } from "d3-dsv"; | ||
@@ -37,9 +38,11 @@ /** | ||
* | ||
* The generic parameter describes the column names as a union of string literal types. | ||
* | ||
* @param url A valid URL string. | ||
* @param init An optional request initialization object. | ||
*/ | ||
export function csv( | ||
export function csv<Columns extends string>( | ||
url: string, | ||
init?: RequestInit, | ||
): Promise<DSVParsedArray<DSVRowString>>; | ||
init?: RequestInit | ||
): Promise<DSVRowArray<Columns>>; | ||
/** | ||
@@ -52,3 +55,4 @@ * Fetches the CSV file at the specified input URL and returns | ||
* | ||
* The generic parameter describes the type of the object representation of a parsed row. | ||
* The first generic parameter describes the type of the object representation of a parsed row. | ||
* The second generic parameter describes the column names as a union of string literal types. | ||
* | ||
@@ -61,5 +65,5 @@ * @param url A valid URL string. | ||
*/ | ||
export function csv<ParsedRow extends object>( | ||
export function csv<ParsedRow extends object, Columns extends string = string>( | ||
url: string, | ||
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null | ||
row: (rawRow: DSVRowString<Columns>, index: number, columns: Columns[]) => ParsedRow | undefined | null | ||
): Promise<DSVParsedArray<ParsedRow>>; | ||
@@ -75,3 +79,4 @@ /** | ||
* | ||
* The generic parameter describes the type of the object representation of a parsed row. | ||
* The first generic parameter describes the type of the object representation of a parsed row. | ||
* The second generic parameter describes the column names as a union of string literal types. | ||
* | ||
@@ -85,6 +90,6 @@ * @param url A valid URL string. | ||
*/ | ||
export function csv<ParsedRow extends object>( | ||
export function csv<ParsedRow extends object, Columns extends string = string>( | ||
url: string, | ||
init: RequestInit, | ||
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null | ||
row: (rawRow: DSVRowString<Columns>, index: number, columns: Columns[]) => ParsedRow | undefined | null | ||
): Promise<DSVParsedArray<ParsedRow>>; | ||
@@ -99,2 +104,4 @@ | ||
* | ||
* The generic parameter describes the column names as a union of string literal types. | ||
* | ||
* @param delimiter The delimiter character used in the DSV file to be fetched. | ||
@@ -104,7 +111,7 @@ * @param url A valid URL string. | ||
*/ | ||
export function dsv( | ||
export function dsv<Columns extends string>( | ||
delimiter: string, | ||
url: string, | ||
init?: RequestInit, | ||
): Promise<DSVParsedArray<DSVRowString>>; | ||
init?: RequestInit | ||
): Promise<DSVRowArray<Columns>>; | ||
/** | ||
@@ -117,3 +124,4 @@ * Fetches the DSV file with the specified delimiter character at the specified input URL and returns | ||
* | ||
* The generic parameter describes the type of the object representation of a parsed row. | ||
* The first generic parameter describes the type of the object representation of a parsed row. | ||
* The second generic parameter describes the column names as a union of string literal types. | ||
* | ||
@@ -127,6 +135,6 @@ * @param delimiter The delimiter character used in the DSV file to be fetched. | ||
*/ | ||
export function dsv<ParsedRow extends object>( | ||
export function dsv<ParsedRow extends object, Columns extends string = string>( | ||
delimiter: string, | ||
url: string, | ||
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null | ||
row: (rawRow: DSVRowString<Columns>, index: number, columns: Columns[]) => ParsedRow | undefined | null | ||
): Promise<DSVParsedArray<ParsedRow>>; | ||
@@ -142,3 +150,4 @@ /** | ||
* | ||
* The generic parameter describes the type of the object representation of a parsed row. | ||
* The first generic parameter describes the type of the object representation of a parsed row. | ||
* The second generic parameter describes the column names as a union of string literal types. | ||
* | ||
@@ -153,7 +162,7 @@ * @param delimiter The delimiter character used in the DSV file to be fetched. | ||
*/ | ||
export function dsv<ParsedRow extends object>( | ||
export function dsv<ParsedRow extends object, Columns extends string = string>( | ||
delimiter: string, | ||
url: string, | ||
init: RequestInit, | ||
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null | ||
row: (rawRow: DSVRowString<Columns>, index: number, columns: Columns[]) => ParsedRow | undefined | null | ||
): Promise<DSVParsedArray<ParsedRow>>; | ||
@@ -179,3 +188,3 @@ | ||
*/ | ||
export function image(url: string, init?: {[key: string]: any}): Promise<HTMLImageElement>; | ||
export function image(url: string, init?: Partial<HTMLImageElement>): Promise<HTMLImageElement>; | ||
@@ -220,9 +229,11 @@ /** | ||
* | ||
* The generic parameter describes the column names as a union of string literal types. | ||
* | ||
* @param url A valid URL string. | ||
* @param init An optional request initialization object. | ||
*/ | ||
export function tsv( | ||
export function tsv<Columns extends string>( | ||
url: string, | ||
init?: RequestInit, | ||
): Promise<DSVParsedArray<DSVRowString>>; | ||
init?: RequestInit | ||
): Promise<DSVRowArray<Columns>>; | ||
/** | ||
@@ -236,3 +247,4 @@ * Fetches the TSV file at the specified input URL and returns | ||
* | ||
* The generic parameter describes the type of the object representation of a parsed row. | ||
* The first generic parameter describes the type of the object representation of a parsed row. | ||
* The second generic parameter describes the column names as a union of string literal types. | ||
* | ||
@@ -245,5 +257,5 @@ * @param url A valid URL string. | ||
*/ | ||
export function tsv<ParsedRow extends object>( | ||
export function tsv<ParsedRow extends object, Columns extends string = string>( | ||
url: string, | ||
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null | ||
row: (rawRow: DSVRowString<Columns>, index: number, columns: Columns[]) => ParsedRow | undefined | null | ||
): Promise<DSVParsedArray<ParsedRow>>; | ||
@@ -259,3 +271,4 @@ /** | ||
* | ||
* The generic parameter describes the type of the object representation of a parsed row. | ||
* The first generic parameter describes the type of the object representation of a parsed row. | ||
* The second generic parameter describes the column names as a union of string literal types. | ||
* | ||
@@ -269,6 +282,6 @@ * @param url A valid URL string. | ||
*/ | ||
export function tsv<ParsedRow extends object>( | ||
export function tsv<ParsedRow extends object, Columns extends string = string>( | ||
url: string, | ||
init: RequestInit, | ||
row: (rawRow: DSVRowString, index: number, columns: string[]) => ParsedRow | undefined | null | ||
row: (rawRow: DSVRowString<Columns>, index: number, columns: Columns[]) => ParsedRow | undefined | null | ||
): Promise<DSVParsedArray<ParsedRow>>; | ||
@@ -275,0 +288,0 @@ |
{ | ||
"name": "@types/d3-fetch", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "TypeScript definitions for d3-fetch", | ||
@@ -11,2 +11,7 @@ "license": "MIT", | ||
"githubUsername": "ledragon" | ||
}, | ||
{ | ||
"name": "denisname", | ||
"url": "https://github.com/denisname", | ||
"githubUsername": "denisname" | ||
} | ||
@@ -24,4 +29,4 @@ ], | ||
}, | ||
"typesPublisherContentHash": "c6fca8282d902e3f85669b9ae3229ccadfe7bcb3b8a44c1fb337274934076a5b", | ||
"typesPublisherContentHash": "63760c232deb13f95dec7986f6abade923e7de01d34cb09f7ee4f018883477f9", | ||
"typeScriptVersion": "2.3" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Wed, 19 Dec 2018 18:17:49 GMT | ||
* Last updated: Wed, 02 Jan 2019 22:37:55 GMT | ||
* Dependencies: @types/d3-dsv | ||
@@ -17,2 +17,2 @@ * Global values: none | ||
# Credits | ||
These definitions were written by Hugues Stefanski <https://github.com/ledragon>. | ||
These definitions were written by Hugues Stefanski <https://github.com/ledragon>, denisname <https://github.com/denisname>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16316
266