diff --git a/babel-core/babel-core-tests.ts b/babel-core/babel-core-tests.ts new file mode 100644 index 0000000000..e564b9d81e --- /dev/null +++ b/babel-core/babel-core-tests.ts @@ -0,0 +1,32 @@ +/// +import * as babel from "babel-core"; + + +// Example from https://github.com/babel/babel/tree/master/packages/babel-core +const code = `class Example {}`; +const result = babel.transform(code, { /* options */ }); +result.code; // Generated code +result.map; // Sourcemap +result.ast; // AST + + +// Examples from http://babeljs.io/docs/usage/api/ +let options: babel.TransformOptions = { + plugins: [ + "es2015-arrow-functions", + "es2015-block-scoped-functions", + "es2015-block-scoping", + "es2015-classes", + ], + only: /.*\.js/, + ast: false, + sourceMaps: true +}; + +babel.transformFile("filename.js", options, function (err, result) { + result.code; + result.map; + result.ast; +}); + +babel.transformFileSync("filename.js", options).code; diff --git a/babel-core/babel-core.d.ts b/babel-core/babel-core.d.ts new file mode 100644 index 0000000000..19146e65e0 --- /dev/null +++ b/babel-core/babel-core.d.ts @@ -0,0 +1,144 @@ +// Type definitions for babel-core v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-core +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// +/// + +declare module "babel-core" { + import * as t from 'babel-types'; + export {t as types}; + type Node = t.Node; + export import template = require('babel-template'); + export var version: string; + import traverse, {Visitor} from "babel-traverse"; + export {traverse, Visitor}; + + + /** Transforms the passed in `code`. Returning an object with the generated code, source map, and AST. */ + export function transform(code: string, opts?: TransformOptions): BabelFileResult; + + /** Asynchronously transforms the entire contents of a file. */ + export function transformFile(filename: string, opts: TransformOptions, callback: (err: any, result: BabelFileResult) => void): void; + + /** Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`. */ + export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult; + + export function transformFromAst(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult; + + export interface TransformOptions { + + /** Filename to use when reading from stdin - this will be used in source-maps, errors etc. Default: "unknown". */ + filename?: string; + + /** Filename relative to `sourceRoot`. */ + filenameRelative?: string; + + /** A source map object that the output source map will be based on. */ + inputSourceMap?: Object; + + /** + * This is an object of keys that represent different environments. For example, you may have: + * `{ env: { production: { / * specific options * / } } }` + * which will use those options when the enviroment variable `BABEL_ENV` is set to `"production"`. + * If `BABEL_ENV` isn't set then `NODE_ENV` will be used, if it's not set then it defaults to `"development"`. + */ + env?: Object; + + /** Retain line numbers - will result in really ugly code. Default: `false` */ + retainLines?: boolean; + + /** Enable/disable ANSI syntax highlighting of code frames. Default: `true`. */ + highlightCode?: boolean; + + /** List of presets (a set of plugins) to load and use. */ + presets?: any[]; + + /** List of plugins to load and use. */ + plugins?: any[]; + + /** list of glob paths to **not** compile. Opposite to the `only` option. */ + ignore?: string[]; + + /** + * A glob, regex, or mixed array of both, matching paths to only compile. Can also be an array of arrays containing + * paths to explicitly match. When attempting to compile a non-matching file it's returned verbatim. + */ + only?: string | RegExp | Array; + + /** Enable code generation. Default: `true`. */ + code?: boolean; + + /** Include the AST in the returned object. Default: `true`. */ + ast?: boolean; + + /** A path to an .babelrc file to extend. */ + extends?: string; + + /** write comments to generated output. Default: `true`. */ + comments?: boolean; + + /** + * An optional callback that controls whether a comment should be output or not. Called as + * `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comments` option when used. + */ + shouldPrintComment?: (comment: string) => boolean; + + /** + * Do not include superfluous whitespace characters and line terminators. When set to `"auto"`, `compact` is set to + * `true` on input sizes of >100KB. + */ + compact?: boolean | "auto"; + + /** + * If truthy, adds a `map` property to returned output. If set to `"inline"`, a comment with a `sourceMappingURL` + * directive is added to the bottom of the returned code. If set to `"both"` then a map property is returned as well + * as a source map comment appended. + */ + sourceMaps?: boolean | "inline" | "both"; + + /** Set `file` on returned source map. */ + sourceMapTarget?: string; + + /** Set `sources[0]` on returned source map. */ + sourceFileName?: string; + + /** The root from which all sources are relative. */ + sourceRoot?: string; + + /** Specify whether or not to use `.babelrc` and `.babelignore` files. Default: `true`. */ + babelrc?: boolean; + + /** Attach a comment before all non-user injected code. */ + auxiliaryCommentBefore?: string; + + /** Attach a comment after all non-user injected code. */ + auxiliaryCommentAfter?: string; + + /** + * Specify a custom callback to generate a module id with. Called as `getModuleId(moduleName)`. + * If falsy value is returned then the generated module id is used. + */ + getModuleId?: (moduleName: string) => string; + + /** Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions. */ + moduleRoot?: string; + + /** + * If truthy, insert an explicit id for modules. By default, all modules are anonymous. + * (Not available for `common` modules). + */ + moduleIds?: boolean; + + /** Specify a custom name for module ids. */ + moduleId?: string; + } + + export interface BabelFileResult { + ast?: Node; + code?: string; + map?: Object; + } +} diff --git a/babel-generator/babel-generator-tests.ts b/babel-generator/babel-generator-tests.ts new file mode 100644 index 0000000000..33d10b5cd9 --- /dev/null +++ b/babel-generator/babel-generator-tests.ts @@ -0,0 +1,27 @@ +/// +/// + + +// Example from https://github.com/babel/babel/tree/master/packages/babel-generator +import {parse} from 'babylon'; +import generate from 'babel-generator'; + +const code = 'class Example {}'; +const ast = parse(code); + +ast.type; +ast.loc.start; + +const output = generate(ast, { /* options */ }, code); + + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-generator +let result = generate(ast, { + retainLines: false, + compact: "auto", + concise: false, + quotes: "double", + // ... +}, code); +result.code; +result.map; diff --git a/babel-generator/babel-generator.d.ts b/babel-generator/babel-generator.d.ts new file mode 100644 index 0000000000..aa8232e8b0 --- /dev/null +++ b/babel-generator/babel-generator.d.ts @@ -0,0 +1,102 @@ +// Type definitions for babel-generator v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-generator +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "babel-generator" { + import * as t from 'babel-types'; + type Node = t.Node; + + /** + * Turns an AST into code, maintaining sourcemaps, user preferences, and valid output. + * @param ast - the abstract syntax tree from which to generate output code. + * @param opts - used for specifying options for code generation. + * @param code - the original source code, used for source maps. + * @returns - an object containing the output code and source map. + */ + export default function generate(ast: Node, opts?: GeneratorOptions, code?: string | {[filename: string]: string}): GeneratorResult; + + export interface GeneratorOptions { + + /** + * Optional string to add as a block comment at the start of the output file. + */ + auxiliaryCommentBefore?: string; + + /** + * Optional string to add as a block comment at the end of the output file. + */ + auxiliaryCommentAfter?: string; + + /** + * Function that takes a comment (as a string) and returns true if the comment should be included in the output. + * By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment + * contains `@preserve` or `@license`. + */ + shouldPrintComment?: (comment: string) => boolean; + + /** + * Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces). + * Defaults to `false`. + */ + retainLines?: boolean; + + /** + * Should comments be included in output? Defaults to `true`. + */ + comments?: boolean; + + /** + * Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`. + */ + compact?: boolean | 'auto'; + + /** + * Should the output be minified. Defaults to `false`. + */ + minified?: boolean; + + /** + * Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`. + */ + concise?: boolean; + + /** + * The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`. + */ + quotes?: 'single' | 'double'; + + /** + * Used in warning messages + */ + filename?: string; + + /** + * Enable generating source maps. Defaults to `false`. + */ + sourceMaps?: boolean; + + /** + * The filename of the generated code that the source map will be associated with. + */ + sourceMapTarget?: string; + + /** + * A root for all relative URLs in the source map. + */ + sourceRoot?: string; + + /** + * The filename for the source code (i.e. the code in the `code` argument). + * This will only be used if `code` is a string. + */ + sourceFileName?: string; + } + + export interface GeneratorResult { + map: Object; + code: string; + } +} diff --git a/babel-template/babel-template-tests.ts b/babel-template/babel-template-tests.ts new file mode 100644 index 0000000000..e0ae7497ff --- /dev/null +++ b/babel-template/babel-template-tests.ts @@ -0,0 +1,21 @@ +/// +/// +/// + + +// Example from https://github.com/babel/babel/tree/master/packages/babel-template +import template = require('babel-template'); +import generate from 'babel-generator'; +import * as t from 'babel-types'; + +const buildRequire = template(` + var IMPORT_NAME = require(SOURCE); +`); + +const ast = buildRequire({ + IMPORT_NAME: t.identifier('myModule'), + SOURCE: t.stringLiteral('my-module') +}); + +console.log(generate(ast).code); +// var myModule = require('my-module'); diff --git a/babel-template/babel-template.d.ts b/babel-template/babel-template.d.ts new file mode 100644 index 0000000000..7b3cafe7f4 --- /dev/null +++ b/babel-template/babel-template.d.ts @@ -0,0 +1,21 @@ +// Type definitions for babel-template v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-template +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// +/// + +declare module "babel-template" { + import {BabylonOptions} from 'babylon'; + import * as t from 'babel-types'; + type Node = t.Node; + + // NB: This export doesn't match the handbook example, where `template` is the default export. + // But it does match the runtime behaviour (at least at the time of this writing). For some reason, + // babel-template/lib/index.js has this line at the bottom: module.exports = exports["default"]; + export = template; + function template(code: string, opts?: BabylonOptions): UseTemplate; + + type UseTemplate = (nodes?: {[placeholder: string]: Node}) => Node; +} diff --git a/babel-traverse/babel-traverse-tests.ts b/babel-traverse/babel-traverse-tests.ts new file mode 100644 index 0000000000..fba04dfd5d --- /dev/null +++ b/babel-traverse/babel-traverse-tests.ts @@ -0,0 +1,111 @@ +/// +/// +/// + + +import * as babylon from "babylon"; +import traverse, {Visitor} from 'babel-traverse'; +import * as t from 'babel-types'; + + +// Examples from: https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md +const MyVisitor: Visitor = { + Identifier: { + enter() { + console.log("Entered!"); + }, + exit() { + console.log("Exited!"); + } + } +}; + +const MyVisitor2: Visitor = { + Identifier(path) { + console.log("Visiting: " + path.node.name); + } +}; + + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-traverse +const code = `function square(n) { + return n * n; +}`; + +const ast = babylon.parse(code); + +traverse(ast, { + enter(path) { + let node = path.node; + if (t.isIdentifier(node) && node.name === "n") { + node.name = "x"; + } + } +}); + + +// Examples from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#writing-your-first-babel-plugin + +const v1: Visitor = { + + BinaryExpression(path) { + if (t.isIdentifier(path.node.left)) { + // ... + } + path.replaceWith( + t.binaryExpression("**", path.node.left, t.numericLiteral(2)) + ); + path.parentPath.replaceWith( + t.expressionStatement(t.stringLiteral("Anyway the wind blows, doesn't really matter to me, to me.")) + ); + path.parentPath.remove(); + }, + + Identifier(path) { + if (path.isReferencedIdentifier()) { + // ... + } + if (t.isReferenced(path.node, path.parent)) { + // ... + } + }, + + ReturnStatement(path) { + path.replaceWithMultiple([ + t.expressionStatement(t.stringLiteral("Is this the real life?")), + t.expressionStatement(t.stringLiteral("Is this just fantasy?")), + t.expressionStatement(t.stringLiteral("(Enjoy singing the rest of the song in your head)")), + ]); + }, + + FunctionDeclaration(path, state) { + path.replaceWithSourceString(`function add(a, b) { + return a + b; + }`); + + path.insertBefore(t.expressionStatement(t.stringLiteral("Because I'm easy come, easy go."))); + path.insertAfter(t.expressionStatement(t.stringLiteral("A little high, little low."))); + path.remove(); + + if (path.scope.hasBinding("n")) { + // ... + } + if (path.scope.hasOwnBinding("n")) { + // ... + } + + let id1 = path.scope.generateUidIdentifier("uid"); + id1.type; + id1.name; + let id2 = path.scope.generateUidIdentifier("uid"); + id2.type; + id2.name; + + const id = path.scope.generateUidIdentifierBasedOnNode(path.node.id); + path.remove(); + path.scope.parent.push({ id, init: path.node }); + + path.scope.rename("n", "x"); + path.scope.rename("n"); + } +}; diff --git a/babel-traverse/babel-traverse.d.ts b/babel-traverse/babel-traverse.d.ts new file mode 100644 index 0000000000..17cbda2f23 --- /dev/null +++ b/babel-traverse/babel-traverse.d.ts @@ -0,0 +1,966 @@ +// Type definitions for babel-traverse v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "babel-traverse" { + import * as t from 'babel-types'; + type Node = t.Node; + + export default function traverse(parent: Node | Node[], opts?: TraverseOptions, scope?: Scope, state?: any, parentPath?: NodePath): void; + + export interface TraverseOptions extends Visitor { + scope?: Scope; + noScope?: boolean; + } + + export class Scope { + constructor(path: NodePath, parentScope?: Scope); + path: NodePath; + block: Node; + parentBlock: Node; + parent: Scope; + hub: Hub; + bindings: { [name: string]: Binding; }; + + /** Traverse node with current scope and path. */ + traverse(node: Node | Node[], opts?: TraverseOptions, state?: any): void; + + /** Generate a unique identifier and add it to the current scope. */ + generateDeclaredUidIdentifier(name?: string): t.Identifier; + + /** Generate a unique identifier. */ + generateUidIdentifier(name?: string): t.Identifier; + + /** Generate a unique `_id1` binding. */ + generateUid(name?: string): string; + + /** Generate a unique identifier based on a node. */ + generateUidIdentifierBasedOnNode(parent: Node, defaultName?: string): t.Identifier; + + /** + * Determine whether evaluating the specific input `node` is a consequenceless reference. ie. + * evaluating it wont result in potentially arbitrary code from being ran. The following are + * whitelisted and determined not to cause side effects: + * + * - `this` expressions + * - `super` expressions + * - Bound identifiers + */ + isStatic(node: Node): boolean; + + /** Possibly generate a memoised identifier if it is not static and has consequences. */ + maybeGenerateMemoised(node: Node, dontPush?: boolean): t.Identifier; + + checkBlockScopedCollisions(local: Node, kind: string, name: string, id: Object): void; + + rename(oldName: string, newName?: string, block?: Node): void; + + dump(): void; + + toArray(node: Node, i?: number): Node; + + registerDeclaration(path: NodePath): void; + + buildUndefinedNode(): Node; + + registerConstantViolation(path: NodePath): void; + + registerBinding(kind: string, path: NodePath, bindingPath?: NodePath): void; + + addGlobal(node: Node): void; + + hasUid(name: string): boolean; + + hasGlobal(name: string): boolean; + + hasReference(name: string): boolean; + + isPure(node: Node, constantsOnly?: boolean): boolean; + + setData(key: string, val: any): any; + + getData(key: string): any; + + removeData(key: string): void; + + push(opts: any): void; + + getProgramParent(): Scope; + + getFunctionParent(): Scope; + + getBlockParent(): Scope; + + /** Walks the scope tree and gathers **all** bindings. */ + getAllBindings(...kinds: string[]): Object; + + bindingIdentifierEquals(name: string, node: Node): boolean; + + getBinding(name: string): Binding; + + getOwnBinding(name: string): Binding; + + getBindingIdentifier(name: string): t.Identifier; + + getOwnBindingIdentifier(name: string): t.Identifier; + + hasOwnBinding(name: string): boolean; + + hasBinding(name: string, noGlobals?: boolean): boolean; + + parentHasBinding(name: string, noGlobals?: boolean): boolean; + + /** Move a binding of `name` to another `scope`. */ + moveBindingTo(name: string, scope: Scope): void; + + removeOwnBinding(name: string): void; + + removeBinding(name: string): void; + } + + export class Binding { + constructor(opts: { existing: Binding; identifier: t.Identifier; scope: Scope; path: NodePath; kind: 'var' | 'let' | 'const'; }); + identifier: t.Identifier; + scope: Scope; + path: NodePath; + kind: 'var' | 'let' | 'const'; + referenced: boolean; + references: number; + referencePaths: NodePath[]; + constant: boolean; + constantViolations: NodePath[]; + } + + export interface Visitor extends VisitNodeObject { + ArrayExpression?: VisitNode; + AssignmentExpression?: VisitNode; + LVal?: VisitNode; + Expression?: VisitNode; + BinaryExpression?: VisitNode; + Directive?: VisitNode; + DirectiveLiteral?: VisitNode; + BlockStatement?: VisitNode; + BreakStatement?: VisitNode; + Identifier?: VisitNode; + CallExpression?: VisitNode; + CatchClause?: VisitNode; + ConditionalExpression?: VisitNode; + ContinueStatement?: VisitNode; + DebuggerStatement?: VisitNode; + DoWhileStatement?: VisitNode; + Statement?: VisitNode; + EmptyStatement?: VisitNode; + ExpressionStatement?: VisitNode; + File?: VisitNode; + Program?: VisitNode; + ForInStatement?: VisitNode; + VariableDeclaration?: VisitNode; + ForStatement?: VisitNode; + FunctionDeclaration?: VisitNode; + FunctionExpression?: VisitNode; + IfStatement?: VisitNode; + LabeledStatement?: VisitNode; + StringLiteral?: VisitNode; + NumericLiteral?: VisitNode; + NullLiteral?: VisitNode; + BooleanLiteral?: VisitNode; + RegExpLiteral?: VisitNode; + LogicalExpression?: VisitNode; + MemberExpression?: VisitNode; + NewExpression?: VisitNode; + ObjectExpression?: VisitNode; + ObjectMethod?: VisitNode; + ObjectProperty?: VisitNode; + RestElement?: VisitNode; + ReturnStatement?: VisitNode; + SequenceExpression?: VisitNode; + SwitchCase?: VisitNode; + SwitchStatement?: VisitNode; + ThisExpression?: VisitNode; + ThrowStatement?: VisitNode; + TryStatement?: VisitNode; + UnaryExpression?: VisitNode; + UpdateExpression?: VisitNode; + VariableDeclarator?: VisitNode; + WhileStatement?: VisitNode; + WithStatement?: VisitNode; + AssignmentPattern?: VisitNode; + ArrayPattern?: VisitNode; + ArrowFunctionExpression?: VisitNode; + ClassBody?: VisitNode; + ClassDeclaration?: VisitNode; + ClassExpression?: VisitNode; + ExportAllDeclaration?: VisitNode; + ExportDefaultDeclaration?: VisitNode; + ExportNamedDeclaration?: VisitNode; + Declaration?: VisitNode; + ExportSpecifier?: VisitNode; + ForOfStatement?: VisitNode; + ImportDeclaration?: VisitNode; + ImportDefaultSpecifier?: VisitNode; + ImportNamespaceSpecifier?: VisitNode; + ImportSpecifier?: VisitNode; + MetaProperty?: VisitNode; + ClassMethod?: VisitNode; + ObjectPattern?: VisitNode; + SpreadElement?: VisitNode; + Super?: VisitNode; + TaggedTemplateExpression?: VisitNode; + TemplateLiteral?: VisitNode; + TemplateElement?: VisitNode; + YieldExpression?: VisitNode; + AnyTypeAnnotation?: VisitNode; + ArrayTypeAnnotation?: VisitNode; + BooleanTypeAnnotation?: VisitNode; + BooleanLiteralTypeAnnotation?: VisitNode; + NullLiteralTypeAnnotation?: VisitNode; + ClassImplements?: VisitNode; + ClassProperty?: VisitNode; + DeclareClass?: VisitNode; + DeclareFunction?: VisitNode; + DeclareInterface?: VisitNode; + DeclareModule?: VisitNode; + DeclareTypeAlias?: VisitNode; + DeclareVariable?: VisitNode; + ExistentialTypeParam?: VisitNode; + FunctionTypeAnnotation?: VisitNode; + FunctionTypeParam?: VisitNode; + GenericTypeAnnotation?: VisitNode; + InterfaceExtends?: VisitNode; + InterfaceDeclaration?: VisitNode; + IntersectionTypeAnnotation?: VisitNode; + MixedTypeAnnotation?: VisitNode; + NullableTypeAnnotation?: VisitNode; + NumericLiteralTypeAnnotation?: VisitNode; + NumberTypeAnnotation?: VisitNode; + StringLiteralTypeAnnotation?: VisitNode; + StringTypeAnnotation?: VisitNode; + ThisTypeAnnotation?: VisitNode; + TupleTypeAnnotation?: VisitNode; + TypeofTypeAnnotation?: VisitNode; + TypeAlias?: VisitNode; + TypeAnnotation?: VisitNode; + TypeCastExpression?: VisitNode; + TypeParameterDeclaration?: VisitNode; + TypeParameterInstantiation?: VisitNode; + ObjectTypeAnnotation?: VisitNode; + ObjectTypeCallProperty?: VisitNode; + ObjectTypeIndexer?: VisitNode; + ObjectTypeProperty?: VisitNode; + QualifiedTypeIdentifier?: VisitNode; + UnionTypeAnnotation?: VisitNode; + VoidTypeAnnotation?: VisitNode; + JSXAttribute?: VisitNode; + JSXIdentifier?: VisitNode; + JSXNamespacedName?: VisitNode; + JSXElement?: VisitNode; + JSXExpressionContainer?: VisitNode; + JSXClosingElement?: VisitNode; + JSXMemberExpression?: VisitNode; + JSXOpeningElement?: VisitNode; + JSXEmptyExpression?: VisitNode; + JSXSpreadAttribute?: VisitNode; + JSXText?: VisitNode; + Noop?: VisitNode; + ParenthesizedExpression?: VisitNode; + AwaitExpression?: VisitNode; + BindExpression?: VisitNode; + Decorator?: VisitNode; + DoExpression?: VisitNode; + ExportDefaultSpecifier?: VisitNode; + ExportNamespaceSpecifier?: VisitNode; + RestProperty?: VisitNode; + SpreadProperty?: VisitNode; + Binary?: VisitNode; + Scopable?: VisitNode; + BlockParent?: VisitNode; + Block?: VisitNode; + Terminatorless?: VisitNode; + CompletionStatement?: VisitNode; + Conditional?: VisitNode; + Loop?: VisitNode; + While?: VisitNode; + ExpressionWrapper?: VisitNode; + For?: VisitNode; + ForXStatement?: VisitNode; + Function?: VisitNode; + FunctionParent?: VisitNode; + Pureish?: VisitNode; + Literal?: VisitNode; + Immutable?: VisitNode; + UserWhitespacable?: VisitNode; + Method?: VisitNode; + ObjectMember?: VisitNode; + Property?: VisitNode; + UnaryLike?: VisitNode; + Pattern?: VisitNode; + Class?: VisitNode; + ModuleDeclaration?: VisitNode; + ExportDeclaration?: VisitNode; + ModuleSpecifier?: VisitNode; + Flow?: VisitNode; + FlowBaseAnnotation?: VisitNode; + FlowDeclaration?: VisitNode; + JSX?: VisitNode; + } + + export type VisitNode = VisitNodeFunction | VisitNodeObject; + + export type VisitNodeFunction = (path: NodePath, state: any) => void; + + export interface VisitNodeObject { + enter?(path: NodePath, state: any): void; + exit?(path: NodePath, state: any): void; + } + + export class NodePath { + constructor(hub: Hub, parent: Node); + parent: Node; + hub: Hub; + contexts: TraversalContext[]; + data: Object; + shouldSkip: boolean; + shouldStop: boolean; + removed: boolean; + state: any; + opts: Object; + skipKeys: Object; + parentPath: NodePath; + context: TraversalContext; + container: Object | Object[]; + listKey: string; + inList: boolean; + parentKey: string; + key: string; + node: T; + scope: Scope; + type: string; + typeAnnotation: Object; + + getScope(scope: Scope): Scope; + + setData(key: string, val: any): any; + + getData(key: string, def?: any): any; + + buildCodeFrameError(msg: string, Error: Error): Error; + + traverse(visitor: Visitor, state?: any): void; + + set(key: string, node: Node): void; + + getPathLocation(): string; + + debug(buildMessage: Function): void; + + // ------------------------- ancestry ------------------------- + /** + * Call the provided `callback` with the `NodePath`s of all the parents. + * When the `callback` returns a truthy value, we return that node path. + */ + findParent(callback: (path: NodePath) => boolean): NodePath; + + find(callback: (path: NodePath) => boolean): NodePath; + + /** Get the parent function of the current path. */ + getFunctionParent(): NodePath; + + /** Walk up the tree until we hit a parent node path in a list. */ + getStatementParent(): NodePath; + + /** + * Get the deepest common ancestor and then from it, get the earliest relationship path + * to that ancestor. + * + * Earliest is defined as being "before" all the other nodes in terms of list container + * position and visiting key. + */ + getEarliestCommonAncestorFrom(paths: NodePath[]): NodePath; + + /** Get the earliest path in the tree where the provided `paths` intersect. */ + getDeepestCommonAncestorFrom(paths: NodePath[], filter?: Function): NodePath; + + /** + * Build an array of node paths containing the entire ancestry of the current node path. + * + * NOTE: The current node path is included in this. + */ + getAncestry(): NodePath[]; + + inType(...candidateTypes: string[]): boolean; + + // ------------------------- inference ------------------------- + /** Infer the type of the current `NodePath`. */ + getTypeAnnotation(): t.FlowTypeAnnotation; + + isBaseType(baseName: string, soft?: boolean): boolean; + + couldBeBaseType(name: string): boolean; + + baseTypeStrictlyMatches(right: NodePath): boolean; + + isGenericType(genericName: string): boolean; + + // ------------------------- replacement ------------------------- + /** + * Replace a node with an array of multiple. This method performs the following steps: + * + * - Inherit the comments of first provided node with that of the current node. + * - Insert the provided nodes after the current node. + * - Remove the current node. + */ + replaceWithMultiple(nodes: Node[]): void; + + /** + * Parse a string as an expression and replace the current node with the result. + * + * NOTE: This is typically not a good idea to use. Building source strings when + * transforming ASTs is an antipattern and SHOULD NOT be encouraged. Even if it's + * easier to use, your transforms will be extremely brittle. + */ + replaceWithSourceString(replacement: any): void; + + /** Replace the current node with another. */ + replaceWith(replacement: Node | NodePath): void; + + /** + * This method takes an array of statements nodes and then explodes it + * into expressions. This method retains completion records which is + * extremely important to retain original semantics. + */ + replaceExpressionWithStatements(nodes: Node[]): Node; + + replaceInline(nodes: Node | Node[]): void; + + // ------------------------- evaluation ------------------------- + /** + * Walk the input `node` and statically evaluate if it's truthy. + * + * Returning `true` when we're sure that the expression will evaluate to a + * truthy value, `false` if we're sure that it will evaluate to a falsy + * value and `undefined` if we aren't sure. Because of this please do not + * rely on coercion when using this method and check with === if it's false. + */ + evaluateTruthy(): boolean; + + /** + * Walk the input `node` and statically evaluate it. + * + * Returns an object in the form `{ confident, value }`. `confident` indicates + * whether or not we had to drop out of evaluating the expression because of + * hitting an unknown node that we couldn't confidently find the value of. + * + * Example: + * + * t.evaluate(parse("5 + 5")) // { confident: true, value: 10 } + * t.evaluate(parse("!true")) // { confident: true, value: false } + * t.evaluate(parse("foo + foo")) // { confident: false, value: undefined } + */ + evaluate(): { confident: boolean; value: any }; + + // ------------------------- introspection ------------------------- + /** + * Match the current node if it matches the provided `pattern`. + * + * For example, given the match `React.createClass` it would match the + * parsed nodes of `React.createClass` and `React["createClass"]`. + */ + matchesPattern(pattern: string, allowPartial?: boolean): boolean; + + /** + * Check whether we have the input `key`. If the `key` references an array then we check + * if the array has any items, otherwise we just check if it's falsy. + */ + has(key: string): boolean; + + isStatic(): boolean; + + /** Alias of `has`. */ + is(key: string): boolean; + + /** Opposite of `has`. */ + isnt(key: string): boolean; + + /** Check whether the path node `key` strict equals `value`. */ + equals(key: string, value: any): boolean; + + /** + * Check the type against our stored internal type of the node. This is handy when a node has + * been removed yet we still internally know the type and need it to calculate node replacement. + */ + isNodeType(type: string): boolean; + + /** + * This checks whether or not we're in one of the following positions: + * + * for (KEY in right); + * for (KEY;;); + * + * This is because these spots allow VariableDeclarations AND normal expressions so we need + * to tell the path replacement that it's ok to replace this with an expression. + */ + canHaveVariableDeclarationOrExpression(): boolean; + + /** + * This checks whether we are swapping an arrow function's body between an + * expression and a block statement (or vice versa). + * + * This is because arrow functions may implicitly return an expression, which + * is the same as containing a block statement. + */ + canSwapBetweenExpressionAndStatement(replacement: Node): boolean; + + /** Check whether the current path references a completion record */ + isCompletionRecord(allowInsideFunction?: boolean): boolean; + + /** + * Check whether or not the current `key` allows either a single statement or block statement + * so we can explode it if necessary. + */ + isStatementOrBlock(): boolean; + + /** Check if the currently assigned path references the `importName` of `moduleSource`. */ + referencesImport(moduleSource: string, importName: string): boolean; + + /** Get the source code associated with this node. */ + getSource(): string; + + // ------------------------- context ------------------------- + call(key: string): boolean; + + isBlacklisted(): boolean; + + visit(): boolean; + + skip(): void; + + skipKey(key: string): void; + + stop(): void; + + setScope(): void; + + setContext(context: TraversalContext): NodePath; + + popContext(): void; + + pushContext(context: TraversalContext): void; + + // ------------------------- removal ------------------------- + remove(): void; + + // ------------------------- modification ------------------------- + /** Insert the provided nodes before the current one. */ + insertBefore(nodes: Node | Node[]): any; + + /** + * Insert the provided nodes after the current one. When inserting nodes after an + * expression, ensure that the completion record is correct by pushing the current node. + */ + insertAfter(nodes: Node | Node[]): any; + + /** Update all sibling node paths after `fromIndex` by `incrementBy`. */ + updateSiblingKeys(fromIndex: number, incrementBy: number): void; + + /** Hoist the current node to the highest scope possible and return a UID referencing it. */ + hoist(scope: Scope): void; + + // ------------------------- family ------------------------- + getStatementParent(): NodePath; + + getOpposite(): NodePath; + + getCompletionRecords(): NodePath[]; + + getSibling(key: string): NodePath; + + get(key: string, context?: boolean | TraversalContext): NodePath; + + getBindingIdentifiers(duplicates?: boolean): Node[]; + + getOuterBindingIdentifiers(duplicates?: boolean): Node[]; + + // ------------------------- comments ------------------------- + /** Share comments amongst siblings. */ + shareCommentsWithSiblings(): void; + + addComment(type: string, content: string, line?: boolean): void; + + /** Give node `comments` of the specified `type`. */ + addComments(type: string, comments: any[]): void; + + // ------------------------- isXXX ------------------------- + isArrayExpression(opts?: Object): boolean; + isAssignmentExpression(opts?: Object): boolean; + isBinaryExpression(opts?: Object): boolean; + isDirective(opts?: Object): boolean; + isDirectiveLiteral(opts?: Object): boolean; + isBlockStatement(opts?: Object): boolean; + isBreakStatement(opts?: Object): boolean; + isCallExpression(opts?: Object): boolean; + isCatchClause(opts?: Object): boolean; + isConditionalExpression(opts?: Object): boolean; + isContinueStatement(opts?: Object): boolean; + isDebuggerStatement(opts?: Object): boolean; + isDoWhileStatement(opts?: Object): boolean; + isEmptyStatement(opts?: Object): boolean; + isExpressionStatement(opts?: Object): boolean; + isFile(opts?: Object): boolean; + isForInStatement(opts?: Object): boolean; + isForStatement(opts?: Object): boolean; + isFunctionDeclaration(opts?: Object): boolean; + isFunctionExpression(opts?: Object): boolean; + isIdentifier(opts?: Object): boolean; + isIfStatement(opts?: Object): boolean; + isLabeledStatement(opts?: Object): boolean; + isStringLiteral(opts?: Object): boolean; + isNumericLiteral(opts?: Object): boolean; + isNullLiteral(opts?: Object): boolean; + isBooleanLiteral(opts?: Object): boolean; + isRegExpLiteral(opts?: Object): boolean; + isLogicalExpression(opts?: Object): boolean; + isMemberExpression(opts?: Object): boolean; + isNewExpression(opts?: Object): boolean; + isProgram(opts?: Object): boolean; + isObjectExpression(opts?: Object): boolean; + isObjectMethod(opts?: Object): boolean; + isObjectProperty(opts?: Object): boolean; + isRestElement(opts?: Object): boolean; + isReturnStatement(opts?: Object): boolean; + isSequenceExpression(opts?: Object): boolean; + isSwitchCase(opts?: Object): boolean; + isSwitchStatement(opts?: Object): boolean; + isThisExpression(opts?: Object): boolean; + isThrowStatement(opts?: Object): boolean; + isTryStatement(opts?: Object): boolean; + isUnaryExpression(opts?: Object): boolean; + isUpdateExpression(opts?: Object): boolean; + isVariableDeclaration(opts?: Object): boolean; + isVariableDeclarator(opts?: Object): boolean; + isWhileStatement(opts?: Object): boolean; + isWithStatement(opts?: Object): boolean; + isAssignmentPattern(opts?: Object): boolean; + isArrayPattern(opts?: Object): boolean; + isArrowFunctionExpression(opts?: Object): boolean; + isClassBody(opts?: Object): boolean; + isClassDeclaration(opts?: Object): boolean; + isClassExpression(opts?: Object): boolean; + isExportAllDeclaration(opts?: Object): boolean; + isExportDefaultDeclaration(opts?: Object): boolean; + isExportNamedDeclaration(opts?: Object): boolean; + isExportSpecifier(opts?: Object): boolean; + isForOfStatement(opts?: Object): boolean; + isImportDeclaration(opts?: Object): boolean; + isImportDefaultSpecifier(opts?: Object): boolean; + isImportNamespaceSpecifier(opts?: Object): boolean; + isImportSpecifier(opts?: Object): boolean; + isMetaProperty(opts?: Object): boolean; + isClassMethod(opts?: Object): boolean; + isObjectPattern(opts?: Object): boolean; + isSpreadElement(opts?: Object): boolean; + isSuper(opts?: Object): boolean; + isTaggedTemplateExpression(opts?: Object): boolean; + isTemplateElement(opts?: Object): boolean; + isTemplateLiteral(opts?: Object): boolean; + isYieldExpression(opts?: Object): boolean; + isAnyTypeAnnotation(opts?: Object): boolean; + isArrayTypeAnnotation(opts?: Object): boolean; + isBooleanTypeAnnotation(opts?: Object): boolean; + isBooleanLiteralTypeAnnotation(opts?: Object): boolean; + isNullLiteralTypeAnnotation(opts?: Object): boolean; + isClassImplements(opts?: Object): boolean; + isClassProperty(opts?: Object): boolean; + isDeclareClass(opts?: Object): boolean; + isDeclareFunction(opts?: Object): boolean; + isDeclareInterface(opts?: Object): boolean; + isDeclareModule(opts?: Object): boolean; + isDeclareTypeAlias(opts?: Object): boolean; + isDeclareVariable(opts?: Object): boolean; + isExistentialTypeParam(opts?: Object): boolean; + isFunctionTypeAnnotation(opts?: Object): boolean; + isFunctionTypeParam(opts?: Object): boolean; + isGenericTypeAnnotation(opts?: Object): boolean; + isInterfaceExtends(opts?: Object): boolean; + isInterfaceDeclaration(opts?: Object): boolean; + isIntersectionTypeAnnotation(opts?: Object): boolean; + isMixedTypeAnnotation(opts?: Object): boolean; + isNullableTypeAnnotation(opts?: Object): boolean; + isNumericLiteralTypeAnnotation(opts?: Object): boolean; + isNumberTypeAnnotation(opts?: Object): boolean; + isStringLiteralTypeAnnotation(opts?: Object): boolean; + isStringTypeAnnotation(opts?: Object): boolean; + isThisTypeAnnotation(opts?: Object): boolean; + isTupleTypeAnnotation(opts?: Object): boolean; + isTypeofTypeAnnotation(opts?: Object): boolean; + isTypeAlias(opts?: Object): boolean; + isTypeAnnotation(opts?: Object): boolean; + isTypeCastExpression(opts?: Object): boolean; + isTypeParameterDeclaration(opts?: Object): boolean; + isTypeParameterInstantiation(opts?: Object): boolean; + isObjectTypeAnnotation(opts?: Object): boolean; + isObjectTypeCallProperty(opts?: Object): boolean; + isObjectTypeIndexer(opts?: Object): boolean; + isObjectTypeProperty(opts?: Object): boolean; + isQualifiedTypeIdentifier(opts?: Object): boolean; + isUnionTypeAnnotation(opts?: Object): boolean; + isVoidTypeAnnotation(opts?: Object): boolean; + isJSXAttribute(opts?: Object): boolean; + isJSXClosingElement(opts?: Object): boolean; + isJSXElement(opts?: Object): boolean; + isJSXEmptyExpression(opts?: Object): boolean; + isJSXExpressionContainer(opts?: Object): boolean; + isJSXIdentifier(opts?: Object): boolean; + isJSXMemberExpression(opts?: Object): boolean; + isJSXNamespacedName(opts?: Object): boolean; + isJSXOpeningElement(opts?: Object): boolean; + isJSXSpreadAttribute(opts?: Object): boolean; + isJSXText(opts?: Object): boolean; + isNoop(opts?: Object): boolean; + isParenthesizedExpression(opts?: Object): boolean; + isAwaitExpression(opts?: Object): boolean; + isBindExpression(opts?: Object): boolean; + isDecorator(opts?: Object): boolean; + isDoExpression(opts?: Object): boolean; + isExportDefaultSpecifier(opts?: Object): boolean; + isExportNamespaceSpecifier(opts?: Object): boolean; + isRestProperty(opts?: Object): boolean; + isSpreadProperty(opts?: Object): boolean; + isExpression(opts?: Object): boolean; + isBinary(opts?: Object): boolean; + isScopable(opts?: Object): boolean; + isBlockParent(opts?: Object): boolean; + isBlock(opts?: Object): boolean; + isStatement(opts?: Object): boolean; + isTerminatorless(opts?: Object): boolean; + isCompletionStatement(opts?: Object): boolean; + isConditional(opts?: Object): boolean; + isLoop(opts?: Object): boolean; + isWhile(opts?: Object): boolean; + isExpressionWrapper(opts?: Object): boolean; + isFor(opts?: Object): boolean; + isForXStatement(opts?: Object): boolean; + isFunction(opts?: Object): boolean; + isFunctionParent(opts?: Object): boolean; + isPureish(opts?: Object): boolean; + isDeclaration(opts?: Object): boolean; + isLVal(opts?: Object): boolean; + isLiteral(opts?: Object): boolean; + isImmutable(opts?: Object): boolean; + isUserWhitespacable(opts?: Object): boolean; + isMethod(opts?: Object): boolean; + isObjectMember(opts?: Object): boolean; + isProperty(opts?: Object): boolean; + isUnaryLike(opts?: Object): boolean; + isPattern(opts?: Object): boolean; + isClass(opts?: Object): boolean; + isModuleDeclaration(opts?: Object): boolean; + isExportDeclaration(opts?: Object): boolean; + isModuleSpecifier(opts?: Object): boolean; + isFlow(opts?: Object): boolean; + isFlowBaseAnnotation(opts?: Object): boolean; + isFlowDeclaration(opts?: Object): boolean; + isJSX(opts?: Object): boolean; + isNumberLiteral(opts?: Object): boolean; + isRegexLiteral(opts?: Object): boolean; + isReferencedIdentifier(opts?: Object): boolean; + isReferencedMemberExpression(opts?: Object): boolean; + isBindingIdentifier(opts?: Object): boolean; + isScope(opts?: Object): boolean; + isReferenced(opts?: Object): boolean; + isBlockScoped(opts?: Object): boolean; + isVar(opts?: Object): boolean; + isUser(opts?: Object): boolean; + isGenerated(opts?: Object): boolean; + isPure(opts?: Object): boolean; + + // ------------------------- assertXXX ------------------------- + assertArrayExpression(opts?: Object): void; + assertAssignmentExpression(opts?: Object): void; + assertBinaryExpression(opts?: Object): void; + assertDirective(opts?: Object): void; + assertDirectiveLiteral(opts?: Object): void; + assertBlockStatement(opts?: Object): void; + assertBreakStatement(opts?: Object): void; + assertCallExpression(opts?: Object): void; + assertCatchClause(opts?: Object): void; + assertConditionalExpression(opts?: Object): void; + assertContinueStatement(opts?: Object): void; + assertDebuggerStatement(opts?: Object): void; + assertDoWhileStatement(opts?: Object): void; + assertEmptyStatement(opts?: Object): void; + assertExpressionStatement(opts?: Object): void; + assertFile(opts?: Object): void; + assertForInStatement(opts?: Object): void; + assertForStatement(opts?: Object): void; + assertFunctionDeclaration(opts?: Object): void; + assertFunctionExpression(opts?: Object): void; + assertIdentifier(opts?: Object): void; + assertIfStatement(opts?: Object): void; + assertLabeledStatement(opts?: Object): void; + assertStringLiteral(opts?: Object): void; + assertNumericLiteral(opts?: Object): void; + assertNullLiteral(opts?: Object): void; + assertBooleanLiteral(opts?: Object): void; + assertRegExpLiteral(opts?: Object): void; + assertLogicalExpression(opts?: Object): void; + assertMemberExpression(opts?: Object): void; + assertNewExpression(opts?: Object): void; + assertProgram(opts?: Object): void; + assertObjectExpression(opts?: Object): void; + assertObjectMethod(opts?: Object): void; + assertObjectProperty(opts?: Object): void; + assertRestElement(opts?: Object): void; + assertReturnStatement(opts?: Object): void; + assertSequenceExpression(opts?: Object): void; + assertSwitchCase(opts?: Object): void; + assertSwitchStatement(opts?: Object): void; + assertThisExpression(opts?: Object): void; + assertThrowStatement(opts?: Object): void; + assertTryStatement(opts?: Object): void; + assertUnaryExpression(opts?: Object): void; + assertUpdateExpression(opts?: Object): void; + assertVariableDeclaration(opts?: Object): void; + assertVariableDeclarator(opts?: Object): void; + assertWhileStatement(opts?: Object): void; + assertWithStatement(opts?: Object): void; + assertAssignmentPattern(opts?: Object): void; + assertArrayPattern(opts?: Object): void; + assertArrowFunctionExpression(opts?: Object): void; + assertClassBody(opts?: Object): void; + assertClassDeclaration(opts?: Object): void; + assertClassExpression(opts?: Object): void; + assertExportAllDeclaration(opts?: Object): void; + assertExportDefaultDeclaration(opts?: Object): void; + assertExportNamedDeclaration(opts?: Object): void; + assertExportSpecifier(opts?: Object): void; + assertForOfStatement(opts?: Object): void; + assertImportDeclaration(opts?: Object): void; + assertImportDefaultSpecifier(opts?: Object): void; + assertImportNamespaceSpecifier(opts?: Object): void; + assertImportSpecifier(opts?: Object): void; + assertMetaProperty(opts?: Object): void; + assertClassMethod(opts?: Object): void; + assertObjectPattern(opts?: Object): void; + assertSpreadElement(opts?: Object): void; + assertSuper(opts?: Object): void; + assertTaggedTemplateExpression(opts?: Object): void; + assertTemplateElement(opts?: Object): void; + assertTemplateLiteral(opts?: Object): void; + assertYieldExpression(opts?: Object): void; + assertAnyTypeAnnotation(opts?: Object): void; + assertArrayTypeAnnotation(opts?: Object): void; + assertBooleanTypeAnnotation(opts?: Object): void; + assertBooleanLiteralTypeAnnotation(opts?: Object): void; + assertNullLiteralTypeAnnotation(opts?: Object): void; + assertClassImplements(opts?: Object): void; + assertClassProperty(opts?: Object): void; + assertDeclareClass(opts?: Object): void; + assertDeclareFunction(opts?: Object): void; + assertDeclareInterface(opts?: Object): void; + assertDeclareModule(opts?: Object): void; + assertDeclareTypeAlias(opts?: Object): void; + assertDeclareVariable(opts?: Object): void; + assertExistentialTypeParam(opts?: Object): void; + assertFunctionTypeAnnotation(opts?: Object): void; + assertFunctionTypeParam(opts?: Object): void; + assertGenericTypeAnnotation(opts?: Object): void; + assertInterfaceExtends(opts?: Object): void; + assertInterfaceDeclaration(opts?: Object): void; + assertIntersectionTypeAnnotation(opts?: Object): void; + assertMixedTypeAnnotation(opts?: Object): void; + assertNullableTypeAnnotation(opts?: Object): void; + assertNumericLiteralTypeAnnotation(opts?: Object): void; + assertNumberTypeAnnotation(opts?: Object): void; + assertStringLiteralTypeAnnotation(opts?: Object): void; + assertStringTypeAnnotation(opts?: Object): void; + assertThisTypeAnnotation(opts?: Object): void; + assertTupleTypeAnnotation(opts?: Object): void; + assertTypeofTypeAnnotation(opts?: Object): void; + assertTypeAlias(opts?: Object): void; + assertTypeAnnotation(opts?: Object): void; + assertTypeCastExpression(opts?: Object): void; + assertTypeParameterDeclaration(opts?: Object): void; + assertTypeParameterInstantiation(opts?: Object): void; + assertObjectTypeAnnotation(opts?: Object): void; + assertObjectTypeCallProperty(opts?: Object): void; + assertObjectTypeIndexer(opts?: Object): void; + assertObjectTypeProperty(opts?: Object): void; + assertQualifiedTypeIdentifier(opts?: Object): void; + assertUnionTypeAnnotation(opts?: Object): void; + assertVoidTypeAnnotation(opts?: Object): void; + assertJSXAttribute(opts?: Object): void; + assertJSXClosingElement(opts?: Object): void; + assertJSXElement(opts?: Object): void; + assertJSXEmptyExpression(opts?: Object): void; + assertJSXExpressionContainer(opts?: Object): void; + assertJSXIdentifier(opts?: Object): void; + assertJSXMemberExpression(opts?: Object): void; + assertJSXNamespacedName(opts?: Object): void; + assertJSXOpeningElement(opts?: Object): void; + assertJSXSpreadAttribute(opts?: Object): void; + assertJSXText(opts?: Object): void; + assertNoop(opts?: Object): void; + assertParenthesizedExpression(opts?: Object): void; + assertAwaitExpression(opts?: Object): void; + assertBindExpression(opts?: Object): void; + assertDecorator(opts?: Object): void; + assertDoExpression(opts?: Object): void; + assertExportDefaultSpecifier(opts?: Object): void; + assertExportNamespaceSpecifier(opts?: Object): void; + assertRestProperty(opts?: Object): void; + assertSpreadProperty(opts?: Object): void; + assertExpression(opts?: Object): void; + assertBinary(opts?: Object): void; + assertScopable(opts?: Object): void; + assertBlockParent(opts?: Object): void; + assertBlock(opts?: Object): void; + assertStatement(opts?: Object): void; + assertTerminatorless(opts?: Object): void; + assertCompletionStatement(opts?: Object): void; + assertConditional(opts?: Object): void; + assertLoop(opts?: Object): void; + assertWhile(opts?: Object): void; + assertExpressionWrapper(opts?: Object): void; + assertFor(opts?: Object): void; + assertForXStatement(opts?: Object): void; + assertFunction(opts?: Object): void; + assertFunctionParent(opts?: Object): void; + assertPureish(opts?: Object): void; + assertDeclaration(opts?: Object): void; + assertLVal(opts?: Object): void; + assertLiteral(opts?: Object): void; + assertImmutable(opts?: Object): void; + assertUserWhitespacable(opts?: Object): void; + assertMethod(opts?: Object): void; + assertObjectMember(opts?: Object): void; + assertProperty(opts?: Object): void; + assertUnaryLike(opts?: Object): void; + assertPattern(opts?: Object): void; + assertClass(opts?: Object): void; + assertModuleDeclaration(opts?: Object): void; + assertExportDeclaration(opts?: Object): void; + assertModuleSpecifier(opts?: Object): void; + assertFlow(opts?: Object): void; + assertFlowBaseAnnotation(opts?: Object): void; + assertFlowDeclaration(opts?: Object): void; + assertJSX(opts?: Object): void; + assertNumberLiteral(opts?: Object): void; + assertRegexLiteral(opts?: Object): void; + } + + export class Hub { + constructor(file: any, options: any); + file: any; + options: any; + } + + interface TraversalContext { + parentPath: NodePath; + scope: Scope; + state: any; + opts: any; + } +} diff --git a/babel-types/babel-types-tests.ts b/babel-types/babel-types-tests.ts new file mode 100644 index 0000000000..2a8a25a961 --- /dev/null +++ b/babel-types/babel-types-tests.ts @@ -0,0 +1,26 @@ +/// +/// + + +// Examples from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babel-types +import traverse from "babel-traverse"; +import * as t from "babel-types"; + +let ast: t.Node; + +traverse(ast, { + enter(path) { + let node = path.node; + if (t.isIdentifier(node, { name: "n" })) { + node.name = "x"; + } + } +}); + +if (t.isBinaryExpression(ast)) { + ast.left; + ast.right; + ast.operator; +} +t.assertBinaryExpression(ast); +t.assertBinaryExpression(ast, { operator: "*" }); diff --git a/babel-types/babel-types.d.ts b/babel-types/babel-types.d.ts new file mode 100644 index 0000000000..d10302370a --- /dev/null +++ b/babel-types/babel-types.d.ts @@ -0,0 +1,1403 @@ +// Type definitions for babel-types v6.7 +// Project: https://github.com/babel/babel/tree/master/packages/babel-types +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "babel-types" { + + export interface Comment { + value: string; + start: number; + end: number; + loc: SourceLocation; + } + + export interface CommentBlock extends Comment { + type: "CommentBlock"; + } + + export interface CommentLine extends Comment { + type: "CommentLine"; + } + + export interface SourceLocation { + start: { + line: number; + column: number; + }; + + end: { + line: number; + column: number; + }; + } + + export interface Node { + type: string; + leadingComments?: Array; + innerComments?: Array; + trailingComments?: Array; + start: number; + end: number; + loc: SourceLocation; + } + + export interface ArrayExpression extends Node { + type: "ArrayExpression"; + elements: Array; + } + + export interface AssignmentExpression extends Node { + type: "AssignmentExpression"; + operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&="; + left: LVal; + right: Expression; + } + + export interface BinaryExpression extends Node { + type: "BinaryExpression"; + operator: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<="; + left: Expression; + right: Expression; + } + + export interface Directive extends Node { + type: "Directive"; + value: DirectiveLiteral; + } + + export interface DirectiveLiteral extends Node { + type: "DirectiveLiteral"; + value: string; + } + + export interface BlockStatement extends Node { + type: "BlockStatement"; + directives?: Directive[]; + body: Statement[]; + } + + export interface BreakStatement extends Node { + type: "BreakStatement"; + label: Identifier; + } + + export interface CallExpression extends Node { + type: "CallExpression"; + callee: Expression | Super; + arguments: Array; + } + + export interface CatchClause extends Node { + type: "CatchClause"; + param: Pattern; + body: BlockStatement; + } + + export interface ConditionalExpression extends Node { + type: "ConditionalExpression"; + test: Expression; + consequent: Expression; + alternate: Expression; + } + + export interface ContinueStatement extends Node { + type: "ContinueStatement"; + label: Identifier; + } + + export interface DebuggerStatement extends Node { + type: "DebuggerStatement"; + } + + export interface DoWhileStatement extends Node { + type: "DoWhileStatement"; + test: Expression; + body: Statement; + } + + export interface EmptyStatement extends Node { + type: "EmptyStatement"; + } + + export interface ExpressionStatement extends Node { + type: "ExpressionStatement"; + expression: Expression; + } + + export interface File extends Node { + type: "File"; + program: Program; + comments: Comment[]; + tokens: any[]; + } + + export interface ForInStatement extends Node { + type: "ForInStatement"; + left: VariableDeclaration | LVal; + right: Expression; + body: Statement; + } + + export interface ForStatement extends Node { + type: "ForStatement"; + init: VariableDeclaration | Expression; + test: Expression; + update: Expression; + body: Statement; + } + + export interface FunctionDeclaration extends Node { + type: "FunctionDeclaration"; + id: Identifier; + params: Pattern[]; + body: BlockStatement; + generator: boolean; + async: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + export interface FunctionExpression extends Node { + type: "FunctionExpression"; + id: Identifier; + params: Pattern[]; + body: BlockStatement; + generator: boolean; + async: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + export interface Identifier extends Node { + type: "Identifier"; + name: string; + typeAnnotation?: TypeAnnotation; + } + + export interface IfStatement extends Node { + type: "IfStatement"; + test: Expression; + consequent: Statement; + alternate: Statement; + } + + export interface LabeledStatement extends Node { + type: "LabeledStatement"; + label: Identifier; + body: Statement; + } + + export interface StringLiteral extends Node { + type: "StringLiteral"; + value: string; + } + + export interface NumericLiteral extends Node { + type: "NumericLiteral"; + value: number; + } + + export interface NullLiteral extends Node { + type: "NullLiteral"; + } + + export interface BooleanLiteral extends Node { + type: "BooleanLiteral"; + value: boolean; + } + + export interface RegExpLiteral extends Node { + type: "RegExpLiteral"; + pattern: string; + flags?: string; + } + + export interface LogicalExpression extends Node { + type: "LogicalExpression"; + operator: "||" | "&&"; + left: Expression; + right: Expression; + } + + export interface MemberExpression extends Node { + type: "MemberExpression"; + object: Expression | Super; + property: Expression; + computed: boolean; + } + + export interface NewExpression extends Node { + type: "NewExpression"; + callee: Expression | Super; + arguments: Array; + } + + export interface Program extends Node { + type: "Program"; + sourceType: "script" | "module"; + directives?: Directive[]; + body: Array; + } + + export interface ObjectExpression extends Node { + type: "ObjectExpression"; + properties: Array; + } + + export interface ObjectMethod extends Node { + type: "ObjectMethod"; + key: Expression; + kind: "get" | "set" | "method"; + shorthand: boolean; + computed: boolean; + value: Expression; + decorators?: Decorator[]; + id: Identifier; + params: Pattern[]; + body: BlockStatement; + generator: boolean; + async: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + export interface ObjectProperty extends Node { + type: "ObjectProperty"; + key: Expression; + computed: boolean; + value: Expression; + decorators?: Decorator[]; + shorthand: boolean; + } + + export interface RestElement extends Node { + type: "RestElement"; + argument: LVal; + typeAnnotation?: TypeAnnotation; + } + + export interface ReturnStatement extends Node { + type: "ReturnStatement"; + argument: Expression; + } + + export interface SequenceExpression extends Node { + type: "SequenceExpression"; + expressions: Expression[]; + } + + export interface SwitchCase extends Node { + type: "SwitchCase"; + test: Expression; + consequent: Statement[]; + } + + export interface SwitchStatement extends Node { + type: "SwitchStatement"; + discriminant: Expression; + cases: SwitchCase[]; + } + + export interface ThisExpression extends Node { + type: "ThisExpression"; + } + + export interface ThrowStatement extends Node { + type: "ThrowStatement"; + argument: Expression; + } + + export interface TryStatement extends Node { + type: "TryStatement"; + block: BlockStatement; + handler: CatchClause; + finalizer: BlockStatement; + } + + export interface UnaryExpression extends Node { + type: "UnaryExpression"; + operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"; + prefix: boolean; + argument: Expression; + } + + export interface UpdateExpression extends Node { + type: "UpdateExpression"; + operator: "++" | "--"; + prefix: boolean; + argument: Expression; + } + + export interface VariableDeclaration extends Node { + type: "VariableDeclaration"; + declarations: VariableDeclarator[]; + kind: "var" | "let" | "const"; + } + + export interface VariableDeclarator extends Node { + type: "VariableDeclarator"; + id: LVal; + init: Expression; + } + + export interface WhileStatement extends Node { + type: "WhileStatement"; + test: Expression; + body: Statement; + } + + export interface WithStatement extends Node { + type: "WithStatement"; + object: Expression; + body: BlockStatement | Statement; + } + + export interface AssignmentPattern extends Node { + type: "AssignmentPattern"; + left: Pattern; + right: Expression; + } + + export interface ArrayPattern extends Node { + type: "ArrayPattern"; + elements: Array; + typeAnnotation?: TypeAnnotation; + } + + export interface ArrowFunctionExpression extends Node { + type: "ArrowFunctionExpression"; + id: Identifier; + params: Pattern[]; + body: BlockStatement | Expression; + generator: boolean; + async: boolean; + expression: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + export interface ClassBody extends Node { + type: "ClassBody"; + body: Array; + } + + export interface ClassDeclaration extends Node { + type: "ClassDeclaration"; + id: Identifier; + superClass: Expression; + body: ClassBody; + decorators?: Decorator[]; + implements?: ClassImplements[]; + mixins?: any[]; + typeParameters?: TypeParameterDeclaration; + superTypeParameters?: TypeParameterInstantiation; + } + + export interface ClassExpression extends Node { + type: "ClassExpression"; + id: Identifier; + superClass: Expression; + body: ClassBody; + decorators?: Decorator[]; + implements?: ClassImplements[]; + mixins?: any[]; + typeParameters?: TypeParameterDeclaration; + superTypeParameters?: TypeParameterInstantiation; + } + + export interface ExportAllDeclaration extends Node { + type: "ExportAllDeclaration"; + source: StringLiteral; + } + + export interface ExportDefaultDeclaration extends Node { + type: "ExportDefaultDeclaration"; + declaration: Declaration | Expression; + } + + export interface ExportNamedDeclaration extends Node { + type: "ExportNamedDeclaration"; + declaration: Declaration; + specifiers: ExportSpecifier[]; + source: StringLiteral; + } + + export interface ExportSpecifier extends Node { + type: "ExportSpecifier"; + local: Identifier; + imported: Identifier; + exported: Identifier; + } + + export interface ForOfStatement extends Node { + type: "ForOfStatement"; + left: VariableDeclaration | LVal; + right: Expression; + body: Statement; + } + + export interface ImportDeclaration extends Node { + type: "ImportDeclaration"; + specifiers: Array; + source: StringLiteral; + } + + export interface ImportDefaultSpecifier extends Node { + type: "ImportDefaultSpecifier"; + local: Identifier; + } + + export interface ImportNamespaceSpecifier extends Node { + type: "ImportNamespaceSpecifier"; + local: Identifier; + } + + export interface ImportSpecifier extends Node { + type: "ImportSpecifier"; + local: Identifier; + imported: Identifier; + } + + export interface MetaProperty extends Node { + type: "MetaProperty"; + meta: Identifier; + property: Identifier; + } + + export interface ClassMethod extends Node { + type: "ClassMethod"; + key: Expression; + value?: FunctionExpression; + kind: "constructor" | "method" | "get" | "set"; + computed: boolean; + static: boolean; + decorators?: Decorator[]; + id: Identifier; + params: Pattern[]; + body: BlockStatement; + generator: boolean; + async: boolean; + expression: boolean; + returnType?: TypeAnnotation; + typeParameters?: TypeParameterDeclaration; + } + + // See: https://github.com/babel/babel/blob/master/doc/ast/spec.md#objectpattern + export interface AssignmentProperty extends Node { + type: "ObjectProperty"; + key: Expression; + computed: boolean; + value: Pattern; + decorators?: Decorator[]; + shorthand: boolean; + } + + export interface ObjectPattern extends Node { + type: "ObjectPattern"; + properties: Array; + typeAnnotation?: TypeAnnotation; + } + + export interface SpreadElement extends Node { + type: "SpreadElement"; + argument: Expression; + } + + export interface Super extends Node { + type: "Super"; + } + + export interface TaggedTemplateExpression extends Node { + type: "TaggedTemplateExpression"; + tag: Expression; + quasi: TemplateLiteral; + } + + export interface TemplateElement extends Node { + type: "TemplateElement"; + tail: boolean; + value: { + cooked: string; + raw: string; + }; + } + + export interface TemplateLiteral extends Node { + type: "TemplateLiteral"; + quasis: TemplateElement[]; + expressions: Expression[]; + } + + export interface YieldExpression extends Node { + type: "YieldExpression"; + argument: Expression; + delegate: boolean; + } + + export interface AnyTypeAnnotation extends Node { + type: "AnyTypeAnnotation"; + } + + export interface ArrayTypeAnnotation extends Node { + type: "ArrayTypeAnnotation"; + elementType: FlowTypeAnnotation; + } + + export interface BooleanTypeAnnotation extends Node { + type: "BooleanTypeAnnotation"; + } + + export interface BooleanLiteralTypeAnnotation extends Node { + type: "BooleanLiteralTypeAnnotation"; + } + + export interface NullLiteralTypeAnnotation extends Node { + type: "NullLiteralTypeAnnotation"; + } + + export interface ClassImplements extends Node { + type: "ClassImplements"; + id: Identifier; + typeParameters: TypeParameterInstantiation; + } + + export interface ClassProperty extends Node { + type: "ClassProperty"; + key: Identifier; + value: Expression; + decorators?: Decorator[]; + typeAnnotation?: TypeAnnotation; + } + + export interface DeclareClass extends Node { + type: "DeclareClass"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + extends: InterfaceExtends[]; + body: ObjectTypeAnnotation; + } + + export interface DeclareFunction extends Node { + type: "DeclareFunction"; + id: Identifier; + } + + export interface DeclareInterface extends Node { + type: "DeclareInterface"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + extends: InterfaceExtends[]; + body: ObjectTypeAnnotation; + } + + export interface DeclareModule extends Node { + type: "DeclareModule"; + id: StringLiteral | Identifier; + body: BlockStatement; + } + + export interface DeclareTypeAlias extends Node { + type: "DeclareTypeAlias"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + right: FlowTypeAnnotation; + } + + export interface DeclareVariable extends Node { + type: "DeclareVariable"; + id: Identifier; + } + + export interface ExistentialTypeParam extends Node { + type: "ExistentialTypeParam"; + } + + export interface FunctionTypeAnnotation extends Node { + type: "FunctionTypeAnnotation"; + typeParameters: TypeParameterDeclaration; + params: FunctionTypeParam[]; + rest: FunctionTypeParam; + returnType: FlowTypeAnnotation; + } + + export interface FunctionTypeParam extends Node { + type: "FunctionTypeParam"; + name: Identifier; + typeAnnotation: FlowTypeAnnotation; + } + + export interface GenericTypeAnnotation extends Node { + type: "GenericTypeAnnotation"; + id: Identifier; + typeParameters: TypeParameterInstantiation; + } + + export interface InterfaceExtends extends Node { + type: "InterfaceExtends"; + id: Identifier; + typeParameters: TypeParameterInstantiation; + } + + export interface InterfaceDeclaration extends Node { + type: "InterfaceDeclaration"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + extends: InterfaceExtends[]; + mixins?: any[]; + body: ObjectTypeAnnotation; + } + + export interface IntersectionTypeAnnotation extends Node { + type: "IntersectionTypeAnnotation"; + types: FlowTypeAnnotation[]; + } + + export interface MixedTypeAnnotation extends Node { + type: "MixedTypeAnnotation"; + } + + export interface NullableTypeAnnotation extends Node { + type: "NullableTypeAnnotation"; + typeAnnotation: FlowTypeAnnotation; + } + + export interface NumericLiteralTypeAnnotation extends Node { + type: "NumericLiteralTypeAnnotation"; + } + + export interface NumberTypeAnnotation extends Node { + type: "NumberTypeAnnotation"; + } + + export interface StringLiteralTypeAnnotation extends Node { + type: "StringLiteralTypeAnnotation"; + } + + export interface StringTypeAnnotation extends Node { + type: "StringTypeAnnotation"; + } + + export interface ThisTypeAnnotation extends Node { + type: "ThisTypeAnnotation"; + } + + export interface TupleTypeAnnotation extends Node { + type: "TupleTypeAnnotation"; + types: FlowTypeAnnotation[]; + } + + export interface TypeofTypeAnnotation extends Node { + type: "TypeofTypeAnnotation"; + argument: FlowTypeAnnotation; + } + + export interface TypeAlias extends Node { + type: "TypeAlias"; + id: Identifier; + typeParameters: TypeParameterDeclaration; + right: FlowTypeAnnotation; + } + + export interface TypeAnnotation extends Node { + type: "TypeAnnotation"; + typeAnnotation: FlowTypeAnnotation; + } + + export interface TypeCastExpression extends Node { + type: "TypeCastExpression"; + expression: Expression; + typeAnnotation: FlowTypeAnnotation; + } + + export interface TypeParameterDeclaration extends Node { + type: "TypeParameterDeclaration"; + params: Identifier[]; + } + + export interface TypeParameterInstantiation extends Node { + type: "TypeParameterInstantiation"; + params: FlowTypeAnnotation[]; + } + + export interface ObjectTypeAnnotation extends Node { + type: "ObjectTypeAnnotation"; + properties: ObjectTypeProperty[]; + indexers: ObjectTypeIndexer[]; + callProperties: ObjectTypeCallProperty[]; + } + + export interface ObjectTypeCallProperty extends Node { + type: "ObjectTypeCallProperty"; + value: FlowTypeAnnotation; + } + + export interface ObjectTypeIndexer extends Node { + type: "ObjectTypeIndexer"; + id: Expression; + key: FlowTypeAnnotation; + value: FlowTypeAnnotation; + } + + export interface ObjectTypeProperty extends Node { + type: "ObjectTypeProperty"; + key: Expression; + value: FlowTypeAnnotation; + } + + export interface QualifiedTypeIdentifier extends Node { + type: "QualifiedTypeIdentifier"; + id: Identifier; + qualification: Identifier | QualifiedTypeIdentifier; + } + + export interface UnionTypeAnnotation extends Node { + type: "UnionTypeAnnotation"; + types: FlowTypeAnnotation[]; + } + + export interface VoidTypeAnnotation extends Node { + type: "VoidTypeAnnotation"; + } + + export interface JSXAttribute extends Node { + type: "JSXAttribute"; + name: JSXIdentifier | JSXNamespacedName; + value: JSXElement | StringLiteral | JSXExpressionContainer; + } + + export interface JSXClosingElement extends Node { + type: "JSXClosingElement"; + name: JSXIdentifier | JSXMemberExpression; + } + + export interface JSXElement extends Node { + type: "JSXElement"; + openingElement: JSXOpeningElement; + closingElement: JSXClosingElement; + children: Array; + selfClosing?: boolean; + } + + export interface JSXEmptyExpression extends Node { + type: "JSXEmptyExpression"; + } + + export interface JSXExpressionContainer extends Node { + type: "JSXExpressionContainer"; + expression: Expression; + } + + export interface JSXIdentifier extends Node { + type: "JSXIdentifier"; + name: string; + } + + export interface JSXMemberExpression extends Node { + type: "JSXMemberExpression"; + object: JSXMemberExpression | JSXIdentifier; + property: JSXIdentifier; + } + + export interface JSXNamespacedName extends Node { + type: "JSXNamespacedName"; + namespace: JSXIdentifier; + name: JSXIdentifier; + } + + export interface JSXOpeningElement extends Node { + type: "JSXOpeningElement"; + name: JSXIdentifier | JSXMemberExpression; + selfClosing: boolean; + attributes: JSXAttribute[]; + } + + export interface JSXSpreadAttribute extends Node { + type: "JSXSpreadAttribute"; + argument: Expression; + } + + export interface JSXText extends Node { + type: "JSXText"; + value: string; + } + + export interface Noop extends Node { + type: "Noop"; + } + + export interface ParenthesizedExpression extends Node { + type: "ParenthesizedExpression"; + expression: Expression; + } + + export interface AwaitExpression extends Node { + type: "AwaitExpression"; + argument: Expression; + } + + export interface BindExpression extends Node { + type: "BindExpression"; + object: Expression; + callee: Expression; + } + + export interface Decorator extends Node { + type: "Decorator"; + expression: Expression; + } + + export interface DoExpression extends Node { + type: "DoExpression"; + body: BlockStatement; + } + + export interface ExportDefaultSpecifier extends Node { + type: "ExportDefaultSpecifier"; + exported: Identifier; + } + + export interface ExportNamespaceSpecifier extends Node { + type: "ExportNamespaceSpecifier"; + exported: Identifier; + } + + export interface RestProperty extends Node { + type: "RestProperty"; + argument: LVal; + } + + export interface SpreadProperty extends Node { + type: "SpreadProperty"; + argument: Expression; + } + + export type Expression = ArrayExpression | AssignmentExpression | BinaryExpression | CallExpression | ConditionalExpression | FunctionExpression | Identifier | StringLiteral | NumericLiteral | BooleanLiteral | RegExpLiteral | LogicalExpression | MemberExpression | NewExpression | ObjectExpression | SequenceExpression | ThisExpression | UnaryExpression | UpdateExpression | ArrowFunctionExpression | ClassExpression | MetaProperty | Super | TaggedTemplateExpression | TemplateLiteral | YieldExpression | TypeCastExpression | JSXElement | JSXEmptyExpression | JSXIdentifier | JSXMemberExpression | ParenthesizedExpression | AwaitExpression | BindExpression | DoExpression; + export type Binary = BinaryExpression | LogicalExpression; + export type Scopable = BlockStatement | CatchClause | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ClassDeclaration | ClassExpression | ForOfStatement | ClassMethod; + export type BlockParent = BlockStatement | DoWhileStatement | ForInStatement | ForStatement | FunctionDeclaration | FunctionExpression | Program | ObjectMethod | SwitchStatement | WhileStatement | ArrowFunctionExpression | ForOfStatement | ClassMethod; + export type Block = BlockStatement | Program; + export type Statement = BlockStatement | BreakStatement | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExpressionStatement | ForInStatement | ForStatement | FunctionDeclaration | IfStatement | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | VariableDeclaration | WhileStatement | WithStatement | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ForOfStatement | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias; + export type Terminatorless = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement | YieldExpression | AwaitExpression; + export type CompletionStatement = BreakStatement | ContinueStatement | ReturnStatement | ThrowStatement; + export type Conditional = ConditionalExpression | IfStatement; + export type Loop = DoWhileStatement | ForInStatement | ForStatement | WhileStatement | ForOfStatement; + export type While = DoWhileStatement | WhileStatement; + export type ExpressionWrapper = ExpressionStatement | TypeCastExpression | ParenthesizedExpression; + export type For = ForInStatement | ForStatement | ForOfStatement; + export type ForXStatement = ForInStatement | ForOfStatement; + export type Function = FunctionDeclaration | FunctionExpression | ObjectMethod | ArrowFunctionExpression | ClassMethod; + export type FunctionParent = FunctionDeclaration | FunctionExpression | Program | ObjectMethod | ArrowFunctionExpression | ClassMethod; + export type Pureish = FunctionDeclaration | FunctionExpression | StringLiteral | NumericLiteral | BooleanLiteral | ArrowFunctionExpression | ClassDeclaration | ClassExpression; + export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias; + export type LVal = Identifier | MemberExpression | RestElement | AssignmentPattern | ArrayPattern | ObjectPattern; + export type Literal = StringLiteral | NumericLiteral | BooleanLiteral | RegExpLiteral | TemplateLiteral; + export type Immutable = StringLiteral | NumericLiteral | BooleanLiteral | JSXAttribute | JSXClosingElement | JSXElement | JSXExpressionContainer | JSXOpeningElement; + export type UserWhitespacable = ObjectMethod | ObjectProperty | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty; + export type Method = ObjectMethod | ClassMethod; + export type ObjectMember = ObjectMethod | ObjectProperty; + export type Property = ObjectProperty | ClassProperty; + export type UnaryLike = UnaryExpression | SpreadElement | RestProperty | SpreadProperty; + export type Pattern = AssignmentPattern | ArrayPattern | ObjectPattern; + export type Class = ClassDeclaration | ClassExpression; + export type ModuleDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration; + export type ExportDeclaration = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration; + export type ModuleSpecifier = ExportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier | ExportDefaultSpecifier | ExportNamespaceSpecifier; + export type Flow = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | ClassImplements | ClassProperty | DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | ExistentialTypeParam | FunctionTypeAnnotation | FunctionTypeParam | GenericTypeAnnotation | InterfaceExtends | InterfaceDeclaration | IntersectionTypeAnnotation | MixedTypeAnnotation | NullableTypeAnnotation | NumericLiteralTypeAnnotation | NumberTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAlias | TypeAnnotation | TypeCastExpression | TypeParameterDeclaration | TypeParameterInstantiation | ObjectTypeAnnotation | ObjectTypeCallProperty | ObjectTypeIndexer | ObjectTypeProperty | QualifiedTypeIdentifier | UnionTypeAnnotation | VoidTypeAnnotation; + export type FlowTypeAnnotation = AnyTypeAnnotation | ArrayTypeAnnotation | BooleanTypeAnnotation | BooleanLiteralTypeAnnotation | FunctionTypeAnnotation | GenericTypeAnnotation | IntersectionTypeAnnotation | MixedTypeAnnotation | NullableTypeAnnotation | NumericLiteralTypeAnnotation | NumberTypeAnnotation | StringLiteralTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | TupleTypeAnnotation | TypeofTypeAnnotation | TypeAnnotation | ObjectTypeAnnotation | UnionTypeAnnotation | VoidTypeAnnotation; + export type FlowBaseAnnotation = AnyTypeAnnotation | BooleanTypeAnnotation | MixedTypeAnnotation | NumberTypeAnnotation | StringTypeAnnotation | ThisTypeAnnotation | VoidTypeAnnotation; + export type FlowDeclaration = DeclareClass | DeclareFunction | DeclareInterface | DeclareModule | DeclareTypeAlias | DeclareVariable | InterfaceDeclaration | TypeAlias; + export type JSX = JSXAttribute | JSXClosingElement | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXSpreadAttribute | JSXText; + + export function arrayExpression(elements?: Array): ArrayExpression; + export function assignmentExpression(operator?: string, left?: LVal, right?: Expression): AssignmentExpression; + export function binaryExpression(operator?: "+" | "-" | "/" | "%" | "*" | "**" | "&" | "|" | ">>" | ">>>" | "<<" | "^" | "==" | "===" | "!=" | "!==" | "in" | "instanceof" | ">" | "<" | ">=" | "<=", left?: Expression, right?: Expression): BinaryExpression; + export function directive(value?: DirectiveLiteral): Directive; + export function directiveLiteral(value?: string): DirectiveLiteral; + export function blockStatement(body?: Statement[], directives?: Directive[]): BlockStatement; + export function breakStatement(label?: Identifier): BreakStatement; + export function callExpression(callee?: Expression, _arguments?: Array): CallExpression; + export function catchClause(param?: Identifier, body?: BlockStatement): CatchClause; + export function conditionalExpression(test?: Expression, consequent?: Expression, alternate?: Expression): ConditionalExpression; + export function continueStatement(label?: Identifier): ContinueStatement; + export function debuggerStatement(): DebuggerStatement; + export function doWhileStatement(test?: Expression, body?: Statement): DoWhileStatement; + export function emptyStatement(): EmptyStatement; + export function expressionStatement(expression?: Expression): ExpressionStatement; + export function file(program?: Program, comments?: Comment[], tokens?: any[]): File; + export function forInStatement(left?: VariableDeclaration | LVal, right?: Expression, body?: Statement): ForInStatement; + export function forStatement(init?: VariableDeclaration | Expression, test?: Expression, update?: Expression, body?: Statement): ForStatement; + export function functionDeclaration(id?: Identifier, params?: Pattern[], body?: BlockStatement, generator?: boolean, async?: boolean): FunctionDeclaration; + export function functionExpression(id?: Identifier, params?: Pattern[], body?: BlockStatement, generator?: boolean, async?: boolean): FunctionExpression; + export function identifier(name?: string): Identifier; + export function ifStatement(test?: Expression, consequent?: Statement, alternate?: Statement): IfStatement; + export function labeledStatement(label?: Identifier, body?: Statement): LabeledStatement; + export function stringLiteral(value?: string): StringLiteral; + export function numericLiteral(value?: number): NumericLiteral; + export function nullLiteral(): NullLiteral; + export function booleanLiteral(value?: boolean): BooleanLiteral; + export function regExpLiteral(pattern?: string, flags?: string): RegExpLiteral; + export function logicalExpression(operator?: "||" | "&&", left?: Expression, right?: Expression): LogicalExpression; + export function memberExpression(object?: Expression | Super, property?: Expression, computed?: boolean): MemberExpression; + export function newExpression(callee?: Expression | Super, _arguments?: Array): NewExpression; + export function program(body?: Array, directives?: Directive[]): Program; + export function objectExpression(properties?: Array): ObjectExpression; + export function objectMethod(kind?: "get" | "set" | "method", key?: Expression, params?: Pattern[], body?: BlockStatement, computed?: boolean): ObjectMethod; + export function objectProperty(key?: Expression, value?: Expression, computed?: boolean, shorthand?: boolean, decorators?: Decorator[]): ObjectProperty; + export function restElement(argument?: LVal, typeAnnotation?: TypeAnnotation): RestElement; + export function returnStatement(argument?: Expression): ReturnStatement; + export function sequenceExpression(expressions?: Expression[]): SequenceExpression; + export function switchCase(test?: Expression, consequent?: Statement[]): SwitchCase; + export function switchStatement(discriminant?: Expression, cases?: SwitchCase[]): SwitchStatement; + export function thisExpression(): ThisExpression; + export function throwStatement(argument?: Expression): ThrowStatement; + export function tryStatement(block?: BlockStatement, handler?: CatchClause, finalizer?: BlockStatement): TryStatement; + export function unaryExpression(operator?: "void" | "delete" | "!" | "+" | "-" | "++" | "--" | "~" | "typeof", argument?: Expression, prefix?: boolean): UnaryExpression; + export function updateExpression(operator?: "++" | "--", argument?: Expression, prefix?: boolean): UpdateExpression; + export function variableDeclaration(kind?: "var" | "let" | "const", declarations?: VariableDeclarator[]): VariableDeclaration; + export function variableDeclarator(id?: LVal, init?: Expression): VariableDeclarator; + export function whileStatement(test?: Expression, body?: BlockStatement | Statement): WhileStatement; + export function withStatement(object?: Expression, body?: BlockStatement | Statement): WithStatement; + export function assignmentPattern(left?: Identifier, right?: Expression): AssignmentPattern; + export function arrayPattern(elements?: Array, typeAnnotation?: TypeAnnotation): ArrayPattern; + export function arrowFunctionExpression(params?: Pattern[], body?: BlockStatement | Expression, async?: boolean): ArrowFunctionExpression; + export function classBody(body?: Array): ClassBody; + export function classDeclaration(id?: Identifier, superClass?: Expression, body?: ClassBody, decorators?: Decorator[]): ClassDeclaration; + export function classExpression(id?: Identifier, superClass?: Expression, body?: ClassBody, decorators?: Decorator[]): ClassExpression; + export function exportAllDeclaration(source?: StringLiteral): ExportAllDeclaration; + export function exportDefaultDeclaration(declaration?: FunctionDeclaration | ClassDeclaration | Expression): ExportDefaultDeclaration; + export function exportNamedDeclaration(declaration?: Declaration, specifiers?: ExportSpecifier[], source?: StringLiteral): ExportNamedDeclaration; + export function exportSpecifier(local?: Identifier, exported?: Identifier): ExportSpecifier; + export function forOfStatement(left?: VariableDeclaration | LVal, right?: Expression, body?: Statement): ForOfStatement; + export function importDeclaration(specifiers?: Array, source?: StringLiteral): ImportDeclaration; + export function importDefaultSpecifier(local?: Identifier): ImportDefaultSpecifier; + export function importNamespaceSpecifier(local?: Identifier): ImportNamespaceSpecifier; + export function importSpecifier(local?: Identifier, imported?: Identifier): ImportSpecifier; + export function metaProperty(meta?: string, property?: string): MetaProperty; + export function classMethod(kind?: "constructor" | "method" | "get" | "set", key?: Expression, params?: Pattern[], body?: BlockStatement, computed?: boolean, _static?: boolean): ClassMethod; + export function objectPattern(properties?: Array, typeAnnotation?: TypeAnnotation): ObjectPattern; + export function spreadElement(argument?: Expression): SpreadElement; + export function taggedTemplateExpression(tag?: Expression, quasi?: TemplateLiteral): TaggedTemplateExpression; + export function templateElement(value?: {cooked?: string; raw?: string;}, tail?: boolean): TemplateElement; + export function templateLiteral(quasis?: TemplateElement[], expressions?: Expression[]): TemplateLiteral; + export function yieldExpression(argument?: Expression, delegate?: boolean): YieldExpression; + export function anyTypeAnnotation(): AnyTypeAnnotation; + export function arrayTypeAnnotation(elementType?: FlowTypeAnnotation): ArrayTypeAnnotation; + export function booleanTypeAnnotation(): BooleanTypeAnnotation; + export function booleanLiteralTypeAnnotation(): BooleanLiteralTypeAnnotation; + export function nullLiteralTypeAnnotation(): NullLiteralTypeAnnotation; + export function classImplements(id?: Identifier, typeParameters?: TypeParameterInstantiation): ClassImplements; + export function classProperty(key?: Identifier, value?: Expression, typeAnnotation?: TypeAnnotation, decorators?: Decorator[]): ClassProperty; + export function declareClass(id?: Identifier, typeParameters?: TypeParameterDeclaration, _extends?: InterfaceExtends[], body?: ObjectTypeAnnotation): DeclareClass; + export function declareFunction(id?: Identifier): DeclareFunction; + export function declareInterface(id?: Identifier, typeParameters?: TypeParameterDeclaration, _extends?: InterfaceExtends[], body?: ObjectTypeAnnotation): DeclareInterface; + export function declareModule(id?: StringLiteral | Identifier, body?: BlockStatement): DeclareModule; + export function declareTypeAlias(id?: Identifier, typeParameters?: TypeParameterDeclaration, right?: FlowTypeAnnotation): DeclareTypeAlias; + export function declareVariable(id?: Identifier): DeclareVariable; + export function existentialTypeParam(): ExistentialTypeParam; + export function functionTypeAnnotation(typeParameters?: TypeParameterDeclaration, params?: FunctionTypeParam[], rest?: FunctionTypeParam, returnType?: FlowTypeAnnotation): FunctionTypeAnnotation; + export function functionTypeParam(name?: Identifier, typeAnnotation?: FlowTypeAnnotation): FunctionTypeParam; + export function genericTypeAnnotation(id?: Identifier, typeParameters?: TypeParameterInstantiation): GenericTypeAnnotation; + export function interfaceExtends(id?: Identifier, typeParameters?: TypeParameterInstantiation): InterfaceExtends; + export function interfaceDeclaration(id?: Identifier, typeParameters?: TypeParameterDeclaration, _extends?: InterfaceExtends[], body?: ObjectTypeAnnotation): InterfaceDeclaration; + export function intersectionTypeAnnotation(types?: FlowTypeAnnotation[]): IntersectionTypeAnnotation; + export function mixedTypeAnnotation(): MixedTypeAnnotation; + export function nullableTypeAnnotation(typeAnnotation?: FlowTypeAnnotation): NullableTypeAnnotation; + export function numericLiteralTypeAnnotation(): NumericLiteralTypeAnnotation; + export function numberTypeAnnotation(): NumberTypeAnnotation; + export function stringLiteralTypeAnnotation(): StringLiteralTypeAnnotation; + export function stringTypeAnnotation(): StringTypeAnnotation; + export function thisTypeAnnotation(): ThisTypeAnnotation; + export function tupleTypeAnnotation(types?: FlowTypeAnnotation[]): TupleTypeAnnotation; + export function typeofTypeAnnotation(argument?: FlowTypeAnnotation): TypeofTypeAnnotation; + export function typeAlias(id?: Identifier, typeParameters?: TypeParameterDeclaration, right?: FlowTypeAnnotation): TypeAlias; + export function typeAnnotation(typeAnnotation?: FlowTypeAnnotation): TypeAnnotation; + export function typeCastExpression(expression?: Expression, typeAnnotation?: FlowTypeAnnotation): TypeCastExpression; + export function typeParameterDeclaration(params?: Identifier[]): TypeParameterDeclaration; + export function typeParameterInstantiation(params?: FlowTypeAnnotation[]): TypeParameterInstantiation; + export function objectTypeAnnotation(properties?: ObjectTypeProperty[], indexers?: ObjectTypeIndexer[], callProperties?: ObjectTypeCallProperty[]): ObjectTypeAnnotation; + export function objectTypeCallProperty(value?: FlowTypeAnnotation): ObjectTypeCallProperty; + export function objectTypeIndexer(id?: Expression, key?: FlowTypeAnnotation, value?: FlowTypeAnnotation): ObjectTypeIndexer; + export function objectTypeProperty(key?: Expression, value?: FlowTypeAnnotation): ObjectTypeProperty; + export function qualifiedTypeIdentifier(id?: Identifier, qualification?: Identifier | QualifiedTypeIdentifier): QualifiedTypeIdentifier; + export function unionTypeAnnotation(types?: FlowTypeAnnotation[]): UnionTypeAnnotation; + export function voidTypeAnnotation(): VoidTypeAnnotation; + export function jSXAttribute(name?: JSXIdentifier | JSXNamespacedName, value?: JSXElement | StringLiteral | JSXExpressionContainer): JSXAttribute; + export function jSXClosingElement(name?: JSXIdentifier | JSXMemberExpression): JSXClosingElement; + export function jSXElement(openingElement?: JSXOpeningElement, closingElement?: JSXClosingElement, children?: Array, selfClosing?: boolean): JSXElement; + export function jSXEmptyExpression(): JSXEmptyExpression; + export function jSXExpressionContainer(expression?: Expression): JSXExpressionContainer; + export function jSXIdentifier(name?: string): JSXIdentifier; + export function jSXMemberExpression(object?: JSXMemberExpression | JSXIdentifier, property?: JSXIdentifier): JSXMemberExpression; + export function jSXNamespacedName(namespace?: JSXIdentifier, name?: JSXIdentifier): JSXNamespacedName; + export function jSXOpeningElement(name?: JSXIdentifier | JSXMemberExpression, attributes?: JSXAttribute[], selfClosing?: boolean): JSXOpeningElement; + export function jSXSpreadAttribute(argument?: Expression): JSXSpreadAttribute; + export function jSXText(value?: string): JSXText; + export function noop(): Noop; + export function parenthesizedExpression(expression?: Expression): ParenthesizedExpression; + export function awaitExpression(argument?: Expression): AwaitExpression; + export function bindExpression(object?: Expression, callee?: Expression): BindExpression; + export function decorator(expression?: Expression): Decorator; + export function doExpression(body?: BlockStatement): DoExpression; + export function exportDefaultSpecifier(exported?: Identifier): ExportDefaultSpecifier; + export function exportNamespaceSpecifier(exported?: Identifier): ExportNamespaceSpecifier; + export function restProperty(argument?: LVal): RestProperty; + export function spreadProperty(argument?: Expression): SpreadProperty; + + export function isArrayExpression(node: Object, opts?: Object): node is ArrayExpression; + export function isAssignmentExpression(node: Object, opts?: Object): node is AssignmentExpression; + export function isBinaryExpression(node: Object, opts?: Object): node is BinaryExpression; + export function isDirective(node: Object, opts?: Object): node is Directive; + export function isDirectiveLiteral(node: Object, opts?: Object): node is DirectiveLiteral; + export function isBlockStatement(node: Object, opts?: Object): node is BlockStatement; + export function isBreakStatement(node: Object, opts?: Object): node is BreakStatement; + export function isCallExpression(node: Object, opts?: Object): node is CallExpression; + export function isCatchClause(node: Object, opts?: Object): node is CatchClause; + export function isConditionalExpression(node: Object, opts?: Object): node is ConditionalExpression; + export function isContinueStatement(node: Object, opts?: Object): node is ContinueStatement; + export function isDebuggerStatement(node: Object, opts?: Object): node is DebuggerStatement; + export function isDoWhileStatement(node: Object, opts?: Object): node is DoWhileStatement; + export function isEmptyStatement(node: Object, opts?: Object): node is EmptyStatement; + export function isExpressionStatement(node: Object, opts?: Object): node is ExpressionStatement; + export function isFile(node: Object, opts?: Object): node is File; + export function isForInStatement(node: Object, opts?: Object): node is ForInStatement; + export function isForStatement(node: Object, opts?: Object): node is ForStatement; + export function isFunctionDeclaration(node: Object, opts?: Object): node is FunctionDeclaration; + export function isFunctionExpression(node: Object, opts?: Object): node is FunctionExpression; + export function isIdentifier(node: Object, opts?: Object): node is Identifier; + export function isIfStatement(node: Object, opts?: Object): node is IfStatement; + export function isLabeledStatement(node: Object, opts?: Object): node is LabeledStatement; + export function isStringLiteral(node: Object, opts?: Object): node is StringLiteral; + export function isNumericLiteral(node: Object, opts?: Object): node is NumericLiteral; + export function isNullLiteral(node: Object, opts?: Object): node is NullLiteral; + export function isBooleanLiteral(node: Object, opts?: Object): node is BooleanLiteral; + export function isRegExpLiteral(node: Object, opts?: Object): node is RegExpLiteral; + export function isLogicalExpression(node: Object, opts?: Object): node is LogicalExpression; + export function isMemberExpression(node: Object, opts?: Object): node is MemberExpression; + export function isNewExpression(node: Object, opts?: Object): node is NewExpression; + export function isProgram(node: Object, opts?: Object): node is Program; + export function isObjectExpression(node: Object, opts?: Object): node is ObjectExpression; + export function isObjectMethod(node: Object, opts?: Object): node is ObjectMethod; + export function isObjectProperty(node: Object, opts?: Object): node is ObjectProperty; + export function isRestElement(node: Object, opts?: Object): node is RestElement; + export function isReturnStatement(node: Object, opts?: Object): node is ReturnStatement; + export function isSequenceExpression(node: Object, opts?: Object): node is SequenceExpression; + export function isSwitchCase(node: Object, opts?: Object): node is SwitchCase; + export function isSwitchStatement(node: Object, opts?: Object): node is SwitchStatement; + export function isThisExpression(node: Object, opts?: Object): node is ThisExpression; + export function isThrowStatement(node: Object, opts?: Object): node is ThrowStatement; + export function isTryStatement(node: Object, opts?: Object): node is TryStatement; + export function isUnaryExpression(node: Object, opts?: Object): node is UnaryExpression; + export function isUpdateExpression(node: Object, opts?: Object): node is UpdateExpression; + export function isVariableDeclaration(node: Object, opts?: Object): node is VariableDeclaration; + export function isVariableDeclarator(node: Object, opts?: Object): node is VariableDeclarator; + export function isWhileStatement(node: Object, opts?: Object): node is WhileStatement; + export function isWithStatement(node: Object, opts?: Object): node is WithStatement; + export function isAssignmentPattern(node: Object, opts?: Object): node is AssignmentPattern; + export function isArrayPattern(node: Object, opts?: Object): node is ArrayPattern; + export function isArrowFunctionExpression(node: Object, opts?: Object): node is ArrowFunctionExpression; + export function isClassBody(node: Object, opts?: Object): node is ClassBody; + export function isClassDeclaration(node: Object, opts?: Object): node is ClassDeclaration; + export function isClassExpression(node: Object, opts?: Object): node is ClassExpression; + export function isExportAllDeclaration(node: Object, opts?: Object): node is ExportAllDeclaration; + export function isExportDefaultDeclaration(node: Object, opts?: Object): node is ExportDefaultDeclaration; + export function isExportNamedDeclaration(node: Object, opts?: Object): node is ExportNamedDeclaration; + export function isExportSpecifier(node: Object, opts?: Object): node is ExportSpecifier; + export function isForOfStatement(node: Object, opts?: Object): node is ForOfStatement; + export function isImportDeclaration(node: Object, opts?: Object): node is ImportDeclaration; + export function isImportDefaultSpecifier(node: Object, opts?: Object): node is ImportDefaultSpecifier; + export function isImportNamespaceSpecifier(node: Object, opts?: Object): node is ImportNamespaceSpecifier; + export function isImportSpecifier(node: Object, opts?: Object): node is ImportSpecifier; + export function isMetaProperty(node: Object, opts?: Object): node is MetaProperty; + export function isClassMethod(node: Object, opts?: Object): node is ClassMethod; + export function isObjectPattern(node: Object, opts?: Object): node is ObjectPattern; + export function isSpreadElement(node: Object, opts?: Object): node is SpreadElement; + export function isSuper(node: Object, opts?: Object): node is Super; + export function isTaggedTemplateExpression(node: Object, opts?: Object): node is TaggedTemplateExpression; + export function isTemplateElement(node: Object, opts?: Object): node is TemplateElement; + export function isTemplateLiteral(node: Object, opts?: Object): node is TemplateLiteral; + export function isYieldExpression(node: Object, opts?: Object): node is YieldExpression; + export function isAnyTypeAnnotation(node: Object, opts?: Object): node is AnyTypeAnnotation; + export function isArrayTypeAnnotation(node: Object, opts?: Object): node is ArrayTypeAnnotation; + export function isBooleanTypeAnnotation(node: Object, opts?: Object): node is BooleanTypeAnnotation; + export function isBooleanLiteralTypeAnnotation(node: Object, opts?: Object): node is BooleanLiteralTypeAnnotation; + export function isNullLiteralTypeAnnotation(node: Object, opts?: Object): node is NullLiteralTypeAnnotation; + export function isClassImplements(node: Object, opts?: Object): node is ClassImplements; + export function isClassProperty(node: Object, opts?: Object): node is ClassProperty; + export function isDeclareClass(node: Object, opts?: Object): node is DeclareClass; + export function isDeclareFunction(node: Object, opts?: Object): node is DeclareFunction; + export function isDeclareInterface(node: Object, opts?: Object): node is DeclareInterface; + export function isDeclareModule(node: Object, opts?: Object): node is DeclareModule; + export function isDeclareTypeAlias(node: Object, opts?: Object): node is DeclareTypeAlias; + export function isDeclareVariable(node: Object, opts?: Object): node is DeclareVariable; + export function isExistentialTypeParam(node: Object, opts?: Object): node is ExistentialTypeParam; + export function isFunctionTypeAnnotation(node: Object, opts?: Object): node is FunctionTypeAnnotation; + export function isFunctionTypeParam(node: Object, opts?: Object): node is FunctionTypeParam; + export function isGenericTypeAnnotation(node: Object, opts?: Object): node is GenericTypeAnnotation; + export function isInterfaceExtends(node: Object, opts?: Object): node is InterfaceExtends; + export function isInterfaceDeclaration(node: Object, opts?: Object): node is InterfaceDeclaration; + export function isIntersectionTypeAnnotation(node: Object, opts?: Object): node is IntersectionTypeAnnotation; + export function isMixedTypeAnnotation(node: Object, opts?: Object): node is MixedTypeAnnotation; + export function isNullableTypeAnnotation(node: Object, opts?: Object): node is NullableTypeAnnotation; + export function isNumericLiteralTypeAnnotation(node: Object, opts?: Object): node is NumericLiteralTypeAnnotation; + export function isNumberTypeAnnotation(node: Object, opts?: Object): node is NumberTypeAnnotation; + export function isStringLiteralTypeAnnotation(node: Object, opts?: Object): node is StringLiteralTypeAnnotation; + export function isStringTypeAnnotation(node: Object, opts?: Object): node is StringTypeAnnotation; + export function isThisTypeAnnotation(node: Object, opts?: Object): node is ThisTypeAnnotation; + export function isTupleTypeAnnotation(node: Object, opts?: Object): node is TupleTypeAnnotation; + export function isTypeofTypeAnnotation(node: Object, opts?: Object): node is TypeofTypeAnnotation; + export function isTypeAlias(node: Object, opts?: Object): node is TypeAlias; + export function isTypeAnnotation(node: Object, opts?: Object): node is TypeAnnotation; + export function isTypeCastExpression(node: Object, opts?: Object): node is TypeCastExpression; + export function isTypeParameterDeclaration(node: Object, opts?: Object): node is TypeParameterDeclaration; + export function isTypeParameterInstantiation(node: Object, opts?: Object): node is TypeParameterInstantiation; + export function isObjectTypeAnnotation(node: Object, opts?: Object): node is ObjectTypeAnnotation; + export function isObjectTypeCallProperty(node: Object, opts?: Object): node is ObjectTypeCallProperty; + export function isObjectTypeIndexer(node: Object, opts?: Object): node is ObjectTypeIndexer; + export function isObjectTypeProperty(node: Object, opts?: Object): node is ObjectTypeProperty; + export function isQualifiedTypeIdentifier(node: Object, opts?: Object): node is QualifiedTypeIdentifier; + export function isUnionTypeAnnotation(node: Object, opts?: Object): node is UnionTypeAnnotation; + export function isVoidTypeAnnotation(node: Object, opts?: Object): node is VoidTypeAnnotation; + export function isJSXAttribute(node: Object, opts?: Object): node is JSXAttribute; + export function isJSXClosingElement(node: Object, opts?: Object): node is JSXClosingElement; + export function isJSXElement(node: Object, opts?: Object): node is JSXElement; + export function isJSXEmptyExpression(node: Object, opts?: Object): node is JSXEmptyExpression; + export function isJSXExpressionContainer(node: Object, opts?: Object): node is JSXExpressionContainer; + export function isJSXIdentifier(node: Object, opts?: Object): node is JSXIdentifier; + export function isJSXMemberExpression(node: Object, opts?: Object): node is JSXMemberExpression; + export function isJSXNamespacedName(node: Object, opts?: Object): node is JSXNamespacedName; + export function isJSXOpeningElement(node: Object, opts?: Object): node is JSXOpeningElement; + export function isJSXSpreadAttribute(node: Object, opts?: Object): node is JSXSpreadAttribute; + export function isJSXText(node: Object, opts?: Object): node is JSXText; + export function isNoop(node: Object, opts?: Object): node is Noop; + export function isParenthesizedExpression(node: Object, opts?: Object): node is ParenthesizedExpression; + export function isAwaitExpression(node: Object, opts?: Object): node is AwaitExpression; + export function isBindExpression(node: Object, opts?: Object): node is BindExpression; + export function isDecorator(node: Object, opts?: Object): node is Decorator; + export function isDoExpression(node: Object, opts?: Object): node is DoExpression; + export function isExportDefaultSpecifier(node: Object, opts?: Object): node is ExportDefaultSpecifier; + export function isExportNamespaceSpecifier(node: Object, opts?: Object): node is ExportNamespaceSpecifier; + export function isRestProperty(node: Object, opts?: Object): node is RestProperty; + export function isSpreadProperty(node: Object, opts?: Object): node is SpreadProperty; + export function isExpression(node: Object, opts?: Object): node is Expression; + export function isBinary(node: Object, opts?: Object): node is Binary; + export function isScopable(node: Object, opts?: Object): node is Scopable; + export function isBlockParent(node: Object, opts?: Object): node is BlockParent; + export function isBlock(node: Object, opts?: Object): node is Block; + export function isStatement(node: Object, opts?: Object): node is Statement; + export function isTerminatorless(node: Object, opts?: Object): node is Terminatorless; + export function isCompletionStatement(node: Object, opts?: Object): node is CompletionStatement; + export function isConditional(node: Object, opts?: Object): node is Conditional; + export function isLoop(node: Object, opts?: Object): node is Loop; + export function isWhile(node: Object, opts?: Object): node is While; + export function isExpressionWrapper(node: Object, opts?: Object): node is ExpressionWrapper; + export function isFor(node: Object, opts?: Object): node is For; + export function isForXStatement(node: Object, opts?: Object): node is ForXStatement; + export function isFunction(node: Object, opts?: Object): node is Function; + export function isFunctionParent(node: Object, opts?: Object): node is FunctionParent; + export function isPureish(node: Object, opts?: Object): node is Pureish; + export function isDeclaration(node: Object, opts?: Object): node is Declaration; + export function isLVal(node: Object, opts?: Object): node is LVal; + export function isLiteral(node: Object, opts?: Object): node is Literal; + export function isImmutable(node: Object, opts?: Object): node is Immutable; + export function isUserWhitespacable(node: Object, opts?: Object): node is UserWhitespacable; + export function isMethod(node: Object, opts?: Object): node is Method; + export function isObjectMember(node: Object, opts?: Object): node is ObjectMember; + export function isProperty(node: Object, opts?: Object): node is Property; + export function isUnaryLike(node: Object, opts?: Object): node is UnaryLike; + export function isPattern(node: Object, opts?: Object): node is Pattern; + export function isClass(node: Object, opts?: Object): node is Class; + export function isModuleDeclaration(node: Object, opts?: Object): node is ModuleDeclaration; + export function isExportDeclaration(node: Object, opts?: Object): node is ExportDeclaration; + export function isModuleSpecifier(node: Object, opts?: Object): node is ModuleSpecifier; + export function isFlow(node: Object, opts?: Object): node is Flow; + export function isFlowBaseAnnotation(node: Object, opts?: Object): node is FlowBaseAnnotation; + export function isFlowDeclaration(node: Object, opts?: Object): node is FlowDeclaration; + export function isJSX(node: Object, opts?: Object): node is JSX; + export function isNumberLiteral(node: Object, opts?: Object): node is NumericLiteral; + export function isRegexLiteral(node: Object, opts?: Object): node is RegExpLiteral; + + export function isReferencedIdentifier(node: Object, opts?: Object): boolean; + export function isReferencedMemberExpression(node: Object, opts?: Object): boolean; + export function isBindingIdentifier(node: Object, opts?: Object): boolean; + export function isScope(node: Object, opts?: Object): boolean; + export function isReferenced(node: Object, opts?: Object): boolean; + export function isBlockScoped(node: Object, opts?: Object): boolean; + export function isVar(node: Object, opts?: Object): boolean; + export function isUser(node: Object, opts?: Object): boolean; + export function isGenerated(node: Object, opts?: Object): boolean; + export function isPure(node: Object, opts?: Object): boolean; + + export function assertArrayExpression(node: Object, opts?: Object): void; + export function assertAssignmentExpression(node: Object, opts?: Object): void; + export function assertBinaryExpression(node: Object, opts?: Object): void; + export function assertDirective(node: Object, opts?: Object): void; + export function assertDirectiveLiteral(node: Object, opts?: Object): void; + export function assertBlockStatement(node: Object, opts?: Object): void; + export function assertBreakStatement(node: Object, opts?: Object): void; + export function assertCallExpression(node: Object, opts?: Object): void; + export function assertCatchClause(node: Object, opts?: Object): void; + export function assertConditionalExpression(node: Object, opts?: Object): void; + export function assertContinueStatement(node: Object, opts?: Object): void; + export function assertDebuggerStatement(node: Object, opts?: Object): void; + export function assertDoWhileStatement(node: Object, opts?: Object): void; + export function assertEmptyStatement(node: Object, opts?: Object): void; + export function assertExpressionStatement(node: Object, opts?: Object): void; + export function assertFile(node: Object, opts?: Object): void; + export function assertForInStatement(node: Object, opts?: Object): void; + export function assertForStatement(node: Object, opts?: Object): void; + export function assertFunctionDeclaration(node: Object, opts?: Object): void; + export function assertFunctionExpression(node: Object, opts?: Object): void; + export function assertIdentifier(node: Object, opts?: Object): void; + export function assertIfStatement(node: Object, opts?: Object): void; + export function assertLabeledStatement(node: Object, opts?: Object): void; + export function assertStringLiteral(node: Object, opts?: Object): void; + export function assertNumericLiteral(node: Object, opts?: Object): void; + export function assertNullLiteral(node: Object, opts?: Object): void; + export function assertBooleanLiteral(node: Object, opts?: Object): void; + export function assertRegExpLiteral(node: Object, opts?: Object): void; + export function assertLogicalExpression(node: Object, opts?: Object): void; + export function assertMemberExpression(node: Object, opts?: Object): void; + export function assertNewExpression(node: Object, opts?: Object): void; + export function assertProgram(node: Object, opts?: Object): void; + export function assertObjectExpression(node: Object, opts?: Object): void; + export function assertObjectMethod(node: Object, opts?: Object): void; + export function assertObjectProperty(node: Object, opts?: Object): void; + export function assertRestElement(node: Object, opts?: Object): void; + export function assertReturnStatement(node: Object, opts?: Object): void; + export function assertSequenceExpression(node: Object, opts?: Object): void; + export function assertSwitchCase(node: Object, opts?: Object): void; + export function assertSwitchStatement(node: Object, opts?: Object): void; + export function assertThisExpression(node: Object, opts?: Object): void; + export function assertThrowStatement(node: Object, opts?: Object): void; + export function assertTryStatement(node: Object, opts?: Object): void; + export function assertUnaryExpression(node: Object, opts?: Object): void; + export function assertUpdateExpression(node: Object, opts?: Object): void; + export function assertVariableDeclaration(node: Object, opts?: Object): void; + export function assertVariableDeclarator(node: Object, opts?: Object): void; + export function assertWhileStatement(node: Object, opts?: Object): void; + export function assertWithStatement(node: Object, opts?: Object): void; + export function assertAssignmentPattern(node: Object, opts?: Object): void; + export function assertArrayPattern(node: Object, opts?: Object): void; + export function assertArrowFunctionExpression(node: Object, opts?: Object): void; + export function assertClassBody(node: Object, opts?: Object): void; + export function assertClassDeclaration(node: Object, opts?: Object): void; + export function assertClassExpression(node: Object, opts?: Object): void; + export function assertExportAllDeclaration(node: Object, opts?: Object): void; + export function assertExportDefaultDeclaration(node: Object, opts?: Object): void; + export function assertExportNamedDeclaration(node: Object, opts?: Object): void; + export function assertExportSpecifier(node: Object, opts?: Object): void; + export function assertForOfStatement(node: Object, opts?: Object): void; + export function assertImportDeclaration(node: Object, opts?: Object): void; + export function assertImportDefaultSpecifier(node: Object, opts?: Object): void; + export function assertImportNamespaceSpecifier(node: Object, opts?: Object): void; + export function assertImportSpecifier(node: Object, opts?: Object): void; + export function assertMetaProperty(node: Object, opts?: Object): void; + export function assertClassMethod(node: Object, opts?: Object): void; + export function assertObjectPattern(node: Object, opts?: Object): void; + export function assertSpreadElement(node: Object, opts?: Object): void; + export function assertSuper(node: Object, opts?: Object): void; + export function assertTaggedTemplateExpression(node: Object, opts?: Object): void; + export function assertTemplateElement(node: Object, opts?: Object): void; + export function assertTemplateLiteral(node: Object, opts?: Object): void; + export function assertYieldExpression(node: Object, opts?: Object): void; + export function assertAnyTypeAnnotation(node: Object, opts?: Object): void; + export function assertArrayTypeAnnotation(node: Object, opts?: Object): void; + export function assertBooleanTypeAnnotation(node: Object, opts?: Object): void; + export function assertBooleanLiteralTypeAnnotation(node: Object, opts?: Object): void; + export function assertNullLiteralTypeAnnotation(node: Object, opts?: Object): void; + export function assertClassImplements(node: Object, opts?: Object): void; + export function assertClassProperty(node: Object, opts?: Object): void; + export function assertDeclareClass(node: Object, opts?: Object): void; + export function assertDeclareFunction(node: Object, opts?: Object): void; + export function assertDeclareInterface(node: Object, opts?: Object): void; + export function assertDeclareModule(node: Object, opts?: Object): void; + export function assertDeclareTypeAlias(node: Object, opts?: Object): void; + export function assertDeclareVariable(node: Object, opts?: Object): void; + export function assertExistentialTypeParam(node: Object, opts?: Object): void; + export function assertFunctionTypeAnnotation(node: Object, opts?: Object): void; + export function assertFunctionTypeParam(node: Object, opts?: Object): void; + export function assertGenericTypeAnnotation(node: Object, opts?: Object): void; + export function assertInterfaceExtends(node: Object, opts?: Object): void; + export function assertInterfaceDeclaration(node: Object, opts?: Object): void; + export function assertIntersectionTypeAnnotation(node: Object, opts?: Object): void; + export function assertMixedTypeAnnotation(node: Object, opts?: Object): void; + export function assertNullableTypeAnnotation(node: Object, opts?: Object): void; + export function assertNumericLiteralTypeAnnotation(node: Object, opts?: Object): void; + export function assertNumberTypeAnnotation(node: Object, opts?: Object): void; + export function assertStringLiteralTypeAnnotation(node: Object, opts?: Object): void; + export function assertStringTypeAnnotation(node: Object, opts?: Object): void; + export function assertThisTypeAnnotation(node: Object, opts?: Object): void; + export function assertTupleTypeAnnotation(node: Object, opts?: Object): void; + export function assertTypeofTypeAnnotation(node: Object, opts?: Object): void; + export function assertTypeAlias(node: Object, opts?: Object): void; + export function assertTypeAnnotation(node: Object, opts?: Object): void; + export function assertTypeCastExpression(node: Object, opts?: Object): void; + export function assertTypeParameterDeclaration(node: Object, opts?: Object): void; + export function assertTypeParameterInstantiation(node: Object, opts?: Object): void; + export function assertObjectTypeAnnotation(node: Object, opts?: Object): void; + export function assertObjectTypeCallProperty(node: Object, opts?: Object): void; + export function assertObjectTypeIndexer(node: Object, opts?: Object): void; + export function assertObjectTypeProperty(node: Object, opts?: Object): void; + export function assertQualifiedTypeIdentifier(node: Object, opts?: Object): void; + export function assertUnionTypeAnnotation(node: Object, opts?: Object): void; + export function assertVoidTypeAnnotation(node: Object, opts?: Object): void; + export function assertJSXAttribute(node: Object, opts?: Object): void; + export function assertJSXClosingElement(node: Object, opts?: Object): void; + export function assertJSXElement(node: Object, opts?: Object): void; + export function assertJSXEmptyExpression(node: Object, opts?: Object): void; + export function assertJSXExpressionContainer(node: Object, opts?: Object): void; + export function assertJSXIdentifier(node: Object, opts?: Object): void; + export function assertJSXMemberExpression(node: Object, opts?: Object): void; + export function assertJSXNamespacedName(node: Object, opts?: Object): void; + export function assertJSXOpeningElement(node: Object, opts?: Object): void; + export function assertJSXSpreadAttribute(node: Object, opts?: Object): void; + export function assertJSXText(node: Object, opts?: Object): void; + export function assertNoop(node: Object, opts?: Object): void; + export function assertParenthesizedExpression(node: Object, opts?: Object): void; + export function assertAwaitExpression(node: Object, opts?: Object): void; + export function assertBindExpression(node: Object, opts?: Object): void; + export function assertDecorator(node: Object, opts?: Object): void; + export function assertDoExpression(node: Object, opts?: Object): void; + export function assertExportDefaultSpecifier(node: Object, opts?: Object): void; + export function assertExportNamespaceSpecifier(node: Object, opts?: Object): void; + export function assertRestProperty(node: Object, opts?: Object): void; + export function assertSpreadProperty(node: Object, opts?: Object): void; + export function assertExpression(node: Object, opts?: Object): void; + export function assertBinary(node: Object, opts?: Object): void; + export function assertScopable(node: Object, opts?: Object): void; + export function assertBlockParent(node: Object, opts?: Object): void; + export function assertBlock(node: Object, opts?: Object): void; + export function assertStatement(node: Object, opts?: Object): void; + export function assertTerminatorless(node: Object, opts?: Object): void; + export function assertCompletionStatement(node: Object, opts?: Object): void; + export function assertConditional(node: Object, opts?: Object): void; + export function assertLoop(node: Object, opts?: Object): void; + export function assertWhile(node: Object, opts?: Object): void; + export function assertExpressionWrapper(node: Object, opts?: Object): void; + export function assertFor(node: Object, opts?: Object): void; + export function assertForXStatement(node: Object, opts?: Object): void; + export function assertFunction(node: Object, opts?: Object): void; + export function assertFunctionParent(node: Object, opts?: Object): void; + export function assertPureish(node: Object, opts?: Object): void; + export function assertDeclaration(node: Object, opts?: Object): void; + export function assertLVal(node: Object, opts?: Object): void; + export function assertLiteral(node: Object, opts?: Object): void; + export function assertImmutable(node: Object, opts?: Object): void; + export function assertUserWhitespacable(node: Object, opts?: Object): void; + export function assertMethod(node: Object, opts?: Object): void; + export function assertObjectMember(node: Object, opts?: Object): void; + export function assertProperty(node: Object, opts?: Object): void; + export function assertUnaryLike(node: Object, opts?: Object): void; + export function assertPattern(node: Object, opts?: Object): void; + export function assertClass(node: Object, opts?: Object): void; + export function assertModuleDeclaration(node: Object, opts?: Object): void; + export function assertExportDeclaration(node: Object, opts?: Object): void; + export function assertModuleSpecifier(node: Object, opts?: Object): void; + export function assertFlow(node: Object, opts?: Object): void; + export function assertFlowBaseAnnotation(node: Object, opts?: Object): void; + export function assertFlowDeclaration(node: Object, opts?: Object): void; + export function assertJSX(node: Object, opts?: Object): void; + export function assertNumberLiteral(node: Object, opts?: Object): void; + export function assertRegexLiteral(node: Object, opts?: Object): void; +} diff --git a/babylon/babylon-tests.ts b/babylon/babylon-tests.ts new file mode 100644 index 0000000000..16a6998037 --- /dev/null +++ b/babylon/babylon-tests.ts @@ -0,0 +1,24 @@ +/// +/// +/// + + +// Example from https://github.com/thejameskyle/babel-handbook/blob/master/translations/en/plugin-handbook.md#babylon +import * as babylon from "babylon"; +declare function assert(expr: boolean): void; + +const code = `function square(n) { + return n * n; +}`; + +let node = babylon.parse(code); +assert(node.type === "File"); +assert(node.start === 0); +assert(node.end === 38); +assert(node.loc.start > node.loc.end); + + +babylon.parse(code, { + sourceType: "module", // default: "script" + plugins: ["jsx"] // default: [] +}); diff --git a/babylon/babylon.d.ts b/babylon/babylon.d.ts new file mode 100644 index 0000000000..88be6dab84 --- /dev/null +++ b/babylon/babylon.d.ts @@ -0,0 +1,48 @@ +// Type definitions for babylon v6.7 +// Project: https://github.com/babel/babylon +// Definitions by: Troy Gerwien +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "babylon" { + import * as t from 'babel-types'; + type Node = t.Node; + + export function parse(code: string, opts?: BabylonOptions): Node; + + export interface BabylonOptions { + /** + * By default, import and export declarations can only appear at a program's top level. + * Setting this option to true allows them anywhere where a statement is allowed. + */ + allowImportExportEverywhere?: boolean; + + /** + * By default, a return statement at the top level raises an error. Set this to true to accept such code. + */ + allowReturnOutsideFunction?: boolean; + + allowSuperOutsideMethod?: boolean; + + /** + * Indicate the mode the code should be parsed in. Can be either "script" or "module". + */ + sourceType?: 'script' | 'module'; + + /** + * Correlate output AST nodes with their source filename. Useful when + * generating code and source maps from the ASTs of multiple input files. + */ + sourceFilename?: string; + + /** + * Array containing the plugins that you want to enable. + */ + plugins?: PluginName[]; + } + + export type PluginName = 'jsx' | 'flow' | 'asyncFunctions' | 'classConstructorCall' | 'doExpressions' + | 'trailingFunctionCommas' | 'objectRestSpread' | 'decorators' | 'classProperties' | 'exportExtensions' + | 'exponentiationOperator' | 'asyncGenerators' | 'functionBind' | 'functionSent'; +} diff --git a/chai-as-promised/chai-as-promised.d.ts b/chai-as-promised/chai-as-promised.d.ts index 91a46f9033..6b2882b338 100644 --- a/chai-as-promised/chai-as-promised.d.ts +++ b/chai-as-promised/chai-as-promised.d.ts @@ -36,6 +36,7 @@ declare namespace Chai { // From chai not: PromisedAssertion; deep: PromisedDeep; + all: PromisedKeyFilter; a: PromisedTypeComparison; an: PromisedTypeComparison; include: PromisedInclude; @@ -129,6 +130,10 @@ declare namespace Chai { property: PromisedProperty; } + interface PromisedKeyFilter { + keys: PromisedKeys; + } + interface PromisedEqual { (value: any, message?: string): PromisedAssertion; } @@ -151,6 +156,7 @@ declare namespace Chai { (value: number, message?: string): PromisedAssertion; keys: PromisedKeys; members: PromisedMembers; + all: PromisedKeyFilter; } interface PromisedKeys { diff --git a/codemirror/codemirror.d.ts b/codemirror/codemirror.d.ts index 6196d015c6..bade422821 100644 --- a/codemirror/codemirror.d.ts +++ b/codemirror/codemirror.d.ts @@ -1063,6 +1063,12 @@ declare namespace CodeMirror { */ function defineMode(id: string, modefactory: ModeFactory): void; + /** + * id will be the id for the defined mode. Typically, you should use this second argument to defineMode as your module scope function + * (modes should not leak anything into the global scope!), i.e. write your whole mode inside this function. + */ + function defineMode(id: string, modefactory: ModeFactory): void; + /** * The first argument is a configuration object as passed to the mode constructor function, and the second argument * is a mode specification as in the EditorConfiguration mode option. diff --git a/es6-promise/es6-promise-tests.ts b/es6-promise/es6-promise-tests.ts index ac4f92d3d5..ee88cbc96f 100644 --- a/es6-promise/es6-promise-tests.ts +++ b/es6-promise/es6-promise-tests.ts @@ -80,9 +80,8 @@ promiseNumber = catchWithSimpleResult; var catchWithPromiseResult = promiseString.catch(error => Promise.resolve(10)); promiseNumber = catchWithPromiseResult; -promiseString = promiseString.catch(function () { +promiseString = promiseString.catch(function (): string { throw new Error('Better error msg'); - return null; }); //examples coming from http://www.html5rocks.com/en/tutorials/es6/promises/ diff --git a/es6-promise/es6-promise.d.ts b/es6-promise/es6-promise.d.ts index ec0c222385..001330fd24 100644 --- a/es6-promise/es6-promise.d.ts +++ b/es6-promise/es6-promise.d.ts @@ -58,7 +58,16 @@ declare namespace Promise { * the array passed to all can be a mixture of promise-like objects and other objects. * The fulfillment value is an array (in order) of fulfillment values. The rejection value is the first rejection value. */ - function all(promises: (T | Thenable)[]): Promise; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable, T10 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9, T10]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable, T9 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8, T9]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable, T8 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7, T8]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable, T7 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6, T7]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable, T6 | Thenable]): Promise<[T1, T2, T3, T4, T5, T6]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable , T5 | Thenable]): Promise<[T1, T2, T3, T4, T5]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable, T4 | Thenable ]): Promise<[T1, T2, T3, T4]>; + function all(values: [T1 | Thenable, T2 | Thenable, T3 | Thenable]): Promise<[T1, T2, T3]>; + function all(values: [T1 | Thenable, T2 | Thenable]): Promise<[T1, T2]>; + function all(values: (T | Thenable)[]): Promise; /** * Make a Promise that fulfills when any item fulfills, and rejects if any item rejects. diff --git a/hapi/hapi.d.ts b/hapi/hapi.d.ts index 874a73a6c3..9962dd6c62 100644 --- a/hapi/hapi.d.ts +++ b/hapi/hapi.d.ts @@ -12,6 +12,7 @@ declare module "hapi" { import http = require("http"); import stream = require("stream"); import Events = require("events"); + import url = require("url"); interface IDictionary { [key: string]: T; @@ -303,7 +304,7 @@ declare module "hapi" { response(result: any): Response; /** Sets a cookie on the response */ - state(name: string, value: string, options?: any): void; + state(name: string, value: any, options?: any): void; /** Clears a cookie on the response */ unstate(name: string, options?: any): void; @@ -1250,8 +1251,7 @@ declare module "hapi" { request.setUrl('/test'); return reply.continue(); });*/ - setUrl(url: string): void; - + setUrl(url: string | url.Url): void; /** request.setMethod(method) Available only in 'onRequest' extension methods. diff --git a/hellojs/hellojs.d.ts b/hellojs/hellojs.d.ts index 6da9f9ca0b..686d5c1adf 100644 --- a/hellojs/hellojs.d.ts +++ b/hellojs/hellojs.d.ts @@ -80,3 +80,8 @@ interface HelloJSServiceDef { } declare var hello: HelloJSStatic; + +// Support AMD require +declare module 'hellojs' { + export = hello; +} diff --git a/helmet/helmet-tests.ts b/helmet/helmet-tests.ts index 98ebb77d00..0223244cc0 100644 --- a/helmet/helmet-tests.ts +++ b/helmet/helmet-tests.ts @@ -110,8 +110,46 @@ function noSniffTest() { */ function publicKeyPinsTest() { app.use(helmet.publicKeyPins({ + maxAge: 7776000000, + sha256s: ["AbCdEf123=", "ZyXwVu456="], + })); + + app.use(helmet.publicKeyPins({ + maxAge: 7776000000, + sha256s: ["AbCdEf123=", "ZyXwVu456="], + includeSubdomains: false + })); + + app.use(helmet.publicKeyPins({ + maxAge: 7776000000, + sha256s: ["AbCdEf123=", "ZyXwVu456="], + includeSubdomains: true + })); + + app.use(helmet.publicKeyPins({ + maxAge: 7776000000, sha256s: ["AbCdEf123=", "ZyXwVu456="], - includeSubdomains: true, reportUri: "http://example.com" })); + + app.use(helmet.publicKeyPins({ + maxAge: 7776000000, + sha256s: ["AbCdEf123=", "ZyXwVu456="], + reportOnly: true + })); + + app.use(helmet.publicKeyPins({ + maxAge: 7776000000, + sha256s: ["AbCdEf123=", "ZyXwVu456="], + setIf: function (req, res) { return true; } + })); +} + +/** + * @summary Test for {@see helmet#dnsPrefetchControl} function. + */ +function dnsPrefetchControlTest() { + app.use(helmet.dnsPrefetchControl()); + app.use(helmet.dnsPrefetchControl({ allow: false })); + app.use(helmet.dnsPrefetchControl({ allow: true })); } diff --git a/helmet/helmet.d.ts b/helmet/helmet.d.ts index 5c34378f04..f32ba0a2d9 100644 --- a/helmet/helmet.d.ts +++ b/helmet/helmet.d.ts @@ -40,10 +40,27 @@ declare module "helmet" { directives? : IHelmetCspDirectives } + interface IHelmetPublicKeyPinsSetIfFunction { + (req: express.Request, res: express.Response): boolean; + } + + interface IHelmetPublicKeyPinsConfiguration { + maxAge : number; + sha256s : string[]; + includeSubdomains? : boolean; + reportUri? : string; + reportOnly? : boolean; + setIf?: IHelmetPublicKeyPinsSetIfFunction + } + interface IHelmetXssFilterConfiguration { setOnOldIE? : boolean; } + interface IHelmetDnsPrefetchControlConfiguration { + allow? : boolean; + } + /** * @summary Interface for helmet class. * @interface @@ -55,6 +72,11 @@ declare module "helmet" { */ ():express.RequestHandler; + /** + * @summary Stop browsers from doing DNS prefetching. + */ + dnsPrefetchControl(options ?: IHelmetDnsPrefetchControlConfiguration):express.RequestHandler; + /** * @summary Prevent clickjacking. * @param {string} header The header. @@ -98,7 +120,7 @@ declare module "helmet" { * @summary Adds the "Public-Key-Pins" header. * @return {RequestHandler} The Request handler. */ - publicKeyPins(options ?: Object):express.RequestHandler; + publicKeyPins(options ?: IHelmetPublicKeyPinsConfiguration):express.RequestHandler; /** * @summary Mitigate cross-site scripting attacks with the "X-XSS-Protection" header. diff --git a/ionic/ionic-tests.ts b/ionic/ionic-tests.ts index 8491fc13f8..1790e542f1 100644 --- a/ionic/ionic-tests.ts +++ b/ionic/ionic-tests.ts @@ -387,6 +387,7 @@ class IonicTestController { ready = ionic.Platform.ready(callbackWithReturn); var setGrade: void = ionic.Platform.setGrade('iOS'); var deviceInformation: string = ionic.Platform.device(); + var isBrowser: boolean = ionic.Platform.is('browser'); var isWebView: boolean = ionic.Platform.isWebView(); var isIPad: boolean = ionic.Platform.isIPad(); var isIOS: boolean = ionic.Platform.isIOS(); diff --git a/ionic/ionic.d.ts b/ionic/ionic.d.ts index 994b7ae27e..e2cbc195b7 100644 --- a/ionic/ionic.d.ts +++ b/ionic/ionic.d.ts @@ -32,6 +32,10 @@ interface IonicStatic { * Return the current device (given by cordova). */ device(): any; + /** + * Check if the platform name provided is detected. + */ + is(platformName: string): boolean; /** * Check if we are running within a WebView (such as Cordova). */ diff --git a/jquery-backstretch/jquery-backstretch-tests.ts b/jquery-backstretch/jquery-backstretch-tests.ts new file mode 100644 index 0000000000..b658c6aaeb --- /dev/null +++ b/jquery-backstretch/jquery-backstretch-tests.ts @@ -0,0 +1,19 @@ +/// +/// + +var backstretch = jQuery.backstretch(['image.png'], { + centeredX: false, + centeredY: false, + duration: 'normal', + fade: 1000 +}); + +backstretch.next(); +backstretch.prev(); +backstretch.pause(); +backstretch.resize(); +backstretch.resume(); +backstretch.destroy(true); + +jQuery('body').backstretch(['image.png']).pause(); +jQuery('body').backstretch('resume'); diff --git a/jquery-backstretch/jquery-backstretch.d.ts b/jquery-backstretch/jquery-backstretch.d.ts new file mode 100644 index 0000000000..5c951beeee --- /dev/null +++ b/jquery-backstretch/jquery-backstretch.d.ts @@ -0,0 +1,92 @@ +// Type definitions for backstretch v 2.0.4 +// Project: https://github.com/srobbin/jquery-backstretch +// Definitions by: Dmytro Kulyk +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare namespace JQueryBackStretch { + + interface BackStretchOptions { + /** + * The ratio of the width/height of the image doesn't always jive with the + * width/height of the window. This parameter controls whether or not we + * center the image on the X axis to account for the discrepancy. + */ + centeredX?:boolean; + + /** + * This parameter controls whether or not we center the image on the Y axis + * to account for the aforementioned discrepancy. + */ + centeredY?:boolean; + + /** + * This is the speed at which the image will fade in. Integers in + * milliseconds are accepted, as well as standard jQuery speed strings + * (slow, normal, fast). + */ + duration?:number | string; + + /** + * The amount of time in between slides, when using Backstretch as a + * slideshow, expressed as the number of milliseconds. + */ + fade?:number; + } + + interface BackStretch { + /** + * This method is called automatically when the container (window or + * block-level element) is resized, however you can always call this + * manually if needed. + */ + resize():BackStretch; + + /** + * Jump to the slide at a given index, where n is the number of the + * image that you'd like to display. Slide number starts at 0. + * + * @param {number} newIndex + */ + show(newIndex:number):BackStretch; + + /** + * Advance to the next image in a slideshow. + */ + next():BackStretch; + + /** + * Display the previous image in a slideshow. + */ + prev():BackStretch; + + /** + * Pause the slideshow. + */ + pause():BackStretch; + + /** + * Resume a paused slideshow. + */ + resume():BackStretch; + + /** + * Destroy the Backstretch instance. Optionally, you can pass in a Boolean + * parameter, preserveBackground, to determine whether or not you'd like + * to keep the current image stretched as the background image. + * + * @param {boolean} preserveBackground + */ + destroy(preserveBackground?:boolean):void; + } +} + +interface JQueryStatic { + backstretch(images:string[], config?:JQueryBackStretch.BackStretchOptions):JQueryBackStretch.BackStretch; +} + +interface JQuery { + backstretch(images:string[], config?:JQueryBackStretch.BackStretchOptions):JQueryBackStretch.BackStretch; + backstretch(method:string):JQuery; +} \ No newline at end of file diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index ecd9266b45..a3a8e6581d 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -2528,6 +2528,18 @@ function test_jQuery() { $.post('url.xml', function (data) { var $child = $(data).find('child'); }); + $.post({ + url: "test.php", + success : () => { + console.log("successfull"); + } + }); + $.get({ + url: "test.php", + success : () => { + console.log("successfull"); + } + }); var foo = { foo: 'bar', hello: 'world' }; var $foo = $(foo); var test1 = $foo.prop('foo'); diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 51a2773bf2..6478529dad 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -676,6 +676,12 @@ interface JQueryStatic { * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, or html). */ get(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; + /** + * Load data from the server using a HTTP GET request. + * + * @param settings The JQueryAjaxSettings to be used for the request + */ + get(settings : JQueryAjaxSettings): JQueryXHR; /** * Load JSON-encoded data from the server using a GET HTTP request. * @@ -721,7 +727,12 @@ interface JQueryStatic { * @param dataType The type of data expected from the server. Default: Intelligent Guess (xml, json, script, text, html). */ post(url: string, data?: Object|string, success?: (data: any, textStatus: string, jqXHR: JQueryXHR) => any, dataType?: string): JQueryXHR; - + /** + * Load data from the server using a HTTP POST request. + * + * @param settings The JQueryAjaxSettings to be used for the request + */ + post(settings : JQueryAjaxSettings): JQueryXHR; /** * A multi-purpose callbacks list object that provides a powerful way to manage callback lists. * diff --git a/koa-mount/koa-mount-tests.ts b/koa-mount/koa-mount-tests.ts new file mode 100644 index 0000000000..560938b22f --- /dev/null +++ b/koa-mount/koa-mount-tests.ts @@ -0,0 +1,26 @@ +/// +/// + +import * as Koa from "koa"; +import mount = require("koa-mount"); + +const a = new Koa(); + +a.use((next) => { + this.body = "Hello"; +}) + +const b = new Koa(); + +b.use((next) => { + this.body = "World"; +}); + +const app = new Koa(); + +app.use(mount("/hello", a)); +app.use(mount("/world", b)); + +app.listen(3000); +console.log("listening on port 3000"); + diff --git a/koa-mount/koa-mount.d.ts b/koa-mount/koa-mount.d.ts new file mode 100644 index 0000000000..6c9c83bb73 --- /dev/null +++ b/koa-mount/koa-mount.d.ts @@ -0,0 +1,23 @@ +// Type definitions for koa-mount v2.0.0 +// Project: https://github.com/koajs/mount +// Definitions by: AmirSaber Sharifi +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare module "koa-mount" { + + import * as Koa from "koa"; + + interface Function { (ctx: Koa.Context, next?: () => any): any } + + function mount(app: Function): Function; + + function mount(app: Koa): Function; + + function mount(prefix: string, app: Function): Function; + + function mount(prefix: string, app: Koa): Function; + + export = mount; +} diff --git a/lodash/lodash-tests.ts b/lodash/lodash-tests.ts index 7931acb2b2..2d5f5b50f3 100644 --- a/lodash/lodash-tests.ts +++ b/lodash/lodash-tests.ts @@ -527,16 +527,12 @@ namespace TestDropRightWhile { result = _.dropRightWhile(array); result = _.dropRightWhile(array, predicateFn); - result = _.dropRightWhile(array, predicateFn, any); result = _.dropRightWhile(array, ''); - result = _.dropRightWhile(array, '', any); result = _.dropRightWhile<{a: number;}, TResult>(array, {a: 42}); result = _.dropRightWhile(list); result = _.dropRightWhile(list, predicateFn); - result = _.dropRightWhile(list, predicateFn, any); result = _.dropRightWhile(list, ''); - result = _.dropRightWhile(list, '', any); result = _.dropRightWhile<{a: number;}, TResult>(list, {a: 42}); } @@ -545,16 +541,12 @@ namespace TestDropRightWhile { result = _(array).dropRightWhile(); result = _(array).dropRightWhile(predicateFn); - result = _(array).dropRightWhile(predicateFn, any); result = _(array).dropRightWhile(''); - result = _(array).dropRightWhile('', any); result = _(array).dropRightWhile<{a: number;}>({a: 42}); result = _(list).dropRightWhile(); result = _(list).dropRightWhile(predicateFn); - result = _(list).dropRightWhile(predicateFn, any); result = _(list).dropRightWhile(''); - result = _(list).dropRightWhile('', any); result = _(list).dropRightWhile<{a: number;}, TResult>({a: 42}); } @@ -563,16 +555,12 @@ namespace TestDropRightWhile { result = _(array).chain().dropRightWhile(); result = _(array).chain().dropRightWhile(predicateFn); - result = _(array).chain().dropRightWhile(predicateFn, any); result = _(array).chain().dropRightWhile(''); - result = _(array).chain().dropRightWhile('', any); result = _(array).chain().dropRightWhile<{a: number;}>({a: 42}); result = _(list).chain().dropRightWhile(); result = _(list).chain().dropRightWhile(predicateFn); - result = _(list).chain().dropRightWhile(predicateFn, any); result = _(list).chain().dropRightWhile(''); - result = _(list).chain().dropRightWhile('', any); result = _(list).chain().dropRightWhile<{a: number;}, TResult>({a: 42}); } } @@ -588,16 +576,12 @@ namespace TestDropWhile { result = _.dropWhile(array); result = _.dropWhile(array, predicateFn); - result = _.dropWhile(array, predicateFn, any); result = _.dropWhile(array, ''); - result = _.dropWhile(array, '', any); result = _.dropWhile<{a: number;}, TResult>(array, {a: 42}); result = _.dropWhile(list); result = _.dropWhile(list, predicateFn); - result = _.dropWhile(list, predicateFn, any); result = _.dropWhile(list, ''); - result = _.dropWhile(list, '', any); result = _.dropWhile<{a: number;}, TResult>(list, {a: 42}); } @@ -606,16 +590,12 @@ namespace TestDropWhile { result = _(array).dropWhile(); result = _(array).dropWhile(predicateFn); - result = _(array).dropWhile(predicateFn, any); result = _(array).dropWhile(''); - result = _(array).dropWhile('', any); result = _(array).dropWhile<{a: number;}>({a: 42}); result = _(list).dropWhile(); result = _(list).dropWhile(predicateFn); - result = _(list).dropWhile(predicateFn, any); result = _(list).dropWhile(''); - result = _(list).dropWhile('', any); result = _(list).dropWhile<{a: number;}, TResult>({a: 42}); } @@ -624,16 +604,12 @@ namespace TestDropWhile { result = _(array).chain().dropWhile(); result = _(array).chain().dropWhile(predicateFn); - result = _(array).chain().dropWhile(predicateFn, any); result = _(array).chain().dropWhile(''); - result = _(array).chain().dropWhile('', any); result = _(array).chain().dropWhile<{a: number;}>({a: 42}); result = _(list).chain().dropWhile(); result = _(list).chain().dropWhile(predicateFn); - result = _(list).chain().dropWhile(predicateFn, any); result = _(list).chain().dropWhile(''); - result = _(list).chain().dropWhile('', any); result = _(list).chain().dropWhile<{a: number;}, TResult>({a: 42}); } } @@ -703,30 +679,22 @@ namespace TestFindIndex { result = _.findIndex(array); result = _.findIndex(array, predicateFn); - result = _.findIndex(array, predicateFn, any); result = _.findIndex(array, ''); - result = _.findIndex(array, '', any); result = _.findIndex<{a: number}, TResult>(array, {a: 42}); result = _.findIndex(list); result = _.findIndex(list, predicateFn); - result = _.findIndex(list, predicateFn, any); result = _.findIndex(list, ''); - result = _.findIndex(list, '', any); result = _.findIndex<{a: number}, TResult>(list, {a: 42}); result = _(array).findIndex(); result = _(array).findIndex(predicateFn); - result = _(array).findIndex(predicateFn, any); result = _(array).findIndex(''); - result = _(array).findIndex('', any); result = _(array).findIndex<{a: number}>({a: 42}); result = _(list).findIndex(); result = _(list).findIndex(predicateFn); - result = _(list).findIndex(predicateFn, any); result = _(list).findIndex(''); - result = _(list).findIndex('', any); result = _(list).findIndex<{a: number}>({a: 42}); } @@ -735,16 +703,12 @@ namespace TestFindIndex { result = _(array).chain().findIndex(); result = _(array).chain().findIndex(predicateFn); - result = _(array).chain().findIndex(predicateFn, any); result = _(array).chain().findIndex(''); - result = _(array).chain().findIndex('', any); result = _(array).chain().findIndex<{a: number}>({a: 42}); result = _(list).chain().findIndex(); result = _(list).chain().findIndex(predicateFn); - result = _(list).chain().findIndex(predicateFn, any); result = _(list).chain().findIndex(''); - result = _(list).chain().findIndex('', any); result = _(list).chain().findIndex<{a: number}>({a: 42}); } } @@ -761,30 +725,22 @@ namespace TestFindLastIndex { result = _.findLastIndex(array); result = _.findLastIndex(array, predicateFn); - result = _.findLastIndex(array, predicateFn, any); result = _.findLastIndex(array, ''); - result = _.findLastIndex(array, '', any); result = _.findLastIndex<{a: number}, TResult>(array, {a: 42}); result = _.findLastIndex(list); result = _.findLastIndex(list, predicateFn); - result = _.findLastIndex(list, predicateFn, any); result = _.findLastIndex(list, ''); - result = _.findLastIndex(list, '', any); result = _.findLastIndex<{a: number}, TResult>(list, {a: 42}); result = _(array).findLastIndex(); result = _(array).findLastIndex(predicateFn); - result = _(array).findLastIndex(predicateFn, any); result = _(array).findLastIndex(''); - result = _(array).findLastIndex('', any); result = _(array).findLastIndex<{a: number}>({a: 42}); result = _(list).findLastIndex(); result = _(list).findLastIndex(predicateFn); - result = _(list).findLastIndex(predicateFn, any); result = _(list).findLastIndex(''); - result = _(list).findLastIndex('', any); result = _(list).findLastIndex<{a: number}>({a: 42}); } @@ -793,16 +749,12 @@ namespace TestFindLastIndex { result = _(array).chain().findLastIndex(); result = _(array).chain().findLastIndex(predicateFn); - result = _(array).chain().findLastIndex(predicateFn, any); result = _(array).chain().findLastIndex(''); - result = _(array).chain().findLastIndex('', any); result = _(array).chain().findLastIndex<{a: number}>({a: 42}); result = _(list).chain().findLastIndex(); result = _(list).chain().findLastIndex(predicateFn); - result = _(list).chain().findLastIndex(predicateFn, any); result = _(list).chain().findLastIndex(''); - result = _(list).chain().findLastIndex('', any); result = _(list).chain().findLastIndex<{a: number}>({a: 42}); } } @@ -1019,6 +971,24 @@ namespace TestFlattenDeep { } } +// _.fromPairs +namespace TestFromPairs { + let array: string[][]; + let result: _.Dictionary; + + { + result = _.fromPairs(array); + } + + { + result = _(array).fromPairs().value(); + } + + { + result = _.chain(array).fromPairs().value(); + } +} + // _.head namespace TestHead { let array: TResult[]; @@ -1412,16 +1382,12 @@ namespace TestRemove { result = _.remove(array); result = _.remove(array, predicateFn); - result = _.remove(array, predicateFn, any); result = _.remove(array, ''); - result = _.remove(array, '', any); result = _.remove<{a: number}, TResult>(array, {a: 42}); result = _.remove(list); result = _.remove(list, predicateFn); - result = _.remove(list, predicateFn, any); result = _.remove(list, ''); - result = _.remove(list, '', any); result = _.remove<{a: number}, TResult>(list, {a: 42}); } @@ -1430,16 +1396,12 @@ namespace TestRemove { result = _(array).remove(); result = _(array).remove(predicateFn); - result = _(array).remove(predicateFn, any); result = _(array).remove(''); - result = _(array).remove('', any); result = _(array).remove<{a: number}>({a: 42}); result = _(list).remove(); result = _(list).remove(predicateFn); - result = _(list).remove(predicateFn, any); result = _(list).remove(''); - result = _(list).remove('', any); result = _(list).remove<{a: number}, TResult>({a: 42}); } @@ -1448,16 +1410,12 @@ namespace TestRemove { result = _(array).chain().remove(); result = _(array).chain().remove(predicateFn); - result = _(array).chain().remove(predicateFn, any); result = _(array).chain().remove(''); - result = _(array).chain().remove('', any); result = _(array).chain().remove<{a: number}>({a: 42}); result = _(list).chain().remove(); result = _(list).chain().remove(predicateFn); - result = _(list).chain().remove(predicateFn, any); result = _(list).chain().remove(''); - result = _(list).chain().remove('', any); result = _(list).chain().remove<{a: number}, TResult>({a: 42}); } } @@ -1834,16 +1792,12 @@ namespace TestTakeRightWhile { result = _.takeRightWhile(array); result = _.takeRightWhile(array, predicateFn); - result = _.takeRightWhile(array, predicateFn, any); result = _.takeRightWhile(array, ''); - result = _.takeRightWhile(array, '', any); result = _.takeRightWhile<{a: number;}, TResult>(array, {a: 42}); result = _.takeRightWhile(list); result = _.takeRightWhile(list, predicateFn); - result = _.takeRightWhile(list, predicateFn, any); result = _.takeRightWhile(list, ''); - result = _.takeRightWhile(list, '', any); result = _.takeRightWhile<{a: number;}, TResult>(list, {a: 42}); } @@ -1852,16 +1806,12 @@ namespace TestTakeRightWhile { result = _(array).takeRightWhile(); result = _(array).takeRightWhile(predicateFn); - result = _(array).takeRightWhile(predicateFn, any); result = _(array).takeRightWhile(''); - result = _(array).takeRightWhile('', any); result = _(array).takeRightWhile<{a: number;}>({a: 42}); result = _(list).takeRightWhile(); result = _(list).takeRightWhile(predicateFn); - result = _(list).takeRightWhile(predicateFn, any); result = _(list).takeRightWhile(''); - result = _(list).takeRightWhile('', any); result = _(list).takeRightWhile<{a: number;}, TResult>({a: 42}); } @@ -1870,16 +1820,12 @@ namespace TestTakeRightWhile { result = _(array).chain().takeRightWhile(); result = _(array).chain().takeRightWhile(predicateFn); - result = _(array).chain().takeRightWhile(predicateFn, any); result = _(array).chain().takeRightWhile(''); - result = _(array).chain().takeRightWhile('', any); result = _(array).chain().takeRightWhile<{a: number;}>({a: 42}); result = _(list).chain().takeRightWhile(); result = _(list).chain().takeRightWhile(predicateFn); - result = _(list).chain().takeRightWhile(predicateFn, any); result = _(list).chain().takeRightWhile(''); - result = _(list).chain().takeRightWhile('', any); result = _(list).chain().takeRightWhile<{a: number;}, TResult>({a: 42}); } } @@ -1895,16 +1841,12 @@ namespace TestTakeWhile { result = _.takeWhile(array); result = _.takeWhile(array, predicateFn); - result = _.takeWhile(array, predicateFn, any); result = _.takeWhile(array, ''); - result = _.takeWhile(array, '', any); result = _.takeWhile<{a: number;}, TResult>(array, {a: 42}); result = _.takeWhile(list); result = _.takeWhile(list, predicateFn); - result = _.takeWhile(list, predicateFn, any); result = _.takeWhile(list, ''); - result = _.takeWhile(list, '', any); result = _.takeWhile<{a: number;}, TResult>(list, {a: 42}); } @@ -1913,16 +1855,12 @@ namespace TestTakeWhile { result = _(array).takeWhile(); result = _(array).takeWhile(predicateFn); - result = _(array).takeWhile(predicateFn, any); result = _(array).takeWhile(''); - result = _(array).takeWhile('', any); result = _(array).takeWhile<{a: number;}>({a: 42}); result = _(list).takeWhile(); result = _(list).takeWhile(predicateFn); - result = _(list).takeWhile(predicateFn, any); result = _(list).takeWhile(''); - result = _(list).takeWhile('', any); result = _(list).takeWhile<{a: number;}, TResult>({a: 42}); } @@ -1931,16 +1869,12 @@ namespace TestTakeWhile { result = _(array).chain().takeWhile(); result = _(array).chain().takeWhile(predicateFn); - result = _(array).chain().takeWhile(predicateFn, any); result = _(array).chain().takeWhile(''); - result = _(array).chain().takeWhile('', any); result = _(array).chain().takeWhile<{a: number;}>({a: 42}); result = _(list).chain().takeWhile(); result = _(list).chain().takeWhile(predicateFn); - result = _(list).chain().takeWhile(predicateFn, any); result = _(list).chain().takeWhile(''); - result = _(list).chain().takeWhile('', any); result = _(list).chain().takeWhile<{a: number;}, TResult>({a: 42}); } } @@ -2443,14 +2377,10 @@ namespace TestUnzip { let result: TResult[]; result = _.unzipWith(testUnzipWithArray); result = _.unzipWith(testUnzipWithArray, testUnzipWithIterator); - result = _.unzipWith(testUnzipWithArray, testUnzipWithIterator, any); result = _.unzipWith(testUnzipWithList); result = _.unzipWith(testUnzipWithList, testUnzipWithIterator); - result = _.unzipWith(testUnzipWithList, testUnzipWithIterator, any); result = _(testUnzipWithArray).unzipWith(testUnzipWithIterator).value(); - result = _(testUnzipWithArray).unzipWith(testUnzipWithIterator, any).value(); result = _(testUnzipWithList).unzipWith(testUnzipWithIterator).value(); - result = _(testUnzipWithList).unzipWith(testUnzipWithIterator, any).value(); } // _.without @@ -2717,14 +2647,12 @@ interface TestZipWithFn { var testZipWithFn: TestZipWithFn; result = _.zipWith([1, 2]); result = _.zipWith([1, 2], testZipWithFn); -result = _.zipWith([1, 2], testZipWithFn, any); -result = _.zipWith([1, 2], [1, 2], testZipWithFn, any); -result = _.zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn, any); +result = _.zipWith([1, 2], [1, 2], testZipWithFn); +result = _.zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn); result = _([1, 2]).zipWith().value(); result = _([1, 2]).zipWith(testZipWithFn).value(); -result = _([1, 2]).zipWith(testZipWithFn, any).value(); -result = _([1, 2]).zipWith([1, 2], testZipWithFn, any).value(); -result = _([1, 2]).zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn, any).value(); +result = _([1, 2]).zipWith([1, 2], testZipWithFn).value(); +result = _([1, 2]).zipWith([1, 2], [1, 2], [1, 2], [1, 2], [1, 2], testZipWithFn).value(); /********* * Chain * @@ -2778,7 +2706,6 @@ namespace TestTap { let result: string; _.tap('', interceptor); - _.tap('', interceptor, any); } { @@ -2786,7 +2713,6 @@ namespace TestTap { let result: _.LoDashImplicitArrayWrapper; _.tap([''], interceptor); - _.tap([''], interceptor, any); } { @@ -2794,18 +2720,15 @@ namespace TestTap { let result: _.LoDashImplicitObjectWrapper<{a: string}>; _.tap({a: ''}, interceptor); - _.tap({a: ''}, interceptor, any); } { let interceptor: (value: string) => void; let result: _.LoDashImplicitWrapper; - _.chain('').tap(interceptor, any); - _.chain('').tap(interceptor, any); + _.chain('').tap(interceptor); _('').tap(interceptor); - _('').tap(interceptor, any); } { @@ -2813,10 +2736,8 @@ namespace TestTap { let result: _.LoDashImplicitArrayWrapper; _.chain(['']).tap(interceptor); - _.chain(['']).tap(interceptor, any); _(['']).tap(interceptor); - _(['']).tap(interceptor, any); } { @@ -2824,21 +2745,17 @@ namespace TestTap { let result: _.LoDashImplicitObjectWrapper<{a: string}>; _.chain({a: ''}).tap(interceptor); - _.chain({a: ''}).tap(interceptor, any); _({a: ''}).tap(interceptor); - _({a: ''}).tap(interceptor, any); } { let interceptor: (value: string) => void; let result: _.LoDashExplicitWrapper; - _.chain('').tap(interceptor, any); - _.chain('').tap(interceptor, any); + _.chain('').tap(interceptor); _('').chain().tap(interceptor); - _('').chain().tap(interceptor, any); } { @@ -2846,10 +2763,8 @@ namespace TestTap { let result: _.LoDashExplicitArrayWrapper; _.chain(['']).tap(interceptor); - _.chain(['']).tap(interceptor, any); _(['']).chain().tap(interceptor); - _(['']).chain().tap(interceptor, any); } { @@ -2857,10 +2772,8 @@ namespace TestTap { let result: _.LoDashExplicitObjectWrapper<{a: string}>; _.chain({a: ''}).tap(interceptor); - _.chain({a: ''}).tap(interceptor, any); _({a: ''}).chain().tap(interceptor); - _({a: ''}).chain().tap(interceptor, any); } } @@ -2875,7 +2788,6 @@ namespace TestThru { let result: number; result = _.thru(1, interceptor); - result = _.thru(1, interceptor, any); } { @@ -2883,7 +2795,6 @@ namespace TestThru { let result: _.LoDashImplicitWrapper; result = _(1).thru(interceptor); - result = _(1).thru(interceptor, any); } { @@ -2891,7 +2802,6 @@ namespace TestThru { let result: _.LoDashImplicitWrapper; result = _('').thru(interceptor); - result = _('').thru(interceptor, any); } { @@ -2899,7 +2809,6 @@ namespace TestThru { let result: _.LoDashImplicitWrapper; result = _(true).thru(interceptor); - result = _(true).thru(interceptor, any); } { @@ -2907,7 +2816,6 @@ namespace TestThru { let result: _.LoDashImplicitObjectWrapper<{a: string}>; result = _({a: ''}).thru<{a: string}>(interceptor); - result = _({a: ''}).thru<{a: string}>(interceptor, any); } { @@ -2915,7 +2823,6 @@ namespace TestThru { let result: _.LoDashImplicitArrayWrapper; result = _([1, 2, 3]).thru(interceptor); - result = _([1, 2, 3]).thru(interceptor, any); } { @@ -2923,7 +2830,6 @@ namespace TestThru { let result: _.LoDashExplicitWrapper; result = _(1).chain().thru(interceptor); - result = _(1).chain().thru(interceptor, any); } { @@ -2931,7 +2837,6 @@ namespace TestThru { let result: _.LoDashExplicitWrapper; result = _('').chain().thru(interceptor); - result = _('').chain().thru(interceptor, any); } { @@ -2939,7 +2844,6 @@ namespace TestThru { let result: _.LoDashExplicitWrapper; result = _(true).chain().thru(interceptor); - result = _(true).chain().thru(interceptor, any); } { @@ -2947,7 +2851,6 @@ namespace TestThru { let result: _.LoDashExplicitObjectWrapper<{a: string}>; result = _({a: ''}).chain().thru<{a: string}>(interceptor); - result = _({a: ''}).chain().thru<{a: string}>(interceptor, any); } { @@ -2955,7 +2858,6 @@ namespace TestThru { let result: _.LoDashExplicitArrayWrapper; result = _([1, 2, 3]).chain().thru(interceptor); - result = _([1, 2, 3]).chain().thru(interceptor, any); } } @@ -3134,12 +3036,12 @@ namespace TestPlant { namespace TestReverse { { let result: _.LoDashImplicitArrayWrapper; - result: _([42]).reverse(); + result = _([42]).reverse(); } { let result: _.LoDashExplicitArrayWrapper; - result: _([42]).chain().reverse(); + result = _([42]).chain().reverse(); } } @@ -3326,37 +3228,28 @@ namespace TestCountBy { result = _.countBy(''); result = _.countBy('', stringIterator); - result = _.countBy('', stringIterator, any); result = _.countBy(array); result = _.countBy(array, listIterator); - result = _.countBy(array, listIterator, any); result = _.countBy(array, ''); - result = _.countBy(array, '', any); result = _.countBy<{a: number}, TResult>(array, {a: 42}); result = _.countBy(array, {a: 42}); result = _.countBy(list); result = _.countBy(list, listIterator); - result = _.countBy(list, listIterator, any); result = _.countBy(list, ''); - result = _.countBy(list, '', any); result = _.countBy<{a: number}, TResult>(list, {a: 42}); result = _.countBy(list, {a: 42}); result = _.countBy(dictionary); result = _.countBy(dictionary, dictionaryIterator); - result = _.countBy(dictionary, dictionaryIterator, any); result = _.countBy(dictionary, ''); - result = _.countBy(dictionary, '', any); result = _.countBy<{a: number}, TResult>(dictionary, {a: 42}); result = _.countBy(dictionary, {a: 42}); result = _.countBy(numericDictionary); result = _.countBy(numericDictionary, numericDictionaryIterator); - result = _.countBy(numericDictionary, numericDictionaryIterator, any); result = _.countBy(numericDictionary, ''); - result = _.countBy(numericDictionary, '', any); result = _.countBy<{a: number}, TResult>(numericDictionary, {a: 42}); result = _.countBy(numericDictionary, {a: 42}); } @@ -3366,37 +3259,28 @@ namespace TestCountBy { result = _('').countBy(); result = _('').countBy(stringIterator); - result = _('').countBy(stringIterator, any); result = _(array).countBy(); result = _(array).countBy(listIterator); - result = _(array).countBy(listIterator, any); result = _(array).countBy(''); - result = _(array).countBy('', any); result = _(array).countBy<{a: number}>({a: 42}); result = _(array).countBy({a: 42}); result = _(list).countBy(); result = _(list).countBy(listIterator); - result = _(list).countBy(listIterator, any); result = _(list).countBy(''); - result = _(list).countBy('', any); result = _(list).countBy<{a: number}>({a: 42}); result = _(list).countBy({a: 42}); result = _(dictionary).countBy(); result = _(dictionary).countBy(dictionaryIterator); - result = _(dictionary).countBy(dictionaryIterator, any); result = _(dictionary).countBy(''); - result = _(dictionary).countBy('', any); result = _(dictionary).countBy<{a: number}>({a: 42}); result = _(dictionary).countBy({a: 42}); result = _(numericDictionary).countBy(); result = _(numericDictionary).countBy(numericDictionaryIterator); - result = _(numericDictionary).countBy(numericDictionaryIterator, any); result = _(numericDictionary).countBy(''); - result = _(numericDictionary).countBy('', any); result = _(numericDictionary).countBy<{a: number}>({a: 42}); result = _(numericDictionary).countBy({a: 42}); } @@ -3406,37 +3290,28 @@ namespace TestCountBy { result = _('').chain().countBy(); result = _('').chain().countBy(stringIterator); - result = _('').chain().countBy(stringIterator, any); result = _(array).chain().countBy(); result = _(array).chain().countBy(listIterator); - result = _(array).chain().countBy(listIterator, any); result = _(array).chain().countBy(''); - result = _(array).chain().countBy('', any); result = _(array).chain().countBy<{a: number}>({a: 42}); result = _(array).chain().countBy({a: 42}); result = _(list).chain().countBy(); result = _(list).chain().countBy(listIterator); - result = _(list).chain().countBy(listIterator, any); result = _(list).chain().countBy(''); - result = _(list).chain().countBy('', any); result = _(list).chain().countBy<{a: number}>({a: 42}); result = _(list).chain().countBy({a: 42}); result = _(dictionary).chain().countBy(); result = _(dictionary).chain().countBy(dictionaryIterator); - result = _(dictionary).chain().countBy(dictionaryIterator, any); result = _(dictionary).chain().countBy(''); - result = _(dictionary).chain().countBy('', any); result = _(dictionary).chain().countBy<{a: number}>({a: 42}); result = _(dictionary).chain().countBy({a: 42}); result = _(numericDictionary).chain().countBy(); result = _(numericDictionary).chain().countBy(numericDictionaryIterator); - result = _(numericDictionary).chain().countBy(numericDictionaryIterator, any); result = _(numericDictionary).chain().countBy(''); - result = _(numericDictionary).chain().countBy('', any); result = _(numericDictionary).chain().countBy<{a: number}>({a: 42}); result = _(numericDictionary).chain().countBy({a: 42}); } @@ -3456,84 +3331,72 @@ namespace TestEach { let result: string; _.each('', stringIterator); - _.each('', stringIterator, any); } { let result: TResult[]; _.each(array, listIterator); - _.each(array, listIterator, any); } { let result: _.List; _.each(list, listIterator); - _.each(list, listIterator, any); } { let result: _.Dictionary; _.each(dictionary, dictionaryIterator); - _.each(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').each(stringIterator); - _('').each(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).each(listIterator); - _(array).each(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).each(listIterator); - _(list).each(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).each(dictionaryIterator); - _(dictionary).each(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().each(stringIterator); - _('').chain().each(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().each(listIterator); - _(array).chain().each(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().each(listIterator); - _(list).chain().each(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().each(dictionaryIterator); - _(dictionary).chain().each(dictionaryIterator, any); } } @@ -3551,84 +3414,72 @@ namespace TestEachRight { let result: string; _.eachRight('', stringIterator); - _.eachRight('', stringIterator, any); } { let result: TResult[]; _.eachRight(array, listIterator); - _.eachRight(array, listIterator, any); } { let result: _.List; _.eachRight(list, listIterator); - _.eachRight(list, listIterator, any); } { let result: _.Dictionary; _.eachRight(dictionary, dictionaryIterator); - _.eachRight(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').eachRight(stringIterator); - _('').eachRight(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).eachRight(listIterator); - _(array).eachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).eachRight(listIterator); - _(list).eachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).eachRight(dictionaryIterator); - _(dictionary).eachRight(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().eachRight(stringIterator); - _('').chain().eachRight(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().eachRight(listIterator); - _(array).chain().eachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().eachRight(listIterator); - _(list).chain().eachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().eachRight(dictionaryIterator); - _(dictionary).chain().eachRight(dictionaryIterator, any); } } @@ -3740,28 +3591,21 @@ namespace TestFilter { let result: string[]; result = _.filter('', stringIterator); - result = _.filter('', stringIterator, any); } { let result: TResult[]; result = _.filter(array, listIterator); - result = _.filter(array, listIterator, any); result = _.filter(array, ''); - result = _.filter(array, '', any); result = _.filter<{a: number}, TResult>(array, {a: 42}); result = _.filter(list, listIterator); - result = _.filter(list, listIterator, any); result = _.filter(list, ''); - result = _.filter(list, '', any); result = _.filter<{a: number}, TResult>(list, {a: 42}); result = _.filter(dictionary, dictionaryIterator); - result = _.filter(dictionary, dictionaryIterator, any); result = _.filter(dictionary, ''); - result = _.filter(dictionary, '', any); result = _.filter<{a: number}, TResult>(dictionary, {a: 42}); } @@ -3769,28 +3613,21 @@ namespace TestFilter { let result: _.LoDashImplicitArrayWrapper; result = _('').filter(stringIterator); - result = _('').filter(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).filter(listIterator); - result = _(array).filter(listIterator, any); result = _(array).filter(''); - result = _(array).filter('', any); result = _(array).filter<{a: number}>({a: 42}); result = _(list).filter(listIterator); - result = _(list).filter(listIterator, any); result = _(list).filter(''); - result = _(list).filter('', any); result = _(list).filter<{a: number}, TResult>({a: 42}); result = _(dictionary).filter(dictionaryIterator); - result = _(dictionary).filter(dictionaryIterator, any); result = _(dictionary).filter(''); - result = _(dictionary).filter('', any); result = _(dictionary).filter<{a: number}, TResult>({a: 42}); } @@ -3798,28 +3635,21 @@ namespace TestFilter { let result: _.LoDashExplicitArrayWrapper; result = _('').chain().filter(stringIterator); - result = _('').chain().filter(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().filter(listIterator); - result = _(array).chain().filter(listIterator, any); result = _(array).chain().filter(''); - result = _(array).chain().filter('', any); result = _(array).chain().filter<{a: number}>({a: 42}); result = _(list).chain().filter(listIterator); - result = _(list).chain().filter(listIterator, any); result = _(list).chain().filter(''); - result = _(list).chain().filter('', any); result = _(list).chain().filter<{a: number}, TResult>({a: 42}); result = _(dictionary).chain().filter(dictionaryIterator); - result = _(dictionary).chain().filter(dictionaryIterator, any); result = _(dictionary).chain().filter(''); - result = _(dictionary).chain().filter('', any); result = _(dictionary).chain().filter<{a: number}, TResult>({a: 42}); } } @@ -3837,37 +3667,31 @@ namespace TestFind { result = _.find(array); result = _.find(array, listIterator); - result = _.find(array, listIterator, any); result = _.find(array, ''); result = _.find<{a: number}, TResult>(array, {a: 42}); result = _.find(list); result = _.find(list, listIterator); - result = _.find(list, listIterator, any); result = _.find(list, ''); result = _.find<{a: number}, TResult>(list, {a: 42}); result = _.find(dictionary); result = _.find(dictionary, dictionaryIterator); - result = _.find(dictionary, dictionaryIterator, any); result = _.find(dictionary, ''); result = _.find<{a: number}, TResult>(dictionary, {a: 42}); result = _(array).find(); result = _(array).find(listIterator); - result = _(array).find(listIterator, any); result = _(array).find(''); result = _(array).find<{a: number}>({a: 42}); result = _(list).find(); result = _(list).find(listIterator); - result = _(list).find(listIterator, any); result = _(list).find(''); result = _(list).find<{a: number}, TResult>({a: 42}); result = _(dictionary).find(); result = _(dictionary).find(dictionaryIterator); - result = _(dictionary).find(dictionaryIterator, any); result = _(dictionary).find(''); result = _(dictionary).find<{a: number}, TResult>({a: 42}); } @@ -4089,84 +3913,72 @@ namespace TestForEach { let result: string; _.forEach('', stringIterator); - _.forEach('', stringIterator, any); } { let result: TResult[]; _.forEach(array, listIterator); - _.forEach(array, listIterator, any); } { let result: _.List; _.forEach(list, listIterator); - _.forEach(list, listIterator, any); } { let result: _.Dictionary; _.forEach(dictionary, dictionaryIterator); - _.forEach(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').forEach(stringIterator); - _('').forEach(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).forEach(listIterator); - _(array).forEach(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).forEach(listIterator); - _(list).forEach(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).forEach(dictionaryIterator); - _(dictionary).forEach(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().forEach(stringIterator); - _('').chain().forEach(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().forEach(listIterator); - _(array).chain().forEach(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().forEach(listIterator); - _(list).chain().forEach(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().forEach(dictionaryIterator); - _(dictionary).chain().forEach(dictionaryIterator, any); } } @@ -4184,84 +3996,72 @@ namespace TestForEachRight { let result: string; _.forEachRight('', stringIterator); - _.forEachRight('', stringIterator, any); } { let result: TResult[]; _.forEachRight(array, listIterator); - _.forEachRight(array, listIterator, any); } { let result: _.List; _.forEachRight(list, listIterator); - _.forEachRight(list, listIterator, any); } { let result: _.Dictionary; _.forEachRight(dictionary, dictionaryIterator); - _.forEachRight(dictionary, dictionaryIterator, any); } { let result: _.LoDashImplicitWrapper; _('').forEachRight(stringIterator); - _('').forEachRight(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; _(array).forEachRight(listIterator); - _(array).forEachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.List>; _(list).forEachRight(listIterator); - _(list).forEachRight(listIterator, any); } { let result: _.LoDashImplicitObjectWrapper<_.Dictionary>; _(dictionary).forEachRight(dictionaryIterator); - _(dictionary).forEachRight(dictionaryIterator, any); } { let result: _.LoDashExplicitWrapper; _('').chain().forEachRight(stringIterator); - _('').chain().forEachRight(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; _(array).chain().forEachRight(listIterator); - _(array).chain().forEachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.List>; _(list).chain().forEachRight(listIterator); - _(list).chain().forEachRight(listIterator, any); } { let result: _.LoDashExplicitObjectWrapper<_.Dictionary>; _(dictionary).chain().forEachRight(dictionaryIterator); - _(dictionary).chain().forEachRight(dictionaryIterator, any); } } @@ -4282,9 +4082,7 @@ namespace TestGroupBy { result = _.groupBy(''); result = _.groupBy('', stringIterator); - result = _.groupBy('', stringIterator, any); result = _.groupBy('', stringIterator); - result = _.groupBy('', stringIterator, any); } { @@ -4292,38 +4090,29 @@ namespace TestGroupBy { result = _.groupBy(array); result = _.groupBy(array, listIterator); - result = _.groupBy(array, listIterator, any); result = _.groupBy(array, ''); - result = _.groupBy(array, '', any); result = _.groupBy(array, {a: 42}); result = _.groupBy(array, listIterator); - result = _.groupBy(array, listIterator, any); - result = _.groupBy(array, '', true); + result = _.groupBy(array, ''); result = _.groupBy<{a: number}, SampleType>(array, {a: 42}); result = _.groupBy(list); result = _.groupBy(list, listIterator); - result = _.groupBy(list, listIterator, any); result = _.groupBy(list, ''); - result = _.groupBy(list, '', any); result = _.groupBy(list, {a: 42}); result = _.groupBy(list, listIterator); - result = _.groupBy(list, listIterator, any); - result = _.groupBy(list, '', true); + result = _.groupBy(list, ''); result = _.groupBy<{a: number}, SampleType>(list, {a: 42}); result = _.groupBy(dictionary); result = _.groupBy(dictionary, dictionaryIterator); - result = _.groupBy(dictionary, dictionaryIterator, any); result = _.groupBy(dictionary, ''); - result = _.groupBy(dictionary, '', any); result = _.groupBy(dictionary, {a: 42}); result = _.groupBy(dictionary, dictionaryIterator); - result = _.groupBy(dictionary, dictionaryIterator, any); - result = _.groupBy(dictionary, '', true); + result = _.groupBy(dictionary, ''); result = _.groupBy<{a: number}, SampleType>(dictionary, {a: 42}); } @@ -4332,7 +4121,6 @@ namespace TestGroupBy { result = _('').groupBy(); result = _('').groupBy(stringIterator); - result = _('').groupBy(stringIterator, any); } { @@ -4340,33 +4128,26 @@ namespace TestGroupBy { result = _(array).groupBy(); result = _(array).groupBy(listIterator); - result = _(array).groupBy(listIterator, any); result = _(array).groupBy(''); - result = _(array).groupBy('', true); + result = _(array).groupBy(''); result = _(array).groupBy<{a: number}>({a: 42}); result = _(list).groupBy(); result = _(list).groupBy(listIterator); - result = _(list).groupBy(listIterator, any); result = _(list).groupBy(''); - result = _(list).groupBy('', any); result = _(list).groupBy({a: 42}); result = _(list).groupBy(listIterator); - result = _(list).groupBy(listIterator, any); - result = _(list).groupBy('', true); + result = _(list).groupBy(''); result = _(list).groupBy<{a: number}, SampleType>({a: 42}); result = _(dictionary).groupBy(); result = _(dictionary).groupBy(dictionaryIterator); - result = _(dictionary).groupBy(dictionaryIterator, any); result = _(dictionary).groupBy(''); - result = _(dictionary).groupBy('', any); result = _(dictionary).groupBy({a: 42}); result = _(dictionary).groupBy(dictionaryIterator); - result = _(dictionary).groupBy(dictionaryIterator, any); - result = _(dictionary).groupBy('', true); + result = _(dictionary).groupBy(''); result = _(dictionary).groupBy<{a: number}, SampleType>({a: 42}); } @@ -4375,7 +4156,6 @@ namespace TestGroupBy { result = _('').chain().groupBy(); result = _('').chain().groupBy(stringIterator); - result = _('').chain().groupBy(stringIterator, any); } { @@ -4383,33 +4163,26 @@ namespace TestGroupBy { result = _(array).chain().groupBy(); result = _(array).chain().groupBy(listIterator); - result = _(array).chain().groupBy(listIterator, any); result = _(array).chain().groupBy(''); - result = _(array).chain().groupBy('', true); + result = _(array).chain().groupBy(''); result = _(array).chain().groupBy<{a: number}>({a: 42}); result = _(list).chain().groupBy(); result = _(list).chain().groupBy(listIterator); - result = _(list).chain().groupBy(listIterator, any); result = _(list).chain().groupBy(''); - result = _(list).chain().groupBy('', any); result = _(list).chain().groupBy({a: 42}); result = _(list).chain().groupBy(listIterator); - result = _(list).chain().groupBy(listIterator, any); - result = _(list).chain().groupBy('', true); + result = _(list).chain().groupBy(''); result = _(list).chain().groupBy<{a: number}, SampleType>({a: 42}); result = _(dictionary).chain().groupBy(); result = _(dictionary).chain().groupBy(dictionaryIterator); - result = _(dictionary).chain().groupBy(dictionaryIterator, any); result = _(dictionary).chain().groupBy(''); - result = _(dictionary).chain().groupBy('', any); result = _(dictionary).chain().groupBy({a: 42}); result = _(dictionary).chain().groupBy(dictionaryIterator); - result = _(dictionary).chain().groupBy(dictionaryIterator, any); - result = _(dictionary).chain().groupBy('', true); + result = _(dictionary).chain().groupBy(''); result = _(dictionary).chain().groupBy<{a: number}, SampleType>({a: 42}); } } @@ -4479,7 +4252,6 @@ namespace TestKeyBy { result = _.keyBy('abcd'); result = _.keyBy('abcd', stringIterator); - result = _.keyBy('abcd', stringIterator, any); } { @@ -4487,33 +4259,25 @@ namespace TestKeyBy { result = _.keyBy(array); result = _.keyBy(array, listIterator); - result = _.keyBy(array, listIterator, any); result = _.keyBy(array, 'a'); - result = _.keyBy(array, 'a', any); result = _.keyBy<{a: number}, SampleObject>(array, {a: 42}); result = _.keyBy(array, {a: 42}); result = _.keyBy(list); result = _.keyBy(list, listIterator); - result = _.keyBy(list, listIterator, any); result = _.keyBy(list, 'a'); - result = _.keyBy(list, 'a', any); result = _.keyBy<{a: number}, SampleObject>(list, {a: 42}); result = _.keyBy(list, {a: 42}); result = _.keyBy(numericDictionary); result = _.keyBy(numericDictionary, numericDictionaryIterator); - result = _.keyBy(numericDictionary, numericDictionaryIterator, any); result = _.keyBy(numericDictionary, 'a'); - result = _.keyBy(numericDictionary, 'a', any); result = _.keyBy<{a: number}, SampleObject>(numericDictionary, {a: 42}); result = _.keyBy(numericDictionary, {a: 42}); result = _.keyBy(dictionary); result = _.keyBy(dictionary, dictionaryIterator); - result = _.keyBy(dictionary, dictionaryIterator, any); result = _.keyBy(dictionary, 'a'); - result = _.keyBy(dictionary, 'a', any); result = _.keyBy<{a: number}, SampleObject>(dictionary, {a: 42}); result = _.keyBy(dictionary, {a: 42}); } @@ -4523,7 +4287,6 @@ namespace TestKeyBy { result = _('abcd').keyBy(); result = _('abcd').keyBy(stringIterator); - result = _('abcd').keyBy(stringIterator, any); } { @@ -4531,32 +4294,24 @@ namespace TestKeyBy { result = _(array).keyBy(); result = _(array).keyBy(listIterator); - result = _(array).keyBy(listIterator, any); result = _(array).keyBy('a'); - result = _(array).keyBy('a', any); result = _(array).keyBy<{a: number}>({a: 42}); result = _(list).keyBy(); result = _(list).keyBy(listIterator); - result = _(list).keyBy(listIterator, any); result = _(list).keyBy('a'); - result = _(list).keyBy('a', any); result = _(list).keyBy<{a: number}, SampleObject>({a: 42}); result = _(list).keyBy({a: 42}); result = _(numericDictionary).keyBy(); result = _(numericDictionary).keyBy(numericDictionaryIterator); - result = _(numericDictionary).keyBy(numericDictionaryIterator, any); result = _(numericDictionary).keyBy('a'); - result = _(numericDictionary).keyBy('a', any); result = _(numericDictionary).keyBy<{a: number}, SampleObject>({a: 42}); result = _(numericDictionary).keyBy({a: 42}); result = _(dictionary).keyBy(); result = _(dictionary).keyBy(dictionaryIterator); - result = _(dictionary).keyBy(dictionaryIterator, any); result = _(dictionary).keyBy('a'); - result = _(dictionary).keyBy('a', any); result = _(dictionary).keyBy<{a: number}, SampleObject>({a: 42}); result = _(dictionary).keyBy({a: 42}); } @@ -4566,7 +4321,6 @@ namespace TestKeyBy { result = _('abcd').chain().keyBy(); result = _('abcd').chain().keyBy(stringIterator); - result = _('abcd').chain().keyBy(stringIterator, any); } { @@ -4574,32 +4328,24 @@ namespace TestKeyBy { result = _(array).chain().keyBy(); result = _(array).chain().keyBy(listIterator); - result = _(array).chain().keyBy(listIterator, any); result = _(array).chain().keyBy('a'); - result = _(array).chain().keyBy('a', any); result = _(array).chain().keyBy<{a: number}>({a: 42}); result = _(list).chain().keyBy(); result = _(list).chain().keyBy(listIterator); - result = _(list).chain().keyBy(listIterator, any); result = _(list).chain().keyBy('a'); - result = _(list).chain().keyBy('a', any); result = _(list).chain().keyBy<{a: number}, SampleObject>({a: 42}); result = _(list).chain().keyBy({a: 42}); result = _(numericDictionary).chain().keyBy(); result = _(numericDictionary).chain().keyBy(numericDictionaryIterator); - result = _(numericDictionary).chain().keyBy(numericDictionaryIterator, any); result = _(numericDictionary).chain().keyBy('a'); - result = _(numericDictionary).chain().keyBy('a', any); result = _(numericDictionary).chain().keyBy<{a: number}, SampleObject>({a: 42}); result = _(numericDictionary).chain().keyBy({a: 42}); result = _(dictionary).chain().keyBy(); result = _(dictionary).chain().keyBy(dictionaryIterator); - result = _(dictionary).chain().keyBy(dictionaryIterator, any); result = _(dictionary).chain().keyBy('a'); - result = _(dictionary).chain().keyBy('a', any); result = _(dictionary).chain().keyBy<{a: number}, SampleObject>({a: 42}); result = _(dictionary).chain().keyBy({a: 42}); } @@ -4749,17 +4495,14 @@ namespace TestMap { result = _.map(array); result = _.map(array, listIterator); - result = _.map(array, listIterator, any); result = _.map(array, ''); result = _.map(list); result = _.map(list, listIterator); - result = _.map(list, listIterator, any); result = _.map(list, ''); result = _.map(dictionary); result = _.map(dictionary, dictionaryIterator); - result = _.map(dictionary, dictionaryIterator, any); result = _.map(dictionary, ''); } @@ -4776,17 +4519,14 @@ namespace TestMap { result = _(array).map(); result = _(array).map(listIterator); - result = _(array).map(listIterator, any); result = _(array).map(''); result = _(list).map(); result = _(list).map(listIterator); - result = _(list).map(listIterator, any); result = _(list).map(''); result = _(dictionary).map(); result = _(dictionary).map(dictionaryIterator); - result = _(dictionary).map(dictionaryIterator, any); result = _(dictionary).map(''); } @@ -4803,17 +4543,14 @@ namespace TestMap { result = _(array).chain().map(); result = _(array).chain().map(listIterator); - result = _(array).chain().map(listIterator, any); result = _(array).chain().map(''); result = _(list).chain().map(); result = _(list).chain().map(listIterator); - result = _(list).chain().map(listIterator, any); result = _(list).chain().map(''); result = _(dictionary).chain().map(); result = _(dictionary).chain().map(dictionaryIterator); - result = _(dictionary).chain().map(dictionaryIterator, any); result = _(dictionary).chain().map(''); } @@ -4939,7 +4676,7 @@ result = _([1, 2, 3]).reduce(function (sum: number, num: number) result = _({ 'a': 1, 'b': 2, 'c': 3 }).reduce(function (r: ABC, num: number, key: string) { r[key] = num * 3; return r; -}, {}); +}, {}); result = _.reduceRight([[0, 1], [2, 3], [4, 5]], function (a: number[], b: number[]) { return a.concat(b); }, []); @@ -4957,28 +4694,21 @@ namespace TestReject { let result: string[]; result = _.reject('', stringIterator); - result = _.reject('', stringIterator, any); } { let result: TResult[]; result = _.reject(array, listIterator); - result = _.reject(array, listIterator, any); result = _.reject(array, ''); - result = _.reject(array, '', any); result = _.reject<{a: number}, TResult>(array, {a: 42}); result = _.reject(list, listIterator); - result = _.reject(list, listIterator, any); result = _.reject(list, ''); - result = _.reject(list, '', any); result = _.reject<{a: number}, TResult>(list, {a: 42}); result = _.reject(dictionary, dictionaryIterator); - result = _.reject(dictionary, dictionaryIterator, any); result = _.reject(dictionary, ''); - result = _.reject(dictionary, '', any); result = _.reject<{a: number}, TResult>(dictionary, {a: 42}); } @@ -4986,28 +4716,21 @@ namespace TestReject { let result: _.LoDashImplicitArrayWrapper; result = _('').reject(stringIterator); - result = _('').reject(stringIterator, any); } { let result: _.LoDashImplicitArrayWrapper; result = _(array).reject(listIterator); - result = _(array).reject(listIterator, any); result = _(array).reject(''); - result = _(array).reject('', any); result = _(array).reject<{a: number}>({a: 42}); result = _(list).reject(listIterator); - result = _(list).reject(listIterator, any); result = _(list).reject(''); - result = _(list).reject('', any); result = _(list).reject<{a: number}, TResult>({a: 42}); result = _(dictionary).reject(dictionaryIterator); - result = _(dictionary).reject(dictionaryIterator, any); result = _(dictionary).reject(''); - result = _(dictionary).reject('', any); result = _(dictionary).reject<{a: number}, TResult>({a: 42}); } @@ -5015,28 +4738,21 @@ namespace TestReject { let result: _.LoDashExplicitArrayWrapper; result = _('').chain().reject(stringIterator); - result = _('').chain().reject(stringIterator, any); } { let result: _.LoDashExplicitArrayWrapper; result = _(array).chain().reject(listIterator); - result = _(array).chain().reject(listIterator, any); result = _(array).chain().reject(''); - result = _(array).chain().reject('', any); result = _(array).chain().reject<{a: number}>({a: 42}); result = _(list).chain().reject(listIterator); - result = _(list).chain().reject(listIterator, any); result = _(list).chain().reject(''); - result = _(list).chain().reject('', any); result = _(list).chain().reject<{a: number}, TResult>({a: 42}); result = _(dictionary).chain().reject(dictionaryIterator); - result = _(dictionary).chain().reject(dictionaryIterator, any); result = _(dictionary).chain().reject(''); - result = _(dictionary).chain().reject('', any); result = _(dictionary).chain().reject<{a: number}, TResult>({a: 42}); } } @@ -8970,7 +8686,6 @@ namespace TestExtend { result = _.extend(obj, s1); result = _.extend(obj, s1, customizer); - result = _.extend(obj, s1, customizer, any); } { @@ -8978,7 +8693,6 @@ namespace TestExtend { result = _.extend(obj, s1, s2); result = _.extend(obj, s1, s2, customizer); - result = _.extend(obj, s1, s2, customizer, any); } { @@ -8986,7 +8700,6 @@ namespace TestExtend { result = _.extend(obj, s1, s2, s3); result = _.extend(obj, s1, s2, s3, customizer); - result = _.extend(obj, s1, s2, s3, customizer, any); } { @@ -8994,7 +8707,6 @@ namespace TestExtend { result = _.extend(obj, s1, s2, s3, s4); result = _.extend(obj, s1, s2, s3, s4, customizer); - result = _.extend(obj, s1, s2, s3, s4, customizer, any); } { @@ -9002,7 +8714,6 @@ namespace TestExtend { result = _.extend(obj, s1, s2, s3, s4, s5); result = _.extend(obj, s1, s2, s3, s4, s5, customizer); - result = _.extend(obj, s1, s2, s3, s4, s5, customizer, any); } { @@ -9016,7 +8727,6 @@ namespace TestExtend { result = _(obj).extend(s1); result = _(obj).extend(s1, customizer); - result = _(obj).extend(s1, customizer, any); } { @@ -9024,7 +8734,6 @@ namespace TestExtend { result = _(obj).extend(s1, s2); result = _(obj).extend(s1, s2, customizer); - result = _(obj).extend(s1, s2, customizer, any); } { @@ -9032,7 +8741,6 @@ namespace TestExtend { result = _(obj).extend(s1, s2, s3); result = _(obj).extend(s1, s2, s3, customizer); - result = _(obj).extend(s1, s2, s3, customizer, any); } { @@ -9040,7 +8748,6 @@ namespace TestExtend { result = _(obj).extend(s1, s2, s3, s4); result = _(obj).extend(s1, s2, s3, s4, customizer); - result = _(obj).extend(s1, s2, s3, s4, customizer, any); } { @@ -9048,7 +8755,6 @@ namespace TestExtend { result = _(obj).extend(s1, s2, s3, s4, s5); result = _(obj).extend(s1, s2, s3, s4, s5, customizer); - result = _(obj).extend(s1, s2, s3, s4, s5, customizer, any); } { @@ -9062,7 +8768,6 @@ namespace TestExtend { result = _(obj).chain().extend(s1); result = _(obj).chain().extend(s1, customizer); - result = _(obj).chain().extend(s1, customizer, any); } { @@ -9070,7 +8775,6 @@ namespace TestExtend { result = _(obj).chain().extend(s1, s2); result = _(obj).chain().extend(s1, s2, customizer); - result = _(obj).chain().extend(s1, s2, customizer, any); } { @@ -9078,7 +8782,6 @@ namespace TestExtend { result = _(obj).chain().extend(s1, s2, s3); result = _(obj).chain().extend(s1, s2, s3, customizer); - result = _(obj).chain().extend(s1, s2, s3, customizer, any); } { @@ -9086,7 +8789,6 @@ namespace TestExtend { result = _(obj).chain().extend(s1, s2, s3, s4); result = _(obj).chain().extend(s1, s2, s3, s4, customizer); - result = _(obj).chain().extend(s1, s2, s3, s4, customizer, any); } { @@ -9094,7 +8796,6 @@ namespace TestExtend { result = _(obj).chain().extend(s1, s2, s3, s4, s5); result = _(obj).chain().extend(s1, s2, s3, s4, s5, customizer); - result = _(obj).chain().extend(s1, s2, s3, s4, s5, customizer, any); } } @@ -9107,22 +8808,18 @@ namespace TestFindKey { result = _.findKey<{a: string;}>({a: ''}); result = _.findKey<{a: string;}>({a: ''}, predicateFn); - result = _.findKey<{a: string;}>({a: ''}, predicateFn, any); result = _.findKey<{a: string;}>({a: ''}, ''); - result = _.findKey<{a: string;}>({a: ''}, '', any); result = _.findKey<{a: number;}, {a: string;}>({a: ''}, {a: 42}); result = _<{a: string;}>({a: ''}).findKey(); result = _<{a: string;}>({a: ''}).findKey(predicateFn); - result = _<{a: string;}>({a: ''}).findKey(predicateFn, any); result = _<{a: string;}>({a: ''}).findKey(''); - result = _<{a: string;}>({a: ''}).findKey('', any); result = _<{a: string;}>({a: ''}).findKey<{a: number;}>({a: 42}); } @@ -9132,10 +8829,8 @@ namespace TestFindKey { let result: string; result = _.findKey({a: ''}, predicateFn); - result = _.findKey({a: ''}, predicateFn, any); result = _<{a: string;}>({a: ''}).findKey(predicateFn); - result = _<{a: string;}>({a: ''}).findKey(predicateFn, any); } { @@ -9145,11 +8840,9 @@ namespace TestFindKey { result = _<{a: string;}>({a: ''}).chain().findKey(); result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn); - result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any); result = _<{a: string;}>({a: ''}).chain().findKey(''); - result = _<{a: string;}>({a: ''}).chain().findKey('', any); result = _<{a: string;}>({a: ''}).chain().findKey<{a: number;}>({a: 42}); } @@ -9159,7 +8852,6 @@ namespace TestFindKey { let result: _.LoDashExplicitWrapper; result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn); - result = _<{a: string;}>({a: ''}).chain().findKey(predicateFn, any); } } @@ -9172,22 +8864,18 @@ namespace TestFindLastKey { result = _.findLastKey<{a: string;}>({a: ''}); result = _.findLastKey<{a: string;}>({a: ''}, predicateFn); - result = _.findLastKey<{a: string;}>({a: ''}, predicateFn, any); result = _.findLastKey<{a: string;}>({a: ''}, ''); - result = _.findLastKey<{a: string;}>({a: ''}, '', any); result = _.findLastKey<{a: number;}, {a: string;}>({a: ''}, {a: 42}); result = _<{a: string;}>({a: ''}).findLastKey(); result = _<{a: string;}>({a: ''}).findLastKey(predicateFn); - result = _<{a: string;}>({a: ''}).findLastKey(predicateFn, any); result = _<{a: string;}>({a: ''}).findLastKey(''); - result = _<{a: string;}>({a: ''}).findLastKey('', any); result = _<{a: string;}>({a: ''}).findLastKey<{a: number;}>({a: 42}); } @@ -9197,10 +8885,8 @@ namespace TestFindLastKey { let result: string; result = _.findLastKey({a: ''}, predicateFn); - result = _.findLastKey({a: ''}, predicateFn, any); result = _<{a: string;}>({a: ''}).findLastKey(predicateFn); - result = _<{a: string;}>({a: ''}).findLastKey(predicateFn, any); } { @@ -9210,11 +8896,9 @@ namespace TestFindLastKey { result = _<{a: string;}>({a: ''}).chain().findLastKey(); result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn); - result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn, any); result = _<{a: string;}>({a: ''}).chain().findLastKey(''); - result = _<{a: string;}>({a: ''}).chain().findLastKey('', any); result = _<{a: string;}>({a: ''}).chain().findLastKey<{a: number;}>({a: 42}); } @@ -9224,7 +8908,6 @@ namespace TestFindLastKey { let result: _.LoDashExplicitWrapper; result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn); - result = _<{a: string;}>({a: ''}).chain().findLastKey(predicateFn, any); } } @@ -9243,7 +8926,6 @@ namespace TestForIn { result = _.forIn(dictionary); result = _.forIn(dictionary, dictionaryIterator); - result = _.forIn(dictionary, dictionaryIterator, any); } { @@ -9251,7 +8933,6 @@ namespace TestForIn { result = _.forIn(object); result = _.forIn(object, objectIterator); - result = _.forIn(object, objectIterator, any); } { @@ -9259,7 +8940,6 @@ namespace TestForIn { result = _(dictionary).forIn(); result = _(dictionary).forIn(dictionaryIterator); - result = _(dictionary).forIn(dictionaryIterator, any); } { @@ -9267,7 +8947,6 @@ namespace TestForIn { result = _(dictionary).chain().forIn(); result = _(dictionary).chain().forIn(dictionaryIterator); - result = _(dictionary).chain().forIn(dictionaryIterator, any); } } @@ -9286,7 +8965,6 @@ namespace TestForInRight { result = _.forInRight(dictionary); result = _.forInRight(dictionary, dictionaryIterator); - result = _.forInRight(dictionary, dictionaryIterator, any); } { @@ -9294,7 +8972,6 @@ namespace TestForInRight { result = _.forInRight(object); result = _.forInRight(object, objectIterator); - result = _.forInRight(object, objectIterator, any); } { @@ -9302,7 +8979,6 @@ namespace TestForInRight { result = _(dictionary).forInRight(); result = _(dictionary).forInRight(dictionaryIterator); - result = _(dictionary).forInRight(dictionaryIterator, any); } { @@ -9310,7 +8986,6 @@ namespace TestForInRight { result = _(dictionary).chain().forInRight(); result = _(dictionary).chain().forInRight(dictionaryIterator); - result = _(dictionary).chain().forInRight(dictionaryIterator, any); } } @@ -9329,7 +9004,6 @@ namespace TestForOwn { result = _.forOwn(dictionary); result = _.forOwn(dictionary, dictionaryIterator); - result = _.forOwn(dictionary, dictionaryIterator, any); } { @@ -9337,7 +9011,6 @@ namespace TestForOwn { result = _.forOwn(object); result = _.forOwn(object, objectIterator); - result = _.forOwn(object, objectIterator, any); } { @@ -9345,7 +9018,6 @@ namespace TestForOwn { result = _(dictionary).forOwn(); result = _(dictionary).forOwn(dictionaryIterator); - result = _(dictionary).forOwn(dictionaryIterator, any); } { @@ -9353,7 +9025,6 @@ namespace TestForOwn { result = _(dictionary).chain().forOwn(); result = _(dictionary).chain().forOwn(dictionaryIterator); - result = _(dictionary).chain().forOwn(dictionaryIterator, any); } } @@ -9372,7 +9043,6 @@ namespace TestForOwnRight { result = _.forOwnRight(dictionary); result = _.forOwnRight(dictionary, dictionaryIterator); - result = _.forOwnRight(dictionary, dictionaryIterator, any); } { @@ -9380,7 +9050,6 @@ namespace TestForOwnRight { result = _.forOwnRight(object); result = _.forOwnRight(object, objectIterator); - result = _.forOwnRight(object, objectIterator, any); } { @@ -9388,7 +9057,6 @@ namespace TestForOwnRight { result = _(dictionary).forOwnRight(); result = _(dictionary).forOwnRight(dictionaryIterator); - result = _(dictionary).forOwnRight(dictionaryIterator, any); } { @@ -9396,7 +9064,6 @@ namespace TestForOwnRight { result = _(dictionary).chain().forOwnRight(); result = _(dictionary).chain().forOwnRight(dictionaryIterator); - result = _(dictionary).chain().forOwnRight(dictionaryIterator, any); } } @@ -9779,23 +9446,17 @@ namespace TestMapKeys { result = _.mapKeys(array); result = _.mapKeys(array, listIterator); - result = _.mapKeys(array, listIterator, any); result = _.mapKeys(array, ''); - result = _.mapKeys(array, '', any); result = _.mapKeys(array, {}); result = _.mapKeys(list); result = _.mapKeys(list, listIterator); - result = _.mapKeys(list, listIterator, any); result = _.mapKeys(list, ''); - result = _.mapKeys(list, '', any); result = _.mapKeys(list, {}); result = _.mapKeys(dictionary); result = _.mapKeys(dictionary, dictionaryIterator); - result = _.mapKeys(dictionary, dictionaryIterator, any); result = _.mapKeys(dictionary, ''); - result = _.mapKeys(dictionary, '', any); result = _.mapKeys(dictionary, {}); } @@ -9804,23 +9465,17 @@ namespace TestMapKeys { result = _(array).mapKeys(); result = _(array).mapKeys(listIterator); - result = _(array).mapKeys(listIterator, any); result = _(array).mapKeys(''); - result = _(array).mapKeys('', any); result = _(array).mapKeys<{}>({}); result = _(list).mapKeys(); result = _(list).mapKeys(listIterator); - result = _(list).mapKeys(listIterator, any); result = _(list).mapKeys(''); - result = _(list).mapKeys('', any); result = _(list).mapKeys({}); result = _(dictionary).mapKeys(); result = _(dictionary).mapKeys(dictionaryIterator); - result = _(dictionary).mapKeys(dictionaryIterator, any); result = _(dictionary).mapKeys(''); - result = _(dictionary).mapKeys('', any); result = _(dictionary).mapKeys({}); } @@ -9829,23 +9484,17 @@ namespace TestMapKeys { result = _(array).chain().mapKeys(); result = _(array).chain().mapKeys(listIterator); - result = _(array).chain().mapKeys(listIterator, any); result = _(array).chain().mapKeys(''); - result = _(array).chain().mapKeys('', any); result = _(array).chain().mapKeys<{}>({}); result = _(list).chain().mapKeys(); result = _(list).chain().mapKeys(listIterator); - result = _(list).chain().mapKeys(listIterator, any); result = _(list).chain().mapKeys(''); - result = _(list).chain().mapKeys('', any); result = _(list).chain().mapKeys({}); result = _(dictionary).chain().mapKeys(); result = _(dictionary).chain().mapKeys(dictionaryIterator); - result = _(dictionary).chain().mapKeys(dictionaryIterator, any); result = _(dictionary).chain().mapKeys(''); - result = _(dictionary).chain().mapKeys('', any); result = _(dictionary).chain().mapKeys({}); } } @@ -10388,12 +10037,10 @@ namespace TestTransform { result = _.transform(array); result = _.transform(array, iterator); result = _.transform(array, iterator, accumulator); - result = _.transform(array, iterator, accumulator, any); result = _(array).transform().value(); result = _(array).transform(iterator).value(); result = _(array).transform(iterator, accumulator).value(); - result = _(array).transform(iterator, accumulator, any).value(); } { @@ -10403,11 +10050,9 @@ namespace TestTransform { result = _.transform(array, iterator); result = _.transform(array, iterator, accumulator); - result = _.transform(array, iterator, accumulator, any); result = _(array).transform(iterator).value(); result = _(array).transform(iterator, accumulator).value(); - result = _(array).transform(iterator, accumulator, any).value(); } { @@ -10418,12 +10063,10 @@ namespace TestTransform { result = _.transform(dictionary); result = _.transform(dictionary, iterator); result = _.transform(dictionary, iterator, accumulator); - result = _.transform(dictionary, iterator, accumulator, any); result = _(dictionary).transform().value(); result = _(dictionary).transform(iterator).value(); result = _(dictionary).transform(iterator, accumulator).value(); - result = _(dictionary).transform(iterator, accumulator, any).value(); } { @@ -10433,11 +10076,9 @@ namespace TestTransform { result = _.transform(dictionary, iterator); result = _.transform(dictionary, iterator, accumulator); - result = _.transform(dictionary, iterator, accumulator, any); result = _(dictionary).transform(iterator).value(); result = _(dictionary).transform(iterator, accumulator).value(); - result = _(dictionary).transform(iterator, accumulator, any).value(); } } @@ -11207,77 +10848,77 @@ namespace TestAttempt { namespace TestConstant { { let result: () => number; - result: _.constant(42); + result = _.constant(42); } { let result: () => string; - result: _.constant('a'); + result = _.constant('a'); } { let result: () => boolean; - result: _.constant(true); + result = _.constant(true); } { let result: () => string[]; - result: _.constant(['a']); + result = _.constant(['a']); } { let result: () => {a: string}; - result: _.constant<{a: string}>({a: 'a'}); + result = _.constant<{a: string}>({a: 'a'}); } { let result: _.LoDashImplicitObjectWrapper<() => number>; - result: _(42).constant(); + result = _(42).constant(); } { let result: _.LoDashImplicitObjectWrapper<() => string>; - result: _('a').constant(); + result = _('a').constant(); } { let result: _.LoDashImplicitObjectWrapper<() => boolean>; - result: _(true).constant(); + result = _(true).constant(); } { let result: _.LoDashImplicitObjectWrapper<() => string[]>; - result: _(['a']).constant(); + result = _(['a']).constant(); } { let result: _.LoDashImplicitObjectWrapper<() => {a: string}>; - result: _({a: 'a'}).constant<{a: string}>(); + result = _({a: 'a'}).constant<{a: string}>(); } { let result: _.LoDashExplicitObjectWrapper<() => number>; - result: _(42).chain().constant(); + result = _(42).chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => string>; - result: _('a').chain().constant(); + result = _('a').chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => boolean>; - result: _(true).chain().constant(); + result = _(true).chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => string[]>; - result: _(['a']).chain().constant(); + result = _(['a']).chain().constant(); } { let result: _.LoDashExplicitObjectWrapper<() => {a: string}>; - result: _({a: 'a'}).chain().constant<{a: string}>(); + result = _({a: 'a'}).chain().constant<{a: string}>(); } } @@ -11329,63 +10970,54 @@ namespace TestIteratee { let result: (...args: any[]) => TResult; result = _.iteratee(Function); - result = _.iteratee(Function, any); } { let result: (object: any) => TResult; result = _.iteratee(''); - result = _.iteratee('', any); } { let result: (object: any) => boolean; result = _.iteratee({}); - result = _.iteratee({}, any); } { let result: _.LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; result = _(Function).iteratee(); - result = _(Function).iteratee(any); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => TResult>; result = _('').iteratee(); - result = _('').iteratee(any); } { let result: _.LoDashImplicitObjectWrapper<(object: any) => boolean>; result = _({}).iteratee(); - result = _({}).iteratee(any); } { let result: _.LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; result = _(Function).chain().iteratee(); - result = _(Function).chain().iteratee(any); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => TResult>; result = _('').chain().iteratee(); - result = _('').chain().iteratee(any); } { let result: _.LoDashExplicitObjectWrapper<(object: any) => boolean>; result = _({}).chain().iteratee(); - result = _({}).chain().iteratee(any); } } @@ -11462,7 +11094,6 @@ namespace TestMethod { let result: (object: any) => {a: string}; result = _.method<{a: string}>('a.0'); - result = _.method<{a: string}>('a.0', any); result = _.method<{a: string}>('a.0', any, any); result = _.method<{a: string}>('a.0', any, any, any); @@ -11476,7 +11107,6 @@ namespace TestMethod { let result: (object: {a: string}) => {b: string}; result = _.method<{a: string}, {b: string}>('a.0'); - result = _.method<{a: string}, {b: string}>('a.0', any); result = _.method<{a: string}, {b: string}>('a.0', any, any); result = _.method<{a: string}, {b: string}>('a.0', any, any, any); diff --git a/lodash/lodash.d.ts b/lodash/lodash.d.ts index bd996b9638..0e506e9597 100644 --- a/lodash/lodash.d.ts +++ b/lodash/lodash.d.ts @@ -1241,8 +1241,7 @@ declare module _ { */ dropRightWhile( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): TValue[]; /** @@ -1250,8 +1249,7 @@ declare module _ { */ dropRightWhile( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): TValue[]; /** @@ -1268,16 +1266,14 @@ declare module _ { * @see _.dropRightWhile */ dropRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.dropRightWhile */ dropRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -1293,16 +1289,14 @@ declare module _ { * @see _.dropRightWhile */ dropRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.dropRightWhile */ dropRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -1318,16 +1312,14 @@ declare module _ { * @see _.dropRightWhile */ dropRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.dropRightWhile */ dropRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -1343,16 +1335,14 @@ declare module _ { * @see _.dropRightWhile */ dropRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.dropRightWhile */ dropRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -1385,8 +1375,7 @@ declare module _ { */ dropWhile( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): TValue[]; /** @@ -1394,8 +1383,7 @@ declare module _ { */ dropWhile( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): TValue[]; /** @@ -1412,16 +1400,14 @@ declare module _ { * @see _.dropWhile */ dropWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.dropWhile */ dropWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -1437,16 +1423,14 @@ declare module _ { * @see _.dropWhile */ dropWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.dropWhile */ dropWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -1462,16 +1446,14 @@ declare module _ { * @see _.dropWhile */ dropWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.dropWhile */ dropWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -1487,16 +1469,14 @@ declare module _ { * @see _.dropWhile */ dropWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.dropWhile */ dropWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -1604,8 +1584,7 @@ declare module _ { */ findIndex( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** @@ -1613,8 +1592,7 @@ declare module _ { */ findIndex( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1631,16 +1609,14 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** * @see _.findIndex */ findIndex( - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1656,16 +1632,14 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** * @see _.findIndex */ findIndex( - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1681,16 +1655,14 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitWrapper; /** * @see _.findIndex */ findIndex( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -1706,16 +1678,14 @@ declare module _ { * @see _.findIndex */ findIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitWrapper; /** * @see _.findIndex */ findIndex( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -1747,8 +1717,7 @@ declare module _ { */ findLastIndex( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** @@ -1756,8 +1725,7 @@ declare module _ { */ findLastIndex( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1774,16 +1742,14 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1799,16 +1765,14 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): number; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string, - thisArg?: any + predicate?: string ): number; /** @@ -1824,16 +1788,14 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitWrapper; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -1849,16 +1811,14 @@ declare module _ { * @see _.findLastIndex */ findLastIndex( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitWrapper; /** * @see _.findLastIndex */ findLastIndex( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -2058,7 +2018,23 @@ declare module _ { */ fromPairs( array: any[]|List - ): any[]; + ): Dictionary; + } + + //_.fromPairs DUMMY + interface LoDashImplicitArrayWrapper { + /** + * @see _.fromPairs + */ + fromPairs(): LoDashImplicitObjectWrapper; + } + + //_.fromPairs DUMMY + interface LoDashExplicitArrayWrapper { + /** + * @see _.fromPairs + */ + fromPairs(): LoDashExplicitObjectWrapper; } //_.head @@ -2756,8 +2732,7 @@ declare module _ { */ remove( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T[]; /** @@ -2765,8 +2740,7 @@ declare module _ { */ remove( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): T[]; /** @@ -2783,16 +2757,14 @@ declare module _ { * @see _.remove */ remove( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.remove */ remove( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -2808,16 +2780,14 @@ declare module _ { * @see _.remove */ remove( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.remove */ remove( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -2833,16 +2803,14 @@ declare module _ { * @see _.remove */ remove( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.remove */ remove( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -2858,16 +2826,14 @@ declare module _ { * @see _.remove */ remove( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.remove */ remove( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -3888,8 +3854,7 @@ declare module _ { */ takeRightWhile( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): TValue[]; /** @@ -3897,8 +3862,7 @@ declare module _ { */ takeRightWhile( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): TValue[]; /** @@ -3915,16 +3879,14 @@ declare module _ { * @see _.takeRightWhile */ takeRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.takeRightWhile */ takeRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -3940,16 +3902,14 @@ declare module _ { * @see _.takeRightWhile */ takeRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.takeRightWhile */ takeRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -3965,16 +3925,14 @@ declare module _ { * @see _.takeRightWhile */ takeRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.takeRightWhile */ takeRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -3990,16 +3948,14 @@ declare module _ { * @see _.takeRightWhile */ takeRightWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.takeRightWhile */ takeRightWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -4032,8 +3988,7 @@ declare module _ { */ takeWhile( array: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): TValue[]; /** @@ -4041,8 +3996,7 @@ declare module _ { */ takeWhile( array: List, - predicate?: string, - thisArg?: any + predicate?: string ): TValue[]; /** @@ -4059,16 +4013,14 @@ declare module _ { * @see _.takeWhile */ takeWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.takeWhile */ takeWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -4084,16 +4036,14 @@ declare module _ { * @see _.takeWhile */ takeWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.takeWhile */ takeWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashImplicitArrayWrapper; /** @@ -4109,16 +4059,14 @@ declare module _ { * @see _.takeWhile */ takeWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.takeWhile */ takeWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -4134,16 +4082,14 @@ declare module _ { * @see _.takeWhile */ takeWhile( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.takeWhile */ takeWhile( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitArrayWrapper; /** @@ -5391,8 +5337,7 @@ declare module _ { */ unzipWith( array: List>, - iteratee?: MemoIterator, - thisArg?: any + iteratee?: MemoIterator ): TResult[]; } @@ -5401,8 +5346,7 @@ declare module _ { * @see _.unzipWith */ unzipWith( - iteratee?: MemoIterator, - thisArg?: any + iteratee?: MemoIterator ): LoDashImplicitArrayWrapper; } @@ -5411,8 +5355,7 @@ declare module _ { * @see _.unzipWith */ unzipWith( - iteratee?: MemoIterator, - thisArg?: any + iteratee?: MemoIterator ): LoDashImplicitArrayWrapper; } @@ -5801,8 +5744,7 @@ declare module _ { **/ tap( value: T, - interceptor: (value: T) => void, - thisArg?: any + interceptor: (value: T) => void ): T; } @@ -5811,8 +5753,7 @@ declare module _ { * @see _.tap */ tap( - interceptor: (value: T) => void, - thisArg?: any + interceptor: (value: T) => void ): TWrapper; } @@ -5821,8 +5762,7 @@ declare module _ { * @see _.tap */ tap( - interceptor: (value: T) => void, - thisArg?: any + interceptor: (value: T) => void ): TWrapper; } @@ -5838,8 +5778,7 @@ declare module _ { */ thru( value: T, - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): TResult; } @@ -5848,36 +5787,31 @@ declare module _ { * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitWrapper; + interceptor: (value: T) => TResult): LoDashImplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitWrapper; + interceptor: (value: T) => TResult): LoDashImplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitWrapper; + interceptor: (value: T) => TResult): LoDashImplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any): LoDashImplicitObjectWrapper; + interceptor: (value: T) => TResult): LoDashImplicitObjectWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult[], - thisArg?: any): LoDashImplicitArrayWrapper; + interceptor: (value: T) => TResult[]): LoDashImplicitArrayWrapper; } interface LoDashExplicitWrapperBase { @@ -5885,40 +5819,35 @@ declare module _ { * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): LoDashExplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): LoDashExplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): LoDashExplicitWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult, - thisArg?: any + interceptor: (value: T) => TResult ): LoDashExplicitObjectWrapper; /** * @see _.thru */ thru( - interceptor: (value: T) => TResult[], - thisArg?: any + interceptor: (value: T) => TResult[] ): LoDashExplicitArrayWrapper; } @@ -6174,8 +6103,7 @@ declare module _ { */ countBy( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -6183,8 +6111,7 @@ declare module _ { */ countBy( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -6192,8 +6119,7 @@ declare module _ { */ countBy( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator, - thisArg?: any + iteratee?: NumericDictionaryIterator ): Dictionary; /** @@ -6201,8 +6127,7 @@ declare module _ { */ countBy( collection: List|Dictionary|NumericDictionary, - iteratee?: string, - thisArg?: any + iteratee?: string ): Dictionary; /** @@ -6227,8 +6152,7 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; } @@ -6237,16 +6161,14 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; /** * @see _.countBy */ countBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -6262,16 +6184,14 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator ): LoDashImplicitObjectWrapper>; /** * @see _.countBy */ countBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -6287,8 +6207,7 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; } @@ -6297,16 +6216,14 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; /** * @see _.countBy */ countBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -6322,16 +6239,14 @@ declare module _ { * @see _.countBy */ countBy( - iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator|NumericDictionaryIterator ): LoDashExplicitObjectWrapper>; /** * @see _.countBy */ countBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -6349,8 +6264,7 @@ declare module _ { */ each( collection: T[], - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): T[]; /** @@ -6358,8 +6272,7 @@ declare module _ { */ each( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): List; /** @@ -6367,8 +6280,7 @@ declare module _ { */ each( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -6376,8 +6288,7 @@ declare module _ { */ each( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; /** @@ -6385,8 +6296,7 @@ declare module _ { */ each( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; } @@ -6395,8 +6305,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitWrapper; } @@ -6405,8 +6314,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitArrayWrapper; } @@ -6415,8 +6323,7 @@ declare module _ { * @see _.forEach */ each( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper; } @@ -6425,8 +6332,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitWrapper; } @@ -6435,8 +6341,7 @@ declare module _ { * @see _.forEach */ each( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitArrayWrapper; } @@ -6445,8 +6350,7 @@ declare module _ { * @see _.forEach */ each( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper; } @@ -6457,8 +6361,7 @@ declare module _ { */ eachRight( collection: T[], - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): T[]; /** @@ -6466,8 +6369,7 @@ declare module _ { */ eachRight( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): List; /** @@ -6475,8 +6377,7 @@ declare module _ { */ eachRight( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -6484,8 +6385,7 @@ declare module _ { */ eachRight( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; /** @@ -6493,8 +6393,7 @@ declare module _ { */ eachRight( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; } @@ -6503,8 +6402,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitWrapper; } @@ -6513,8 +6411,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitArrayWrapper; } @@ -6523,8 +6420,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper; } @@ -6533,8 +6429,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitWrapper; } @@ -6543,8 +6438,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitArrayWrapper; } @@ -6553,8 +6447,7 @@ declare module _ { * @see _.forEachRight */ eachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper; } @@ -6720,8 +6613,7 @@ declare module _ { */ filter( collection: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T[]; /** @@ -6729,8 +6621,7 @@ declare module _ { */ filter( collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): T[]; /** @@ -6738,8 +6629,7 @@ declare module _ { */ filter( collection: string, - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): string[]; /** @@ -6747,8 +6637,7 @@ declare module _ { */ filter( collection: List|Dictionary, - predicate: string, - thisArg?: any + predicate: string ): T[]; /** @@ -6765,8 +6654,7 @@ declare module _ { * @see _.filter */ filter( - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): LoDashImplicitArrayWrapper; } @@ -6775,16 +6663,14 @@ declare module _ { * @see _.filter */ filter( - predicate: ListIterator, - thisArg?: any + predicate: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.filter */ filter( - predicate: string, - thisArg?: any + predicate: string ): LoDashImplicitArrayWrapper; /** @@ -6798,16 +6684,14 @@ declare module _ { * @see _.filter */ filter( - predicate: ListIterator|DictionaryIterator, - thisArg?: any + predicate: ListIterator|DictionaryIterator ): LoDashImplicitArrayWrapper; /** * @see _.filter */ filter( - predicate: string, - thisArg?: any + predicate: string ): LoDashImplicitArrayWrapper; /** @@ -6821,8 +6705,7 @@ declare module _ { * @see _.filter */ filter( - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): LoDashExplicitArrayWrapper; } @@ -6831,16 +6714,14 @@ declare module _ { * @see _.filter */ filter( - predicate: ListIterator, - thisArg?: any + predicate: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.filter */ filter( - predicate: string, - thisArg?: any + predicate: string ): LoDashExplicitArrayWrapper; /** @@ -6854,16 +6735,14 @@ declare module _ { * @see _.filter */ filter( - predicate: ListIterator|DictionaryIterator, - thisArg?: any + predicate: ListIterator|DictionaryIterator ): LoDashExplicitArrayWrapper; /** * @see _.filter */ filter( - predicate: string, - thisArg?: any + predicate: string ): LoDashExplicitArrayWrapper; /** @@ -6894,8 +6773,7 @@ declare module _ { */ find( collection: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T; /** @@ -6903,8 +6781,7 @@ declare module _ { */ find( collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): T; /** @@ -6912,8 +6789,7 @@ declare module _ { */ find( collection: List|Dictionary, - predicate?: string, - thisArg?: any + predicate?: string ): T; /** @@ -6930,16 +6806,14 @@ declare module _ { * @see _.find */ find( - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T; /** * @see _.find */ find( - predicate?: string, - thisArg?: any + predicate?: string ): T; /** @@ -6955,16 +6829,14 @@ declare module _ { * @see _.find */ find( - predicate?: ListIterator|DictionaryIterator, - thisArg?: any + predicate?: ListIterator|DictionaryIterator ): TResult; /** * @see _.find */ find( - predicate?: string, - thisArg?: any + predicate?: string ): TResult; /** @@ -6987,24 +6859,21 @@ declare module _ { **/ findLast( collection: Array, - callback: ListIterator, - thisArg?: any): T; + callback: ListIterator): T; /** * @see _.find **/ findLast( collection: List, - callback: ListIterator, - thisArg?: any): T; + callback: ListIterator): T; /** * @see _.find **/ findLast( collection: Dictionary, - callback: DictionaryIterator, - thisArg?: any): T; + callback: DictionaryIterator): T; /** * @see _.find @@ -7060,8 +6929,7 @@ declare module _ { * @see _.findLast */ findLast( - callback: ListIterator, - thisArg?: any): T; + callback: ListIterator): T; /** * @see _.findLast * @param _.where style callback @@ -7361,8 +7229,7 @@ declare module _ { */ forEach( collection: T[], - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): T[]; /** @@ -7370,8 +7237,7 @@ declare module _ { */ forEach( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): List; /** @@ -7379,8 +7245,7 @@ declare module _ { */ forEach( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7388,8 +7253,7 @@ declare module _ { */ forEach( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; /** @@ -7397,8 +7261,7 @@ declare module _ { */ forEach( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; } @@ -7407,8 +7270,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitWrapper; } @@ -7417,8 +7279,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitArrayWrapper; } @@ -7427,8 +7288,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper; } @@ -7437,8 +7297,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitWrapper; } @@ -7447,8 +7306,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitArrayWrapper; } @@ -7457,8 +7315,7 @@ declare module _ { * @see _.forEach */ forEach( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper; } @@ -7475,8 +7332,7 @@ declare module _ { */ forEachRight( collection: T[], - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): T[]; /** @@ -7484,8 +7340,7 @@ declare module _ { */ forEachRight( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): List; /** @@ -7493,8 +7348,7 @@ declare module _ { */ forEachRight( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7502,8 +7356,7 @@ declare module _ { */ forEachRight( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; /** @@ -7511,8 +7364,7 @@ declare module _ { */ forEachRight( collection: T, - iteratee?: ObjectIterator, - thisArgs?: any + iteratee?: ObjectIterator ): T; } @@ -7521,8 +7373,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitWrapper; } @@ -7531,8 +7382,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashImplicitArrayWrapper; } @@ -7541,8 +7391,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper; } @@ -7551,8 +7400,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitWrapper; } @@ -7561,8 +7409,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee: ListIterator, - thisArg?: any + iteratee: ListIterator ): LoDashExplicitArrayWrapper; } @@ -7571,8 +7418,7 @@ declare module _ { * @see _.forEachRight */ forEachRight( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper; } @@ -7600,8 +7446,7 @@ declare module _ { */ groupBy( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -7609,8 +7454,7 @@ declare module _ { */ groupBy( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -7618,8 +7462,7 @@ declare module _ { */ groupBy( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7627,8 +7470,7 @@ declare module _ { */ groupBy( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7636,8 +7478,7 @@ declare module _ { */ groupBy( collection: List|Dictionary, - iteratee?: string, - thisArg?: TValue + iteratee?: string ): Dictionary; /** @@ -7645,8 +7486,7 @@ declare module _ { */ groupBy( collection: List|Dictionary, - iteratee?: string, - thisArg?: any + iteratee?: string ): Dictionary; /** @@ -7671,8 +7511,7 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; } @@ -7681,16 +7520,14 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: TValue + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -7706,32 +7543,28 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: TValue + iteratee?: string ): LoDashImplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -7754,8 +7587,7 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; } @@ -7764,16 +7596,14 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: TValue + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -7789,32 +7619,28 @@ declare module _ { * @see _.groupBy */ groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: TValue + iteratee?: string ): LoDashExplicitObjectWrapper>; /** * @see _.groupBy */ groupBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -7943,8 +7769,7 @@ declare module _ { */ keyBy( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -7952,8 +7777,7 @@ declare module _ { */ keyBy( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator, - thisArg?: any + iteratee?: NumericDictionaryIterator ): Dictionary; /** @@ -7961,8 +7785,7 @@ declare module _ { */ keyBy( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -7970,8 +7793,7 @@ declare module _ { */ keyBy( collection: List|NumericDictionary|Dictionary, - iteratee?: string, - thisArg?: any + iteratee?: string ): Dictionary; /** @@ -7996,8 +7818,7 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; } @@ -8006,16 +7827,14 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; /** * @see _.keyBy */ keyBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -8031,16 +7850,14 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator ): LoDashImplicitObjectWrapper>; /** * @see _.keyBy */ keyBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; /** @@ -8063,8 +7880,7 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; } @@ -8073,16 +7889,14 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; /** * @see _.keyBy */ keyBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -8098,16 +7912,14 @@ declare module _ { * @see _.keyBy */ keyBy( - iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|NumericDictionaryIterator|DictionaryIterator ): LoDashExplicitObjectWrapper>; /** * @see _.keyBy */ keyBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; /** @@ -8358,8 +8170,7 @@ declare module _ { */ map( collection: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): TResult[]; /** @@ -8367,14 +8178,12 @@ declare module _ { */ map( collection: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): TResult[]; map( collection: NumericDictionary, - iteratee?: NumericDictionaryIterator, - thisArg?: any + iteratee?: NumericDictionaryIterator ): TResult[]; /** @@ -8399,8 +8208,7 @@ declare module _ { * @see _.map */ map( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitArrayWrapper; /** @@ -8423,8 +8231,7 @@ declare module _ { * @see _.map */ map( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitArrayWrapper; /** @@ -8447,8 +8254,7 @@ declare module _ { * @see _.map */ map( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitArrayWrapper; /** @@ -8471,8 +8277,7 @@ declare module _ { * @see _.map */ map( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitArrayWrapper; /** @@ -8513,16 +8318,14 @@ declare module _ { **/ partition( collection: List, - callback: ListIterator, - thisArg?: any): T[][]; + callback: ListIterator): T[][]; /** * @see _.partition **/ partition( collection: Dictionary, - callback: DictionaryIterator, - thisArg?: any): T[][]; + callback: DictionaryIterator): T[][]; /** * @see _.partition @@ -8574,8 +8377,7 @@ declare module _ { * @see _.partition */ partition( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + callback: ListIterator): LoDashImplicitArrayWrapper; } interface LoDashImplicitArrayWrapper { @@ -8583,8 +8385,7 @@ declare module _ { * @see _.partition */ partition( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + callback: ListIterator): LoDashImplicitArrayWrapper; /** * @see _.partition */ @@ -8608,15 +8409,13 @@ declare module _ { * @see _.partition */ partition( - callback: ListIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + callback: ListIterator): LoDashImplicitArrayWrapper; /** * @see _.partition */ partition( - callback: DictionaryIterator, - thisArg?: any): LoDashImplicitArrayWrapper; + callback: DictionaryIterator): LoDashImplicitArrayWrapper; /** * @see _.partition @@ -8655,8 +8454,7 @@ declare module _ { reduce( collection: Array, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce @@ -8664,8 +8462,7 @@ declare module _ { reduce( collection: List, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce @@ -8673,8 +8470,7 @@ declare module _ { reduce( collection: Dictionary, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce @@ -8682,40 +8478,35 @@ declare module _ { reduce( collection: NumericDictionary, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce **/ reduce( collection: Array, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduce **/ reduce( collection: List, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduce **/ reduce( collection: Dictionary, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduce **/ reduce( collection: NumericDictionary, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; } @@ -8725,15 +8516,13 @@ declare module _ { **/ reduce( callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce **/ reduce( - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; } interface LoDashImplicitObjectWrapper { @@ -8742,15 +8531,13 @@ declare module _ { **/ reduce( callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduce **/ reduce( - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; } //_.reduceRight @@ -8767,8 +8554,7 @@ declare module _ { reduceRight( collection: Array, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduceRight @@ -8776,8 +8562,7 @@ declare module _ { reduceRight( collection: List, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduceRight @@ -8785,32 +8570,28 @@ declare module _ { reduceRight( collection: Dictionary, callback: MemoIterator, - accumulator: TResult, - thisArg?: any): TResult; + accumulator: TResult): TResult; /** * @see _.reduceRight **/ reduceRight( collection: Array, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduceRight **/ reduceRight( collection: List, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; /** * @see _.reduceRight **/ reduceRight( collection: Dictionary, - callback: MemoIterator, - thisArg?: any): TResult; + callback: MemoIterator): TResult; } //_.reject @@ -8826,8 +8607,7 @@ declare module _ { */ reject( collection: List, - predicate?: ListIterator, - thisArg?: any + predicate?: ListIterator ): T[]; /** @@ -8835,8 +8615,7 @@ declare module _ { */ reject( collection: Dictionary, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): T[]; /** @@ -8844,8 +8623,7 @@ declare module _ { */ reject( collection: string, - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): string[]; /** @@ -8853,8 +8631,7 @@ declare module _ { */ reject( collection: List|Dictionary, - predicate: string, - thisArg?: any + predicate: string ): T[]; /** @@ -8871,8 +8648,7 @@ declare module _ { * @see _.reject */ reject( - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): LoDashImplicitArrayWrapper; } @@ -8881,16 +8657,14 @@ declare module _ { * @see _.reject */ reject( - predicate: ListIterator, - thisArg?: any + predicate: ListIterator ): LoDashImplicitArrayWrapper; /** * @see _.reject */ reject( - predicate: string, - thisArg?: any + predicate: string ): LoDashImplicitArrayWrapper; /** @@ -8904,16 +8678,14 @@ declare module _ { * @see _.reject */ reject( - predicate: ListIterator|DictionaryIterator, - thisArg?: any + predicate: ListIterator|DictionaryIterator ): LoDashImplicitArrayWrapper; /** * @see _.reject */ reject( - predicate: string, - thisArg?: any + predicate: string ): LoDashImplicitArrayWrapper; /** @@ -8927,8 +8699,7 @@ declare module _ { * @see _.reject */ reject( - predicate?: StringIterator, - thisArg?: any + predicate?: StringIterator ): LoDashExplicitArrayWrapper; } @@ -8937,16 +8708,14 @@ declare module _ { * @see _.reject */ reject( - predicate: ListIterator, - thisArg?: any + predicate: ListIterator ): LoDashExplicitArrayWrapper; /** * @see _.reject */ reject( - predicate: string, - thisArg?: any + predicate: string ): LoDashExplicitArrayWrapper; /** @@ -8960,16 +8729,14 @@ declare module _ { * @see _.reject */ reject( - predicate: ListIterator|DictionaryIterator, - thisArg?: any + predicate: ListIterator|DictionaryIterator ): LoDashExplicitArrayWrapper; /** * @see _.reject */ reject( - predicate: string, - thisArg?: any + predicate: string ): LoDashExplicitArrayWrapper; /** @@ -10120,7 +9887,6 @@ declare module _ { **/ createCallback( func: string, - thisArg?: any, argCount?: number): () => any; /** @@ -10128,7 +9894,6 @@ declare module _ { **/ createCallback( func: Dictionary, - thisArg?: any, argCount?: number): () => boolean; } @@ -10137,7 +9902,6 @@ declare module _ { * @see _.createCallback **/ createCallback( - thisArg?: any, argCount?: number): LoDashImplicitObjectWrapper<() => any>; } @@ -10146,7 +9910,6 @@ declare module _ { * @see _.createCallback **/ createCallback( - thisArg?: any, argCount?: number): LoDashImplicitObjectWrapper<() => any>; } @@ -13349,16 +13112,14 @@ declare module _ { * @see _.maxBy */ maxBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): T; /** * @see _.maxBy */ maxBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): T; /** @@ -13514,16 +13275,14 @@ declare module _ { * @see _.minBy */ minBy( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): T; /** * @see _.minBy */ minBy( - iteratee?: string, - thisArg?: any + iteratee?: string ): T; /** @@ -14917,8 +14676,7 @@ declare module _ { extend( object: TObject, source: TSource, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): TResult; /** @@ -14928,8 +14686,7 @@ declare module _ { object: TObject, source1: TSource1, source2: TSource2, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): TResult; /** @@ -14940,8 +14697,7 @@ declare module _ { source1: TSource1, source2: TSource2, source3: TSource3, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): TResult; /** @@ -14955,8 +14711,7 @@ declare module _ { source2: TSource2, source3: TSource3, source4: TSource4, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): TResult; /** @@ -14978,8 +14733,7 @@ declare module _ { */ extend( source: TSource, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): LoDashImplicitObjectWrapper; /** @@ -14988,8 +14742,7 @@ declare module _ { extend( source1: TSource1, source2: TSource2, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): LoDashImplicitObjectWrapper; /** @@ -14999,8 +14752,7 @@ declare module _ { source1: TSource1, source2: TSource2, source3: TSource3, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): LoDashImplicitObjectWrapper; /** @@ -15011,8 +14763,7 @@ declare module _ { source2: TSource2, source3: TSource3, source4: TSource4, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): LoDashImplicitObjectWrapper; /** @@ -15032,8 +14783,7 @@ declare module _ { */ extend( source: TSource, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): LoDashExplicitObjectWrapper; /** @@ -15042,8 +14792,7 @@ declare module _ { extend( source1: TSource1, source2: TSource2, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): LoDashExplicitObjectWrapper; /** @@ -15053,8 +14802,7 @@ declare module _ { source1: TSource1, source2: TSource2, source3: TSource3, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): LoDashExplicitObjectWrapper; /** @@ -15065,8 +14813,7 @@ declare module _ { source2: TSource2, source3: TSource3, source4: TSource4, - customizer?: AssignCustomizer, - thisArg?: any + customizer?: AssignCustomizer ): LoDashExplicitObjectWrapper; /** @@ -15102,8 +14849,7 @@ declare module _ { */ findKey( object: TObject, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): string; /** @@ -15111,8 +14857,7 @@ declare module _ { */ findKey( object: TObject, - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): string; /** @@ -15120,8 +14865,7 @@ declare module _ { */ findKey( object: TObject, - predicate?: string, - thisArg?: any + predicate?: string ): string; /** @@ -15138,24 +14882,21 @@ declare module _ { * @see _.findKey */ findKey( - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): string; /** * @see _.findKey */ findKey( - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): string; /** * @see _.findKey */ findKey( - predicate?: string, - thisArg?: any + predicate?: string ): string; /** @@ -15171,24 +14912,21 @@ declare module _ { * @see _.findKey */ findKey( - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): LoDashExplicitWrapper; /** * @see _.findKey */ findKey( - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): LoDashExplicitWrapper; /** * @see _.findKey */ findKey( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -15220,8 +14958,7 @@ declare module _ { */ findLastKey( object: TObject, - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): string; /** @@ -15229,8 +14966,7 @@ declare module _ { */ findLastKey( object: TObject, - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): string; /** @@ -15238,8 +14974,7 @@ declare module _ { */ findLastKey( object: TObject, - predicate?: string, - thisArg?: any + predicate?: string ): string; /** @@ -15256,24 +14991,21 @@ declare module _ { * @see _.findLastKey */ findLastKey( - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): string; /** * @see _.findLastKey */ findLastKey( - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): string; /** * @see _.findLastKey */ findLastKey( - predicate?: string, - thisArg?: any + predicate?: string ): string; /** @@ -15289,24 +15021,21 @@ declare module _ { * @see _.findLastKey */ findLastKey( - predicate?: DictionaryIterator, - thisArg?: any + predicate?: DictionaryIterator ): LoDashExplicitWrapper; /** * @see _.findLastKey */ findLastKey( - predicate?: ObjectIterator, - thisArg?: any + predicate?: ObjectIterator ): LoDashExplicitWrapper; /** * @see _.findLastKey */ findLastKey( - predicate?: string, - thisArg?: any + predicate?: string ): LoDashExplicitWrapper; /** @@ -15331,8 +15060,7 @@ declare module _ { */ forIn( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -15340,8 +15068,7 @@ declare module _ { */ forIn( object: T, - iteratee?: ObjectIterator, - thisArg?: any + iteratee?: ObjectIterator ): T; } @@ -15350,8 +15077,7 @@ declare module _ { * @see _.forIn */ forIn( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashImplicitObjectWrapper; } @@ -15360,8 +15086,7 @@ declare module _ { * @see _.forIn */ forIn( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashExplicitObjectWrapper; } @@ -15377,8 +15102,7 @@ declare module _ { */ forInRight( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -15386,8 +15110,7 @@ declare module _ { */ forInRight( object: T, - iteratee?: ObjectIterator, - thisArg?: any + iteratee?: ObjectIterator ): T; } @@ -15396,8 +15119,7 @@ declare module _ { * @see _.forInRight */ forInRight( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashImplicitObjectWrapper; } @@ -15406,8 +15128,7 @@ declare module _ { * @see _.forInRight */ forInRight( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashExplicitObjectWrapper; } @@ -15425,8 +15146,7 @@ declare module _ { */ forOwn( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -15434,8 +15154,7 @@ declare module _ { */ forOwn( object: T, - iteratee?: ObjectIterator, - thisArg?: any + iteratee?: ObjectIterator ): T; } @@ -15444,8 +15163,7 @@ declare module _ { * @see _.forOwn */ forOwn( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashImplicitObjectWrapper; } @@ -15454,8 +15172,7 @@ declare module _ { * @see _.forOwn */ forOwn( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashExplicitObjectWrapper; } @@ -15471,8 +15188,7 @@ declare module _ { */ forOwnRight( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -15480,8 +15196,7 @@ declare module _ { */ forOwnRight( object: T, - iteratee?: ObjectIterator, - thisArg?: any + iteratee?: ObjectIterator ): T; } @@ -15490,8 +15205,7 @@ declare module _ { * @see _.forOwnRight */ forOwnRight( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashImplicitObjectWrapper; } @@ -15500,8 +15214,7 @@ declare module _ { * @see _.forOwnRight */ forOwnRight( - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): _.LoDashExplicitObjectWrapper; } @@ -15999,8 +15712,7 @@ declare module _ { */ mapKeys( object: List, - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): Dictionary; /** @@ -16008,8 +15720,7 @@ declare module _ { */ mapKeys( object: Dictionary, - iteratee?: DictionaryIterator, - thisArg?: any + iteratee?: DictionaryIterator ): Dictionary; /** @@ -16025,8 +15736,7 @@ declare module _ { */ mapKeys( object: List|Dictionary, - iteratee?: string, - thisArg?: any + iteratee?: string ): Dictionary; } @@ -16035,8 +15745,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashImplicitObjectWrapper>; /** @@ -16050,8 +15759,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; } @@ -16060,8 +15768,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashImplicitObjectWrapper>; /** @@ -16075,8 +15782,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashImplicitObjectWrapper>; } @@ -16085,8 +15791,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: ListIterator, - thisArg?: any + iteratee?: ListIterator ): LoDashExplicitObjectWrapper>; /** @@ -16100,8 +15805,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; } @@ -16110,8 +15814,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: ListIterator|DictionaryIterator, - thisArg?: any + iteratee?: ListIterator|DictionaryIterator ): LoDashExplicitObjectWrapper>; /** @@ -16125,8 +15828,7 @@ declare module _ { * @see _.mapKeys */ mapKeys( - iteratee?: string, - thisArg?: any + iteratee?: string ): LoDashExplicitObjectWrapper>; } @@ -16151,10 +15853,10 @@ declare module _ { * @param {Object} [thisArg] The `this` binding of `iteratee`. * @return {Object} Returns the new mapped object. */ - mapValues(obj: Dictionary, callback: ObjectIterator, thisArg?: any): Dictionary; + mapValues(obj: Dictionary, callback: ObjectIterator): Dictionary; mapValues(obj: Dictionary, where: Dictionary): Dictionary; mapValues(obj: T, pluck: string): TMapped; - mapValues(obj: T, callback: ObjectIterator, thisArg?: any): T; + mapValues(obj: T, callback: ObjectIterator): T; } interface LoDashImplicitObjectWrapper { @@ -16163,7 +15865,7 @@ declare module _ { * TValue is the type of the property values of T. * TResult is the type output by the ObjectIterator function */ - mapValues(callback: ObjectIterator, thisArg?: any): LoDashImplicitObjectWrapper>; + mapValues(callback: ObjectIterator): LoDashImplicitObjectWrapper>; /** * @see _.mapValues @@ -16174,17 +15876,33 @@ declare module _ { /** * @see _.mapValues - * TResult is the type of the properties on the object specified by pluck. - * T should be a Dictionary>> + * TResult is the type of the properties of each object in the values of T + * T should be a Dictionary> */ - mapValues(pluck: string, where: Dictionary): LoDashImplicitArrayWrapper>; + mapValues(where: Dictionary): LoDashImplicitArrayWrapper; + } + + interface LoDashExplicitObjectWrapper { + /** + * @see _.mapValues + * TValue is the type of the property values of T. + * TResult is the type output by the ObjectIterator function + */ + mapValues(callback: ObjectIterator): LoDashExplicitObjectWrapper>; + + /** + * @see _.mapValues + * TResult is the type of the property specified by pluck. + * T should be a Dictionary> + */ + mapValues(pluck: string): LoDashExplicitObjectWrapper>; /** * @see _.mapValues * TResult is the type of the properties of each object in the values of T * T should be a Dictionary> */ - mapValues(where: Dictionary): LoDashImplicitArrayWrapper; + mapValues(where: Dictionary): LoDashExplicitObjectWrapper; } //_.merge @@ -16635,7 +16353,7 @@ declare module _ { */ pickBy( object: T, - predicate: ObjectIterator + predicate?: ObjectIterator ): TResult; } @@ -16644,7 +16362,7 @@ declare module _ { * @see _.pickBy */ pickBy( - predicate: ObjectIterator + predicate?: ObjectIterator ): LoDashImplicitObjectWrapper; } @@ -16653,7 +16371,7 @@ declare module _ { * @see _.pickBy */ pickBy( - predicate: ObjectIterator + predicate?: ObjectIterator ): LoDashExplicitObjectWrapper; } @@ -16973,8 +16691,7 @@ declare module _ { transform( object: T[], iteratee?: MemoVoidArrayIterator, - accumulator?: TResult[], - thisArg?: any + accumulator?: TResult[] ): TResult[]; /** @@ -16983,8 +16700,7 @@ declare module _ { transform( object: T[], iteratee?: MemoVoidArrayIterator>, - accumulator?: Dictionary, - thisArg?: any + accumulator?: Dictionary ): Dictionary; /** @@ -16993,8 +16709,7 @@ declare module _ { transform( object: Dictionary, iteratee?: MemoVoidDictionaryIterator>, - accumulator?: Dictionary, - thisArg?: any + accumulator?: Dictionary ): Dictionary; /** @@ -17003,8 +16718,7 @@ declare module _ { transform( object: Dictionary, iteratee?: MemoVoidDictionaryIterator, - accumulator?: TResult[], - thisArg?: any + accumulator?: TResult[] ): TResult[]; } @@ -17014,8 +16728,7 @@ declare module _ { */ transform( iteratee?: MemoVoidArrayIterator, - accumulator?: TResult[], - thisArg?: any + accumulator?: TResult[] ): LoDashImplicitArrayWrapper; /** @@ -17023,8 +16736,7 @@ declare module _ { */ transform( iteratee?: MemoVoidArrayIterator>, - accumulator?: Dictionary, - thisArg?: any + accumulator?: Dictionary ): LoDashImplicitObjectWrapper>; } @@ -17034,8 +16746,7 @@ declare module _ { */ transform( iteratee?: MemoVoidDictionaryIterator>, - accumulator?: Dictionary, - thisArg?: any + accumulator?: Dictionary ): LoDashImplicitObjectWrapper>; /** @@ -17043,8 +16754,7 @@ declare module _ { */ transform( iteratee?: MemoVoidDictionaryIterator, - accumulator?: TResult[], - thisArg?: any + accumulator?: TResult[] ): LoDashImplicitArrayWrapper; } @@ -18344,24 +18054,21 @@ declare module _ { * // => [{ 'user': 'fred', 'age': 40 }] */ iteratee( - func: Function, - thisArg?: any + func: Function ): (...args: any[]) => TResult; /** * @see _.iteratee */ iteratee( - func: string, - thisArg?: any + func: string ): (object: any) => TResult; /** * @see _.iteratee */ iteratee( - func: Object, - thisArg?: any + func: Object ): (object: any) => boolean; /** @@ -18374,38 +18081,38 @@ declare module _ { /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => TResult>; + iteratee(): LoDashImplicitObjectWrapper<(object: any) => TResult>; } interface LoDashImplicitObjectWrapper { /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(object: any) => boolean>; + iteratee(): LoDashImplicitObjectWrapper<(object: any) => boolean>; /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; + iteratee(): LoDashImplicitObjectWrapper<(...args: any[]) => TResult>; } interface LoDashExplicitWrapper { /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => TResult>; + iteratee(): LoDashExplicitObjectWrapper<(object: any) => TResult>; } interface LoDashExplicitObjectWrapper { /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(object: any) => boolean>; + iteratee(): LoDashExplicitObjectWrapper<(object: any) => boolean>; /** * @see _.iteratee */ - iteratee(thisArg?: any): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; + iteratee(): LoDashExplicitObjectWrapper<(...args: any[]) => TResult>; } //_.matches diff --git a/log4javascript/log4javascript.d.ts b/log4javascript/log4javascript.d.ts index 1307053fad..460e17c91f 100644 --- a/log4javascript/log4javascript.d.ts +++ b/log4javascript/log4javascript.d.ts @@ -274,6 +274,8 @@ declare namespace log4javascript { messages: any[]; exception: Error; + constructor(logger: Logger, timeStamp: Date, level: Level, messages: string[], exception?: Error); + getThrowableStrRep: () => string; getCombinedMessages: () => string; toString: () => string; diff --git a/ng-dialog/ng-dialog.d.ts b/ng-dialog/ng-dialog.d.ts index 63510520ad..42d7821d4a 100644 --- a/ng-dialog/ng-dialog.d.ts +++ b/ng-dialog/ng-dialog.d.ts @@ -5,6 +5,18 @@ /// +declare module "ng-dialog" { + export type IDialogService = angular.dialog.IDialogService; + export type IDialogOpenResult = angular.dialog.IDialogOpenResult; + export type IDialogClosePromise = angular.dialog.IDialogClosePromise; + export type IDialogProvider = angular.dialog.IDialogProvider; + export type IDialogScope = angular.dialog.IDialogScope; + export type IDialogConfirmScope = angular.dialog.IDialogConfirmScope; + export type IDialogOptions = angular.dialog.IDialogOptions; + export type IDialogOpenOptions = angular.dialog.IDialogOpenOptions; + export type IDialogOpenConfirmOptions = angular.dialog.IDialogOpenConfirmOptions; +} + declare namespace angular.dialog { interface IDialogService { diff --git a/nock/nock.d.ts b/nock/nock.d.ts index 208aac9b31..3319456a5e 100644 --- a/nock/nock.d.ts +++ b/nock/nock.d.ts @@ -22,28 +22,45 @@ declare module "nock" { export interface Scope { get(path: string, data?: string): Scope; + get(path: RegExp, data?: string): Scope; post(path: string, data?: string): Scope; post(path: string, data?: Object): Scope; post(path: string, regex?: RegExp): Scope; + post(path: RegExp, data?: string): Scope; + post(path: RegExp, data?: Object): Scope; + post(path: RegExp, regex?: RegExp): Scope; patch(path: string, data?: string): Scope; patch(path: string, data?: Object): Scope; patch(path: string, regex?: RegExp): Scope; + patch(path: RegExp, data?: string): Scope; + patch(path: RegExp, data?: Object): Scope; + patch(path: RegExp, regex?: RegExp): Scope; put(path: string, data?: string): Scope; put(path: string, data?: Object): Scope; put(path: string, regex?: RegExp): Scope; + put(path: RegExp, data?: string): Scope; + put(path: RegExp, data?: Object): Scope; + put(path: RegExp, regex?: RegExp): Scope; head(path: string): Scope; + head(path: RegExp): Scope; delete(path: string, data?: string): Scope; delete(path: string, data?: Object): Scope; delete(path: string, regex?: RegExp): Scope; + delete(path: RegExp, data?: string): Scope; + delete(path: RegExp, data?: Object): Scope; + delete(path: RegExp, regex?: RegExp): Scope; merge(path: string, data?: string): Scope; merge(path: string, data?: Object): Scope; merge(path: string, regex?: RegExp): Scope; + merge(path: RegExp, data?: string): Scope; + merge(path: RegExp, data?: Object): Scope; + merge(path: RegExp, regex?: RegExp): Scope; query(params: any): Scope; query(acceptAnyParams: boolean): Scope; @@ -51,6 +68,9 @@ declare module "nock" { intercept(path: string, verb: string, body?: string, options?: any): Scope; intercept(path: string, verb: string, body?: Object, options?: any): Scope; intercept(path: string, verb: string, body?: RegExp, options?: any): Scope; + intercept(path: RegExp, verb: string, body?: string, options?: any): Scope; + intercept(path: RegExp, verb: string, body?: Object, options?: any): Scope; + intercept(path: RegExp, verb: string, body?: RegExp, options?: any): Scope; reply(responseCode: number, body?: string, headers?: Object): Scope; reply(responseCode: number, body?: Object, headers?: Object): Scope; diff --git a/node/node-tests.ts b/node/node-tests.ts index 0cc0b5de6c..64f7a5bb29 100644 --- a/node/node-tests.ts +++ b/node/node-tests.ts @@ -15,6 +15,7 @@ import * as querystring from "querystring"; import * as path from "path"; import * as readline from "readline"; import * as childProcess from "child_process"; +import * as cluster from "cluster"; import * as os from "os"; import * as vm from "vm"; // Specifically test buffer module regression. @@ -643,6 +644,18 @@ namespace readline_tests { childProcess.exec("echo test"); childProcess.spawnSync("echo test"); +////////////////////////////////////////////////////////////////////// +/// cluster tests: https://nodejs.org/api/cluster.html /// +////////////////////////////////////////////////////////////////////// + +cluster.fork(); +Object.keys(cluster.workers).forEach(key => { + const worker = cluster.workers[key]; + if (worker.isDead()) { + console.log('worker %d is dead', worker.process.pid); + } +}); + //////////////////////////////////////////////////// /// os tests : https://nodejs.org/api/os.html //////////////////////////////////////////////////// diff --git a/node/node.d.ts b/node/node.d.ts index 1b2da31c94..6f115759ff 100644 --- a/node/node.d.ts +++ b/node/node.d.ts @@ -679,6 +679,8 @@ declare module "cluster" { kill(signal?: string): void; destroy(signal?: string): void; disconnect(): void; + isConnected(): boolean; + isDead(): boolean; } export var settings: ClusterSettings; @@ -688,7 +690,9 @@ declare module "cluster" { export function fork(env?: any): Worker; export function disconnect(callback?: Function): void; export var worker: Worker; - export var workers: Worker[]; + export var workers: { + [index: string]: Worker + }; // Event emitter export function addListener(event: string, listener: Function): void; diff --git a/normalizr/normalizr-tests.ts b/normalizr/normalizr-tests.ts new file mode 100644 index 0000000000..0da5a8aa0b --- /dev/null +++ b/normalizr/normalizr-tests.ts @@ -0,0 +1,270 @@ +/// + +import { normalize, Schema, arrayOf, unionOf, valuesOf } from 'normalizr'; + +// First, define a schema for our entities: + +const article1 = new Schema('articles'); +const user1 = new Schema('users'); + +// Then we define nesting rules: + +article1.define({ + author: user1, + contributors: arrayOf(user1) +}); + +// Now we can use this schema in our API response handlers: + +const ServerActionCreators = { + // These are two different XHR endpoints with different response schemas. + // We can use the schema objects defined earlier to express both of them: + + receiveOneArticle(response: any) { + // Here, the response is an object containing data about one article. + // Passing the article schema as second parameter to normalize() lets it + // correctly traverse the response tree and gather all entities: + + // BEFORE: + // { + // id: 1, + // title: 'Some Article', + // author: { + // id: 7, + // name: 'Dan' + // }, + // contributors: [{ + // id: 10, + // name: 'Abe' + // }, { + // id: 15, + // name: 'Fred' + // }] + // } + // + // AFTER: + // { + // result: 1, // <--- Note object is referenced by ID + // entities: { + // articles: { + // 1: { + // author: 7, // <--- Same happens for references to + // contributors: [10, 15] // <--- other entities in the schema + // ...} + // }, + // users: { + // 7: { ... }, + // 10: { ... }, + // 15: { ... } + // } + // } + // } + + response = normalize(response, article1); + }, + + receiveAllArticles(response: any) { + // Here, the response is an object with the key 'articles' referencing + // an array of article objects. Passing { articles: arrayOf(article) } as + // second parameter to normalize() lets it correctly traverse the response + // tree and gather all entities: + + // BEFORE: + // { + // articles: [{ + // id: 1, + // title: 'Some Article', + // author: { + // id: 7, + // name: 'Dan' + // }, + // ... + // }, + // ... + // ] + // } + // + // AFTER: + // { + // result: { + // articles: [1, 2, ...] // <--- Note how object array turned into ID array + // }, + // entities: { + // articles: { + // 1: { author: 7, ... }, // <--- Same happens for references to other entities in the schema + // 2: { ... }, + // ... + // }, + // users: { + // 7: { ... }, + // .. + // } + // } + // } + + response = normalize(response, { + articles: arrayOf(article1) + }); + } +} + +// new Schema(key, [options]) + +const article2 = new Schema('articles'); + +// You can use a custom id attribute +const article3 = new Schema('articles', { idAttribute: 'slug' }); + +// Or you can specify a function to infer it +function generateSlug(entity: any) { /* ... */ } +const article4 = new Schema('articles', { idAttribute: generateSlug }); + +// Schema.prototype.define(nestedSchema) + +const article5 = new Schema('articles'); +const user5 = new Schema('users'); + +article5.define({ + author: user5 +}); + +// Schema.prototype.getKey() + +const article6 = new Schema('articles'); + +article6.getKey(); +// articles + +// Schema.prototype.getIdAttribute() + +const article7 = new Schema('articles'); +const slugArticle7 = new Schema('articles', { idAttribute: 'slug' }); + +article7.getIdAttribute(); +// id +slugArticle7.getIdAttribute(); +// slug + +// arrayOf(schema, [options]) + +const article8 = new Schema('articles'); +const user8 = new Schema('users'); + +article8.define({ + author: user8, + contributors: arrayOf(user8) +}); + +const article9 = new Schema('articles'); +const image9 = new Schema('images'); +const video9 = new Schema('videos'); +const asset9 = { + images: image9, + videos: video9 +}; + +// You can specify the name of the attribute that determines the schema +article9.define({ + assets: arrayOf(asset9, { schemaAttribute: 'type' }) +}); + +// Or you can specify a function to infer it +function inferSchema9(entity: any) { /* ... */ } +article9.define({ + assets: arrayOf(asset9, { schemaAttribute: inferSchema9 }) +}); + +// valuesOf(schema, [options]) + +const article10 = new Schema('articles'); +const user10 = new Schema('users'); + +article10.define({ + collaboratorsByRole: valuesOf(user10) +}); + +const article11 = new Schema('articles'); +const user11 = new Schema('users'); +const group11 = new Schema('groups'); +const collaborator11 = { + users: user11, + groups: group11 +}; + +// You can specify the name of the attribute that determines the schema +article11.define({ + collaboratorsByRole: valuesOf(collaborator11, { schemaAttribute: 'type' }) +}); + +// Or you can specify a function to infer it +function inferSchema11(entity: any) { /* ... */ } +article11.define({ + collaboratorsByRole: valuesOf(collaborator11, { schemaAttribute: inferSchema }) +}); + +// unionOf(schemaMap, [options]) + +const group12 = new Schema('groups'); +const user12 = new Schema('users'); + +// a member can be either a user or a group +const member12 = { + users: user12, + groups: group12 +}; + +// You can specify the name of the attribute that determines the schema +group12.define({ + owner: unionOf(member12, { schemaAttribute: 'type' }) +}); + +// Or you can specify a function to infer it +function inferSchema(entity: any) { /* ... */ } +group12.define({ + creator: unionOf(member12, { schemaAttribute: inferSchema }) +}); + +const group13 = new Schema('groups'); +const user13 = new Schema('users'); + +const member13 = unionOf({ + users: user13, + groups: group13 +}, { schemaAttribute: 'type' }); + +group13.define({ + owner: member13, + members: arrayOf(member13), + relationships: valuesOf(member13) +}); + +// normalize(obj, schema, [options]) + +const article14 = new Schema('articles'); +const user14 = new Schema('users'); + +article14.define({ + author: user14, + contributors: arrayOf(user14), + meta: { + likes: arrayOf({ + user: user14 + }) + } +}); + +// ... + +// Normalize one article object +const json = { id: 1, author: /*...*/{} }; +const normalized1 = normalize(json, article14); + +// Normalize an array of article objects +const arr = [{ id: 1, author: /*...*/{} }/*, ...*/] +const normalized2 = normalize(arr, arrayOf(article14)); + +// Normalize an array of article objects, referenced by an object key: +const wrappedArr = { articles: [{ id: 1, author: /*...*/{} }/*, ...*/] } +const normalized3 = normalize(wrappedArr, { + articles: arrayOf(article14) +}); diff --git a/normalizr/normalizr.d.ts b/normalizr/normalizr.d.ts new file mode 100644 index 0000000000..77d2f86648 --- /dev/null +++ b/normalizr/normalizr.d.ts @@ -0,0 +1,111 @@ +// Type definitions for normalizr 2.0.1 +// Project: https://github.com/gaearon/normalizr/ +// Definitions by: Markus Peloso +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +declare module "normalizr" { + export = Normalizr; +} + +declare namespace Normalizr { + type AttributeSetting = string | ((entity: any) => any); + + type SchemaClass = Schema | ArraySchema | UnionSchema; + + type SchemaObject = { [property: string]: SchemaClass | SchemaObject }; + + type SchemaType = SchemaClass | SchemaObject | Object; + + export class Schema { + /** + * Schema lets you define a type of entity returned by your API. + * This should correspond to model in your server code. + * @param key The key parameter lets you specify the name of the dictionary for this kind of entity. + * @param options + */ + constructor(key: string, options?: { idAttribute: AttributeSetting; }); + + /** + * Lets you specify relationships between different entities. + * @param nestedSchema + */ + define(nestedSchema: SchemaObject): void; + + /** + * Returns the key of the schema. + */ + getKey(): string; + + /** + * Returns the idAttribute of the schema. + */ + getIdAttribute(): AttributeSetting; + } + + interface UnionSchema { + getItemSchema(): SchemaType; + getSchemaKey(item: any): string; + } + + interface ArraySchema { + getItemSchema(): SchemaType; + } + + /** + * Describes an array of the schema passed as argument. + * @param schema + * @param options + */ + export function arrayOf(schema: SchemaType, options?: { + /** + * If the array contains entities with different schemas, you can use the schemaAttribute option to specify which schema to use for each entity. + */ + schemaAttribute: AttributeSetting + }): ArraySchema; + + /** + * Describes a map whose values follow the schema passed as argument. + * @param schema + * @param options + */ + export function valuesOf(schema: SchemaType, options?: { + /** + * If the map contains entities with different schemas, you can use the schemaAttribute option to specify which schema to use for each entity. + */ + schemaAttribute: AttributeSetting + }): ArraySchema; + + /** + * Describe a schema which is a union of multiple schemas. This is useful if you need the polymorphic behavior provided by arrayOf or valuesOf but for non-collection fields. + * @param schemaMap + * @param options + */ + export function unionOf(schemaMap: SchemaType, options?: { + /** + * Use the required schemaAttribute option to specify which schema to use for each entity. + */ + schemaAttribute: AttributeSetting + }): UnionSchema; + + /** + * Normalizes object according to schema. + * Passed schema should be a nested object reflecting the structure of API response. + * @param obj + * @param schema + * @param options + */ + export function normalize(obj: any | Array, schema: SchemaType, options?: { + /** + * This is useful if your backend emits additional fields, such as separate ID fields, you'd like to delete in the normalized entity. + */ + assignEntity?: (normalized: any, key: string, entity: any) => any; + + /** + * You can use this to resolve conflicts when merging entities with the same key. + */ + mergeIntoEntity?: (stored: any, normalized: any, entityKey: string) => any; + }): { + entites: any; + result: any; + }; +} diff --git a/p2/p2.d.ts b/p2/p2.d.ts index a6f3cf256e..bdbac86b0e 100644 --- a/p2/p2.d.ts +++ b/p2/p2.d.ts @@ -118,7 +118,6 @@ declare namespace p2 { constructor(bodyA: Body, bodyB: Body, type: number, options?: { collideConnected?: boolean; - wakeUpBodies?: boolean; }); type: number; @@ -135,9 +134,7 @@ declare namespace p2 { export class DistanceConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { distance?: number; localAnchorA?: number[]; localAnchorB?: number[]; @@ -161,9 +158,7 @@ declare namespace p2 { export class GearConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { angle?: number; ratio?: number; maxTorque?: number; @@ -179,9 +174,7 @@ declare namespace p2 { export class LockConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { localOffsetB?: number[]; localAngleB?: number; maxForce?: number; @@ -194,9 +187,7 @@ declare namespace p2 { export class PrismaticConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { maxForce?: number; localAnchorA?: number[]; localAnchorB?: number[]; @@ -229,9 +220,7 @@ declare namespace p2 { export class RevoluteConstraint extends Constraint { - constructor(bodyA: Body, bodyB: Body, type: number, options?: { - collideConnected?: boolean; - wakeUpBodies?: boolean; + constructor(bodyA: Body, bodyB: Body, options?: { worldPivot?: number[]; localPivotA?: number[]; localPivotB?: number[]; diff --git a/physijs/physijs.d.ts b/physijs/physijs.d.ts index 035f1da389..d70eadad2b 100644 --- a/physijs/physijs.d.ts +++ b/physijs/physijs.d.ts @@ -147,7 +147,7 @@ declare namespace Physijs { add(object:THREE.Object3D):void; remove(object:THREE.Object3D):void; setFixedTimeStep(fixedTimeStep:number):void; - setGravity(gravity:number):void; + setGravity(gravity:THREE.Vector3):void; simulate(timeStep?:number, maxSubSteps?:number):boolean; diff --git a/react-bootstrap/react-bootstrap-tests.tsx b/react-bootstrap/react-bootstrap-tests.tsx index 4198e62320..cad2242a38 100644 --- a/react-bootstrap/react-bootstrap-tests.tsx +++ b/react-bootstrap/react-bootstrap-tests.tsx @@ -281,7 +281,7 @@ export class ReactBootstrapTest extends Component {
- + Modal title diff --git a/react-bootstrap/react-bootstrap.d.ts b/react-bootstrap/react-bootstrap.d.ts index e64f831de5..9dd6b9bbf1 100644 --- a/react-bootstrap/react-bootstrap.d.ts +++ b/react-bootstrap/react-bootstrap.d.ts @@ -190,6 +190,12 @@ declare module "react-bootstrap" { dialogComponent?: any; // TODO: Add more specific type enforceFocus?: boolean; keyboard?: boolean; + onEnter?: (node: HTMLElement) => any; + onEntered?: (node: HTMLElement) => any; + onEntering?: (node: HTMLElement) => any; + onExit?: (node: HTMLElement) => any; + onExited?: (node: HTMLElement) => any; + onExiting?: (node: HTMLElement) => any; show?: boolean; } interface ModalClass extends React.ClassicComponentClass { diff --git a/react-helmet/react-helmet-tests.tsx b/react-helmet/react-helmet-tests.tsx index c50bdf2e17..a9f89d74c9 100644 --- a/react-helmet/react-helmet-tests.tsx +++ b/react-helmet/react-helmet-tests.tsx @@ -2,7 +2,7 @@ /// import * as React from 'react'; -import Helmet from 'react-helmet'; +import * as Helmet from 'react-helmet'; diff --git a/react-helmet/react-helmet.d.ts b/react-helmet/react-helmet.d.ts index 8cae272f98..b5b69411ee 100644 --- a/react-helmet/react-helmet.d.ts +++ b/react-helmet/react-helmet.d.ts @@ -1,13 +1,13 @@ // Type definitions for react-helmet // Project: https://github.com/nfl/react-helmet -// Definitions by: Evan Bremer +// Definitions by: Evan Bremer , Isman Usoh // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped /// -declare module 'react-helmet' { - import { Component } from 'react'; - +declare namespace ReactHelmet { + import React = __React; + interface HelmetProps { title?: string; titleTemplate?: string; @@ -25,15 +25,20 @@ declare module 'react-helmet' { meta: HelmetDatum; script: HelmetDatum; } - + interface HelmetDatum { toString(): string; - toComponent(): Component; + toComponent(): React.Component; } - class Helmet extends Component { - static rewind(): HelmetData + class HelmetComponent extends React.Component {} +} + +declare module "react-helmet" { + var Helmet: { + (): ReactHelmet.HelmetComponent + rewind(): ReactHelmet.HelmetData } - - export default Helmet; + + export = Helmet; } diff --git a/react-native/react-native-tests.tsx b/react-native/react-native-tests.tsx index ffb127b6cc..8bed3c8be3 100644 --- a/react-native/react-native-tests.tsx +++ b/react-native/react-native-tests.tsx @@ -27,9 +27,27 @@ import { View, AppState, AppStateIOS, - ViewPagerAndroid + ViewPagerAndroid, + Dimensions, } from 'react-native'; +function testDimensions() { + var { + width, + height, + scale, + fontScale, + } = Dimensions.get("window"); + + var { + width, + height, + scale, + fontScale, + } = Dimensions.get("screen"); +} + + var styles = StyleSheet.create( { container: { diff --git a/react-native/react-native.d.ts b/react-native/react-native.d.ts index b7f19c4489..a6cab25ff0 100644 --- a/react-native/react-native.d.ts +++ b/react-native/react-native.d.ts @@ -2499,8 +2499,28 @@ declare namespace __React { width: number; height: number; scale: number; + fontScale: number; } + /** + * Initial dimensions are set before `runApplication` is called so they should + * be available before any other require's are run, but may be updated later. + * + * Note: Although dimensions are available immediately, they may change (e.g + * due to device rotation) so any rendering logic or styles that depend on + * these constants should try to call this function on every render, rather + * than caching the value (for example, using inline styles rather than + * setting a value in a `StyleSheet`). + * + * Example: `var {height, width} = Dimensions.get('window');` + * + * @param {string} dim Name of dimension as defined when calling `set`. + * @returns {Object?} Value for the dimension. + * @see https://facebook.github.io/react-native/docs/dimensions.html#content + */ + export interface Dimensions { + get( what: "window" | "screen" ): React.ScaledSize; + } export interface InteractionManagerStatic { runAfterInteractions( fn: () => void ): void; @@ -3447,6 +3467,7 @@ declare namespace __React { export var VibrationIOS: VibrationIOSStatic export type VibrationIOS = VibrationIOSStatic + export var Dimensions: Dimensions; // // /TODO: BGR: These are leftovers of the initial port that must be revisited @@ -3509,17 +3530,4 @@ declare module "react-native" { declare var global: __React.GlobalStatic -declare function require( name: string ): any - - -//TODO: BGR: this is a left-over from the initial port. Not sure it makes any sense -declare module "Dimensions" { - import * as React from 'react-native'; - - interface Dimensions { - get( what: string ): React.ScaledSize; - } - - var ExportDimensions: Dimensions; - export = ExportDimensions; -} +declare function require( name: string ): any \ No newline at end of file diff --git a/react-router/react-router-tests.tsx b/react-router/react-router-tests.tsx index 703ce4a9f6..b31924908f 100644 --- a/react-router/react-router-tests.tsx +++ b/react-router/react-router-tests.tsx @@ -8,7 +8,7 @@ import * as React from "react" import * as ReactDOM from "react-dom" -import { browserHistory, hashHistory, Router, Route, IndexRoute, Link } from "react-router" +import { browserHistory, hashHistory, createMemoryHistory, Router, Route, IndexRoute, Link } from "react-router" interface MasterContext { router: ReactRouter.RouterOnContext; diff --git a/react-router/react-router.d.ts b/react-router/react-router.d.ts index 357490e603..07acd52b9e 100644 --- a/react-router/react-router.d.ts +++ b/react-router/react-router.d.ts @@ -86,6 +86,8 @@ declare namespace ReactRouter { const browserHistory: History; const hashHistory: History; + function createMemoryHistory(options?: H.HistoryOptions): H.History + /* components */ interface RouterProps extends React.Props { @@ -245,7 +247,7 @@ declare namespace ReactRouter { interface MatchArgs { routes?: RouteConfig history?: H.History - location?: H.Location + location?: H.Location | string parseQueryString?: ParseQueryString stringifyQuery?: StringifyQuery } @@ -412,6 +414,9 @@ declare module "react-router/lib/useRouterHistory" { export default function useRouterHistory(createHistory: HistoryModule.CreateHistory): CreateRouterHistory; } +declare module "react-router/lib/createMemoryHistory" { + export default ReactRouter.createMemoryHistory; +} declare module "react-router" { @@ -453,6 +458,8 @@ declare module "react-router" { import useRouterHistory from "react-router/lib/useRouterHistory"; + import createMemoryHistory from "react-router/lib/createMemoryHistory"; + // PlainRoute is defined in the API documented at: // https://github.com/rackt/react-router/blob/master/docs/API.md // but not included in any of the .../lib modules above. @@ -492,7 +499,8 @@ declare module "react-router" { RouterContext, PropTypes, match, - useRouterHistory + useRouterHistory, + createMemoryHistory } export default Router diff --git a/react-select/react-select.d.ts b/react-select/react-select.d.ts index 05056d198e..5ad97ba2ff 100644 --- a/react-select/react-select.d.ts +++ b/react-select/react-select.d.ts @@ -173,7 +173,7 @@ declare namespace ReactSelect { * field placeholder, displayed when there's no value * @default "Select..." */ - placeholder?: string; + placeholder?: string | __React.ReactElement; /** * whether to enable searching feature or not * @default true; diff --git a/react/react-0.13.3.d.ts b/react/react-0.13.3.d.ts index a723320141..738b745133 100644 --- a/react/react-0.13.3.d.ts +++ b/react/react-0.13.3.d.ts @@ -730,8 +730,10 @@ declare namespace __React { radialGradient: SVGFactory; rect: SVGFactory; stop: SVGFactory; + symbol: SVGFactory; text: SVGFactory; tspan: SVGFactory; + use: SVGFactory; } // @@ -1538,8 +1540,10 @@ declare module "react/addons" { radialGradient: SVGFactory; rect: SVGFactory; stop: SVGFactory; + symbol: SVGFactory; text: SVGFactory; tspan: SVGFactory; + use: SVGFactory; } // diff --git a/react/react.d.ts b/react/react.d.ts index bfc465c86f..efe8d8c2e8 100644 --- a/react/react.d.ts +++ b/react/react.d.ts @@ -2234,8 +2234,10 @@ declare namespace __React { radialGradient: SVGFactory; rect: SVGFactory; stop: SVGFactory; + symbol: SVGFactory; text: SVGFactory; tspan: SVGFactory; + use: SVGFactory; } // @@ -2464,7 +2466,9 @@ declare namespace JSX { radialGradient: React.SVGProps; rect: React.SVGProps; stop: React.SVGProps; + symbol: React.SVGProps; text: React.SVGProps; tspan: React.SVGProps; + use: React.SVGProps; } } diff --git a/restangular/restangular.d.ts b/restangular/restangular.d.ts index d0f7353667..410713e938 100644 --- a/restangular/restangular.d.ts +++ b/restangular/restangular.d.ts @@ -1,4 +1,4 @@ -// Type definitions for Restangular v1.4.0 +// Type definitions for Restangular v1.5.0 // Project: https://github.com/mgonto/restangular // Definitions by: Boris Yankov // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -56,7 +56,7 @@ declare namespace restangular { addRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string) => any): void; setFullRequestInterceptor(fullRequestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: angular.IRequestShortcutConfig) => {element: any; headers: any; params: any}): void; addFullRequestInterceptor(requestInterceptor: (element: any, operation: string, what: string, url: string, headers: any, params: any, httpConfig: angular.IRequestShortcutConfig) => {headers: any; params: any; element: any; httpConfig: angular.IRequestShortcutConfig}): void; - setErrorInterceptor(errorInterceptor: (response: IResponse, deferred: angular.IDeferred) => any): void; + setErrorInterceptor(errorInterceptor: (response: IResponse, deferred: angular.IDeferred, responseHandler: (response: restangular.IResponse) => any) => any): void; setRestangularFields(fields: {[fieldName: string]: string}): void; setMethodOverriders(overriders: string[]): void; setJsonp(jsonp: boolean): void; diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 86be60d223..6e62606e19 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -882,6 +882,8 @@ User.findAll( { order : [['id', ';DELETE YOLO INJECTIONS']] } ); User.findAll( { include : [User], order : [[User, 'id', ';DELETE YOLO INJECTIONS']] } ); User.findAll( { include : [User], order : [['id', 'ASC NULLS LAST'], [User, 'id', 'DESC NULLS FIRST']] } ); User.findAll( { include : [{ model : User, where : { title : 'DoDat' }, include : [{ model : User }] }] } ); +User.findAll( { attributes: ['username', 'data']}); +User.findAll( { attributes: {include: ['username', 'data']} }); User.findById( 'a string' ); diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index 9af29c0e97..81c7f4a165 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -3121,7 +3121,7 @@ declare module "sequelize" { * `Sequelize.literal`, `Sequelize.fn` and so on), and the second is the name you want the attribute to * have in the returned instance */ - attributes? : Array; + attributes? : Array | { include?: Array, exclude?: Array }; /** * If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will diff --git a/turf/turf.d.ts b/turf/turf.d.ts index 6ed1d617a3..c85d8aa393 100644 --- a/turf/turf.d.ts +++ b/turf/turf.d.ts @@ -574,3 +574,7 @@ declare namespace turf { */ function reclass(input: GeoJSON.FeatureCollection, inField: string, outField: string, translations: Array): GeoJSON.FeatureCollection; } + +declare module 'turf' { + export= turf; +} diff --git a/ui-grid/ui-grid.d.ts b/ui-grid/ui-grid.d.ts index 4501720b6d..4bc6569007 100644 --- a/ui-grid/ui-grid.d.ts +++ b/ui-grid/ui-grid.d.ts @@ -1511,6 +1511,10 @@ declare namespace uiGrid { * Defaults to 150 */ expandableRowHeight?: number; + /** + * reference to the parent grid scope (the parent scope of the sub-grid element) + */ + expandableRowScope?: ng.IScope | Object; /** * Mandatory. The template for your expanded row */ diff --git a/vue/vue-tests.ts b/vue/vue-tests.ts index 360625f05d..c8612ca870 100644 --- a/vue/vue-tests.ts +++ b/vue/vue-tests.ts @@ -8,7 +8,7 @@ namespace TestConfig { Vue.config.unsafeDelimiters = ['{!!', '!!}']; Vue.config.silent = true; Vue.config.async = false; - Vue.config.convertAllProperties = true; + Vue.config.devtools = true; } namespace TestGlobalAPI { @@ -67,6 +67,16 @@ namespace TestGlobalAPI { } } }); + Vue.component("component", { + props: { + a: [String, Number], + b: { + type: [Number, Function], + required: true + } + }, + init: function() {} + }); var transition = Vue.transition("transition"); Vue.transition("transition", transition); Vue.transition("transition", { diff --git a/vue/vue.d.ts b/vue/vue.d.ts index b655cf6d9b..faee50af8f 100644 --- a/vue/vue.d.ts +++ b/vue/vue.d.ts @@ -1,4 +1,4 @@ -// Type definitions for vuejs 1.0.16 +// Type definitions for vuejs 1.0.21 // Project: https://github.com/vuejs/vue // Definitions by: odangosan , kaorun343 // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -11,7 +11,7 @@ interface Array { declare namespace vuejs { interface PropOption { - type?: { new (...args: any[]): any; }; + type?: { new (...args: any[]): any; } | { new (...args: any[]): any; }[]; required?: boolean; default?: any; twoWay?: boolean; @@ -68,13 +68,14 @@ declare namespace vuejs { interface ComponentOption { data?: { [key: string]: any } | Function; - props?: string[] | { [key: string]: (PropOption | { new (...args: any[]): any; }) }; + props?: string[] | { [key: string]: (PropOption | { new (...args: any[]): any; } | { new (...args: any[]): any; }[]) }; computed?: { [key: string]: (Function | ComputedOption) }; methods?: { [key: string]: Function }; watch?: { [key: string]: ((val: any, oldVal: any) => void) | string | WatchOption }; el?: string | HTMLElement | (() => HTMLElement); template?: string; replace?: boolean; + init?(): void; created?(): void; beforeCompile?(): void; compiled?(): void; @@ -143,7 +144,7 @@ declare namespace vuejs { unsafeDelimiters: [string, string]; silent: boolean; async: boolean; - convertAllProperties: boolean; + devtools: boolean; } interface VueUtil {