Update TS definitions to support the Query API
This commit is contained in:
parent
9e65d18ec6
commit
505695040d
1 changed files with 10 additions and 3 deletions
13
lib/binding_web/tree-sitter-web.d.ts
vendored
13
lib/binding_web/tree-sitter-web.d.ts
vendored
|
|
@ -37,7 +37,7 @@ declare module 'web-tree-sitter' {
|
|||
|
||||
export type Logger = (
|
||||
message: string,
|
||||
params: {[param: string]: string},
|
||||
params: { [param: string]: string },
|
||||
type: "parse" | "lex"
|
||||
) => void;
|
||||
|
||||
|
|
@ -131,8 +131,15 @@ declare module 'web-tree-sitter' {
|
|||
readonly version: number;
|
||||
readonly fieldCount: number;
|
||||
|
||||
fieldNameForId(fieldId: number): string | null
|
||||
fieldIdForName(fieldName: string): number | null
|
||||
fieldNameForId(fieldId: number): string | null;
|
||||
fieldIdForName(fieldName: string): number | null;
|
||||
query(source: string): Query;
|
||||
}
|
||||
|
||||
class Query {
|
||||
delete(): void;
|
||||
matches(node: SyntaxNode, startPosition?: Point, endPosition?: Point);
|
||||
captures(node: SyntaxNode, startPosition?: Point, endPosition?: Point);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue