From 453fa5e9a285bc53ece30e55936b64420a9cc837 Mon Sep 17 00:00:00 2001 From: Dom Parfitt Date: Mon, 15 Oct 2018 10:31:36 +0100 Subject: [PATCH] Updated to use generics matching other d3 libraries --- types/d3-graphviz/index.d.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/types/d3-graphviz/index.d.ts b/types/d3-graphviz/index.d.ts index 2774dab42a..356f36c10d 100644 --- a/types/d3-graphviz/index.d.ts +++ b/types/d3-graphviz/index.d.ts @@ -12,7 +12,7 @@ declare module 'd3-graphviz' { module 'd3-selection' { interface Selection { - graphviz(options?: GraphvizOptions | boolean): Graphviz; + graphviz(options?: GraphvizOptions | boolean): Graphviz; selectWithoutDataPropagation(): Selection; } } @@ -22,13 +22,13 @@ declare module 'd3-graphviz' { * @param selector * @param options */ - export function graphviz(selector: string, options?: GraphvizOptions | boolean): Graphviz; + export function graphviz(selector: string | GElement, options?: GraphvizOptions | boolean): Graphviz; /** * Interface representing the Graphviz Renderer. Methods generally return the instance of the * object they were called on (i.e this) in order to allow for easy method chaining. */ - export interface Graphviz { + export interface Graphviz { //Options /** * Gets the currently set options object on the renderer @@ -59,8 +59,8 @@ declare module 'd3-graphviz' { addImage(path: string, width: number | string, height: number | string): this; //Creating Transitions - transition(name?: Function | string | Transition): this; - active(name?: string): Transition | null; + transition(name?: Function | string | Transition): this; + active(name?: string): Transition | null; //Controlling SVG and Graph Size width(width: number | string): this; @@ -88,11 +88,11 @@ declare module 'd3-graphviz' { //Controlling Panning & Zooming zoom(enable: boolean): this; - zoomBehavior(): ZoomBehavior | null; + zoomBehavior(): ZoomBehavior | null; zoomSelection(): Element | null; zoomScaleExtent(extent?: number[]): this; zoomTranslateExtent(extent?: number[][]): this; - resetZoom(transition?: string | Transition): this; + resetZoom(transition?: string | Transition): this; //Maintaining Object Constancy keyMode(keyMode: KeyMode): this; //keyMode should be an enum @@ -110,14 +110,14 @@ declare module 'd3-graphviz' { moveDrawnEdgeEndPoint(x2: number, y2: number, options?: EdgeOptions): this; insertDrawnEdge(name: string): this; removeDrawnEdge(): this; - drawnEdgeSelection(): Selection; + drawnEdgeSelection(): Selection; //Nodes drawNode(x: number, y: number, nodeId: string, attributes?: DotAttributes, options?: NodeOptions): this; updateDrawnNode(x: number, y: number, nodeId: string, attributes?: DotAttributes, options?: NodeOptions): this; moveDrawnNode(x: number, y: number, options?: NodeOptions): this; inserDrawnNode(nodeId: string): this; removeDrawnNode(): this; - drawnNodeSelection(): Selection; + drawnNodeSelection(): Selection; //Large Graphs totalMemory(size: number): this;