Fix typings in signatures of findAncestor(s)

In TypeScript, optional arguments must be declared as such.
This commit is contained in:
Evan Patterson
2019-09-11 10:53:45 -07:00
committed by GitHub
parent 250f0b950d
commit cc28960daa

View File

@@ -1497,7 +1497,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
* // get one of the parent group
* var parentGroups = node.findAncestors('Group');
*/
findAncestors(selector, includeSelf, stopNode) {
findAncestors(selector?, includeSelf?, stopNode?) {
var res: Array<Node> = [];
if (includeSelf && this._isMatch(selector)) {
@@ -1530,7 +1530,7 @@ export abstract class Node<Config extends NodeConfig = NodeConfig> {
* // get one of the parent group
* var group = node.findAncestors('.mygroup');
*/
findAncestor(selector, includeSelf, stopNode) {
findAncestor(selector?, includeSelf?, stopNode?) {
return this.findAncestors(selector, includeSelf, stopNode)[0];
}
// is current node match passed selector?