diff --git a/types/d3/index.d.ts b/types/d3/index.d.ts index de522828ff..8b44deac1a 100644 --- a/types/d3/index.d.ts +++ b/types/d3/index.d.ts @@ -1,9 +1,14 @@ -// Type definitions for D3JS d3 standard bundle 4.12 +// Type definitions for D3JS d3 standard bundle 5.0 // Project: https://github.com/d3/d3 // Definitions by: Tom Wanzek , Alex Ford , Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 +// Last module patch version validated against: 5.0.0 RC3 + +// NOTE TO MAINTAINERS: Review D3 v4.x module dependencies (see v4 sub-folder) and update its path-mappings in tsconfig (v4 folder), +// if new MAJOR version of D3 v4 modules are released!!! + export as namespace d3; export const version: string; @@ -13,10 +18,12 @@ export * from 'd3-brush'; export * from 'd3-chord'; export * from 'd3-collection'; export * from 'd3-color'; +export * from 'd3-contour'; export * from 'd3-dispatch'; export * from 'd3-drag'; export * from 'd3-dsv'; export * from 'd3-ease'; +export * from 'd3-fetch'; export * from 'd3-force'; export * from 'd3-format'; export * from 'd3-geo'; @@ -25,10 +32,9 @@ export * from 'd3-interpolate'; export * from 'd3-path'; export * from 'd3-polygon'; export * from 'd3-quadtree'; -export * from 'd3-queue'; export * from 'd3-random'; -export * from 'd3-request'; export * from 'd3-scale'; +export * from 'd3-scale-chromatic'; export * from 'd3-selection'; export * from 'd3-shape'; export * from 'd3-time'; diff --git a/types/d3/v4/d3-tests.ts b/types/d3/v4/d3-tests.ts new file mode 100644 index 0000000000..3942256a76 --- /dev/null +++ b/types/d3/v4/d3-tests.ts @@ -0,0 +1,7 @@ +import * as d3 from 'd3'; + +const version: string = d3.version; + +// NOTE: Tests for all re-exports of consituent D3 modules are omitted as excessive. +// The standard bundle definition is a straightforward pass-through with the exception of the +// above tested "version" property. diff --git a/types/d3/v4/index.d.ts b/types/d3/v4/index.d.ts new file mode 100644 index 0000000000..b4b784884b --- /dev/null +++ b/types/d3/v4/index.d.ts @@ -0,0 +1,41 @@ +// Type definitions for D3JS d3 standard bundle 4.13 +// Project: https://github.com/d3/d3 +// Definitions by: Tom Wanzek , Alex Ford , Boris Yankov +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.3 + +// NOTE TO MAINTAINERS: Review and update path-mappings in tsconfig, if new major version of D3 v4 modules are released!!! + +export as namespace d3; + +export const version: string; +export * from 'd3-array'; +export * from 'd3-axis'; +export * from 'd3-brush'; +export * from 'd3-chord'; +export * from 'd3-collection'; +export * from 'd3-color'; +export * from 'd3-dispatch'; +export * from 'd3-drag'; +export * from 'd3-dsv'; +export * from 'd3-ease'; +export * from 'd3-force'; +export * from 'd3-format'; +export * from 'd3-geo'; +export * from 'd3-hierarchy'; +export * from 'd3-interpolate'; +export * from 'd3-path'; +export * from 'd3-polygon'; +export * from 'd3-quadtree'; +export * from 'd3-queue'; +export * from 'd3-random'; +export * from 'd3-request'; +export * from 'd3-scale'; +export * from 'd3-selection'; +export * from 'd3-shape'; +export * from 'd3-time'; +export * from 'd3-time-format'; +export * from 'd3-timer'; +export * from 'd3-transition'; +export * from 'd3-voronoi'; +export * from 'd3-zoom'; diff --git a/types/d3/v4/tsconfig.json b/types/d3/v4/tsconfig.json new file mode 100644 index 0000000000..f454459222 --- /dev/null +++ b/types/d3/v4/tsconfig.json @@ -0,0 +1,29 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6", + "dom" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "strictFunctionTypes": true, + "baseUrl": "../../", + "typeRoots": [ + "../../" + ], + "paths": { + "d3-scale": ["d3-scale/v1"], + "d3": ["d3/v4"] + }, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true, + "esModuleInterop": true + }, + "files": [ + "index.d.ts", + "d3-tests.ts" + ] +} diff --git a/types/d3/v4/tslint.json b/types/d3/v4/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/d3/v4/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }