Files
DefinitelyTyped/types/d3-dispatch/index.d.ts
2017-03-24 14:27:52 -07:00

17 lines
788 B
TypeScript

// Type definitions for D3JS d3-dispatch module v1.0.1
// Project: https://github.com/d3/d3-dispatch/
// Definitions by: Tom Wanzek <https://github.com/tomwanzek>, Alex Ford <https://github.com/gustavderdrache>, Boris Yankov <https://github.com/borisyankov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export interface Dispatch<T extends EventTarget> {
apply(type: string, that?: T, args?: any[]): void;
call(type: string, that?: T, ...args: any[]): void;
copy(): Dispatch<T>;
on(typenames: string): (this: T, ...args: any[]) => void;
on(typenames: string, callback: null): this;
on(typenames: string, callback: (this: T, ...args: any[]) => void): this;
}
export function dispatch<T extends EventTarget>(...types: string[]): Dispatch<T>;