Merge branch 'master' of github.com:konvajs/konva

This commit is contained in:
Anton Lavrenov 2018-10-12 12:07:48 -05:00
commit 44d6d83b7f
2 changed files with 10 additions and 13 deletions

View File

@ -4,4 +4,4 @@ Please make sure to check current open and closed issues to see if your question
If you have just a question (not a bug or a feature request) it is better to ask it in [Stackoverflow](http://stackoverflow.com/questions/tagged/konvajs). If you have just a question (not a bug or a feature request) it is better to ask it in [Stackoverflow](http://stackoverflow.com/questions/tagged/konvajs).
If you have a bug, please, try to create a reproducible example with jsfiddle (or any similar service). If you have a bug, please, try to create a reproducible example with jsfiddle (or any similar service).
You can use [this JSBIN](http://jsbin.com/xinabi/edit?html,js,output) as a template. You can use [this JSBIN](https://jsbin.com/tekehizuta/1/edit?html,js,output) as a template.

13
konva.d.ts vendored
View File

@ -5,13 +5,15 @@ declare namespace Konva {
var isDragReady: () => boolean; var isDragReady: () => boolean;
var DD: any; var DD: any;
type HandlerFunc<E = Event> = ( export interface KonvaEventObject<E> {
e: {
target: Konva.Shape; target: Konva.Shape;
evt: E; evt: E;
currentTarget: Konva.Node; currentTarget: Konva.Node;
cancelBubble: boolean; cancelBubble: boolean;
} }
type HandlerFunc<E = Event> = (
e: KonvaEventObject<E>
) => void; ) => void;
enum KonvaNodeEvent { enum KonvaNodeEvent {
@ -364,12 +366,7 @@ declare namespace Konva {
on<K extends keyof KonvaNodeEventMap>( on<K extends keyof KonvaNodeEventMap>(
evtStr: K, evtStr: K,
handler: ( handler: (
e: { e: KonvaEventObject<KonvaNodeEventMap[K]>
target: Konva.Shape;
evt: KonvaNodeEventMap[K];
currentTarget: Konva.Node;
cancelBubble: boolean;
}
) => void ) => void
): this; ): this;
on(evtStr: KonvaEventString, handler: HandlerFunc): this; on(evtStr: KonvaEventString, handler: HandlerFunc): this;