Skip to content

Commit

Permalink
Adding Typescript definition files to export Trees module.
Browse files Browse the repository at this point in the history
Signed-off-by: Lawrence Zeng <lawrence.zeng@gmail.com>
  • Loading branch information
ZengLawrence committed Oct 19, 2024
1 parent 933c4e0 commit 096ef99
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions runtime/JavaScript/src/antlr4/tree/Trees.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Parser } from "../Parser";
import { ParseTree } from "./ParseTree";
import { Tree } from "./Tree";

export default Trees;
declare namespace Trees {
function toStringTree(tree: Tree, ruleNames: string[], recog: Parser): string;
function getNodeText(t: Tree, ruleNames: string[], recog: Parser): string;
function getChildren(t: Tree): Tree[];
function getAncestors(t: Tree): Tree[];
function findAllTokenNodes(t: ParseTree, ttype: number): ParseTree[];
function findAllRuleNodes(t: ParseTree, ruleIndex: number): ParseTree[];
function findAllNodes(t: ParseTree, index: number, findTokens: boolean): ParseTree[];
function descendants(t: ParseTree): ParseTree[];
}
2 changes: 1 addition & 1 deletion runtime/JavaScript/src/antlr4/tree/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export * from './ParseTree';
export * from './ParseTreeListener';
export * from './ParseTreeVisitor';
export * from './ParseTreeWalker';

export * as Trees from './Trees';

0 comments on commit 096ef99

Please sign in to comment.