Typed d3
The type definition for d3.
License
MIT
The type definition for https://github.com/mbostock/d3
License: MIT License
The type definition for d3.
MIT
At the time of writing, the diff between the type definition in this repo and that on DefinitelyTyped is:
--- DefinitelyTyped/d3/d3.d.ts 2015-12-02 10:18:19.698205131 +0000
+++ typings/typed-d3/index.d.ts 2015-12-02 10:02:38.989999203 +0000
@@ -2697,24 +2697,24 @@
response(): (request: XMLHttpRequest) => any;
response(value: (request: XMLHttpRequest) => any): DsvXhr<T>;
- get(callback?: (err: XMLHttpRequest, data: T[]) => void): DsvXhr<T>;
- post(data?: any, callback?: (err: XMLHttpRequest, data: T[]) => void): DsvXhr<T>;
- post(callback: (err: XMLHttpRequest, data: T[]) => void): DsvXhr<T>;
+ get(callback?: (err: any, data: T) => void): DsvXhr<T>;
+ post(data?: any, callback?: (err: any, data: T) => void): DsvXhr<T>;
+ post(callback: (err: any, data: T) => void): DsvXhr<T>;
- send(method: string, data?: any, callback?: (err: XMLHttpRequest, data: T[]) => void): DsvXhr<T>;
- send(method: string, callback: (err: XMLHttpRequest, data: T[]) => void): DsvXhr<T>;
+ send(method: string, data?: any, callback?: (err: any, data: T) => void): DsvXhr<T>;
+ send(method: string, callback: (err: any, data: T) => void): DsvXhr<T>;
abort(): DsvXhr<T>;
on(type: "beforesend"): (request: XMLHttpRequest) => void;
on(type: "progress"): (request: XMLHttpRequest) => void;
- on(type: "load"): (response: T[]) => void;
+ on(type: "load"): (response: T) => void;
on(type: "error"): (err: any) => void;
on(type: string): (...args: any[]) => void;
on(type: "beforesend", listener: (request: XMLHttpRequest) => void): DsvXhr<T>;
on(type: "progress", listener: (request: XMLHttpRequest) => void): DsvXhr<T>;
- on(type: "load", listener: (response: T[]) => void): DsvXhr<T>;
+ on(type: "load", listener: (response: T) => void): DsvXhr<T>;
on(type: "error", listener: (err: any) => void): DsvXhr<T>;
on(type: string, listener: (...args: any[]) => void): DsvXhr<T>;
}
@@ -3313,6 +3313,4 @@
// we need this to exist
interface TouchList { }
-declare module 'd3' {
export = d3;
-}
This highlights the fact that this repo's copy has fallen behind in a couple of places.... and because there are two places to update, that is always a possibility.
But ignoring that for one second, the two are largely identical (and intended as such) with the exception of:
-declare module 'd3' {
export = d3;
-}
Why not split the DefinitelyTyped definition and drop the copy in this repo, thereby creating a single place for modifying what is essentially a shared definition?
I've pushed up an example of what I mean: https://github.com/myitcv/DefinitelyTyped/tree/d3_split_example/d3
The typings registry would then reference the d3-typings.d.ts
file (which would transitively pull in d3-common.d.ts
).
Thoughts?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.