Change QueryResult to be QueryCapture and QueryMatch
matches/captures return 2 different types of object so this change corrects the return types
This commit is contained in:
parent
a7a6139e70
commit
2f897b4d73
1 changed files with 9 additions and 4 deletions
13
lib/binding_web/tree-sitter-web.d.ts
vendored
13
lib/binding_web/tree-sitter-web.d.ts
vendored
|
|
@ -137,9 +137,14 @@ declare module 'web-tree-sitter' {
|
|||
query(source: string): Query;
|
||||
}
|
||||
|
||||
interface QueryResult {
|
||||
interface QueryCapture {
|
||||
name: string;
|
||||
node: SyntaxNode;
|
||||
}
|
||||
|
||||
interface QueryMatch {
|
||||
pattern: number;
|
||||
captures: { name: string; node: SyntaxNode }[];
|
||||
captures: QueryCapture[];
|
||||
}
|
||||
|
||||
interface PredicateResult {
|
||||
|
|
@ -151,8 +156,8 @@ declare module 'web-tree-sitter' {
|
|||
captureNames: string[];
|
||||
|
||||
delete(): void;
|
||||
matches(node: SyntaxNode, startPosition?: Point, endPosition?: Point): QueryResult[];
|
||||
captures(node: SyntaxNode, startPosition?: Point, endPosition?: Point): QueryResult[];
|
||||
matches(node: SyntaxNode, startPosition?: Point, endPosition?: Point): QueryMatch[];
|
||||
captures(node: SyntaxNode, startPosition?: Point, endPosition?: Point): QueryCapture[];
|
||||
predicatesForPattern(patternIndex: number): PredicateResult[];
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue