diff options
author | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2018-09-20 02:56:13 +0200 |
commit | bbff7403fbf46f9ad92240ac213df8d30ef31b64 (patch) | |
tree | c58400ec5124da1c7d56b01aea83309f80a56c3b /node_modules/tsutils/util/util.d.ts | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/tsutils/util/util.d.ts')
-rw-r--r-- | node_modules/tsutils/util/util.d.ts | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/node_modules/tsutils/util/util.d.ts b/node_modules/tsutils/util/util.d.ts index bcc346a21..94efa2465 100644 --- a/node_modules/tsutils/util/util.d.ts +++ b/node_modules/tsutils/util/util.d.ts @@ -1,4 +1,5 @@ import * as ts from 'typescript'; +import { NodeWrap } from './convert-ast'; export * from './control-flow'; export declare function getChildOfKind<T extends ts.SyntaxKind>(node: ts.Node, kind: T, sourceFile?: ts.SourceFile): ts.Token<T> | undefined; export declare function isTokenKind(kind: ts.SyntaxKind): boolean; @@ -15,6 +16,7 @@ export declare const isNodeFlagSet: (node: ts.Node, flag: ts.NodeFlags) => boole export declare const isTypeFlagSet: (type: ts.Type, flag: ts.TypeFlags) => boolean; export declare const isSymbolFlagSet: (symbol: ts.Symbol, flag: ts.SymbolFlags) => boolean; export declare function isObjectFlagSet(objectType: ts.ObjectType, flag: ts.ObjectFlags): boolean; +export declare function isModifierFlagSet(node: ts.Declaration, flag: ts.ModifierFlags): boolean; export declare function isModifierFlagSet(node: ts.Node, flag: ts.ModifierFlags): boolean; export declare function isModfierFlagSet(node: ts.Node, flag: ts.ModifierFlags): boolean; export declare function getPreviousStatement(statement: ts.Statement): ts.Statement | undefined; @@ -24,17 +26,18 @@ export declare function getNextToken(node: ts.Node, sourceFile?: ts.SourceFile): export declare function getTokenAtPosition(parent: ts.Node, pos: number, sourceFile?: ts.SourceFile): ts.Node | undefined; export declare function getCommentAtPosition(sourceFile: ts.SourceFile, pos: number, parent?: ts.Node): ts.CommentRange | undefined; export declare function isPositionInComment(sourceFile: ts.SourceFile, pos: number, parent?: ts.Node): boolean; +export declare function getWrappedNodeAtPosition(wrap: NodeWrap, pos: number): NodeWrap | undefined; export declare function getPropertyName(propertyName: ts.PropertyName): string | undefined; export declare function forEachDestructuringIdentifier<T>(pattern: ts.BindingPattern, fn: (element: ts.BindingElement & { name: ts.Identifier; }) => T): T | undefined; -export declare function forEachDeclaredVariable<T>(declarationList: ts.VariableDeclarationList, cb: (element: ts.VariableLikeDeclaration & { +export declare function forEachDeclaredVariable<T>(declarationList: ts.VariableDeclarationList, cb: (element: (ts.VariableDeclaration | ts.BindingElement) & { name: ts.Identifier; }) => T): T | undefined; export declare const enum VariableDeclarationKind { Var = 0, Let = 1, - Const = 2, + Const = 2 } export declare function getVariableDeclarationKind(declarationList: ts.VariableDeclarationList): VariableDeclarationKind; export declare function isBlockScopedVariableDeclarationList(declarationList: ts.VariableDeclarationList): boolean; @@ -42,7 +45,7 @@ export declare function isBlockScopedVariableDeclaration(declaration: ts.Variabl export declare const enum ScopeBoundary { None = 0, Function = 1, - Block = 2, + Block = 2 } export declare function isScopeBoundary(node: ts.Node): ScopeBoundary; export declare function isFunctionScopeBoundary(node: ts.Node): boolean; @@ -58,6 +61,7 @@ export interface LineRange extends ts.TextRange { contentLength: number; } export declare function getLineRanges(sourceFile: ts.SourceFile): LineRange[]; +export declare function getLineBreakStyle(sourceFile: ts.SourceFile): "\n" | "\r\n"; export declare function isValidIdentifier(text: string): boolean; export declare function isValidPropertyAccess(text: string): boolean; export declare function isValidPropertyName(text: string): boolean; @@ -67,7 +71,7 @@ export declare const enum SideEffectOptions { None = 0, TaggedTemplate = 1, Constructor = 2, - JsxElement = 4, + JsxElement = 4 } export declare function hasSideEffects(node: ts.Expression, options?: SideEffectOptions): boolean; export declare function getDeclarationOfBindingElement(node: ts.BindingElement): ts.VariableDeclaration | ts.ParameterDeclaration; @@ -83,11 +87,12 @@ export declare const enum ImportKind { ExportFrom = 4, DynamicImport = 8, Require = 16, - All = 31, - AllImports = 27, + ImportType = 32, + All = 63, + AllImports = 59, AllStaticImports = 3, AllImportExpressions = 24, - AllRequireLike = 18, + AllRequireLike = 18 } export declare const enum ImportOptions { ImportDeclaration = 1, @@ -99,7 +104,18 @@ export declare const enum ImportOptions { AllImports = 27, AllStaticImports = 3, AllDynamic = 24, - AllRequireLike = 18, + AllRequireLike = 18 } export declare function findImports(sourceFile: ts.SourceFile, kinds: ImportKind): ts.LiteralExpression[]; export declare function findImports(sourceFile: ts.SourceFile, options: ImportOptions): ts.LiteralExpression[]; +export declare function isStatementInAmbientContext(node: ts.Statement): boolean; +export declare function isAmbientModuleBlock(node: ts.Node): node is ts.ModuleBlock; +export declare function getIIFE(func: ts.FunctionExpression | ts.ArrowFunction): ts.CallExpression | undefined; +export declare type StrictCompilerOption = 'noImplicitAny' | 'noImplicitThis' | 'strictNullChecks' | 'strictFunctionTypes' | 'strictPropertyInitialization' | 'alwaysStrict'; +export declare function isStrictCompilerOptionEnabled(options: ts.CompilerOptions, option: StrictCompilerOption): boolean; +export declare type BooleanCompilerOptions = { + [K in keyof ts.CompilerOptions]: NonNullable<ts.CompilerOptions[K]> extends boolean ? K : never; +} extends { + [_ in keyof ts.CompilerOptions]: infer U; +} ? U : never; +export declare function isCompilerOptionEnabled(options: ts.CompilerOptions, option: BooleanCompilerOptions | 'stripInternal'): boolean; |