.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / @typescript-eslint / typescript-estree / dist / parser-options.d.ts
1 import { DebugLevel } from '@typescript-eslint/types';
2 import { Program } from 'typescript';
3 import { TSESTree, TSNode, TSESTreeToTSNode, TSToken } from './ts-estree';
4 declare type DebugModule = 'typescript-eslint' | 'eslint' | 'typescript';
5 export interface Extra {
6     code: string;
7     comment: boolean;
8     comments: TSESTree.Comment[];
9     createDefaultProgram: boolean;
10     debugLevel: Set<DebugModule>;
11     errorOnTypeScriptSyntacticAndSemanticIssues: boolean;
12     errorOnUnknownASTType: boolean;
13     extraFileExtensions: string[];
14     filePath: string;
15     jsx: boolean;
16     loc: boolean;
17     log: (message: string) => void;
18     preserveNodeMaps?: boolean;
19     projects: string[];
20     range: boolean;
21     strict: boolean;
22     tokens: null | TSESTree.Token[];
23     tsconfigRootDir: string;
24     useJSXTextNode: boolean;
25 }
26 interface ParseOptions {
27     /**
28      * create a top-level comments array containing all comments
29      */
30     comment?: boolean;
31     /**
32      * An array of modules to turn explicit debugging on for.
33      * - 'typescript-eslint' is the same as setting the env var `DEBUG=typescript-eslint:*`
34      * - 'eslint' is the same as setting the env var `DEBUG=eslint:*`
35      * - 'typescript' is the same as setting `extendedDiagnostics: true` in your tsconfig compilerOptions
36      *
37      * For convenience, also supports a boolean:
38      * - true === ['typescript-eslint']
39      * - false === []
40      */
41     debugLevel?: DebugLevel;
42     /**
43      * Cause the parser to error if it encounters an unknown AST node type (useful for testing).
44      * This case only usually occurs when TypeScript releases new features.
45      */
46     errorOnUnknownASTType?: boolean;
47     /**
48      * Absolute (or relative to `cwd`) path to the file being parsed.
49      */
50     filePath?: string;
51     /**
52      * Enable parsing of JSX.
53      * For more details, see https://www.typescriptlang.org/docs/handbook/jsx.html
54      *
55      * NOTE: this setting does not effect known file types (.js, .jsx, .ts, .tsx, .json) because the
56      * TypeScript compiler has its own internal handling for known file extensions.
57      *
58      * For the exact behavior, see https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/parser#parseroptionsecmafeaturesjsx
59      */
60     jsx?: boolean;
61     /**
62      * Controls whether the `loc` information to each node.
63      * The `loc` property is an object which contains the exact line/column the node starts/ends on.
64      * This is similar to the `range` property, except it is line/column relative.
65      */
66     loc?: boolean;
67     loggerFn?: ((message: string) => void) | false;
68     /**
69      * Controls whether the `range` property is included on AST nodes.
70      * The `range` property is a [number, number] which indicates the start/end index of the node in the file contents.
71      * This is similar to the `loc` property, except this is the absolute index.
72      */
73     range?: boolean;
74     /**
75      * Set to true to create a top-level array containing all tokens from the file.
76      */
77     tokens?: boolean;
78     useJSXTextNode?: boolean;
79 }
80 interface ParseAndGenerateServicesOptions extends ParseOptions {
81     /**
82      * Causes the parser to error if the TypeScript compiler returns any unexpected syntax/semantic errors.
83      */
84     errorOnTypeScriptSyntacticAndSemanticIssues?: boolean;
85     /**
86      * When `project` is provided, this controls the non-standard file extensions which will be parsed.
87      * It accepts an array of file extensions, each preceded by a `.`.
88      */
89     extraFileExtensions?: string[];
90     /**
91      * Absolute (or relative to `tsconfigRootDir`) path to the file being parsed.
92      * When `project` is provided, this is required, as it is used to fetch the file from the TypeScript compiler's cache.
93      */
94     filePath?: string;
95     /**
96      * Allows the user to control whether or not two-way AST node maps are preserved
97      * during the AST conversion process.
98      *
99      * By default: the AST node maps are NOT preserved, unless `project` has been specified,
100      * in which case the maps are made available on the returned `parserServices`.
101      *
102      * NOTE: If `preserveNodeMaps` is explicitly set by the user, it will be respected,
103      * regardless of whether or not `project` is in use.
104      */
105     preserveNodeMaps?: boolean;
106     /**
107      * Absolute (or relative to `tsconfigRootDir`) paths to the tsconfig(s).
108      * If this is provided, type information will be returned.
109      */
110     project?: string | string[];
111     /**
112      * If you provide a glob (or globs) to the project option, you can use this option to blacklist
113      * certain folders from being matched by the globs.
114      * Any project path that matches one or more of the provided regular expressions will be removed from the list.
115      *
116      * Accepts an array of strings that are passed to new RegExp(), or an array of regular expressions.
117      * By default, this is set to ["/node_modules/"]
118      */
119     projectFolderIgnoreList?: (string | RegExp)[];
120     /**
121      * The absolute path to the root directory for all provided `project`s.
122      */
123     tsconfigRootDir?: string;
124     /**
125      ***************************************************************************************
126      * IT IS RECOMMENDED THAT YOU DO NOT USE THIS OPTION, AS IT CAUSES PERFORMANCE ISSUES. *
127      ***************************************************************************************
128      *
129      * When passed with `project`, this allows the parser to create a catch-all, default program.
130      * This means that if the parser encounters a file not included in any of the provided `project`s,
131      * it will not error, but will instead parse the file and its dependencies in a new program.
132      */
133     createDefaultProgram?: boolean;
134 }
135 export declare type TSESTreeOptions = ParseAndGenerateServicesOptions;
136 export interface ParserWeakMap<TKey, TValueBase> {
137     get<TValue extends TValueBase>(key: TKey): TValue;
138     has(key: unknown): boolean;
139 }
140 export interface ParserWeakMapESTreeToTSNode<TKey extends TSESTree.Node = TSESTree.Node> {
141     get<TKeyBase extends TKey>(key: TKeyBase): TSESTreeToTSNode<TKeyBase>;
142     has(key: unknown): boolean;
143 }
144 export interface ParserServices {
145     program: Program;
146     esTreeNodeToTSNodeMap: ParserWeakMapESTreeToTSNode;
147     tsNodeToESTreeNodeMap: ParserWeakMap<TSNode | TSToken, TSESTree.Node>;
148     hasFullTypeInformation: boolean;
149 }
150 export {};
151 //# sourceMappingURL=parser-options.d.ts.map