made type of dragBoundFunc more specific

This commit is contained in:
Thomas Röggla
2017-09-28 12:09:19 +01:00
parent 3027495076
commit eab70a0c39

11
konva.d.ts vendored
View File

@@ -6,6 +6,11 @@ declare module Konva {
var isDragReady: () => boolean;
var DD: any;
interface Coordinates {
x: number;
y: number;
}
export class Util {
static getRandomColor(): string;
static getRGB(color: string): string;
@@ -85,7 +90,7 @@ declare module Konva {
offsetY?: number;
draggable?: boolean;
dragDistance?: number;
dragBoundFunc?: Function;
dragBoundFunc?: (pos: Coordinates) => Coordinates;
}
interface SizeConfig {
@@ -124,8 +129,8 @@ declare module Konva {
clone(attrs?: NodeConfig): Node;
destroy(): void;
dragBoundFunc(): Function;
dragBoundFunc(dragBoundFunc: Function): Node;
dragBoundFunc(): (pos: Coordinates) => Coordinates;
dragBoundFunc(dragBoundFunc: (pos: Coordinates) => Coordinates): Node;
draggable(): boolean;
draggable(draggable: boolean): Node;
draw(): Node;