mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
Merge pull request #439 from IgorBabkin/collection-typings
Add generic variable to Collection
This commit is contained in:
commit
f453ddbd5d
11
konva.d.ts
vendored
11
konva.d.ts
vendored
@ -1137,12 +1137,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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user