Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
lavrton committed Jul 18, 2018
2 parents a2c5920 + 04c921c commit 28df587
Showing 1 changed file with 45 additions and 2 deletions.
47 changes: 45 additions & 2 deletions konva.d.ts
Expand Up @@ -9,6 +9,49 @@ declare namespace Konva {
e: { target: Konva.Shape; evt: Event; currentTarget: Konva.Node; cancelBubble: boolean }
) => void;

enum KonvaNodeEvent {
mouseover = 'mouseover',
mouseout = 'mouseout',
mousemove = 'mousemove',
mouseleave = 'mouseleave',
mouseenter = 'mouseenter',
mousedown = 'mousedown',
mouseup = 'mouseup',
wheel = 'wheel',
contextmenu = 'contextmenu',
click = 'click',
dblclick = 'dblclick',
touchstart = 'touchstart',
touchmove = 'touchmove',
touchend = 'touchend',
tap = 'tap',
dbltap = 'dbltap',
dragstart = 'dragstart',
dragmove = 'dragmove',
dragend = 'dragend',
}

enum KonvaStageEvent {
contentMouseover = 'contentMouseover',
contentMousemove = 'contentMousemove',
contentMouseout = 'contentMouseout',
contentMousedown = 'contentMousedown',
contentMouseup = 'contentMouseup',
contentWheel = 'contentWheel',
contentContextmenu = 'contentContextmenu',
contentClick = 'contentClick',
contentDblclick = 'contentDblclick',
contentTouchstart = 'contentTouchstart',
contentTouchmove = 'contentTouchmove',
contentTouchend = 'contentTouchend',
contentTap = 'contentTap',
contentDblTap = 'contentDblTap',
}

type KonvaEvent = KonvaNodeEvent & KonvaStageEvent;

type KonvaEventString = KonvaEvent | string;

type globalCompositeOperationType =
| ''
| 'source-over'
Expand Down Expand Up @@ -303,15 +346,15 @@ declare namespace Konva {
name(name: string): this;
noise(): number;
noise(noise: number): this;
off(evtStr: string): this;
off(evtStr: KonvaEventString): this;
offset(): Vector2d;
offset(offset: Vector2d): this;
offsetX(): number;
offsetX(offsetX: number): this;
offsetY(): number;
offsetY(offsetY: number): this;
on<K extends keyof KonvaNodeEventMap>(evtStr: K, handler: (e: { target: Konva.Shape; evt: KonvaNodeEventMap[K]; currentTarget: Konva.Node; cancelBubble: boolean }) => void): this;
on(evtStr: string, handler: HandlerFunc): this;
on(evtStr: KonvaEventString, handler: HandlerFunc): this;
opacity(): number;
opacity(opacity: number): this;
pixelSize(): number;
Expand Down

0 comments on commit 28df587

Please sign in to comment.