Add generic variable to Collection

This commit is contained in:
Igor Babkin
2018-08-22 13:32:38 +03:00
parent 87820449ad
commit 698fe0f49b

11
konva.d.ts vendored
View File

@@ -1031,12 +1031,13 @@ declare namespace Konva {
fontStyle(fontStyle: string): this; fontStyle(fontStyle: string): this;
} }
class Collection { class Collection<T extends Node = Node> {
[i: number]: any; [i: number]: T;
static toCollection(arr: any[]): Collection; each(f: (el: T) => void): void;
each(f: (el: Node) => void): void; toArray(): T[];
toArray(): any[];
length: number; length: number;
static toCollection<T extends Node = Node>(arr: T[]): Collection<T>;
} }
class Transform { class Transform {