.gitignore added
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-prettier / node_modules / tslint / node_modules / tsutils / util / util.d.ts
1 import * as ts from 'typescript';
2 import { NodeWrap } from './convert-ast';
3 export * from './control-flow';
4 export declare function getChildOfKind<T extends ts.SyntaxKind>(node: ts.Node, kind: T, sourceFile?: ts.SourceFile): ts.Token<T> | undefined;
5 export declare function isTokenKind(kind: ts.SyntaxKind): boolean;
6 export declare function isNodeKind(kind: ts.SyntaxKind): boolean;
7 export declare function isAssignmentKind(kind: ts.SyntaxKind): boolean;
8 export declare function isTypeNodeKind(kind: ts.SyntaxKind): boolean;
9 export declare function isJsDocKind(kind: ts.SyntaxKind): boolean;
10 export declare function isThisParameter(parameter: ts.ParameterDeclaration): boolean;
11 export declare function getModifier(node: ts.Node, kind: ts.Modifier['kind']): ts.Modifier | undefined;
12 export declare function hasModifier(modifiers: ts.ModifiersArray | undefined, ...kinds: Array<ts.Modifier['kind']>): boolean;
13 export declare function isParameterProperty(node: ts.ParameterDeclaration): boolean;
14 export declare function hasAccessModifier(node: ts.ClassElement | ts.ParameterDeclaration): boolean;
15 export declare const isNodeFlagSet: (node: ts.Node, flag: ts.NodeFlags) => boolean;
16 export declare const isTypeFlagSet: (type: ts.Type, flag: ts.TypeFlags) => boolean;
17 export declare const isSymbolFlagSet: (symbol: ts.Symbol, flag: ts.SymbolFlags) => boolean;
18 export declare function isObjectFlagSet(objectType: ts.ObjectType, flag: ts.ObjectFlags): boolean;
19 export declare function isModifierFlagSet(node: ts.Declaration, flag: ts.ModifierFlags): boolean;
20 export declare function isModifierFlagSet(node: ts.Node, flag: ts.ModifierFlags): boolean;
21 export declare function isModfierFlagSet(node: ts.Node, flag: ts.ModifierFlags): boolean;
22 export declare function getPreviousStatement(statement: ts.Statement): ts.Statement | undefined;
23 export declare function getNextStatement(statement: ts.Statement): ts.Statement | undefined;
24 export declare function getPreviousToken(node: ts.Node, sourceFile?: ts.SourceFile): ts.Node | undefined;
25 export declare function getNextToken(node: ts.Node, sourceFile?: ts.SourceFile): ts.Node | undefined;
26 export declare function getTokenAtPosition(parent: ts.Node, pos: number, sourceFile?: ts.SourceFile): ts.Node | undefined;
27 export declare function getCommentAtPosition(sourceFile: ts.SourceFile, pos: number, parent?: ts.Node): ts.CommentRange | undefined;
28 export declare function isPositionInComment(sourceFile: ts.SourceFile, pos: number, parent?: ts.Node): boolean;
29 export declare function getWrappedNodeAtPosition(wrap: NodeWrap, pos: number): NodeWrap | undefined;
30 export declare function getPropertyName(propertyName: ts.PropertyName): string | undefined;
31 export declare function forEachDestructuringIdentifier<T>(pattern: ts.BindingPattern, fn: (element: ts.BindingElement & {
32     name: ts.Identifier;
33 }) => T): T | undefined;
34 export declare function forEachDeclaredVariable<T>(declarationList: ts.VariableDeclarationList, cb: (element: (ts.VariableDeclaration | ts.BindingElement) & {
35     name: ts.Identifier;
36 }) => T): T | undefined;
37 export declare const enum VariableDeclarationKind {
38     Var = 0,
39     Let = 1,
40     Const = 2
41 }
42 export declare function getVariableDeclarationKind(declarationList: ts.VariableDeclarationList): VariableDeclarationKind;
43 export declare function isBlockScopedVariableDeclarationList(declarationList: ts.VariableDeclarationList): boolean;
44 export declare function isBlockScopedVariableDeclaration(declaration: ts.VariableDeclaration): boolean;
45 export declare const enum ScopeBoundary {
46     None = 0,
47     Function = 1,
48     Block = 2
49 }
50 export declare function isScopeBoundary(node: ts.Node): ScopeBoundary;
51 export declare function isFunctionScopeBoundary(node: ts.Node): boolean;
52 export declare function isBlockScopeBoundary(node: ts.Node): boolean;
53 export declare function hasOwnThisReference(node: ts.Node): boolean;
54 export declare function isFunctionWithBody(node: ts.Node): node is ts.FunctionLikeDeclaration;
55 export declare function forEachToken(node: ts.Node, cb: (node: ts.Node) => void, sourceFile?: ts.SourceFile): void;
56 export declare type ForEachTokenCallback = (fullText: string, kind: ts.SyntaxKind, range: ts.TextRange, parent: ts.Node) => void;
57 export declare function forEachTokenWithTrivia(node: ts.Node, cb: ForEachTokenCallback, sourceFile?: ts.SourceFile): void;
58 export declare type ForEachCommentCallback = (fullText: string, comment: ts.CommentRange) => void;
59 export declare function forEachComment(node: ts.Node, cb: ForEachCommentCallback, sourceFile?: ts.SourceFile): void;
60 export interface LineRange extends ts.TextRange {
61     contentLength: number;
62 }
63 export declare function getLineRanges(sourceFile: ts.SourceFile): LineRange[];
64 export declare function getLineBreakStyle(sourceFile: ts.SourceFile): "\n" | "\r\n";
65 export declare function isValidIdentifier(text: string): boolean;
66 export declare function isValidPropertyAccess(text: string): boolean;
67 export declare function isValidPropertyName(text: string): boolean;
68 export declare function isValidNumericLiteral(text: string): boolean;
69 export declare function isSameLine(sourceFile: ts.SourceFile, pos1: number, pos2: number): boolean;
70 export declare const enum SideEffectOptions {
71     None = 0,
72     TaggedTemplate = 1,
73     Constructor = 2,
74     JsxElement = 4
75 }
76 export declare function hasSideEffects(node: ts.Expression, options?: SideEffectOptions): boolean;
77 export declare function getDeclarationOfBindingElement(node: ts.BindingElement): ts.VariableDeclaration | ts.ParameterDeclaration;
78 export declare function isExpressionValueUsed(node: ts.Expression): boolean;
79 export declare function isReassignmentTarget(node: ts.Expression): boolean;
80 export declare function getIdentifierText(node: ts.Identifier): string;
81 export declare function canHaveJsDoc(node: ts.Node): node is ts.HasJSDoc;
82 export declare function getJsDoc(node: ts.Node, sourceFile?: ts.SourceFile): ts.JSDoc[];
83 export declare function parseJsDocOfNode(node: ts.Node, considerTrailingComments?: boolean, sourceFile?: ts.SourceFile): ts.JSDoc[];
84 export declare const enum ImportKind {
85     ImportDeclaration = 1,
86     ImportEquals = 2,
87     ExportFrom = 4,
88     DynamicImport = 8,
89     Require = 16,
90     ImportType = 32,
91     All = 63,
92     AllImports = 59,
93     AllStaticImports = 3,
94     AllImportExpressions = 24,
95     AllRequireLike = 18
96 }
97 export declare const enum ImportOptions {
98     ImportDeclaration = 1,
99     ImportEquals = 2,
100     ExportFrom = 4,
101     DynamicImport = 8,
102     Require = 16,
103     All = 31,
104     AllImports = 27,
105     AllStaticImports = 3,
106     AllDynamic = 24,
107     AllRequireLike = 18
108 }
109 export declare function findImports(sourceFile: ts.SourceFile, kinds: ImportKind): ts.LiteralExpression[];
110 export declare function findImports(sourceFile: ts.SourceFile, options: ImportOptions): ts.LiteralExpression[];
111 export declare function isStatementInAmbientContext(node: ts.Statement): boolean;
112 export declare function isAmbientModuleBlock(node: ts.Node): node is ts.ModuleBlock;
113 export declare function getIIFE(func: ts.FunctionExpression | ts.ArrowFunction): ts.CallExpression | undefined;
114 export declare type StrictCompilerOption = 'noImplicitAny' | 'noImplicitThis' | 'strictNullChecks' | 'strictFunctionTypes' | 'strictPropertyInitialization' | 'alwaysStrict';
115 export declare function isStrictCompilerOptionEnabled(options: ts.CompilerOptions, option: StrictCompilerOption): boolean;
116 export declare type BooleanCompilerOptions = {
117     [K in keyof ts.CompilerOptions]: NonNullable<ts.CompilerOptions[K]> extends boolean ? K : never;
118 } extends {
119     [_ in keyof ts.CompilerOptions]: infer U;
120 } ? U : never;
121 export declare function isCompilerOptionEnabled(options: ts.CompilerOptions, option: BooleanCompilerOptions | 'stripInternal'): boolean;