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/tslint/lib/language/utils.d.ts | |
parent | 003fb34971cf63466184351b4db5f7c67df4f444 (diff) |
update packages
Diffstat (limited to 'node_modules/tslint/lib/language/utils.d.ts')
-rw-r--r-- | node_modules/tslint/lib/language/utils.d.ts | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/node_modules/tslint/lib/language/utils.d.ts b/node_modules/tslint/lib/language/utils.d.ts index ffdd0aabc..40b4aee16 100644 --- a/node_modules/tslint/lib/language/utils.d.ts +++ b/node_modules/tslint/lib/language/utils.d.ts @@ -1,3 +1,19 @@ +/** + * @license + * Copyright 2013 Palantir Technologies, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ import * as ts from "typescript"; import { IDisabledInterval, RuleFailure } from "./rule/rule"; export declare function getSourceFile(fileName: string, source: string): ts.SourceFile; @@ -5,59 +21,86 @@ export declare function getSourceFile(fileName: string, source: string): ts.Sour export declare function doesIntersect(failure: RuleFailure, disabledIntervals: IDisabledInterval[]): boolean; /** * @returns true if any modifier kinds passed along exist in the given modifiers array + * + * @deprecated use `hasModifier` from `tsutils` */ export declare function hasModifier(modifiers: ts.ModifiersArray | undefined, ...modifierKinds: ts.SyntaxKind[]): boolean; /** * Determines if the appropriate bit in the parent (VariableDeclarationList) is set, * which indicates this is a "let" or "const". + * + * @deprecated use `isBlockScopedVariableDeclarationList` from `tsutils` */ export declare function isBlockScopedVariable(node: ts.VariableDeclaration | ts.VariableStatement): boolean; +/** @deprecated use `isBlockScopedVariableDeclarationList` and `getDeclarationOfBindingElement` from `tsutils` */ export declare function isBlockScopedBindingElement(node: ts.BindingElement): boolean; +/** @deprecated use `getDeclarationOfBindingElement` from `tsutils` */ export declare function getBindingElementVariableDeclaration(node: ts.BindingElement): ts.VariableDeclaration | null; /** * Finds a child of a given node with a given kind. * Note: This uses `node.getChildren()`, which does extra parsing work to include tokens. + * + * @deprecated use `getChildOfKind` from `tsutils` */ export declare function childOfKind(node: ts.Node, kind: ts.SyntaxKind): ts.Node | undefined; /** * @returns true if some ancestor of `node` satisfies `predicate`, including `node` itself. + * + * @deprecated no longer used, use a `while` loop instead */ export declare function someAncestor(node: ts.Node, predicate: (n: ts.Node) => boolean): boolean; -export declare function ancestorWhere<T extends ts.Node>(node: ts.Node, predicate: (n: ts.Node) => n is T): T | undefined; -export declare function ancestorWhere(node: ts.Node, predicate: (n: ts.Node) => boolean): ts.Node | undefined; +export declare function ancestorWhere<T extends ts.Node = ts.Node>(node: ts.Node, predicate: ((n: ts.Node) => n is T) | ((n: ts.Node) => boolean)): T | undefined; +/** @deprecated use `isBinaryExpression(node) && isAssignmentKind(node.operatorToken.kind)` with functions from `tsutils` */ export declare function isAssignment(node: ts.Node): boolean; /** * Bitwise check for node flags. + * + * @deprecated use `isNodeFlagSet` from `tsutils` */ export declare function isNodeFlagSet(node: ts.Node, flagToCheck: ts.NodeFlags): boolean; /** * Bitwise check for combined node flags. + * + * @deprecated no longer used */ export declare function isCombinedNodeFlagSet(node: ts.Node, flagToCheck: ts.NodeFlags): boolean; /** * Bitwise check for combined modifier flags. + * + * @deprecated no longer used */ export declare function isCombinedModifierFlagSet(node: ts.Node, flagToCheck: ts.ModifierFlags): boolean; /** * Bitwise check for type flags. + * + * @deprecated use `isTypeFlagSet` from `tsutils` */ export declare function isTypeFlagSet(type: ts.Type, flagToCheck: ts.TypeFlags): boolean; /** * Bitwise check for symbol flags. + * + * @deprecated use `isSymbolFlagSet` from `tsutils` */ export declare function isSymbolFlagSet(symbol: ts.Symbol, flagToCheck: ts.SymbolFlags): boolean; /** * Bitwise check for object flags. * Does not work with TypeScript 2.0.x + * + * @deprecated use `isObjectFlagSet` from `tsutils` */ export declare function isObjectFlagSet(objectType: ts.ObjectType, flagToCheck: ts.ObjectFlags): boolean; /** * @returns true if decl is a nested module declaration, i.e. represents a segment of a dotted module path. + * + * @deprecated use `decl.parent!.kind === ts.SyntaxKind.ModuleDeclaration` */ export declare function isNestedModuleDeclaration(decl: ts.ModuleDeclaration): boolean; export declare function unwrapParentheses(node: ts.Expression): ts.Expression; +/** @deprecated use `isFunctionScopeBoundary` from `tsutils` */ export declare function isScopeBoundary(node: ts.Node): boolean; +/** @deprecated use `isBlockScopeBoundary` from `tsutils` */ export declare function isBlockScopeBoundary(node: ts.Node): boolean; +/** @deprecated use `isIterationStatement` from `tsutils` or `typescript` */ export declare function isLoop(node: ts.Node): node is ts.IterationStatement; /** * @returns Whether node is a numeric expression. @@ -83,9 +126,15 @@ export declare type FilterCallback = (node: ts.Node) => boolean; * @param skipTrivia If set to false all trivia preceeding `node` or any of its children is included * @param cb Is called for every token of `node`. It gets the full text of the SourceFile and the position of the token within that text. * @param filter If provided, will be called for every Node and Token found. If it returns false `cb` will not be called for this subtree. + * + * @deprecated use `forEachToken` or `forEachTokenWithTrivia` from `tsutils` */ export declare function forEachToken(node: ts.Node, skipTrivia: boolean, cb: ForEachTokenCallback, filter?: FilterCallback): void; -/** Iterate over all comments owned by `node` or its children */ +/** + * Iterate over all comments owned by `node` or its children + * + * @deprecated use `forEachComment` from `tsutils` + */ export declare function forEachComment(node: ts.Node, cb: ForEachCommentCallback): void; /** * Checks if there are any comments between `position` and the next non-trivia token |