mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
Merge pull request #480 from IgorBabkin/443-get-children-generics
Methods which return Konva.Collection have problems with generic typi…
This commit is contained in:
commit
16caf0ae9d
10
konva.d.ts
vendored
10
konva.d.ts
vendored
@ -444,10 +444,10 @@ declare namespace Konva {
|
|||||||
clipHeight?: number;
|
clipHeight?: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Container extends Node {
|
class Container<T extends Node = Node> extends Node {
|
||||||
constructor(params?: ContainerConfig);
|
constructor(params?: ContainerConfig);
|
||||||
add(...children: Node[]): this;
|
add(...children: Node[]): this;
|
||||||
getChildren(filterfunc?: Function): Collection;
|
getChildren(filterfunc?: Function): Collection<T>;
|
||||||
clip(): SizeConfig;
|
clip(): SizeConfig;
|
||||||
clip(clip: SizeConfig | undefined | null): this;
|
clip(clip: SizeConfig | undefined | null): this;
|
||||||
clipHeight(): number;
|
clipHeight(): number;
|
||||||
@ -461,7 +461,7 @@ declare namespace Konva {
|
|||||||
clipFunc(): (ctx: CanvasRenderingContext2D) => void;
|
clipFunc(): (ctx: CanvasRenderingContext2D) => void;
|
||||||
clipFunc(ctx: CanvasRenderingContext2D | undefined | null): void;
|
clipFunc(ctx: CanvasRenderingContext2D | undefined | null): void;
|
||||||
destroyChildren(): void;
|
destroyChildren(): void;
|
||||||
find(selector?: string | ((node: Node) => boolean)): Collection;
|
find<T extends Node = Node>(selector?: string | ((node: Node) => boolean)): Collection<T>;
|
||||||
findOne<T extends Node>(selector: string | ((node: Node) => boolean)): T;
|
findOne<T extends Node>(selector: string | ((node: Node) => boolean)): T;
|
||||||
getAllIntersections(pos: Vector2d): Shape[];
|
getAllIntersections(pos: Vector2d): Shape[];
|
||||||
hasChildren(): boolean;
|
hasChildren(): boolean;
|
||||||
@ -677,7 +677,7 @@ declare namespace Konva {
|
|||||||
drawScene(): void;
|
drawScene(): void;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Group extends Container {}
|
class Group<T extends Node = Node> extends Container<T> {}
|
||||||
|
|
||||||
interface CanvasConfig {
|
interface CanvasConfig {
|
||||||
width: number;
|
width: number;
|
||||||
@ -1072,7 +1072,7 @@ declare namespace Konva {
|
|||||||
|
|
||||||
interface LabelInterface extends ContainerConfig {}
|
interface LabelInterface extends ContainerConfig {}
|
||||||
|
|
||||||
class Label extends Group {
|
class Label extends Group<Shape> {
|
||||||
constructor(LabelInterface: LabelInterface);
|
constructor(LabelInterface: LabelInterface);
|
||||||
getText(): Text;
|
getText(): Text;
|
||||||
getTag(): Rect;
|
getTag(): Rect;
|
||||||
|
Loading…
Reference in New Issue
Block a user