UNPKG

1.02 kBTypeScriptView Raw
1import type { ScopeManager } from '@typescript-eslint/scope-manager';
2import type { ParserOptions, TSESTree } from '@typescript-eslint/types';
3import type { AST, ParserServices } from '@typescript-eslint/typescript-estree';
4import type { VisitorKeys } from '@typescript-eslint/visitor-keys';
5import type * as ts from 'typescript';
6interface ESLintProgram extends AST<{
7 comment: true;
8 tokens: true;
9}> {
10 comments: TSESTree.Comment[];
11 range: [number, number];
12 tokens: TSESTree.Token[];
13}
14interface ParseForESLintResult {
15 ast: ESLintProgram;
16 scopeManager: ScopeManager;
17 services: ParserServices;
18 visitorKeys: VisitorKeys;
19}
20declare function parse(code: string | ts.SourceFile, options?: ParserOptions): ParseForESLintResult['ast'];
21declare function parseForESLint(code: string | ts.SourceFile, parserOptions?: ParserOptions | null): ParseForESLintResult;
22export { parse, parseForESLint };
23export type { ParserOptions } from '@typescript-eslint/types';
24//# sourceMappingURL=parser.d.ts.map
\No newline at end of file