File tree Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Expand file tree Collapse file tree 1 file changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -48,6 +48,7 @@ declare module 'web-tree-sitter' {
4848 ) => string | null ;
4949
5050 export interface SyntaxNode {
51+ id : number ;
5152 tree : Tree ;
5253 type : string ;
5354 isNamed : boolean ;
@@ -136,10 +137,23 @@ declare module 'web-tree-sitter' {
136137 query ( source : string ) : Query ;
137138 }
138139
140+ interface QueryResult {
141+ pattern : number ;
142+ captures : { name : string ; node : SyntaxNode } [ ] ;
143+ }
144+
145+ interface PredicateResult {
146+ operator : string ;
147+ operands : { name : string ; type : string } [ ] ;
148+ }
149+
139150 class Query {
151+ captureNames : string [ ] ;
152+
140153 delete ( ) : void ;
141- matches ( node : SyntaxNode , startPosition ?: Point , endPosition ?: Point ) ;
142- captures ( node : SyntaxNode , startPosition ?: Point , endPosition ?: Point ) ;
154+ matches ( node : SyntaxNode , startPosition ?: Point , endPosition ?: Point ) : QueryResult [ ] ;
155+ captures ( node : SyntaxNode , startPosition ?: Point , endPosition ?: Point ) : QueryResult [ ] ;
156+ predicatesForPattern ( patternIndex : number ) : PredicateResult [ ] ;
143157 }
144158 }
145159
You can’t perform that action at this time.
0 commit comments