mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
types fixes. close #945
This commit is contained in:
parent
4e1b1c7812
commit
8bf97ba8c1
@ -3,6 +3,9 @@
|
||||
All notable changes to this project will be documented in this file.
|
||||
This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
* Fix incorrect text rendering with `letterSpacing !== 0`
|
||||
* Typescript fixes
|
||||
|
||||
## 7.0.2 - 2020-06-30
|
||||
|
||||
* Fix wrong trigger `dbltap` and `click` on mobile
|
||||
|
@ -219,7 +219,7 @@ export abstract class Container<ChildType extends Node> extends Node<
|
||||
* return node.getType() === 'Shape'
|
||||
* })
|
||||
*/
|
||||
findOne<ChildNode extends Node = Node>(selector: string | Function): Node {
|
||||
findOne<ChildNode extends Node = Node>(selector: string | Function) {
|
||||
var result = this._generalFind<ChildNode>(selector, true);
|
||||
return result.length > 0 ? result[0] : undefined;
|
||||
}
|
||||
@ -227,9 +227,9 @@ export abstract class Container<ChildType extends Node> extends Node<
|
||||
selector: string | Function,
|
||||
findOne: boolean
|
||||
) {
|
||||
var retArr: Array<Node> = [];
|
||||
var retArr: Array<ChildNode> = [];
|
||||
|
||||
this._descendants((node) => {
|
||||
this._descendants((node: ChildNode) => {
|
||||
const valid = node._isMatch(selector);
|
||||
if (valid) {
|
||||
retArr.push(node);
|
||||
@ -240,7 +240,7 @@ export abstract class Container<ChildType extends Node> extends Node<
|
||||
return false;
|
||||
});
|
||||
|
||||
return Collection.toCollection(retArr);
|
||||
return Collection.toCollection<ChildNode>(retArr);
|
||||
}
|
||||
private _descendants(fn: (n: Node) => boolean) {
|
||||
let shouldStop = false;
|
||||
|
@ -3,6 +3,7 @@ import { Container } from './Container';
|
||||
import { _registerNode } from './Global';
|
||||
import { Node } from './Node';
|
||||
import { Shape } from './Shape';
|
||||
import Konva from './index-types';
|
||||
|
||||
/**
|
||||
* Group constructor. Groups are used to contain shapes or other groups.
|
||||
|
Loading…
Reference in New Issue
Block a user