]> source.dussan.org Git - svg.js.git/commitdiff
Typescript definition file: add null as possible parameter for event binding methods...
authorMaxime AILLOUD <maxime.ailloud@gmail.com>
Fri, 24 May 2019 10:33:03 +0000 (11:33 +0100)
committerMaxime AILLOUD <maxime.ailloud@gmail.com>
Fri, 24 May 2019 10:33:03 +0000 (11:33 +0100)
svg.js.d.ts

index f35ce5682a73f2265f45972a6968dba2b1cce099..93e644d560839177e309762b4d2e210e7b25cd06 100644 (file)
@@ -1183,7 +1183,7 @@ declare module "@svgdotjs/svg.js" {
         before(element: Element): Element;\r
         center(x: number, y: number): this;\r
         classes(): string[];\r
-        click(cb: Function): this;\r
+        click(cb: Function | null): this;\r
         clipper(): ClipPath;\r
         clipWith(element: Element): this;\r
         clone(): this;\r
@@ -1195,7 +1195,7 @@ declare module "@svgdotjs/svg.js" {
         data(name: string, value: any, sustain?: boolean): this;\r
         data(name: string): any;\r
         data(val: Object): this;\r
-        dblclick(cb: Function): this;\r
+        dblclick(cb: Function | null): this;\r
         defs(): Defs;\r
         dmove(x: NumberAlias, y: NumberAlias): this;\r
         dx(x: NumberAlias): this;\r
@@ -1237,11 +1237,11 @@ declare module "@svgdotjs/svg.js" {
         matrix(mat: MatrixAlias, b?: number, c?: number, d?: number, e?: number, f?: number): this;\r
         matrixify(): Matrix;\r
         memory(): Object;\r
-        mousedown(cb: Function): this;\r
-        mousemove(cb: Function): this;\r
-        mouseout(cb: Function): this;\r
-        mouseover(cb: Function): this;\r
-        mouseup(cb: Function): this;\r
+        mousedown(cb: Function | null): this;\r
+        mousemove(cb: Function | null): this;\r
+        mouseout(cb: Function | null): this;\r
+        mouseover(cb: Function | null): this;\r
+        mouseup(cb: Function | null): this;\r
         move(x: NumberAlias, y: NumberAlias): this;\r
         native(): LinkedHTMLElement;\r
         next(): Element;\r
@@ -1301,11 +1301,11 @@ declare module "@svgdotjs/svg.js" {
         toggleClass(name: string): this;\r
         toParent(parent: Dom): this;\r
         toSvg(): this;\r
-        touchcancel(cb: Function): this;\r
-        touchend(cb: Function): this;\r
-        touchleave(cb: Function): this;\r
-        touchmove(cb: Function): this;\r
-        touchstart(cb: Function): this;\r
+        touchcancel(cb: Function | null): this;\r
+        touchend(cb: Function | null): this;\r
+        touchleave(cb: Function | null): this;\r
+        touchmove(cb: Function | null): this;\r
+        touchstart(cb: Function | null): this;\r
         transform(): MatrixExtract;\r
         transform(t: MatrixAlias, relative?: boolean): this;\r
         translate(x: number, y: number): this;\r
@@ -1332,7 +1332,7 @@ declare module "@svgdotjs/svg.js" {
     class Circle extends Shape implements CircleMethods {\r
         constructor(node?: SVGCircleElement);\r
         constructor(attr: CircleAttr)\r
-        \r
+\r
         node: SVGCircleElement;\r
 \r
         rx(rx: number): this;\r
@@ -1458,7 +1458,7 @@ declare module "@svgdotjs/svg.js" {
     class Path extends Shape {\r
         constructor(attr: PathAttr)\r
         constructor(node?: SVGPathElement);\r
-        \r
+\r
         node: SVGPathElement;\r
 \r
         morphArray: PathArray;\r
@@ -1659,4 +1659,4 @@ declare module "@svgdotjs/svg.js" {
         morph(x: number, y: number, width: number, height: number): ViewBox;\r
         at(pos: number): ViewBox;\r
     }\r
-}
\ No newline at end of file
+}\r