replace jest with ava

This commit is contained in:
Robert Brignull 2020-05-04 18:50:13 +01:00
parent 27cc8b23fe
commit 0347b72305
11775 changed files with 84546 additions and 1440575 deletions

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/babel__core`
# Summary
This package contains type definitions for @babel/core (https://github.com/babel/babel/tree/master/packages/babel-core).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__core
Additional Details
* Last updated: Wed, 04 Sep 2019 17:40:11 GMT
* Dependencies: @types/babel__generator, @types/babel__traverse, @types/babel__template, @types/babel__types, @types/babel__parser
* Global values: babel
# Credits
These definitions were written by Troy Gerwien <https://github.com/yortus>, Marvin Hagemeister <https://github.com/marvinhagemeister>, Melvin Groenhoff <https://github.com/mgroenhoff>, and Jessica Franco <https://github.com/Jessidhia>.

View file

@ -1,687 +0,0 @@
// Type definitions for @babel/core 7.1
// Project: https://github.com/babel/babel/tree/master/packages/babel-core, https://babeljs.io
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Melvin Groenhoff <https://github.com/mgroenhoff>
// Jessica Franco <https://github.com/Jessidhia>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
import { GeneratorOptions } from "@babel/generator";
import traverse, { Visitor, NodePath } from "@babel/traverse";
import template from "@babel/template";
import * as t from "@babel/types";
import { ParserOptions } from "@babel/parser";
export {
ParserOptions,
GeneratorOptions,
t as types,
template,
traverse,
NodePath,
Visitor
};
export type Node = t.Node;
export type ParseResult = t.File | t.Program;
export const version: string;
export const DEFAULT_EXTENSIONS: ['.js', '.jsx', '.es6', '.es', '.mjs'];
export interface TransformOptions {
/**
* Include the AST in the returned object
*
* Default: `false`
*/
ast?: boolean | null;
/**
* Attach a comment after all non-user injected code
*
* Default: `null`
*/
auxiliaryCommentAfter?: string | null;
/**
* Attach a comment before all non-user injected code
*
* Default: `null`
*/
auxiliaryCommentBefore?: string | null;
/**
* Specify the "root" folder that defines the location to search for "babel.config.js", and the default folder to allow `.babelrc` files inside of.
*
* Default: `"."`
*/
root?: string | null;
/**
* This option, combined with the "root" value, defines how Babel chooses its project root.
* The different modes define different ways that Babel can process the "root" value to get
* the final project root.
*
* @see https://babeljs.io/docs/en/next/options#rootmode
*/
rootMode?: 'root' | 'upward' | 'upward-optional';
/**
* The config file to load Babel's config from. Defaults to searching for "babel.config.js" inside the "root" folder. `false` will disable searching for config files.
*
* Default: `undefined`
*/
configFile?: string | false | null;
/**
* Specify whether or not to use .babelrc and
* .babelignore files.
*
* Default: `true`
*/
babelrc?: boolean | null;
/**
* Specify which packages should be search for .babelrc files when they are being compiled. `true` to always search, or a path string or an array of paths to packages to search
* inside of. Defaults to only searching the "root" package.
*
* Default: `(root)`
*/
babelrcRoots?: true | string | string[] | null;
/**
* Defaults to environment variable `BABEL_ENV` if set, or else `NODE_ENV` if set, or else it defaults to `"development"`
*
* Default: env vars
*/
envName?: string;
/**
* Enable code generation
*
* Default: `true`
*/
code?: boolean | null;
/**
* Output comments in generated output
*
* Default: `true`
*/
comments?: boolean | null;
/**
* Do not include superfluous whitespace characters and line terminators. When set to `"auto"` compact is set to `true` on input sizes of >500KB
*
* Default: `"auto"`
*/
compact?: boolean | "auto" | null;
/**
* The working directory that Babel's programmatic options are loaded relative to.
*
* Default: `"."`
*/
cwd?: string | null;
/**
* Utilities may pass a caller object to identify themselves to Babel and
* pass capability-related flags for use by configs, presets and plugins.
*
* @see https://babeljs.io/docs/en/next/options#caller
*/
caller?: TransformCaller;
/**
* 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 `envName` is `production`
*
* Default: `{}`
*/
env?: { [index: string]: TransformOptions | null | undefined; } | null;
/**
* A path to a `.babelrc` file to extend
*
* Default: `null`
*/
extends?: string | null;
/**
* Filename for use in errors etc
*
* Default: `"unknown"`
*/
filename?: string | null;
/**
* Filename relative to `sourceRoot`
*
* Default: `(filename)`
*/
filenameRelative?: string | null;
/**
* An object containing the options to be passed down to the babel code generator, @babel/generator
*
* Default: `{}`
*/
generatorOpts?: GeneratorOptions | null;
/**
* 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
*
* Default: `null`
*/
getModuleId?: ((moduleName: string) => string | null | undefined) | null;
/**
* ANSI highlight syntax error code frames
*
* Default: `true`
*/
highlightCode?: boolean | null;
/**
* Opposite to the `only` option. `ignore` is disregarded if `only` is specified
*
* Default: `null`
*/
ignore?: string[] | null;
/**
* A source map object that the output source map will be based on
*
* Default: `null`
*/
inputSourceMap?: object | null;
/**
* Should the output be minified (not printing last semicolons in blocks, printing literal string values instead of escaped ones, stripping `()` from `new` when safe)
*
* Default: `false`
*/
minified?: boolean | null;
/**
* Specify a custom name for module ids
*
* Default: `null`
*/
moduleId?: string | null;
/**
* If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for `common` modules)
*
* Default: `false`
*/
moduleIds?: boolean | null;
/**
* Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions
*
* Default: `(sourceRoot)`
*/
moduleRoot?: string | null;
/**
* 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
*
* Default: `null`
*/
only?: string | RegExp | Array<string | RegExp> | null;
/**
* An object containing the options to be passed down to the babel parser, @babel/parser
*
* Default: `{}`
*/
parserOpts?: ParserOptions | null;
/**
* List of plugins to load and use
*
* Default: `[]`
*/
plugins?: PluginItem[] | null;
/**
* List of presets (a set of plugins) to load and use
*
* Default: `[]`
*/
presets?: PluginItem[] | null;
/**
* Retain line numbers. This will lead to wacky code but is handy for scenarios where you can't use source maps. (**NOTE**: This will not retain the columns)
*
* Default: `false`
*/
retainLines?: boolean | null;
/**
* An optional callback that controls whether a comment should be output or not. Called as `shouldPrintComment(commentContents)`. **NOTE**: This overrides the `comment` option when used
*
* Default: `null`
*/
shouldPrintComment?: ((commentContents: string) => boolean) | null;
/**
* Set `sources[0]` on returned source map
*
* Default: `(filenameRelative)`
*/
sourceFileName?: string | null;
/**
* 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. **This does not emit sourcemap files by itself!**
*
* Default: `false`
*/
sourceMaps?: boolean | "inline" | "both" | null;
/**
* The root from which all sources are relative
*
* Default: `(moduleRoot)`
*/
sourceRoot?: string | null;
/**
* Indicate the mode the code should be parsed in. Can be one of "script", "module", or "unambiguous". `"unambiguous"` will make Babel attempt to guess, based on the presence of ES6
* `import` or `export` statements. Files with ES6 `import`s and `export`s are considered `"module"` and are otherwise `"script"`.
*
* Default: `("module")`
*/
sourceType?: "script" | "module" | "unambiguous" | null;
/**
* An optional callback that can be used to wrap visitor methods. **NOTE**: This is useful for things like introspection, and not really needed for implementing anything. Called as
* `wrapPluginVisitorMethod(pluginAlias, visitorType, callback)`.
*/
wrapPluginVisitorMethod?: ((pluginAlias: string, visitorType: "enter" | "exit", callback: (path: NodePath, state: any) => void) => (path: NodePath, state: any) => void) | null;
}
export interface TransformCaller {
// the only required property
name: string;
// e.g. set to true by `babel-loader` and false by `babel-jest`
supportsStaticESM?: boolean;
// augment this with a "declare module '@babel/core' { ... }" if you need more keys
}
export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any;
/**
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
*/
export function transform(code: string, callback: FileResultCallback): void;
/**
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
*/
export function transform(code: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
/**
* Here for backward-compatibility. Ideally use `transformSync` if you want a synchronous API.
*/
export function transform(code: string, opts?: TransformOptions): BabelFileResult | null;
/**
* Transforms the passed in code. Returning an object with the generated code, source map, and AST.
*/
export function transformSync(code: string, opts?: TransformOptions): BabelFileResult | null;
/**
* Transforms the passed in code. Calling a callback with an object with the generated code, source map, and AST.
*/
export function transformAsync(code: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
/**
* Asynchronously transforms the entire contents of a file.
*/
export function transformFile(filename: string, callback: FileResultCallback): void;
/**
* Asynchronously transforms the entire contents of a file.
*/
export function transformFile(filename: string, opts: TransformOptions | undefined, callback: FileResultCallback): void;
/**
* Synchronous version of `babel.transformFile`. Returns the transformed contents of the `filename`.
*/
export function transformFileSync(filename: string, opts?: TransformOptions): BabelFileResult | null;
/**
* Asynchronously transforms the entire contents of a file.
*/
export function transformFileAsync(filename: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
/**
* Given an AST, transform it.
*/
export function transformFromAst(ast: Node, code: string | undefined, callback: FileResultCallback): void;
/**
* Given an AST, transform it.
*/
export function transformFromAst(ast: Node, code: string | undefined, opts: TransformOptions | undefined, callback: FileResultCallback): void;
/**
* Here for backward-compatibility. Ideally use ".transformSync" if you want a synchronous API.
*/
export function transformFromAstSync(ast: Node, code?: string, opts?: TransformOptions): BabelFileResult | null;
/**
* Given an AST, transform it.
*/
export function transformFromAstAsync(ast: Node, code?: string, opts?: TransformOptions): Promise<BabelFileResult | null>;
// A babel plugin is a simple function which must return an object matching
// the following interface. Babel will throw if it finds unknown properties.
// The list of allowed plugin keys is here:
// https://github.com/babel/babel/blob/4e50b2d9d9c376cee7a2cbf56553fe5b982ea53c/packages/babel-core/src/config/option-manager.js#L71
export interface PluginObj<S = {}> {
name?: string;
manipulateOptions?(opts: any, parserOpts: any): void;
pre?(this: S, state: any): void;
visitor: Visitor<S>;
post?(this: S, state: any): void;
inherits?: any;
}
export interface BabelFileResult {
ast?: t.File | null;
code?: string | null;
ignored?: boolean;
map?: {
version: number;
sources: string[];
names: string[];
sourceRoot?: string;
sourcesContent?: string[];
mappings: string;
file: string;
} | null;
metadata?: BabelFileMetadata;
}
export interface BabelFileMetadata {
usedHelpers: string[];
marked: Array<{
type: string;
message: string;
loc: object;
}>;
modules: BabelFileModulesMetadata;
}
export interface BabelFileModulesMetadata {
imports: object[];
exports: {
exported: object[];
specifiers: object[];
};
}
export type FileParseCallback = (err: Error | null, result: ParseResult | null) => any;
/**
* Given some code, parse it using Babel's standard behavior.
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
*/
export function parse(code: string, callback: FileParseCallback): void;
/**
* Given some code, parse it using Babel's standard behavior.
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
*/
export function parse(code: string, options: TransformOptions | undefined, callback: FileParseCallback): void;
/**
* Given some code, parse it using Babel's standard behavior.
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
*/
export function parse(code: string, options?: TransformOptions): ParseResult | null;
/**
* Given some code, parse it using Babel's standard behavior.
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
*/
export function parseSync(code: string, options?: TransformOptions): ParseResult | null;
/**
* Given some code, parse it using Babel's standard behavior.
* Referenced presets and plugins will be loaded such that optional syntax plugins are automatically enabled.
*/
export function parseAsync(code: string, options?: TransformOptions): Promise<ParseResult | null>;
/**
* Resolve Babel's options fully, resulting in an options object where:
*
* * opts.plugins is a full list of Plugin instances.
* * opts.presets is empty and all presets are flattened into opts.
* * It can be safely passed back to Babel. Fields like babelrc have been set to false so that later calls to Babel
* will not make a second attempt to load config files.
*
* Plugin instances aren't meant to be manipulated directly, but often callers will serialize this opts to JSON to
* use it as a cache key representing the options Babel has received. Caching on this isn't 100% guaranteed to
* invalidate properly, but it is the best we have at the moment.
*/
export function loadOptions(options?: TransformOptions): object | null;
/**
* To allow systems to easily manipulate and validate a user's config, this function resolves the plugins and
* presets and proceeds no further. The expectation is that callers will take the config's .options, manipulate it
* as then see fit and pass it back to Babel again.
*
* * `babelrc: string | void` - The path of the `.babelrc` file, if there was one.
* * `babelignore: string | void` - The path of the `.babelignore` file, if there was one.
* * `options: ValidatedOptions` - The partially resolved options, which can be manipulated and passed back
* to Babel again.
* * `plugins: Array<ConfigItem>` - See below.
* * `presets: Array<ConfigItem>` - See below.
* * It can be safely passed back to Babel. Fields like `babelrc` have been set to false so that later calls to
* Babel will not make a second attempt to load config files.
*
* `ConfigItem` instances expose properties to introspect the values, but each item should be treated as
* immutable. If changes are desired, the item should be removed from the list and replaced with either a normal
* Babel config value, or with a replacement item created by `babel.createConfigItem`. See that function for
* information about `ConfigItem` fields.
*/
export function loadPartialConfig(options?: TransformOptions): Readonly<PartialConfig> | null;
export interface PartialConfig {
options: TransformOptions;
babelrc?: string;
babelignore?: string;
config?: string;
}
export interface ConfigItem {
/**
* The name that the user gave the plugin instance, e.g. `plugins: [ ['env', {}, 'my-env'] ]`
*/
name?: string;
/**
* The resolved value of the plugin.
*/
value: object | ((...args: any[]) => any);
/**
* The options object passed to the plugin.
*/
options?: object | false;
/**
* The path that the options are relative to.
*/
dirname: string;
/**
* Information about the plugin's file, if Babel knows it.
* *
*/
file?: {
/**
* The file that the user requested, e.g. `"@babel/env"`
*/
request: string;
/**
* The full path of the resolved file, e.g. `"/tmp/node_modules/@babel/preset-env/lib/index.js"`
*/
resolved: string;
} | null;
}
export type PluginOptions = object | undefined | false;
export type PluginTarget = string | object | ((...args: any[]) => any);
export type PluginItem = ConfigItem | PluginObj<any> | PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined];
export function resolvePlugin(name: string, dirname: string): string | null;
export function resolvePreset(name: string, dirname: string): string | null;
export interface CreateConfigItemOptions {
dirname?: string;
type?: "preset" | "plugin";
}
/**
* Allows build tooling to create and cache config items up front. If this function is called multiple times for a
* given plugin, Babel will call the plugin's function itself multiple times. If you have a clear set of expected
* plugins and presets to inject, pre-constructing the config items would be recommended.
*/
export function createConfigItem(value: PluginTarget | [PluginTarget, PluginOptions] | [PluginTarget, PluginOptions, string | undefined], options?: CreateConfigItemOptions): ConfigItem;
// NOTE: the documentation says the ConfigAPI also exposes @babel/core's exports, but it actually doesn't
/**
* @see https://babeljs.io/docs/en/next/config-files#config-function-api
*/
export interface ConfigAPI {
/**
* The version string for the Babel version that is loading the config file.
*
* @see https://babeljs.io/docs/en/next/config-files#apiversion
*/
version: string;
/**
* @see https://babeljs.io/docs/en/next/config-files#apicache
*/
cache: SimpleCacheConfigurator;
/**
* @see https://babeljs.io/docs/en/next/config-files#apienv
*/
env: EnvFunction;
// undocumented; currently hardcoded to return 'false'
// async(): boolean
/**
* This API is used as a way to access the `caller` data that has been passed to Babel.
* Since many instances of Babel may be running in the same process with different `caller` values,
* this API is designed to automatically configure `api.cache`, the same way `api.env()` does.
*
* The `caller` value is available as the first parameter of the callback function.
* It is best used with something like this to toggle configuration behavior
* based on a specific environment:
*
* @example
* function isBabelRegister(caller?: { name: string }) {
* return !!(caller && caller.name === "@babel/register")
* }
* api.caller(isBabelRegister)
*
* @see https://babeljs.io/docs/en/next/config-files#apicallercb
*/
caller<T extends SimpleCacheKey>(callerCallback: (caller: TransformOptions['caller']) => T): T;
/**
* While `api.version` can be useful in general, it's sometimes nice to just declare your version.
* This API exposes a simple way to do that with:
*
* @example
* api.assertVersion(7) // major version only
* api.assertVersion("^7.2")
*
* @see https://babeljs.io/docs/en/next/config-files#apiassertversionrange
*/
assertVersion(versionRange: number | string): boolean;
// NOTE: this is an undocumented reexport from "@babel/parser" but it's missing from its types
// tokTypes: typeof tokTypes
}
/**
* JS configs are great because they can compute a config on the fly,
* but the downside there is that it makes caching harder.
* Babel wants to avoid re-executing the config function every time a file is compiled,
* because then it would also need to re-execute any plugin and preset functions
* referenced in that config.
*
* To avoid this, Babel expects users of config functions to tell it how to manage caching
* within a config file.
*
* @see https://babeljs.io/docs/en/next/config-files#apicache
*/
export interface SimpleCacheConfigurator {
// there is an undocumented call signature that is a shorthand for forever()/never()/using().
// (ever: boolean): void
// <T extends SimpleCacheKey>(callback: CacheCallback<T>): T
/**
* Permacache the computed config and never call the function again.
*/
forever(): void;
/**
* Do not cache this config, and re-execute the function every time.
*/
never(): void;
/**
* Any time the using callback returns a value other than the one that was expected,
* the overall config function will be called again and a new entry will be added to the cache.
*
* @example
* api.cache.using(() => process.env.NODE_ENV)
*/
using<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
/**
* Any time the using callback returns a value other than the one that was expected,
* the overall config function will be called again and all entries in the cache will
* be replaced with the result.
*
* @example
* api.cache.invalidate(() => process.env.NODE_ENV)
*/
invalidate<T extends SimpleCacheKey>(callback: SimpleCacheCallback<T>): T;
}
// https://github.com/babel/babel/blob/v7.3.3/packages/babel-core/src/config/caching.js#L231
export type SimpleCacheKey = string | boolean | number | null | undefined;
export type SimpleCacheCallback<T extends SimpleCacheKey> = () => T;
/**
* Since `NODE_ENV` is a fairly common way to toggle behavior, Babel also includes an API function
* meant specifically for that. This API is used as a quick way to check the `"envName"` that Babel
* was loaded with, which takes `NODE_ENV` into account if no other overriding environment is set.
*
* @see https://babeljs.io/docs/en/next/config-files#apienv
*/
export interface EnvFunction {
/**
* @returns the current `envName` string
*/
(): string;
/**
* @returns `true` if the `envName` is `===` any of the given strings
*/
(envName: string | ReadonlyArray<string>): boolean;
// the official documentation is misleading for this one...
// this just passes the callback to `cache.using` but with an additional argument.
// it returns its result instead of necessarily returning a boolean.
<T extends SimpleCacheKey>(envCallback: (envName: NonNullable<TransformOptions['envName']>) => T): T;
}
export type ConfigFunction = (api: ConfigAPI) => TransformOptions;
export as namespace babel;

View file

@ -1,45 +0,0 @@
{
"name": "@types/babel__core",
"version": "7.1.3",
"description": "TypeScript definitions for @babel/core",
"license": "MIT",
"contributors": [
{
"name": "Troy Gerwien",
"url": "https://github.com/yortus",
"githubUsername": "yortus"
},
{
"name": "Marvin Hagemeister",
"url": "https://github.com/marvinhagemeister",
"githubUsername": "marvinhagemeister"
},
{
"name": "Melvin Groenhoff",
"url": "https://github.com/mgroenhoff",
"githubUsername": "mgroenhoff"
},
{
"name": "Jessica Franco",
"url": "https://github.com/Jessidhia",
"githubUsername": "Jessidhia"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/babel__core"
},
"scripts": {},
"dependencies": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0",
"@types/babel__generator": "*",
"@types/babel__template": "*",
"@types/babel__traverse": "*"
},
"typesPublisherContentHash": "478fc636b3b91d2d8148bbc98176f96231386926f4af91893dbe95d3812775a5",
"typeScriptVersion": "2.9"
}

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/babel__generator`
# Summary
This package contains type definitions for @babel/generator (https://github.com/babel/babel/tree/master/packages/babel-generator).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__generator
Additional Details
* Last updated: Tue, 24 Sep 2019 17:18:01 GMT
* Dependencies: @types/babel__types
* Global values: none
# Credits
These definitions were written by Troy Gerwien <https://github.com/yortus>, Johnny Estilles <https://github.com/johnnyestilles>, Melvin Groenhoff <https://github.com/mgroenhoff>, and Cameron Yan <https://github.com/khell>.

View file

@ -1,140 +0,0 @@
// Type definitions for @babel/generator 7.6
// Project: https://github.com/babel/babel/tree/master/packages/babel-generator, https://babeljs.io
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Johnny Estilles <https://github.com/johnnyestilles>
// Melvin Groenhoff <https://github.com/mgroenhoff>
// Cameron Yan <https://github.com/khell>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
import * as t from '@babel/types';
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;
/**
* Retain parens around function expressions (could be used to change engine parsing behavior)
* Defaults to `false`.
*/
retainFunctionParens?: 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;
/**
* Used in warning messages
*/
filename?: string;
/**
* Enable generating source maps. Defaults to `false`.
*/
sourceMaps?: boolean;
/**
* 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;
/**
* Set to true to run jsesc with "json": true to print "\u00A9" vs. "©";
*/
jsonCompatibleStrings?: boolean;
/**
* Set to true to enable support for experimental decorators syntax before module exports.
* Defaults to `false`.
*/
decoratorsBeforeExport?: boolean;
/**
* Options for outputting jsesc representation.
*/
jsescOption?: {
/**
* The type of quote to use in the output. If omitted, autodetects based on `ast.tokens`.
*/
quotes?: 'single' | 'double';
/**
* When enabled, the output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through the quotes setting.
* Defaults to `true`.
*/
wrap?: boolean;
};
}
export class CodeGenerator {
constructor(ast: t.Node, opts?: GeneratorOptions, code?: string);
generate(): GeneratorResult;
}
/**
* 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: t.Node,
opts?: GeneratorOptions,
code?: string | { [filename: string]: string },
): GeneratorResult;
export interface GeneratorResult {
code: string;
map: {
version: number;
sources: string[];
names: string[];
sourceRoot?: string;
sourcesContent?: string[];
mappings: string;
file: string;
} | null;
}

View file

@ -1,41 +0,0 @@
{
"name": "@types/babel__generator",
"version": "7.6.0",
"description": "TypeScript definitions for @babel/generator",
"license": "MIT",
"contributors": [
{
"name": "Troy Gerwien",
"url": "https://github.com/yortus",
"githubUsername": "yortus"
},
{
"name": "Johnny Estilles",
"url": "https://github.com/johnnyestilles",
"githubUsername": "johnnyestilles"
},
{
"name": "Melvin Groenhoff",
"url": "https://github.com/mgroenhoff",
"githubUsername": "mgroenhoff"
},
{
"name": "Cameron Yan",
"url": "https://github.com/khell",
"githubUsername": "khell"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/babel__generator"
},
"scripts": {},
"dependencies": {
"@babel/types": "^7.0.0"
},
"typesPublisherContentHash": "dfa67637cd47499ff534300526632280d98604e8587e28d1e8a38c371a7e33ca",
"typeScriptVersion": "2.9"
}

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/babel__template`
# Summary
This package contains type definitions for @babel/template ( https://github.com/babel/babel/tree/master/packages/babel-template ).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template
Additional Details
* Last updated: Wed, 13 Feb 2019 21:04:23 GMT
* Dependencies: @types/babel__parser, @types/babel__types
* Global values: none
# Credits
These definitions were written by Troy Gerwien <https://github.com/yortus>, Marvin Hagemeister <https://github.com/marvinhagemeister>, Melvin Groenhoff <https://github.com/mgroenhoff>.

View file

@ -1,72 +0,0 @@
// Type definitions for @babel/template 7.0
// Project: https://github.com/babel/babel/tree/master/packages/babel-template, https://babeljs.io
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Melvin Groenhoff <https://github.com/mgroenhoff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
import { ParserOptions } from "@babel/parser";
import { Expression, File, Program, Statement } from "@babel/types";
export interface TemplateBuilderOptions extends ParserOptions {
/**
* A set of placeholder names to automatically accept. Items in this list do not need to match the given placeholder pattern.
*/
placeholderWhitelist?: Set<string>;
/**
* A pattern to search for when looking for Identifier and StringLiteral nodes that should be considered placeholders. `false` will
* disable placeholder searching entirely, leaving only the `placeholderWhitelist` value to find placeholders.
*/
placeholderPattern?: RegExp | false;
/**
* Set this to `true` to preserve any comments from the `code` parameter.
*/
preserveComments?: boolean;
}
export interface TemplateBuilder<T> {
/**
* Build a new builder, merging the given options with the previous ones.
*/
(opts: TemplateBuilderOptions): TemplateBuilder<T>;
/**
* Building from a string produces an AST builder function by default.
*/
(code: string, opts?: TemplateBuilderOptions): (arg?: PublicReplacements) => T;
/**
* Building from a template literal produces an AST builder function by default.
*/
(tpl: TemplateStringsArray, ...args: any[]): (arg?: PublicReplacements) => T;
// Allow users to explicitly create templates that produce ASTs, skipping the need for an intermediate function.
ast: {
(tpl: string, opts?: TemplateBuilderOptions): T;
(tpl: TemplateStringsArray, ...args: any[]): T;
};
}
export type PublicReplacements = { [index: string]: any; } | any[];
export const smart: TemplateBuilder<Statement | Statement[]>;
export const statement: TemplateBuilder<Statement>;
export const statements: TemplateBuilder<Statement[]>;
export const expression: TemplateBuilder<Expression>;
export const program: TemplateBuilder<Program>;
type DefaultTemplateBuilder = typeof smart & {
smart: typeof smart;
statement: typeof statement;
statements: typeof statements;
expression: typeof expression;
program: typeof program;
ast: typeof smart.ast;
};
declare const templateBuilder: DefaultTemplateBuilder;
export default templateBuilder;

View file

@ -1,36 +0,0 @@
{
"name": "@types/babel__template",
"version": "7.0.2",
"description": "TypeScript definitions for @babel/template",
"license": "MIT",
"contributors": [
{
"name": "Troy Gerwien",
"url": "https://github.com/yortus",
"githubUsername": "yortus"
},
{
"name": "Marvin Hagemeister",
"url": "https://github.com/marvinhagemeister",
"githubUsername": "marvinhagemeister"
},
{
"name": "Melvin Groenhoff",
"url": "https://github.com/mgroenhoff",
"githubUsername": "mgroenhoff"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"dependencies": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0"
},
"typesPublisherContentHash": "fd665ffdd94e184259796e85ff1a8e8626a23fb0eeefd6cfb9f77a316eda2624",
"typeScriptVersion": "2.9"
}

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/babel__traverse`
# Summary
This package contains type definitions for @babel/traverse (https://github.com/babel/babel/tree/master/packages/babel-traverse).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__traverse.
### Additional Details
* Last updated: Tue, 19 Nov 2019 22:50:45 GMT
* Dependencies: [@types/babel__types](https://npmjs.com/package/@types/babel__types)
* Global values: none
# Credits
These definitions were written by Troy Gerwien (https://github.com/yortus), Marvin Hagemeister (https://github.com/marvinhagemeister), Ryan Petrich (https://github.com/rpetrich), Melvin Groenhoff (https://github.com/mgroenhoff), and Dean L. (https://github.com/dlgrit).

View file

@ -1,844 +0,0 @@
// Type definitions for @babel/traverse 7.0
// Project: https://github.com/babel/babel/tree/master/packages/babel-traverse, https://babeljs.io
// Definitions by: Troy Gerwien <https://github.com/yortus>
// Marvin Hagemeister <https://github.com/marvinhagemeister>
// Ryan Petrich <https://github.com/rpetrich>
// Melvin Groenhoff <https://github.com/mgroenhoff>
// Dean L. <https://github.com/dlgrit>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.9
import * as t from "@babel/types";
export type Node = t.Node;
export default function traverse<S>(
parent: Node | Node[],
opts: TraverseOptions<S>,
scope: Scope | undefined,
state: S,
parentPath?: NodePath,
): void;
export default function traverse(
parent: Node | Node[],
opts: TraverseOptions,
scope?: Scope,
state?: any,
parentPath?: NodePath,
): void;
export interface TraverseOptions<S = Node> extends Visitor<S> {
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<S>(node: Node | Node[], opts: TraverseOptions<S>, state: S): void;
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: {
id: t.LVal,
init?: t.Expression,
unique?: boolean,
kind?: "var" | "let" | "const",
}): void;
getProgramParent(): Scope;
getFunctionParent(): Scope | null;
getBlockParent(): Scope;
/** Walks the scope tree and gathers **all** bindings. */
getAllBindings(...kinds: string[]): object;
bindingIdentifierEquals(name: string, node: Node): boolean;
getBinding(name: string): Binding | undefined;
getOwnBinding(name: string): Binding | undefined;
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" | "module";
referenced: boolean;
references: number;
referencePaths: NodePath[];
constant: boolean;
constantViolations: NodePath[];
}
export type Visitor<S = {}> = VisitNodeObject<S, Node> & {
[Type in Node["type"]]?: VisitNode<S, Extract<Node, { type: Type; }>>;
} & {
[K in keyof t.Aliases]?: VisitNode<S, t.Aliases[K]>
};
export type VisitNode<S, P> = VisitNodeFunction<S, P> | VisitNodeObject<S, P>;
export type VisitNodeFunction<S, P> = (this: S, path: NodePath<P>, state: S) => void;
export interface VisitNodeObject<S, P> {
enter?: VisitNodeFunction<S, P>;
exit?: VisitNodeFunction<S, P>;
}
export class NodePath<T = Node> {
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 | number;
node: T;
scope: Scope;
type: T extends undefined | null ? string | null : string;
typeAnnotation: object;
getScope(scope: Scope): Scope;
setData(key: string, val: any): any;
getData(key: string, def?: any): any;
buildCodeFrameError<TError extends Error>(msg: string, Error?: new (msg: string) => TError): TError;
traverse<T>(visitor: Visitor<T>, state: T): void;
traverse(visitor: Visitor): void;
set(key: string, node: Node): void;
getPathLocation(): string;
// Example: https://github.com/babel/babel/blob/63204ae51e020d84a5b246312f5eeb4d981ab952/packages/babel-traverse/src/path/modification.js#L83
debug(buildMessage: () => string): 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<t.Function>;
/** Walk up the tree until we hit a parent node path in a list. */
getStatementParent(): NodePath<t.Statement>;
/**
* 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?: (deepest: Node, i: number, ancestries: NodePath[]) => NodePath
): 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.FlowType;
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;
/** Check if the current path will maybe execute before another path */
willIMaybeExecuteBefore(path: NodePath): boolean;
// ------------------------- context -------------------------
call(key: string): boolean;
isBlacklisted(): boolean;
visit(): boolean;
skip(): void;
skipKey(key: string): void;
stop(): void;
setScope(): void;
setContext(context: TraversalContext): NodePath<T>;
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;
/**
* Insert child nodes at the start of the current node.
* @param listKey - The key at which the child nodes are stored (usually body).
* @param nodes - the nodes to insert.
*/
unshiftContainer(listKey: string, nodes: Node | Node[]): void;
/**
* Insert child nodes at the end of the current node.
* @param listKey - The key at which the child nodes are stored (usually body).
* @param nodes - the nodes to insert.
*/
pushContainer(listKey: string, nodes: Node | Node[]): void;
/** Hoist the current node to the highest scope possible and return a UID referencing it. */
hoist(scope: Scope): void;
// ------------------------- family -------------------------
getOpposite(): NodePath;
getCompletionRecords(): NodePath[];
getSibling(key: string | number): NodePath;
getAllPrevSiblings(): NodePath[];
getAllNextSiblings(): NodePath[];
get<K extends keyof T>(key: K, context?: boolean | TraversalContext):
T[K] extends Array<Node | null | undefined> ? Array<NodePath<T[K][number]>> :
T[K] extends Node | null | undefined ? NodePath<T[K]> :
never;
get(key: string, context?: boolean | TraversalContext): NodePath | 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): this is NodePath<t.ArrayExpression>;
isAssignmentExpression(opts?: object): this is NodePath<t.AssignmentExpression>;
isBinaryExpression(opts?: object): this is NodePath<t.BinaryExpression>;
isDirective(opts?: object): this is NodePath<t.Directive>;
isDirectiveLiteral(opts?: object): this is NodePath<t.DirectiveLiteral>;
isBlockStatement(opts?: object): this is NodePath<t.BlockStatement>;
isBreakStatement(opts?: object): this is NodePath<t.BreakStatement>;
isCallExpression(opts?: object): this is NodePath<t.CallExpression>;
isCatchClause(opts?: object): this is NodePath<t.CatchClause>;
isConditionalExpression(opts?: object): this is NodePath<t.ConditionalExpression>;
isContinueStatement(opts?: object): this is NodePath<t.ContinueStatement>;
isDebuggerStatement(opts?: object): this is NodePath<t.DebuggerStatement>;
isDoWhileStatement(opts?: object): this is NodePath<t.DoWhileStatement>;
isEmptyStatement(opts?: object): this is NodePath<t.EmptyStatement>;
isExpressionStatement(opts?: object): this is NodePath<t.ExpressionStatement>;
isFile(opts?: object): this is NodePath<t.File>;
isForInStatement(opts?: object): this is NodePath<t.ForInStatement>;
isForStatement(opts?: object): this is NodePath<t.ForStatement>;
isFunctionDeclaration(opts?: object): this is NodePath<t.FunctionDeclaration>;
isFunctionExpression(opts?: object): this is NodePath<t.FunctionExpression>;
isIdentifier(opts?: object): this is NodePath<t.Identifier>;
isIfStatement(opts?: object): this is NodePath<t.IfStatement>;
isLabeledStatement(opts?: object): this is NodePath<t.LabeledStatement>;
isStringLiteral(opts?: object): this is NodePath<t.StringLiteral>;
isNumericLiteral(opts?: object): this is NodePath<t.NumericLiteral>;
isNullLiteral(opts?: object): this is NodePath<t.NullLiteral>;
isBooleanLiteral(opts?: object): this is NodePath<t.BooleanLiteral>;
isRegExpLiteral(opts?: object): this is NodePath<t.RegExpLiteral>;
isLogicalExpression(opts?: object): this is NodePath<t.LogicalExpression>;
isMemberExpression(opts?: object): this is NodePath<t.MemberExpression>;
isNewExpression(opts?: object): this is NodePath<t.NewExpression>;
isProgram(opts?: object): this is NodePath<t.Program>;
isObjectExpression(opts?: object): this is NodePath<t.ObjectExpression>;
isObjectMethod(opts?: object): this is NodePath<t.ObjectMethod>;
isObjectProperty(opts?: object): this is NodePath<t.ObjectProperty>;
isRestElement(opts?: object): this is NodePath<t.RestElement>;
isReturnStatement(opts?: object): this is NodePath<t.ReturnStatement>;
isSequenceExpression(opts?: object): this is NodePath<t.SequenceExpression>;
isSwitchCase(opts?: object): this is NodePath<t.SwitchCase>;
isSwitchStatement(opts?: object): this is NodePath<t.SwitchStatement>;
isThisExpression(opts?: object): this is NodePath<t.ThisExpression>;
isThrowStatement(opts?: object): this is NodePath<t.ThrowStatement>;
isTryStatement(opts?: object): this is NodePath<t.TryStatement>;
isUnaryExpression(opts?: object): this is NodePath<t.UnaryExpression>;
isUpdateExpression(opts?: object): this is NodePath<t.UpdateExpression>;
isVariableDeclaration(opts?: object): this is NodePath<t.VariableDeclaration>;
isVariableDeclarator(opts?: object): this is NodePath<t.VariableDeclarator>;
isWhileStatement(opts?: object): this is NodePath<t.WhileStatement>;
isWithStatement(opts?: object): this is NodePath<t.WithStatement>;
isAssignmentPattern(opts?: object): this is NodePath<t.AssignmentPattern>;
isArrayPattern(opts?: object): this is NodePath<t.ArrayPattern>;
isArrowFunctionExpression(opts?: object): this is NodePath<t.ArrowFunctionExpression>;
isClassBody(opts?: object): this is NodePath<t.ClassBody>;
isClassDeclaration(opts?: object): this is NodePath<t.ClassDeclaration>;
isClassExpression(opts?: object): this is NodePath<t.ClassExpression>;
isExportAllDeclaration(opts?: object): this is NodePath<t.ExportAllDeclaration>;
isExportDefaultDeclaration(opts?: object): this is NodePath<t.ExportDefaultDeclaration>;
isExportNamedDeclaration(opts?: object): this is NodePath<t.ExportNamedDeclaration>;
isExportSpecifier(opts?: object): this is NodePath<t.ExportSpecifier>;
isForOfStatement(opts?: object): this is NodePath<t.ForOfStatement>;
isImportDeclaration(opts?: object): this is NodePath<t.ImportDeclaration>;
isImportDefaultSpecifier(opts?: object): this is NodePath<t.ImportDefaultSpecifier>;
isImportNamespaceSpecifier(opts?: object): this is NodePath<t.ImportNamespaceSpecifier>;
isImportSpecifier(opts?: object): this is NodePath<t.ImportSpecifier>;
isMetaProperty(opts?: object): this is NodePath<t.MetaProperty>;
isClassMethod(opts?: object): this is NodePath<t.ClassMethod>;
isObjectPattern(opts?: object): this is NodePath<t.ObjectPattern>;
isSpreadElement(opts?: object): this is NodePath<t.SpreadElement>;
isSuper(opts?: object): this is NodePath<t.Super>;
isTaggedTemplateExpression(opts?: object): this is NodePath<t.TaggedTemplateExpression>;
isTemplateElement(opts?: object): this is NodePath<t.TemplateElement>;
isTemplateLiteral(opts?: object): this is NodePath<t.TemplateLiteral>;
isYieldExpression(opts?: object): this is NodePath<t.YieldExpression>;
isAnyTypeAnnotation(opts?: object): this is NodePath<t.AnyTypeAnnotation>;
isArrayTypeAnnotation(opts?: object): this is NodePath<t.ArrayTypeAnnotation>;
isBooleanTypeAnnotation(opts?: object): this is NodePath<t.BooleanTypeAnnotation>;
isBooleanLiteralTypeAnnotation(opts?: object): this is NodePath<t.BooleanLiteralTypeAnnotation>;
isNullLiteralTypeAnnotation(opts?: object): this is NodePath<t.NullLiteralTypeAnnotation>;
isClassImplements(opts?: object): this is NodePath<t.ClassImplements>;
isClassProperty(opts?: object): this is NodePath<t.ClassProperty>;
isDeclareClass(opts?: object): this is NodePath<t.DeclareClass>;
isDeclareFunction(opts?: object): this is NodePath<t.DeclareFunction>;
isDeclareInterface(opts?: object): this is NodePath<t.DeclareInterface>;
isDeclareModule(opts?: object): this is NodePath<t.DeclareModule>;
isDeclareTypeAlias(opts?: object): this is NodePath<t.DeclareTypeAlias>;
isDeclareVariable(opts?: object): this is NodePath<t.DeclareVariable>;
isFunctionTypeAnnotation(opts?: object): this is NodePath<t.FunctionTypeAnnotation>;
isFunctionTypeParam(opts?: object): this is NodePath<t.FunctionTypeParam>;
isGenericTypeAnnotation(opts?: object): this is NodePath<t.GenericTypeAnnotation>;
isInterfaceExtends(opts?: object): this is NodePath<t.InterfaceExtends>;
isInterfaceDeclaration(opts?: object): this is NodePath<t.InterfaceDeclaration>;
isIntersectionTypeAnnotation(opts?: object): this is NodePath<t.IntersectionTypeAnnotation>;
isMixedTypeAnnotation(opts?: object): this is NodePath<t.MixedTypeAnnotation>;
isNullableTypeAnnotation(opts?: object): this is NodePath<t.NullableTypeAnnotation>;
isNumberTypeAnnotation(opts?: object): this is NodePath<t.NumberTypeAnnotation>;
isStringLiteralTypeAnnotation(opts?: object): this is NodePath<t.StringLiteralTypeAnnotation>;
isStringTypeAnnotation(opts?: object): this is NodePath<t.StringTypeAnnotation>;
isThisTypeAnnotation(opts?: object): this is NodePath<t.ThisTypeAnnotation>;
isTupleTypeAnnotation(opts?: object): this is NodePath<t.TupleTypeAnnotation>;
isTypeofTypeAnnotation(opts?: object): this is NodePath<t.TypeofTypeAnnotation>;
isTypeAlias(opts?: object): this is NodePath<t.TypeAlias>;
isTypeAnnotation(opts?: object): this is NodePath<t.TypeAnnotation>;
isTypeCastExpression(opts?: object): this is NodePath<t.TypeCastExpression>;
isTypeParameterDeclaration(opts?: object): this is NodePath<t.TypeParameterDeclaration>;
isTypeParameterInstantiation(opts?: object): this is NodePath<t.TypeParameterInstantiation>;
isObjectTypeAnnotation(opts?: object): this is NodePath<t.ObjectTypeAnnotation>;
isObjectTypeCallProperty(opts?: object): this is NodePath<t.ObjectTypeCallProperty>;
isObjectTypeIndexer(opts?: object): this is NodePath<t.ObjectTypeIndexer>;
isObjectTypeProperty(opts?: object): this is NodePath<t.ObjectTypeProperty>;
isQualifiedTypeIdentifier(opts?: object): this is NodePath<t.QualifiedTypeIdentifier>;
isUnionTypeAnnotation(opts?: object): this is NodePath<t.UnionTypeAnnotation>;
isVoidTypeAnnotation(opts?: object): this is NodePath<t.VoidTypeAnnotation>;
isJSXAttribute(opts?: object): this is NodePath<t.JSXAttribute>;
isJSXClosingElement(opts?: object): this is NodePath<t.JSXClosingElement>;
isJSXElement(opts?: object): this is NodePath<t.JSXElement>;
isJSXEmptyExpression(opts?: object): this is NodePath<t.JSXEmptyExpression>;
isJSXExpressionContainer(opts?: object): this is NodePath<t.JSXExpressionContainer>;
isJSXIdentifier(opts?: object): this is NodePath<t.JSXIdentifier>;
isJSXMemberExpression(opts?: object): this is NodePath<t.JSXMemberExpression>;
isJSXNamespacedName(opts?: object): this is NodePath<t.JSXNamespacedName>;
isJSXOpeningElement(opts?: object): this is NodePath<t.JSXOpeningElement>;
isJSXSpreadAttribute(opts?: object): this is NodePath<t.JSXSpreadAttribute>;
isJSXText(opts?: object): this is NodePath<t.JSXText>;
isNoop(opts?: object): this is NodePath<t.Noop>;
isParenthesizedExpression(opts?: object): this is NodePath<t.ParenthesizedExpression>;
isAwaitExpression(opts?: object): this is NodePath<t.AwaitExpression>;
isBindExpression(opts?: object): this is NodePath<t.BindExpression>;
isDecorator(opts?: object): this is NodePath<t.Decorator>;
isDoExpression(opts?: object): this is NodePath<t.DoExpression>;
isExportDefaultSpecifier(opts?: object): this is NodePath<t.ExportDefaultSpecifier>;
isExportNamespaceSpecifier(opts?: object): this is NodePath<t.ExportNamespaceSpecifier>;
isRestProperty(opts?: object): this is NodePath<t.RestProperty>;
isSpreadProperty(opts?: object): this is NodePath<t.SpreadProperty>;
isExpression(opts?: object): this is NodePath<t.Expression>;
isBinary(opts?: object): this is NodePath<t.Binary>;
isScopable(opts?: object): this is NodePath<t.Scopable>;
isBlockParent(opts?: object): this is NodePath<t.BlockParent>;
isBlock(opts?: object): this is NodePath<t.Block>;
isStatement(opts?: object): this is NodePath<t.Statement>;
isTerminatorless(opts?: object): this is NodePath<t.Terminatorless>;
isCompletionStatement(opts?: object): this is NodePath<t.CompletionStatement>;
isConditional(opts?: object): this is NodePath<t.Conditional>;
isLoop(opts?: object): this is NodePath<t.Loop>;
isWhile(opts?: object): this is NodePath<t.While>;
isExpressionWrapper(opts?: object): this is NodePath<t.ExpressionWrapper>;
isFor(opts?: object): this is NodePath<t.For>;
isForXStatement(opts?: object): this is NodePath<t.ForXStatement>;
isFunction(opts?: object): this is NodePath<t.Function>;
isFunctionParent(opts?: object): this is NodePath<t.FunctionParent>;
isPureish(opts?: object): this is NodePath<t.Pureish>;
isDeclaration(opts?: object): this is NodePath<t.Declaration>;
isLVal(opts?: object): this is NodePath<t.LVal>;
isLiteral(opts?: object): this is NodePath<t.Literal>;
isImmutable(opts?: object): this is NodePath<t.Immutable>;
isUserWhitespacable(opts?: object): this is NodePath<t.UserWhitespacable>;
isMethod(opts?: object): this is NodePath<t.Method>;
isObjectMember(opts?: object): this is NodePath<t.ObjectMember>;
isProperty(opts?: object): this is NodePath<t.Property>;
isUnaryLike(opts?: object): this is NodePath<t.UnaryLike>;
isPattern(opts?: object): this is NodePath<t.Pattern>;
isClass(opts?: object): this is NodePath<t.Class>;
isModuleDeclaration(opts?: object): this is NodePath<t.ModuleDeclaration>;
isExportDeclaration(opts?: object): this is NodePath<t.ExportDeclaration>;
isModuleSpecifier(opts?: object): this is NodePath<t.ModuleSpecifier>;
isFlow(opts?: object): this is NodePath<t.Flow>;
isFlowBaseAnnotation(opts?: object): this is NodePath<t.FlowBaseAnnotation>;
isFlowDeclaration(opts?: object): this is NodePath<t.FlowDeclaration>;
isJSX(opts?: object): this is NodePath<t.JSX>;
isNumberLiteral(opts?: object): this is NodePath<t.NumericLiteral>;
isRegexLiteral(opts?: object): this is NodePath<t.RegExpLiteral>;
isReferencedIdentifier(opts?: object): this is NodePath<t.Identifier | t.JSXIdentifier>;
isReferencedMemberExpression(opts?: object): this is NodePath<t.MemberExpression>;
isBindingIdentifier(opts?: object): this is NodePath<t.Identifier>;
isScope(opts?: object): this is NodePath<t.Scopable>;
isReferenced(opts?: object): boolean;
isBlockScoped(opts?: object): this is NodePath<t.FunctionDeclaration | t.ClassDeclaration | t.VariableDeclaration>;
isVar(opts?: object): this is NodePath<t.VariableDeclaration>;
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;
}
export interface TraversalContext {
parentPath: NodePath;
scope: Scope;
state: any;
opts: any;
}

View file

@ -1,46 +0,0 @@
{
"name": "@types/babel__traverse",
"version": "7.0.8",
"description": "TypeScript definitions for @babel/traverse",
"license": "MIT",
"contributors": [
{
"name": "Troy Gerwien",
"url": "https://github.com/yortus",
"githubUsername": "yortus"
},
{
"name": "Marvin Hagemeister",
"url": "https://github.com/marvinhagemeister",
"githubUsername": "marvinhagemeister"
},
{
"name": "Ryan Petrich",
"url": "https://github.com/rpetrich",
"githubUsername": "rpetrich"
},
{
"name": "Melvin Groenhoff",
"url": "https://github.com/mgroenhoff",
"githubUsername": "mgroenhoff"
},
{
"name": "Dean L.",
"url": "https://github.com/dlgrit",
"githubUsername": "dlgrit"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/babel__traverse"
},
"scripts": {},
"dependencies": {
"@babel/types": "^7.3.0"
},
"typesPublisherContentHash": "9b5b72051081a25b9f1276449bed6884b88b99d0c4372bd5026fd48e1b5ab780",
"typeScriptVersion": "2.9"
}

16
node_modules/@types/events/README.md generated vendored Normal file
View file

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/events`
# Summary
This package contains type definitions for events (https://github.com/Gozala/events).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/events
Additional Details
* Last updated: Thu, 24 Jan 2019 03:19:08 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by Yasunori Ohoka <https://github.com/yasupeke>, Shenwei Wang <https://github.com/weareoutman>.

28
node_modules/@types/events/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,28 @@
// Type definitions for events 3.0
// Project: https://github.com/Gozala/events
// Definitions by: Yasunori Ohoka <https://github.com/yasupeke>
// Shenwei Wang <https://github.com/weareoutman>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export type Listener = (...args: any[]) => void;
export class EventEmitter {
static listenerCount(emitter: EventEmitter, type: string | number): number;
static defaultMaxListeners: number;
eventNames(): Array<string | number>;
setMaxListeners(n: number): this;
getMaxListeners(): number;
emit(type: string | number, ...args: any[]): boolean;
addListener(type: string | number, listener: Listener): this;
on(type: string | number, listener: Listener): this;
once(type: string | number, listener: Listener): this;
prependListener(type: string | number, listener: Listener): this;
prependOnceListener(type: string | number, listener: Listener): this;
removeListener(type: string | number, listener: Listener): this;
off(type: string | number, listener: Listener): this;
removeAllListeners(type?: string | number): this;
listeners(type: string | number): Listener[];
listenerCount(type: string | number): number;
rawListeners(type: string | number): Listener[];
}

28
node_modules/@types/events/package.json generated vendored Normal file
View file

@ -0,0 +1,28 @@
{
"name": "@types/events",
"version": "3.0.0",
"description": "TypeScript definitions for events",
"license": "MIT",
"contributors": [
{
"name": "Yasunori Ohoka",
"url": "https://github.com/yasupeke",
"githubUsername": "yasupeke"
},
{
"name": "Shenwei Wang",
"url": "https://github.com/weareoutman",
"githubUsername": "weareoutman"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "ae078136220837864b64cc7c1c5267ca1ceb809166fb74569e637bc7de9f2e12",
"typeScriptVersion": "2.0"
}

16
node_modules/@types/glob/README.md generated vendored Normal file
View file

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/glob`
# Summary
This package contains type definitions for Glob (https://github.com/isaacs/node-glob).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/glob
Additional Details
* Last updated: Thu, 27 Sep 2018 12:34:19 GMT
* Dependencies: events, minimatch, node
* Global values: none
# Credits
These definitions were written by vvakame <https://github.com/vvakame>, voy <https://github.com/voy>, Klaus Meinhardt <https://github.com/ajafff>.

87
node_modules/@types/glob/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,87 @@
// Type definitions for Glob 7.1
// Project: https://github.com/isaacs/node-glob
// Definitions by: vvakame <https://github.com/vvakame>
// voy <https://github.com/voy>
// Klaus Meinhardt <https://github.com/ajafff>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
import events = require("events");
import minimatch = require("minimatch");
declare function G(pattern: string, cb: (err: Error | null, matches: string[]) => void): void;
declare function G(pattern: string, options: G.IOptions, cb: (err: Error | null, matches: string[]) => void): void;
declare namespace G {
function __promisify__(pattern: string, options?: IOptions): Promise<string[]>;
function sync(pattern: string, options?: IOptions): string[];
function hasMagic(pattern: string, options?: IOptions): boolean;
let Glob: IGlobStatic;
let GlobSync: IGlobSyncStatic;
interface IOptions extends minimatch.IOptions {
cwd?: string;
root?: string;
dot?: boolean;
nomount?: boolean;
mark?: boolean;
nosort?: boolean;
stat?: boolean;
silent?: boolean;
strict?: boolean;
cache?: { [path: string]: boolean | 'DIR' | 'FILE' | ReadonlyArray<string> };
statCache?: { [path: string]: false | { isDirectory(): boolean} | undefined };
symlinks?: { [path: string]: boolean | undefined };
realpathCache?: { [path: string]: string };
sync?: boolean;
nounique?: boolean;
nonull?: boolean;
debug?: boolean;
nobrace?: boolean;
noglobstar?: boolean;
noext?: boolean;
nocase?: boolean;
matchBase?: any;
nodir?: boolean;
ignore?: string | ReadonlyArray<string>;
follow?: boolean;
realpath?: boolean;
nonegate?: boolean;
nocomment?: boolean;
absolute?: boolean;
}
interface IGlobStatic extends events.EventEmitter {
new (pattern: string, cb?: (err: Error | null, matches: string[]) => void): IGlob;
new (pattern: string, options: IOptions, cb?: (err: Error | null, matches: string[]) => void): IGlob;
prototype: IGlob;
}
interface IGlobSyncStatic {
new (pattern: string, options?: IOptions): IGlobBase;
prototype: IGlobBase;
}
interface IGlobBase {
minimatch: minimatch.IMinimatch;
options: IOptions;
aborted: boolean;
cache: { [path: string]: boolean | 'DIR' | 'FILE' | ReadonlyArray<string> };
statCache: { [path: string]: false | { isDirectory(): boolean; } | undefined };
symlinks: { [path: string]: boolean | undefined };
realpathCache: { [path: string]: string };
found: string[];
}
interface IGlob extends IGlobBase, events.EventEmitter {
pause(): void;
resume(): void;
abort(): void;
}
}
export = G;

36
node_modules/@types/glob/package.json generated vendored Normal file
View file

@ -0,0 +1,36 @@
{
"name": "@types/glob",
"version": "7.1.1",
"description": "TypeScript definitions for Glob",
"license": "MIT",
"contributors": [
{
"name": "vvakame",
"url": "https://github.com/vvakame",
"githubUsername": "vvakame"
},
{
"name": "voy",
"url": "https://github.com/voy",
"githubUsername": "voy"
},
{
"name": "Klaus Meinhardt",
"url": "https://github.com/ajafff",
"githubUsername": "ajafff"
}
],
"main": "",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"dependencies": {
"@types/events": "*",
"@types/minimatch": "*",
"@types/node": "*"
},
"typesPublisherContentHash": "43019f2af91c7a4ca3453c4b806a01c521ca3008ffe1bfefd37c5f9d6135660e",
"typeScriptVersion": "2.0"
}

View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/istanbul-lib-coverage`
# Summary
This package contains type definitions for istanbul-lib-coverage ( https://istanbul.js.org ).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-coverage
Additional Details
* Last updated: Thu, 25 Apr 2019 23:07:43 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by Jason Cheatham <https://github.com/jason0x43>, Lorenzo Rapetti <https://github.com/loryman>.

View file

@ -1,118 +0,0 @@
// Type definitions for istanbul-lib-coverage 2.0
// Project: https://istanbul.js.org, https://github.com/istanbuljs/istanbuljs
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
// Lorenzo Rapetti <https://github.com/loryman>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
export interface CoverageSummaryData {
lines: Totals;
statements: Totals;
branches: Totals;
functions: Totals;
}
export class CoverageSummary {
constructor(data: CoverageSummary | CoverageSummaryData);
merge(obj: CoverageSummary): CoverageSummary;
toJSON(): CoverageSummaryData;
isEmpty(): boolean;
data: CoverageSummaryData;
lines: Totals;
statements: Totals;
branches: Totals;
functions: Totals;
}
export interface CoverageMapData {
[key: string]: FileCoverage;
}
export class CoverageMap {
constructor(data: CoverageMapData | CoverageMap);
addFileCoverage(pathOrObject: string | FileCoverage | FileCoverageData): void;
files(): string[];
fileCoverageFor(filename: string): FileCoverage;
filter(callback: (key: string) => boolean): void;
getCoverageSummary(): CoverageSummary;
merge(data: CoverageMapData | CoverageMap): void;
toJSON(): CoverageMapData;
data: CoverageMapData;
}
export interface Location {
line: number;
column: number;
}
export interface Range {
start: Location;
end: Location;
}
export interface BranchMapping {
loc: Range;
type: string;
locations: Range[];
line: number;
}
export interface FunctionMapping {
name: string;
decl: Range;
loc: Range;
line: number;
}
export interface FileCoverageData {
path: string;
statementMap: { [key: string]: Range };
fnMap: { [key: string]: FunctionMapping };
branchMap: { [key: string]: BranchMapping };
s: { [key: string]: number };
f: { [key: string]: number };
b: { [key: string]: number[] };
}
export interface Totals {
total: number;
covered: number;
skipped: number;
pct: number;
}
export interface Coverage {
covered: number;
total: number;
coverage: number;
}
export class FileCoverage implements FileCoverageData {
constructor(data: string | FileCoverage | FileCoverageData);
merge(other: FileCoverageData): void;
getBranchCoverageByLine(): { [line: number]: Coverage };
getLineCoverage(): { [line: number]: number };
getUncoveredLines(): number[];
resetHits(): void;
computeBranchTotals(): Totals;
computeSimpleTotals(): Totals;
toSummary(): CoverageSummary;
toJSON(): object;
data: FileCoverageData;
path: string;
statementMap: { [key: string]: Range };
fnMap: { [key: string]: FunctionMapping };
branchMap: { [key: string]: BranchMapping };
s: { [key: string]: number };
f: { [key: string]: number };
b: { [key: string]: number[] };
}
export const classes: {
FileCoverage: FileCoverage;
};
export function createCoverageMap(data?: CoverageMap | CoverageMapData): CoverageMap;
export function createCoverageSummary(obj?: CoverageSummary | CoverageSummaryData): CoverageSummary;
export function createFileCoverage(pathOrObject: string | FileCoverage | FileCoverageData): FileCoverage;

View file

@ -1,29 +0,0 @@
{
"name": "@types/istanbul-lib-coverage",
"version": "2.0.1",
"description": "TypeScript definitions for istanbul-lib-coverage",
"license": "MIT",
"contributors": [
{
"name": "Jason Cheatham",
"url": "https://github.com/jason0x43",
"githubUsername": "jason0x43"
},
{
"name": "Lorenzo Rapetti",
"url": "https://github.com/loryman",
"githubUsername": "loryman"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/istanbul-lib-coverage"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "fb2cf9603945473dc60dede8472e884daa070938a01b09aa816ca0cc979213ba",
"typeScriptVersion": "2.4"
}

View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/istanbul-lib-report`
# Summary
This package contains type definitions for istanbul-lib-report ( https://istanbul.js.org ).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-lib-report
Additional Details
* Last updated: Thu, 25 Apr 2019 23:07:44 GMT
* Dependencies: @types/istanbul-lib-coverage
* Global values: none
# Credits
These definitions were written by Jason Cheatham <https://github.com/jason0x43>.

View file

@ -1,82 +0,0 @@
// Type definitions for istanbul-lib-report 1.1
// Project: https://istanbul.js.org, https://github.com/istanbuljs/istanbuljs
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
import { CoverageMap, FileCoverage, CoverageSummary } from 'istanbul-lib-coverage';
export function createContext(options?: Partial<ContextOptions>): Context;
export function getDefaultWatermarks(): Watermarks;
export const summarizers: {
flat(coverageMap: CoverageMap): Tree;
nested(coverageMap: CoverageMap): Tree;
pkg(coverageMap: CoverageMap): Tree;
};
export interface ContextOptions {
dir: string;
watermarks: Watermarks;
sourceFinder(filepath: string): string;
}
export interface Context extends ContextOptions {
data: any;
writer: FileWriter;
}
export interface ContentWriter {
write(str: string): void;
colorize(str: string, cls?: string): string;
println(str: string): void;
close(): void;
}
export interface FileWriter {
writeForDir(subdir: string): FileWriter;
copyFile(source: string, dest: string): void;
writeFile(file: string | null): ContentWriter;
}
export interface Watermarks {
statements: number[];
functions: number[];
branches: number[];
lines: number[];
}
export interface Node {
getQualifiedName(): string;
getRelativeName(): string;
isRoot(): boolean;
getParent(): Node;
getChildren(): Node[];
isSummary(): boolean;
getCoverageSummary(filesOnly: boolean): CoverageSummary;
getFileCoverage(): FileCoverage;
visit(visitor: Visitor, state: any): void;
}
export interface ReportNode extends Node {
path: string;
parent: ReportNode | null;
fileCoverage: FileCoverage;
children: ReportNode[];
addChild(child: ReportNode): void;
asRelative(p: string): string;
visit(visitor: Visitor<ReportNode>, state: any): void;
}
export interface Visitor<N extends Node = Node> {
onStart(root: N, state: any): void;
onSummary(root: N, state: any): void;
onDetail(root: N, state: any): void;
onSummaryEnd(root: N, state: any): void;
onEnd(root: N, state: any): void;
}
export interface Tree<N extends Node = Node> {
getRoot(): N;
visit(visitor: Partial<Visitor<N>>, state: any): void;
}

View file

@ -1,26 +0,0 @@
{
"name": "@types/istanbul-lib-report",
"version": "1.1.1",
"description": "TypeScript definitions for istanbul-lib-report",
"license": "MIT",
"contributors": [
{
"name": "Jason Cheatham",
"url": "https://github.com/jason0x43",
"githubUsername": "jason0x43"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/istanbul-lib-report"
},
"scripts": {},
"dependencies": {
"@types/istanbul-lib-coverage": "*"
},
"typesPublisherContentHash": "64af305d196bdbb3cc44bc664daf0546df5c55bce234d53c29f97d0883da2f32",
"typeScriptVersion": "2.4"
}

View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/istanbul-reports`
# Summary
This package contains type definitions for istanbul-reports ( https://github.com/istanbuljs/istanbuljs ).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports
Additional Details
* Last updated: Wed, 17 Apr 2019 17:14:08 GMT
* Dependencies: @types/istanbul-lib-report, @types/istanbul-lib-coverage
* Global values: none
# Credits
These definitions were written by Jason Cheatham <https://github.com/jason0x43>.

View file

@ -1,50 +0,0 @@
// Type definitions for istanbul-reports 1.1
// Project: https://github.com/istanbuljs/istanbuljs, https://istanbul.js.org
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
import { Context, Node, FileWriter, Visitor } from 'istanbul-lib-report';
import { CoverageSummary } from 'istanbul-lib-coverage';
export function create<T extends keyof ReportOptions>(
name: T,
options?: Partial<ReportOptions[T]>
): Visitor;
export interface ReportOptions {
clover: RootedOptions;
cobertura: RootedOptions;
html: HtmlOptions;
json: Options;
'json-summary': Options;
lcov: never;
lcovonly: Options;
none: RootedOptions;
teamcity: Options & { blockName: string };
text: Options & { maxCols: number };
'text-lcov': Options;
'text-summary': Options;
}
export type ReportType = keyof ReportOptions;
export interface Options {
file: string;
}
export interface RootedOptions extends Options {
projectRoot: string;
}
export interface HtmlOptions {
verbose: boolean;
linkMapper: LinkMapper;
subdir: string;
}
export interface LinkMapper {
getPath(node: string | Node): string;
relativePath(source: string | Node, target: string | Node): string;
assetPath(node: Node, name: string): string;
}

View file

@ -1,27 +0,0 @@
{
"name": "@types/istanbul-reports",
"version": "1.1.1",
"description": "TypeScript definitions for istanbul-reports",
"license": "MIT",
"contributors": [
{
"name": "Jason Cheatham",
"url": "https://github.com/jason0x43",
"githubUsername": "jason0x43"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/istanbul-reports"
},
"scripts": {},
"dependencies": {
"@types/istanbul-lib-coverage": "*",
"@types/istanbul-lib-report": "*"
},
"typesPublisherContentHash": "48ffb8b28b9f445ebd12c748ea4cf877e1b802bee7fa18c4392b793e84bfce5a",
"typeScriptVersion": "2.4"
}

21
node_modules/@types/jest/LICENSE generated vendored
View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

17
node_modules/@types/jest/README.md generated vendored
View file

@ -1,17 +0,0 @@
# Installation
> `npm install --save @types/jest`
# Summary
This package contains type definitions for Jest (https://jestjs.io/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest.
### Additional Details
* Last updated: Tue, 12 Nov 2019 20:45:24 GMT
* Dependencies: [@types/jest-diff](https://npmjs.com/package/@types/jest-diff)
* Global values: `afterAll`, `afterEach`, `beforeAll`, `beforeEach`, `describe`, `expect`, `fail`, `fdescribe`, `fit`, `it`, `jasmine`, `jest`, `pending`, `spyOn`, `test`, `xdescribe`, `xit`, `xtest`
# Credits
These definitions were written by Asana (https://asana.com)
// Ivo Stratev (https://github.com/NoHomey), jwbay (https://github.com/jwbay), Alexey Svetliakov (https://github.com/asvetliakov), Alex Jover Morales (https://github.com/alexjoverm), Allan Lukwago (https://github.com/epicallan), Ika (https://github.com/ikatyang), Waseem Dahman (https://github.com/wsmd), Jamie Mason (https://github.com/JamieMason), Douglas Duteil (https://github.com/douglasduteil), Ahn (https://github.com/ahnpnl), Josh Goldberg (https://github.com/joshuakgoldberg), Jeff Lau (https://github.com/UselessPickles), Andrew Makarov (https://github.com/r3nya), Martin Hochel (https://github.com/hotell), Sebastian Sebald (https://github.com/sebald), Andy (https://github.com/andys8), Antoine Brault (https://github.com/antoinebrault), Jeroen Claassens (https://github.com/favna), Gregor Stamać (https://github.com/gstamac), ExE Boss (https://github.com/ExE-Boss), Alex Bolenok (https://github.com/quassnoi), Mario Beltrán Alarcón (https://github.com/Belco90), Tony Hallett (https://github.com/tonyhallett), and Jason Yu (https://github.com/ycmjason).

2052
node_modules/@types/jest/index.d.ts generated vendored

File diff suppressed because it is too large Load diff

141
node_modules/@types/jest/package.json generated vendored
View file

@ -1,141 +0,0 @@
{
"name": "@types/jest",
"version": "24.0.23",
"description": "TypeScript definitions for Jest",
"license": "MIT",
"contributors": [
{
"name": "Asana (https://asana.com)\n// Ivo Stratev",
"url": "https://github.com/NoHomey",
"githubUsername": "NoHomey"
},
{
"name": "jwbay",
"url": "https://github.com/jwbay",
"githubUsername": "jwbay"
},
{
"name": "Alexey Svetliakov",
"url": "https://github.com/asvetliakov",
"githubUsername": "asvetliakov"
},
{
"name": "Alex Jover Morales",
"url": "https://github.com/alexjoverm",
"githubUsername": "alexjoverm"
},
{
"name": "Allan Lukwago",
"url": "https://github.com/epicallan",
"githubUsername": "epicallan"
},
{
"name": "Ika",
"url": "https://github.com/ikatyang",
"githubUsername": "ikatyang"
},
{
"name": "Waseem Dahman",
"url": "https://github.com/wsmd",
"githubUsername": "wsmd"
},
{
"name": "Jamie Mason",
"url": "https://github.com/JamieMason",
"githubUsername": "JamieMason"
},
{
"name": "Douglas Duteil",
"url": "https://github.com/douglasduteil",
"githubUsername": "douglasduteil"
},
{
"name": "Ahn",
"url": "https://github.com/ahnpnl",
"githubUsername": "ahnpnl"
},
{
"name": "Josh Goldberg",
"url": "https://github.com/joshuakgoldberg",
"githubUsername": "joshuakgoldberg"
},
{
"name": "Jeff Lau",
"url": "https://github.com/UselessPickles",
"githubUsername": "UselessPickles"
},
{
"name": "Andrew Makarov",
"url": "https://github.com/r3nya",
"githubUsername": "r3nya"
},
{
"name": "Martin Hochel",
"url": "https://github.com/hotell",
"githubUsername": "hotell"
},
{
"name": "Sebastian Sebald",
"url": "https://github.com/sebald",
"githubUsername": "sebald"
},
{
"name": "Andy",
"url": "https://github.com/andys8",
"githubUsername": "andys8"
},
{
"name": "Antoine Brault",
"url": "https://github.com/antoinebrault",
"githubUsername": "antoinebrault"
},
{
"name": "Jeroen Claassens",
"url": "https://github.com/favna",
"githubUsername": "favna"
},
{
"name": "Gregor Stamać",
"url": "https://github.com/gstamac",
"githubUsername": "gstamac"
},
{
"name": "ExE Boss",
"url": "https://github.com/ExE-Boss",
"githubUsername": "ExE-Boss"
},
{
"name": "Alex Bolenok",
"url": "https://github.com/quassnoi",
"githubUsername": "quassnoi"
},
{
"name": "Mario Beltrán Alarcón",
"url": "https://github.com/Belco90",
"githubUsername": "Belco90"
},
{
"name": "Tony Hallett",
"url": "https://github.com/tonyhallett",
"githubUsername": "tonyhallett"
},
{
"name": "Jason Yu",
"url": "https://github.com/ycmjason",
"githubUsername": "ycmjason"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/jest"
},
"scripts": {},
"dependencies": {
"jest-diff": "^24.3.0"
},
"typesPublisherContentHash": "fa7e1cb4a1cdb5ef7fcb110f74418bacdca253d461d8a3338a5500c1f6013dc2",
"typeScriptVersion": "3.0"
}

View file

@ -1,21 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

16
node_modules/@types/minimatch/README.md generated vendored Normal file
View file

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/minimatch`
# Summary
This package contains type definitions for Minimatch (https://github.com/isaacs/minimatch).
# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/minimatch
Additional Details
* Last updated: Thu, 04 Jan 2018 23:26:01 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by vvakame <https://github.com/vvakame>, Shant Marouti <https://github.com/shantmarouti>.

214
node_modules/@types/minimatch/index.d.ts generated vendored Normal file
View file

@ -0,0 +1,214 @@
// Type definitions for Minimatch 3.0
// Project: https://github.com/isaacs/minimatch
// Definitions by: vvakame <https://github.com/vvakame>
// Shant Marouti <https://github.com/shantmarouti>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Tests a path against the pattern using the options.
*/
declare function M(target: string, pattern: string, options?: M.IOptions): boolean;
declare namespace M {
/**
* Match against the list of files, in the style of fnmatch or glob.
* If nothing is matched, and options.nonull is set,
* then return a list containing the pattern itself.
*/
function match(list: ReadonlyArray<string>, pattern: string, options?: IOptions): string[];
/**
* Returns a function that tests its supplied argument, suitable for use with Array.filter
*/
function filter(pattern: string, options?: IOptions): (element: string, indexed: number, array: ReadonlyArray<string>) => boolean;
/**
* Make a regular expression object from the pattern.
*/
function makeRe(pattern: string, options?: IOptions): RegExp;
let Minimatch: IMinimatchStatic;
interface IOptions {
/**
* Dump a ton of stuff to stderr.
*
* @default false
*/
debug?: boolean;
/**
* Do not expand {a,b} and {1..3} brace sets.
*
* @default false
*/
nobrace?: boolean;
/**
* Disable ** matching against multiple folder names.
*
* @default false
*/
noglobstar?: boolean;
/**
* Allow patterns to match filenames starting with a period,
* even if the pattern does not explicitly have a period in that spot.
*
* @default false
*/
dot?: boolean;
/**
* Disable "extglob" style patterns like +(a|b).
*
* @default false
*/
noext?: boolean;
/**
* Perform a case-insensitive match.
*
* @default false
*/
nocase?: boolean;
/**
* When a match is not found by minimatch.match,
* return a list containing the pattern itself if this option is set.
* Otherwise, an empty list is returned if there are no matches.
*
* @default false
*/
nonull?: boolean;
/**
* If set, then patterns without slashes will be matched against
* the basename of the path if it contains slashes.
*
* @default false
*/
matchBase?: boolean;
/**
* Suppress the behavior of treating #
* at the start of a pattern as a comment.
*
* @default false
*/
nocomment?: boolean;
/**
* Suppress the behavior of treating a leading ! character as negation.
*
* @default false
*/
nonegate?: boolean;
/**
* Returns from negate expressions the same as if they were not negated.
* (Ie, true on a hit, false on a miss.)
*
* @default false
*/
flipNegate?: boolean;
}
interface IMinimatchStatic {
new(pattern: string, options?: IOptions): IMinimatch;
prototype: IMinimatch;
}
interface IMinimatch {
/**
* The original pattern the minimatch object represents.
*/
pattern: string;
/**
* The options supplied to the constructor.
*/
options: IOptions;
/**
* A 2-dimensional array of regexp or string expressions.
*/
set: any[][]; // (RegExp | string)[][]
/**
* A single regular expression expressing the entire pattern.
* Created by the makeRe method.
*/
regexp: RegExp;
/**
* True if the pattern is negated.
*/
negate: boolean;
/**
* True if the pattern is a comment.
*/
comment: boolean;
/**
* True if the pattern is ""
*/
empty: boolean;
/**
* Generate the regexp member if necessary, and return it.
* Will return false if the pattern is invalid.
*/
makeRe(): RegExp; // regexp or boolean
/**
* Return true if the filename matches the pattern, or false otherwise.
*/
match(fname: string): boolean;
/**
* Take a /-split filename, and match it against a single row in the regExpSet.
* This method is mainly for internal use, but is exposed so that it can be used
* by a glob-walker that needs to avoid excessive filesystem calls.
*/
matchOne(files: string[], pattern: string[], partial: boolean): boolean;
/**
* Deprecated. For internal use.
*
* @private
*/
debug(): void;
/**
* Deprecated. For internal use.
*
* @private
*/
make(): void;
/**
* Deprecated. For internal use.
*
* @private
*/
parseNegate(): void;
/**
* Deprecated. For internal use.
*
* @private
*/
braceExpand(pattern: string, options: IOptions): void;
/**
* Deprecated. For internal use.
*
* @private
*/
parse(pattern: string, isSub?: boolean): void;
}
}
export = M;

27
node_modules/@types/minimatch/package.json generated vendored Normal file
View file

@ -0,0 +1,27 @@
{
"name": "@types/minimatch",
"version": "3.0.3",
"description": "TypeScript definitions for Minimatch",
"license": "MIT",
"contributors": [
{
"name": "vvakame",
"url": "https://github.com/vvakame",
"githubUsername": "vvakame"
},
{
"name": "Shant Marouti",
"url": "https://github.com/shantmarouti",
"githubUsername": "shantmarouti"
}
],
"main": "",
"repository": {
"type": "git",
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "e768e36348874adcc93ac67e9c3c7b5fcbd39079c0610ec16e410b8f851308d1",
"typeScriptVersion": "2.0"
}

View file

@ -1,21 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

16
node_modules/@types/normalize-package-data/README.md generated vendored Executable file
View file

@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/normalize-package-data`
# Summary
This package contains type definitions for normalize-package-data (https://github.com/npm/normalize-package-data#readme).
# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/normalize-package-data
Additional Details
* Last updated: Sun, 07 Jan 2018 07:34:38 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by Jeff Dickey <https://github.com/jdxcode>.

46
node_modules/@types/normalize-package-data/index.d.ts generated vendored Executable file
View file

@ -0,0 +1,46 @@
// Type definitions for normalize-package-data 2.4
// Project: https://github.com/npm/normalize-package-data#readme
// Definitions by: Jeff Dickey <https://github.com/jdxcode>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = normalize;
declare function normalize(data: normalize.Input, warn?: normalize.WarnFn, strict?: boolean): void;
declare function normalize(data: normalize.Input, strict?: boolean): void;
declare namespace normalize {
type WarnFn = (msg: string) => void;
interface Input {[k: string]: any; }
interface Person {
name?: string;
email?: string;
url?: string;
}
interface Package {
[k: string]: any;
name: string;
version: string;
files?: string[];
bin?: {[k: string]: string };
man?: string[];
keywords?: string[];
author?: Person;
maintainers?: Person[];
contributors?: Person[];
bundleDependencies?: {[name: string]: string; };
dependencies?: {[name: string]: string; };
devDependencies?: {[name: string]: string; };
optionalDependencies?: {[name: string]: string; };
description?: string;
engines?: {[type: string]: string };
license?: string;
repository?: { type: string, url: string };
bugs?: { url: string, email?: string } | { url?: string, email: string };
homepage?: string;
scripts?: {[k: string]: string};
readme: string;
_id: string;
}
}

22
node_modules/@types/normalize-package-data/package.json generated vendored Executable file
View file

@ -0,0 +1,22 @@
{
"name": "@types/normalize-package-data",
"version": "2.4.0",
"description": "TypeScript definitions for normalize-package-data",
"license": "MIT",
"contributors": [
{
"name": "Jeff Dickey",
"url": "https://github.com/jdxcode",
"githubUsername": "jdxcode"
}
],
"main": "",
"repository": {
"type": "git",
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "5d2101e9e55c73e1d649a6c311e0d40bdfaa25bb06bb75ea6f3bb0d149c1303b",
"typeScriptVersion": "2.0"
}

21
node_modules/@types/prettier/LICENSE generated vendored
View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/prettier`
# Summary
This package contains type definitions for prettier (https://github.com/prettier/prettier).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/prettier.
### Additional Details
* Last updated: Sun, 22 Mar 2020 21:07:03 GMT
* Dependencies: none
* Global values: `prettier`
# Credits
These definitions were written by [Ika](https://github.com/ikatyang), [Ifiok Jr.](https://github.com/ifiokjr), [Florian Keller](https://github.com/ffflorian), and [Sosuke Suzuki](https://github.com/sosukesuzuki).

View file

@ -1,531 +0,0 @@
// Type definitions for prettier 1.19
// Project: https://github.com/prettier/prettier, https://prettier.io
// Definitions by: Ika <https://github.com/ikatyang>,
// Ifiok Jr. <https://github.com/ifiokjr>,
// Florian Keller <https://github.com/ffflorian>,
// Sosuke Suzuki <https://github.com/sosukesuzuki>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.8
export type AST = any;
export type Doc = doc.builders.Doc;
// https://github.com/prettier/prettier/blob/master/src/common/fast-path.js
export interface FastPath<T = any> {
stack: any[];
getName(): null | PropertyKey;
getValue(): T;
getNode(count?: number): null | T;
getParentNode(count?: number): null | T;
call<U>(callback: (path: this) => U, ...names: PropertyKey[]): U;
each(callback: (path: this) => void, ...names: PropertyKey[]): void;
map<U>(callback: (path: this, index: number) => U, ...names: PropertyKey[]): U[];
}
export type BuiltInParser = (text: string, options?: any) => AST;
export type BuiltInParserName =
| 'babylon' // deprecated
| 'babel'
| 'babel-flow'
| 'flow'
| 'typescript'
| 'postcss' // deprecated
| 'css'
| 'less'
| 'scss'
| 'json'
| 'json5'
| 'json-stringify'
| 'graphql'
| 'markdown'
| 'vue'
| 'html'
| 'angular'
| 'mdx'
| 'yaml'
| 'lwc';
export type CustomParser = (text: string, parsers: Record<BuiltInParserName, BuiltInParser>, options: Options) => AST;
export interface Options extends Partial<RequiredOptions> {}
export interface RequiredOptions extends doc.printer.Options {
/**
* Print semicolons at the ends of statements.
* @default true
*/
semi: boolean;
/**
* Use single quotes instead of double quotes.
* @default false
*/
singleQuote: boolean;
/**
* Use single quotes in JSX.
* @default false
*/
jsxSingleQuote: boolean;
/**
* Print trailing commas wherever possible.
* @default 'none'
*/
trailingComma: 'none' | 'es5' | 'all';
/**
* Print spaces between brackets in object literals.
* @default true
*/
bracketSpacing: boolean;
/**
* Put the `>` of a multi-line JSX element at the end of the last line instead of being alone on the next line.
* @default false
*/
jsxBracketSameLine: boolean;
/**
* Format only a segment of a file.
* @default 0
*/
rangeStart: number;
/**
* Format only a segment of a file.
* @default Infinity
*/
rangeEnd: number;
/**
* Specify which parser to use.
*/
parser: BuiltInParserName | CustomParser;
/**
* Specify the input filepath. This will be used to do parser inference.
*/
filepath: string;
/**
* Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file.
* This is very useful when gradually transitioning large, unformatted codebases to prettier.
* @default false
*/
requirePragma: boolean;
/**
* Prettier can insert a special @format marker at the top of files specifying that
* the file has been formatted with prettier. This works well when used in tandem with
* the --require-pragma option. If there is already a docblock at the top of
* the file then this option will add a newline to it with the @format marker.
* @default false
*/
insertPragma: boolean;
/**
* By default, Prettier will wrap markdown text as-is since some services use a linebreak-sensitive renderer.
* In some cases you may want to rely on editor/viewer soft wrapping instead, so this option allows you to opt out.
* @default 'preserve'
*/
proseWrap:
| boolean // deprecated
| 'always'
| 'never'
| 'preserve';
/**
* Include parentheses around a sole arrow function parameter.
* @default 'avoid'
*/
arrowParens: 'avoid' | 'always';
/**
* The plugin API is in a beta state.
*/
plugins: Array<string | Plugin>;
/**
* How to handle whitespaces in HTML.
* @default 'css'
*/
htmlWhitespaceSensitivity: 'css' | 'strict' | 'ignore';
/**
* Which end of line characters to apply.
* @default 'auto'
*/
endOfLine: 'auto' | 'lf' | 'crlf' | 'cr';
/**
* Change when properties in objects are quoted.
* @default 'as-needed'
*/
quoteProps: 'as-needed' | 'consistent' | 'preserve';
/**
* Whether or not to indent the code inside <script> and <style> tags in Vue files.
* @default false
*/
vueIndentScriptAndStyle: boolean;
}
export interface ParserOptions extends RequiredOptions {
locStart: (node: any) => number;
locEnd: (node: any) => number;
originalText: string;
}
export interface Plugin {
languages?: SupportLanguage[];
parsers?: { [parserName: string]: Parser };
printers?: { [astFormat: string]: Printer };
options?: SupportOption[];
defaultOptions?: Partial<RequiredOptions>;
}
export interface Parser {
parse: (text: string, parsers: { [parserName: string]: Parser }, options: ParserOptions) => AST;
astFormat: string;
hasPragma?: (text: string) => boolean;
locStart: (node: any) => number;
locEnd: (node: any) => number;
preprocess?: (text: string, options: ParserOptions) => string;
}
export interface Printer {
print(
path: FastPath,
options: ParserOptions,
print: (path: FastPath) => Doc,
): Doc;
embed?: (
path: FastPath,
print: (path: FastPath) => Doc,
textToDoc: (text: string, options: Options) => Doc,
options: ParserOptions,
) => Doc | null;
insertPragma?: (text: string) => string;
/**
* @returns `null` if you want to remove this node
* @returns `void` if you want to use modified newNode
* @returns anything if you want to replace the node with it
*/
massageAstNode?: (node: any, newNode: any, parent: any) => any;
hasPrettierIgnore?: (path: FastPath) => boolean;
canAttachComment?: (node: any) => boolean;
willPrintOwnComments?: (path: FastPath) => boolean;
printComments?: (path: FastPath, print: (path: FastPath) => Doc, options: ParserOptions, needsSemi: boolean) => Doc;
handleComments?: {
ownLine?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean;
endOfLine?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean;
remaining?: (commentNode: any, text: string, options: ParserOptions, ast: any, isLastComment: boolean) => boolean;
};
}
export interface CursorOptions extends Options {
/**
* Specify where the cursor is.
*/
cursorOffset: number;
rangeStart?: never;
rangeEnd?: never;
}
export interface CursorResult {
formatted: string;
cursorOffset: number;
}
/**
* `format` is used to format text using Prettier. [Options](https://github.com/prettier/prettier#options) may be provided to override the defaults.
*/
export function format(source: string, options?: Options): string;
/**
* `check` checks to see if the file has been formatted with Prettier given those options and returns a `Boolean`.
* This is similar to the `--list-different` parameter in the CLI and is useful for running Prettier in CI scenarios.
*/
export function check(source: string, options?: Options): boolean;
/**
* `formatWithCursor` both formats the code, and translates a cursor position from unformatted code to formatted code.
* This is useful for editor integrations, to prevent the cursor from moving when code is formatted.
*
* The `cursorOffset` option should be provided, to specify where the cursor is. This option cannot be used with `rangeStart` and `rangeEnd`.
*/
export function formatWithCursor(source: string, options: CursorOptions): CursorResult;
export interface ResolveConfigOptions {
/**
* If set to `false`, all caching will be bypassed.
*/
useCache?: boolean;
/**
* Pass directly the path of the config file if you don't wish to search for it.
*/
config?: string;
/**
* If set to `true` and an `.editorconfig` file is in your project,
* Prettier will parse it and convert its properties to the corresponding prettier configuration.
* This configuration will be overridden by `.prettierrc`, etc. Currently,
* the following EditorConfig properties are supported:
* - indent_style
* - indent_size/tab_width
* - max_line_length
*/
editorconfig?: boolean;
}
/**
* `resolveConfig` can be used to resolve configuration for a given source file,
* passing its path as the first argument. The config search will start at the
* file path and continue to search up the directory.
* (You can use `process.cwd()` to start searching from the current directory).
*
* A promise is returned which will resolve to:
*
* - An options object, providing a [config file](https://github.com/prettier/prettier#configuration-file) was found.
* - `null`, if no file was found.
*
* The promise will be rejected if there was an error parsing the configuration file.
*/
export function resolveConfig(filePath: string, options?: ResolveConfigOptions): Promise<null | Options>;
export namespace resolveConfig {
function sync(filePath: string, options?: ResolveConfigOptions): null | Options;
}
/**
* `resolveConfigFile` can be used to find the path of the Prettier configuration file,
* that will be used when resolving the config (i.e. when calling `resolveConfig`).
*
* A promise is returned which will resolve to:
*
* - The path of the configuration file.
* - `null`, if no file was found.
*
* The promise will be rejected if there was an error parsing the configuration file.
*/
export function resolveConfigFile(filePath?: string): Promise<null | string>;
export namespace resolveConfigFile {
function sync(filePath?: string): null | string;
}
/**
* As you repeatedly call `resolveConfig`, the file system structure will be cached for performance. This function will clear the cache.
* Generally this is only needed for editor integrations that know that the file system has changed since the last format took place.
*/
export function clearConfigCache(): void;
export interface SupportLanguage {
name: string;
since?: string;
parsers: BuiltInParserName[] | string[];
group?: string;
tmScope?: string;
aceMode?: string;
codemirrorMode?: string;
codemirrorMimeType?: string;
aliases?: string[];
extensions?: string[];
filenames?: string[];
linguistLanguageId?: number;
vscodeLanguageIds?: string[];
}
export interface SupportOptionDefault {
since: string;
value: SupportOptionValue;
}
export interface SupportOption {
since?: string;
type: 'int' | 'boolean' | 'choice' | 'path';
array?: boolean;
deprecated?: string;
redirect?: SupportOptionRedirect;
description: string;
oppositeDescription?: string;
default: SupportOptionValue | SupportOptionDefault[];
range?: SupportOptionRange;
choices?: SupportOptionChoice[];
category: string;
}
export interface SupportOptionRedirect {
options: string;
value: SupportOptionValue;
}
export interface SupportOptionRange {
start: number;
end: number;
step: number;
}
export interface SupportOptionChoice {
value: boolean | string;
description?: string;
since?: string;
deprecated?: string;
redirect?: SupportOptionValue;
}
export type SupportOptionValue = number | boolean | string;
export interface SupportInfo {
languages: SupportLanguage[];
options: SupportOption[];
}
export interface FileInfoOptions {
ignorePath?: string;
withNodeModules?: boolean;
plugins?: string[];
resolveConfig?: boolean;
}
export interface FileInfoResult {
ignored: boolean;
inferredParser: string | null;
}
export function getFileInfo(filePath: string, options?: FileInfoOptions): Promise<FileInfoResult>;
export namespace getFileInfo {
function sync(filePath: string, options?: FileInfoOptions): FileInfoResult;
}
/**
* Returns an object representing the parsers, languages and file types Prettier supports.
* If `version` is provided (e.g. `"1.5.0"`), information for that version will be returned,
* otherwise information for the current version will be returned.
*/
export function getSupportInfo(version?: string): SupportInfo;
/**
* `version` field in `package.json`
*/
export const version: string;
// https://github.com/prettier/prettier/blob/master/src/common/util-shared.js
export namespace util {
function isNextLineEmpty(text: string, node: any, options: ParserOptions): boolean;
function isNextLineEmptyAfterIndex(text: string, index: number): boolean;
function getNextNonSpaceNonCommentCharacterIndex(text: string, node: any, options: ParserOptions): number;
function makeString(rawContent: string, enclosingQuote: "'" | '"', unescapeUnnecessaryEscapes: boolean): string;
function addLeadingComment(node: any, commentNode: any): void;
function addDanglingComment(node: any, commentNode: any): void;
function addTrailingComment(node: any, commentNode: any): void;
}
// https://github.com/prettier/prettier/blob/master/src/doc/index.js
export namespace doc {
namespace builders {
type Doc =
| string
| Align
| BreakParent
| Concat
| Fill
| Group
| IfBreak
| Indent
| Line
| LineSuffix
| LineSuffixBoundary;
interface Align {
type: 'align';
contents: Doc;
n: number | string | { type: 'root' };
}
interface BreakParent {
type: 'break-parent';
}
interface Concat {
type: 'concat';
parts: Doc[];
}
interface Fill {
type: 'fill';
parts: Doc[];
}
interface Group {
type: 'group';
contents: Doc;
break: boolean;
expandedStates: Doc[];
}
interface IfBreak {
type: 'if-break';
breakContents: Doc;
flatContents: Doc;
}
interface Indent {
type: 'indent';
contents: Doc;
}
interface Line {
type: 'line';
soft?: boolean;
hard?: boolean;
literal?: boolean;
}
interface LineSuffix {
type: 'line-suffix';
contents: Doc;
}
interface LineSuffixBoundary {
type: 'line-suffix-boundary';
}
function addAlignmentToDoc(doc: Doc, size: number, tabWidth: number): Doc;
function align(n: Align['n'], contents: Doc): Align;
const breakParent: BreakParent;
function concat(contents: Doc[]): Concat;
function conditionalGroup(states: Doc[], opts?: { shouldBreak: boolean }): Group;
function dedent(contents: Doc): Align;
function dedentToRoot(contents: Doc): Align;
function fill(parts: Doc[]): Fill;
function group(contents: Doc, opts?: { shouldBreak: boolean }): Group;
const hardline: Concat;
function ifBreak(breakContents: Doc, flatContents: Doc): IfBreak;
function indent(contents: Doc): Indent;
function join(separator: Doc, parts: Doc[]): Concat;
const line: Line;
function lineSuffix(contents: Doc): LineSuffix;
const lineSuffixBoundary: LineSuffixBoundary;
const literalline: Concat;
function markAsRoot(contents: Doc): Align;
const softline: Line;
}
namespace debug {
function printDocToDebug(doc: Doc): string;
}
namespace printer {
function printDocToString(doc: Doc, options: Options): {
formatted: string;
cursorNodeStart?: number;
cursorNodeText?: string;
};
interface Options {
/**
* Specify the line length that the printer will wrap on.
* @default 80
*/
printWidth: number;
/**
* Specify the number of spaces per indentation-level.
* @default 2
*/
tabWidth: number;
/**
* Indent lines with tabs instead of spaces
* @default false
*/
useTabs: boolean;
}
}
namespace utils {
function isEmpty(doc: Doc): boolean;
function isLineNext(doc: Doc): boolean;
function willBreak(doc: Doc): boolean;
function traverseDoc(doc: Doc, onEnter?: (doc: Doc) => void | boolean, onExit?: (doc: Doc) => void, shouldTraverseConditionalGroups?: boolean): void;
function mapDoc<T>(doc: Doc, callback: (doc: Doc) => T): T;
function propagateBreaks(doc: Doc): void;
function removeLines(doc: Doc): Doc;
function stripTrailingHardline(doc: Doc): Doc;
}
}

View file

@ -1,39 +0,0 @@
{
"name": "@types/prettier",
"version": "1.19.1",
"description": "TypeScript definitions for prettier",
"license": "MIT",
"contributors": [
{
"name": "Ika",
"url": "https://github.com/ikatyang",
"githubUsername": "ikatyang"
},
{
"name": "Ifiok Jr.",
"url": "https://github.com/ifiokjr",
"githubUsername": "ifiokjr"
},
{
"name": "Florian Keller",
"url": "https://github.com/ffflorian",
"githubUsername": "ffflorian"
},
{
"name": "Sosuke Suzuki",
"url": "https://github.com/sosukesuzuki",
"githubUsername": "sosukesuzuki"
}
],
"main": "",
"types": "index.d.ts",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/prettier"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "96ef5cd93f13c2840478ad6701394292ed47245d3340dd8315789b0a6892d1e4",
"typeScriptVersion": "2.8"
}

View file

@ -1,4 +0,0 @@
import { Parser } from './';
declare const parser: { parsers: { [parserName: string]: Parser } };
export = parser;

View file

@ -1,4 +0,0 @@
import { Parser } from './';
declare const parser: { parsers: { [parserName: string]: Parser } };
export = parser;

View file

@ -1,4 +0,0 @@
import { Parser } from './';
declare const parser: { parsers: { [parserName: string]: Parser } };
export = parser;

View file

@ -1,4 +0,0 @@
import { Parser } from './';
declare const parser: { parsers: { [parserName: string]: Parser } };
export = parser;

View file

@ -1,4 +0,0 @@
import { Parser } from './';
declare const parser: { parsers: { [parserName: string]: Parser } };
export = parser;

View file

@ -1,4 +0,0 @@
import { Parser } from './';
declare const parser: { parsers: { [parserName: string]: Parser } };
export = parser;

View file

@ -1,4 +0,0 @@
import { Parser } from './';
declare const parser: { parsers: { [parserName: string]: Parser } };
export = parser;

View file

@ -1,4 +0,0 @@
import { Parser } from './';
declare const parser: { parsers: { [parserName: string]: Parser } };
export = parser;

View file

@ -1,4 +0,0 @@
import { Parser } from './';
declare const parser: { parsers: { [parserName: string]: Parser } };
export = parser;

View file

@ -1,30 +0,0 @@
import { CursorOptions, CursorResult, Options, Plugin } from './';
/**
* formatWithCursor both formats the code, and translates a cursor position from unformatted code to formatted code.
* This is useful for editor integrations, to prevent the cursor from moving when code is formatted
*
* The cursorOffset option should be provided, to specify where the cursor is. This option cannot be used with rangeStart and rangeEnd.
*
* ```js
* prettier.formatWithCursor(" 1", { cursorOffset: 2, parser: "babel" });
* ```
* `-> { formatted: '1;\n', cursorOffset: 1 }`
*/
export function formatWithCursor(
source: string,
options: CursorOptions,
): CursorResult;
/**
* `format` is used to format text using Prettier. [Options](https://github.com/prettier/prettier#options) may be provided to override the defaults.
*/
export function format(source: string, options?: Options): string;
/**
* `check` checks to see if the file has been formatted with Prettier given those options and returns a `Boolean`.
* This is similar to the `--list-different` parameter in the CLI and is useful for running Prettier in CI scenarios.
*/
export function check(source: string, options?: Options): boolean;
export as namespace prettier;

View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/stack-utils`
# Summary
This package contains type definitions for stack-utils (https://github.com/tapjs/stack-utils#readme).
# Details
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/stack-utils
Additional Details
* Last updated: Tue, 07 Nov 2017 17:49:01 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by BendingBender <https://github.com/BendingBender>.

View file

@ -1,64 +0,0 @@
// Type definitions for stack-utils 1.0
// Project: https://github.com/tapjs/stack-utils#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
export = StackUtils;
declare class StackUtils {
static nodeInternals(): RegExp[];
constructor(options?: StackUtils.Options);
clean(stack: string | string[]): string;
capture(limit?: number, startStackFunction?: Function): StackUtils.CallSite[];
capture(startStackFunction: Function): StackUtils.CallSite[];
captureString(limit?: number, startStackFunction?: Function): string;
captureString(startStackFunction: Function): string;
at(startStackFunction?: Function): StackUtils.CallSiteLike;
parseLine(line: string): StackUtils.StackLineData | null;
}
declare namespace StackUtils {
interface Options {
internals?: RegExp[];
cwd?: string;
wrapCallSite?(callSite: CallSite): CallSite;
}
interface CallSite {
getThis(): object | undefined;
getTypeName(): string;
getFunction(): Function | undefined;
getFunctionName(): string;
getMethodName(): string | null;
getFileName(): string | undefined;
getLineNumber(): number;
getColumnNumber(): number;
getEvalOrigin(): CallSite | string;
isToplevel(): boolean;
isEval(): boolean;
isNative(): boolean;
isConstructor(): boolean;
}
interface CallSiteLike extends StackData {
type?: string;
}
interface StackLineData extends StackData {
evalLine?: number;
evalColumn?: number;
evalFile?: string;
}
interface StackData {
line?: number;
column?: number;
file?: string;
constructor?: boolean;
evalOrigin?: string;
native?: boolean;
function?: string;
method?: string;
}
}

View file

@ -1,22 +0,0 @@
{
"name": "@types/stack-utils",
"version": "1.0.1",
"description": "TypeScript definitions for stack-utils",
"license": "MIT",
"contributors": [
{
"name": "BendingBender",
"url": "https://github.com/BendingBender",
"githubUsername": "BendingBender"
}
],
"main": "",
"repository": {
"type": "git",
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "c3d5963386c8535320c11b5edfb22c4bf60fb3e4bcbca34f094f7026b9749d86",
"typeScriptVersion": "2.2"
}

View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/yargs-parser`
# Summary
This package contains type definitions for yargs-parser (https://github.com/yargs/yargs-parser#readme).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs-parser
Additional Details
* Last updated: Thu, 05 Sep 2019 18:22:48 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by Miles Johnson <https://github.com/milesj>.

View file

@ -1,104 +0,0 @@
// Type definitions for yargs-parser 13.1
// Project: https://github.com/yargs/yargs-parser#readme
// Definitions by: Miles Johnson <https://github.com/milesj>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
declare namespace yargsParser {
interface Arguments {
/** Non-option arguments */
_: string[];
/** The script name or node command */
$0: string;
/** All remaining options */
[argName: string]: any;
}
interface DetailedArguments {
/** An object representing the parsed value of `args` */
argv: Arguments;
/** Populated with an error object if an exception occurred during parsing. */
error: Error | null;
/** The inferred list of aliases built by combining lists in opts.alias. */
aliases: { [alias: string]: string[] };
/** Any new aliases added via camel-case expansion. */
newAliases: { [alias: string]: boolean };
/** The configuration loaded from the yargs stanza in package.json. */
configuration: Configuration;
}
interface Configuration {
/** Should variables prefixed with --no be treated as negations? Default is `true` */
'boolean-negation': boolean;
/** Should hyphenated arguments be expanded into camel-case aliases? Default is `true` */
'camel-case-expansion': boolean;
/** Should arrays be combined when provided by both command line arguments and a configuration file. Default is `false` */
'combine-arrays': boolean;
/** Should keys that contain . be treated as objects? Default is `true` */
'dot-notation': boolean;
/** Should arguments be coerced into an array when duplicated. Default is `true` */
'duplicate-arguments-array': boolean;
/** Should array arguments be coerced into a single array when duplicated. Default is `true` */
'flatten-duplicate-arrays': boolean;
/** Should parsing stop at the first text argument? This is similar to how e.g. ssh parses its command line. Default is `false` */
'halt-at-non-option': boolean;
/** The prefix to use for negated boolean variables. Default is `'no-'` */
'negation-prefix': string;
/** Should keys that look like numbers be treated as such? Default is `true` */
'parse-numbers': boolean;
/** Should unparsed flags be stored in -- or _. Default is `false` */
'populate--': boolean;
/** Should a placeholder be added for keys not set via the corresponding CLI argument? Default is `false` */
'set-placeholder-key': boolean;
/** Should a group of short-options be treated as boolean flags? Default is `true` */
'short-option-groups': boolean;
/** Should aliases be removed before returning results? Default is `false` */
'strip-aliased': boolean;
/** Should dashed keys be removed before returning results? This option has no effect if camel-case-expansion is disabled. Default is `false` */
'strip-dashed': boolean;
}
interface Options {
/** An object representing the set of aliases for a key: `{ alias: { foo: ['f']} }`. */
alias?: { [key: string]: string | string[] };
/**
* Indicate that keys should be parsed as an array: `{ array: ['foo', 'bar'] }`.
* Indicate that keys should be parsed as an array and coerced to booleans / numbers:
* { array: [ { key: 'foo', boolean: true }, {key: 'bar', number: true} ] }`.
*/
array?: string[] | Array<{ key: string; boolean?: boolean, number?: boolean }>;
/** Arguments should be parsed as booleans: `{ boolean: ['x', 'y'] }`. */
boolean?: string[];
/** Indicate a key that represents a path to a configuration file (this file will be loaded and parsed). */
config?: string | string[] | { [key: string]: boolean };
/** Provide configuration options to the yargs-parser. */
configuration?: Partial<Configuration>;
/**
* Provide a custom synchronous function that returns a coerced value from the argument provided (or throws an error), e.g.
* `{ coerce: { foo: function (arg) { return modifiedArg } } }`.
*/
coerce?: { [key: string]: (arg: any) => any };
/** Indicate a key that should be used as a counter, e.g., `-vvv = {v: 3}`. */
count?: string[];
/** Provide default values for keys: `{ default: { x: 33, y: 'hello world!' } }`. */
default?: { [key: string]: any };
/** Environment variables (`process.env`) with the prefix provided should be parsed. */
envPrefix?: string;
/** Specify that a key requires n arguments: `{ narg: {x: 2} }`. */
narg?: { [key: string]: number };
/** `path.normalize()` will be applied to values set to this key. */
normalize?: string[];
/** Keys should be treated as strings (even if they resemble a number `-x 33`). */
string?: string[];
/** Keys should be treated as numbers. */
number?: string[];
}
interface Parser {
(argv: string | string[], opts?: Options): Arguments;
detailed(argv: string | string[], opts?: Options): DetailedArguments;
}
}
declare var yargsParser: yargsParser.Parser;
export = yargsParser;

View file

@ -1,24 +0,0 @@
{
"name": "@types/yargs-parser",
"version": "13.1.0",
"description": "TypeScript definitions for yargs-parser",
"license": "MIT",
"contributors": [
{
"name": "Miles Johnson",
"url": "https://github.com/milesj",
"githubUsername": "milesj"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/yargs-parser"
},
"scripts": {},
"dependencies": {},
"typesPublisherContentHash": "72de0ca12c18b0e895e8b04198e0599f4b08e2766251f330f2c7e8a1b008986d",
"typeScriptVersion": "2.2"
}

21
node_modules/@types/yargs/LICENSE generated vendored
View file

@ -1,21 +0,0 @@
MIT License
Copyright (c) Microsoft Corporation. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE

16
node_modules/@types/yargs/README.md generated vendored
View file

@ -1,16 +0,0 @@
# Installation
> `npm install --save @types/yargs`
# Summary
This package contains type definitions for yargs (https://github.com/chevex/yargs).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs
Additional Details
* Last updated: Wed, 25 Sep 2019 16:10:32 GMT
* Dependencies: @types/yargs-parser
* Global values: none
# Credits
These definitions were written by Martin Poelstra <https://github.com/poelstra>, Mizunashi Mana <https://github.com/mizunashi-mana>, Jeffery Grajkowski <https://github.com/pushplay>, Jeff Kenney <https://github.com/jeffkenney>, Jimi (Dimitris) Charalampidis <https://github.com/JimiC>, Steffen Viken Valvåg <https://github.com/steffenvv>, Emily Marigold Klassen <https://github.com/forivall>, and ExE Boss <https://github.com/ExE-Boss>.

768
node_modules/@types/yargs/index.d.ts generated vendored
View file

@ -1,768 +0,0 @@
// Type definitions for yargs 13.0
// Project: https://github.com/chevex/yargs, https://yargs.js.org
// Definitions by: Martin Poelstra <https://github.com/poelstra>
// Mizunashi Mana <https://github.com/mizunashi-mana>
// Jeffery Grajkowski <https://github.com/pushplay>
// Jeff Kenney <https://github.com/jeffkenney>
// Jimi (Dimitris) Charalampidis <https://github.com/JimiC>
// Steffen Viken Valvåg <https://github.com/steffenvv>
// Emily Marigold Klassen <https://github.com/forivall>
// ExE Boss <https://github.com/ExE-Boss>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.0
// The following TSLint rules have been disabled:
// unified-signatures: Because there is useful information in the argument names of the overloaded signatures
// Convention:
// Use 'union types' when:
// - parameter types have similar signature type (i.e. 'string | ReadonlyArray<string>')
// - parameter names have the same semantic meaning (i.e. ['command', 'commands'] , ['key', 'keys'])
// An example for not using 'union types' is the declaration of 'env' where `prefix` and `enable` parameters
// have different semantics. On the other hand, in the declaration of 'usage', a `command: string` parameter
// has the same semantic meaning with declaring an overload method by using `commands: ReadonlyArray<string>`,
// thus it's preferred to use `command: string | ReadonlyArray<string>`
// Use parameterless declaration instead of declaring all parameters optional,
// when all parameters are optional and more than one
import { DetailedArguments, Configuration } from 'yargs-parser';
declare namespace yargs {
type BuilderCallback<T, R> = ((args: Argv<T>) => Argv<R>) | ((args: Argv<T>) => void);
/**
* The type parameter `T` is the expected shape of the parsed options.
* `Arguments<T>` is those options plus `_` and `$0`, and an indexer falling
* back to `unknown` for unknown options.
*
* For the return type / `argv` property, we create a mapped type over
* `Arguments<T>` to simplify the inferred type signature in client code.
*/
interface Argv<T = {}> {
(): { [key in keyof Arguments<T>]: Arguments<T>[key] };
(args: ReadonlyArray<string>, cwd?: string): Argv<T>;
/**
* Set key names as equivalent such that updates to a key will propagate to aliases and vice-versa.
*
* Optionally `.alias()` can take an object that maps keys to aliases.
* Each key of this object should be the canonical version of the option, and each value should be a string or an array of strings.
*/
// Aliases for previously declared options can inherit the types of those options.
alias<K1 extends keyof T, K2 extends string>(shortName: K1, longName: K2 | ReadonlyArray<K2>): Argv<T & { [key in K2]: T[K1] }>;
alias<K1 extends keyof T, K2 extends string>(shortName: K2, longName: K1 | ReadonlyArray<K1>): Argv<T & { [key in K2]: T[K1] }>;
alias(shortName: string | ReadonlyArray<string>, longName: string | ReadonlyArray<string>): Argv<T>;
alias(aliases: { [shortName: string]: string | ReadonlyArray<string> }): Argv<T>;
/**
* Get the arguments as a plain old object.
*
* Arguments without a corresponding flag show up in the `argv._` array.
*
* The script name or node command is available at `argv.$0` similarly to how `$0` works in bash or perl.
*
* If `yargs` is executed in an environment that embeds node and there's no script name (e.g. Electron or nw.js),
* it will ignore the first parameter since it expects it to be the script name. In order to override
* this behavior, use `.parse(process.argv.slice(1))` instead of .argv and the first parameter won't be ignored.
*/
argv: { [key in keyof Arguments<T>]: Arguments<T>[key] };
/**
* Tell the parser to interpret `key` as an array.
* If `.array('foo')` is set, `--foo foo bar` will be parsed as `['foo', 'bar']` rather than as `'foo'`.
* Also, if you use the option multiple times all the values will be flattened in one array so `--foo foo --foo bar` will be parsed as `['foo', 'bar']`
*
* When the option is used with a positional, use `--` to tell `yargs` to stop adding values to the array.
*/
array<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToArray<T[key]> }>;
array<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: Array<string | number> | undefined }>;
/**
* Interpret `key` as a boolean. If a non-flag option follows `key` in `process.argv`, that string won't get set as the value of `key`.
*
* `key` will default to `false`, unless a `default(key, undefined)` is explicitly set.
*
* If `key` is an array, interpret all the elements as booleans.
*/
boolean<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: boolean | undefined }>;
boolean<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: boolean | undefined }>;
/**
* Check that certain conditions are met in the provided arguments.
* @param func Called with two arguments, the parsed `argv` hash and an array of options and their aliases.
* If `func` throws or returns a non-truthy value, show the thrown error, usage information, and exit.
* @param global Indicates whether `check()` should be enabled both at the top-level and for each sub-command.
*/
check(func: (argv: Arguments<T>, aliases: { [alias: string]: string }) => any, global?: boolean): Argv<T>;
/**
* Limit valid values for key to a predefined set of choices, given as an array or as an individual value.
* If this method is called multiple times, all enumerated values will be merged together.
* Choices are generally strings or numbers, and value matching is case-sensitive.
*
* Optionally `.choices()` can take an object that maps multiple keys to their choices.
*
* Choices can also be specified as choices in the object given to `option()`.
*/
choices<K extends keyof T, C extends ReadonlyArray<any>>(key: K, values: C): Argv<Omit<T, K> & { [key in K]: C[number] | undefined }>;
choices<K extends string, C extends ReadonlyArray<any>>(key: K, values: C): Argv<T & { [key in K]: C[number] | undefined }>;
choices<C extends { [key: string]: ReadonlyArray<any> }>(choices: C): Argv<Omit<T, keyof C> & { [key in keyof C]: C[key][number] | undefined }>;
/**
* Provide a synchronous function to coerce or transform the value(s) given on the command line for `key`.
*
* The coercion function should accept one argument, representing the parsed value from the command line, and should return a new value or throw an error.
* The returned value will be used as the value for `key` (or one of its aliases) in `argv`.
*
* If the function throws, the error will be treated as a validation failure, delegating to either a custom `.fail()` handler or printing the error message in the console.
*
* Coercion will be applied to a value after all other modifications, such as `.normalize()`.
*
* Optionally `.coerce()` can take an object that maps several keys to their respective coercion function.
*
* You can also map the same function to several keys at one time. Just pass an array of keys as the first argument to `.coerce()`.
*
* If you are using dot-notion or arrays, .e.g., `user.email` and `user.password`, coercion will be applied to the final object that has been parsed
*/
coerce<K extends keyof T, V>(key: K | ReadonlyArray<K>, func: (arg: any) => V): Argv<Omit<T, K> & { [key in K]: V | undefined }>;
coerce<K extends string, V>(key: K | ReadonlyArray<K>, func: (arg: any) => V): Argv<T & { [key in K]: V | undefined }>;
coerce<O extends { [key: string]: (arg: any) => any }>(opts: O): Argv<Omit<T, keyof O> & { [key in keyof O]: ReturnType<O[key]> | undefined }>;
/**
* Define the commands exposed by your application.
* @param command Should be a string representing the command or an array of strings representing the command and its aliases.
* @param description Use to provide a description for each command your application accepts (the values stored in `argv._`).
* Set `description` to false to create a hidden command. Hidden commands don't show up in the help output and aren't available for completion.
* @param [builder] Object to give hints about the options that your command accepts.
* Can also be a function. This function is executed with a yargs instance, and can be used to provide advanced command specific help.
*
* Note that when `void` is returned, the handler `argv` object type will not include command-specific arguments.
* @param [handler] Function, which will be executed with the parsed `argv` object.
*/
command<U = T>(command: string | ReadonlyArray<string>, description: string, builder?: BuilderCallback<T, U>, handler?: (args: Arguments<U>) => void): Argv<T>;
command<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, description: string, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
command<U>(command: string | ReadonlyArray<string>, description: string, module: CommandModule<T, U>): Argv<U>;
command<U = T>(command: string | ReadonlyArray<string>, showInHelp: false, builder?: BuilderCallback<T, U>, handler?: (args: Arguments<U>) => void): Argv<T>;
command<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, showInHelp: false, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
command<U>(command: string | ReadonlyArray<string>, showInHelp: false, module: CommandModule<T, U>): Argv<U>;
command<U>(module: CommandModule<T, U>): Argv<U>;
// Advanced API
/** Apply command modules from a directory relative to the module calling this method. */
commandDir(dir: string, opts?: RequireDirectoryOptions): Argv<T>;
/**
* Enable bash/zsh-completion shortcuts for commands and options.
*
* If invoked without parameters, `.completion()` will make completion the command to output the completion script.
*
* @param [cmd] When present in `argv._`, will result in the `.bashrc` or `.zshrc` completion script being outputted.
* To enable bash/zsh completions, concat the generated script to your `.bashrc` or `.bash_profile` (or `.zshrc` for zsh).
* @param [description] Provide a description in your usage instructions for the command that generates the completion scripts.
* @param [func] Rather than relying on yargs' default completion functionality, which shiver me timbers is pretty awesome, you can provide your own completion method.
*/
completion(): Argv<T>;
completion(cmd: string, func?: AsyncCompletionFunction): Argv<T>;
completion(cmd: string, func?: SyncCompletionFunction): Argv<T>;
completion(cmd: string, func?: PromiseCompletionFunction): Argv<T>;
completion(cmd: string, description?: string | false, func?: AsyncCompletionFunction): Argv<T>;
completion(cmd: string, description?: string | false, func?: SyncCompletionFunction): Argv<T>;
completion(cmd: string, description?: string | false, func?: PromiseCompletionFunction): Argv<T>;
/**
* Tells the parser that if the option specified by `key` is passed in, it should be interpreted as a path to a JSON config file.
* The file is loaded and parsed, and its properties are set as arguments.
* Because the file is loaded using Node's require(), the filename MUST end in `.json` to be interpreted correctly.
*
* If invoked without parameters, `.config()` will make --config the option to pass the JSON config file.
*
* @param [description] Provided to customize the config (`key`) option in the usage string.
* @param [explicitConfigurationObject] An explicit configuration `object`
*/
config(): Argv<T>;
config(key: string | ReadonlyArray<string>, description?: string, parseFn?: (configPath: string) => object): Argv<T>;
config(key: string | ReadonlyArray<string>, parseFn: (configPath: string) => object): Argv<T>;
config(explicitConfigurationObject: object): Argv<T>;
/**
* Given the key `x` is set, the key `y` must not be set. `y` can either be a single string or an array of argument names that `x` conflicts with.
*
* Optionally `.conflicts()` can accept an object specifying multiple conflicting keys.
*/
conflicts(key: string, value: string | ReadonlyArray<string>): Argv<T>;
conflicts(conflicts: { [key: string]: string | ReadonlyArray<string> }): Argv<T>;
/**
* Interpret `key` as a boolean flag, but set its parsed value to the number of flag occurrences rather than `true` or `false`. Default value is thus `0`.
*/
count<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: number }>;
count<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number }>;
/**
* Set `argv[key]` to `value` if no option was specified in `process.argv`.
*
* Optionally `.default()` can take an object that maps keys to default values.
*
* The default value can be a `function` which returns a value. The name of the function will be used in the usage string.
*
* Optionally, `description` can also be provided and will take precedence over displaying the value in the usage instructions.
*/
default<K extends keyof T, V>(key: K, value: V, description?: string): Argv<Omit<T, K> & { [key in K]: V }>;
default<K extends string, V>(key: K, value: V, description?: string): Argv<T & { [key in K]: V }>;
default<D extends { [key: string]: any }>(defaults: D, description?: string): Argv<Omit<T, keyof D> & D>;
/**
* @deprecated since version 6.6.0
* Use '.demandCommand()' or '.demandOption()' instead
*/
demand<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
demand<K extends string>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<T & { [key in K]: unknown }>;
demand(key: string | ReadonlyArray<string>, required?: boolean): Argv<T>;
demand(positionals: number, msg: string): Argv<T>;
demand(positionals: number, required?: boolean): Argv<T>;
demand(positionals: number, max: number, msg?: string): Argv<T>;
/**
* @param key If is a string, show the usage information and exit if key wasn't specified in `process.argv`.
* If is an array, demand each element.
* @param msg If string is given, it will be printed when the argument is missing, instead of the standard error message.
* @param demand Controls whether the option is demanded; this is useful when using .options() to specify command line parameters.
*/
demandOption<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
demandOption<K extends string>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<T & { [key in K]: unknown }>;
demandOption(key: string | ReadonlyArray<string>, demand?: boolean): Argv<T>;
/**
* Demand in context of commands.
* You can demand a minimum and a maximum number a user can have within your program, as well as provide corresponding error messages if either of the demands is not met.
*/
demandCommand(): Argv<T>;
demandCommand(min: number, minMsg?: string): Argv<T>;
demandCommand(min: number, max?: number, minMsg?: string, maxMsg?: string): Argv<T>;
/**
* Describe a `key` for the generated usage information.
*
* Optionally `.describe()` can take an object that maps keys to descriptions.
*/
describe(key: string | ReadonlyArray<string>, description: string): Argv<T>;
describe(descriptions: { [key: string]: string }): Argv<T>;
/** Should yargs attempt to detect the os' locale? Defaults to `true`. */
detectLocale(detect: boolean): Argv<T>;
/**
* Tell yargs to parse environment variables matching the given prefix and apply them to argv as though they were command line arguments.
*
* Use the "__" separator in the environment variable to indicate nested options. (e.g. prefix_nested__foo => nested.foo)
*
* If this method is called with no argument or with an empty string or with true, then all env vars will be applied to argv.
*
* Program arguments are defined in this order of precedence:
* 1. Command line args
* 2. Env vars
* 3. Config file/objects
* 4. Configured defaults
*
* Env var parsing is disabled by default, but you can also explicitly disable it by calling `.env(false)`, e.g. if you need to undo previous configuration.
*/
env(): Argv<T>;
env(prefix: string): Argv<T>;
env(enable: boolean): Argv<T>;
/** A message to print at the end of the usage instructions */
epilog(msg: string): Argv<T>;
/** A message to print at the end of the usage instructions */
epilogue(msg: string): Argv<T>;
/**
* Give some example invocations of your program.
* Inside `cmd`, the string `$0` will get interpolated to the current script name or node command for the present script similar to how `$0` works in bash or perl.
* Examples will be printed out as part of the help message.
*/
example(command: string, description: string): Argv<T>;
/** Manually indicate that the program should exit, and provide context about why we wanted to exit. Follows the behavior set by `.exitProcess().` */
exit(code: number, err: Error): void;
/**
* By default, yargs exits the process when the user passes a help flag, the user uses the `.version` functionality, validation fails, or the command handler fails.
* Calling `.exitProcess(false)` disables this behavior, enabling further actions after yargs have been validated.
*/
exitProcess(enabled: boolean): Argv<T>;
/**
* Method to execute when a failure occurs, rather than printing the failure message.
* @param func Is called with the failure message that would have been printed, the Error instance originally thrown and yargs state when the failure occurred.
*/
fail(func: (msg: string, err: Error) => any): Argv<T>;
/**
* Allows to programmatically get completion choices for any line.
* @param args An array of the words in the command line to complete.
* @param done The callback to be called with the resulting completions.
*/
getCompletion(args: ReadonlyArray<string>, done: (completions: ReadonlyArray<string>) => void): Argv<T>;
/**
* Indicate that an option (or group of options) should not be reset when a command is executed
*
* Options default to being global.
*/
global(key: string | ReadonlyArray<string>): Argv<T>;
/** Given a key, or an array of keys, places options under an alternative heading when displaying usage instructions */
group(key: string | ReadonlyArray<string>, groupName: string): Argv<T>;
/** Hides a key from the generated usage information. Unless a `--show-hidden` option is also passed with `--help` (see `showHidden()`). */
hide(key: string): Argv<T>;
/**
* Configure an (e.g. `--help`) and implicit command that displays the usage string and exits the process.
* By default yargs enables help on the `--help` option.
*
* Note that any multi-char aliases (e.g. `help`) used for the help option will also be used for the implicit command.
* If there are no multi-char aliases (e.g. `h`), then all single-char aliases will be used for the command.
*
* If invoked without parameters, `.help()` will use `--help` as the option and help as the implicit command to trigger help output.
*
* @param [description] Customizes the description of the help option in the usage string.
* @param [enableExplicit] If `false` is provided, it will disable --help.
*/
help(): Argv<T>;
help(enableExplicit: boolean): Argv<T>;
help(option: string, enableExplicit: boolean): Argv<T>;
help(option: string, description?: string, enableExplicit?: boolean): Argv<T>;
/**
* Given the key `x` is set, it is required that the key `y` is set.
* y` can either be the name of an argument to imply, a number indicating the position of an argument or an array of multiple implications to associate with `x`.
*
* Optionally `.implies()` can accept an object specifying multiple implications.
*/
implies(key: string, value: string | ReadonlyArray<string>): Argv<T>;
implies(implies: { [key: string]: string | ReadonlyArray<string> }): Argv<T>;
/**
* Return the locale that yargs is currently using.
*
* By default, yargs will auto-detect the operating system's locale so that yargs-generated help content will display in the user's language.
*/
locale(): string;
/**
* Override the auto-detected locale from the user's operating system with a static locale.
* Note that the OS locale can be modified by setting/exporting the `LC_ALL` environment variable.
*/
locale(loc: string): Argv<T>;
/**
* Define global middleware functions to be called first, in list order, for all cli command.
* @param callbacks Can be a function or a list of functions. Each callback gets passed a reference to argv.
* @param [applyBeforeValidation] Set to `true` to apply middleware before validation. This will execute the middleware prior to validation checks, but after parsing.
*/
middleware(callbacks: MiddlewareFunction<T> | ReadonlyArray<MiddlewareFunction<T>>, applyBeforeValidation?: boolean): Argv<T>;
/**
* The number of arguments that should be consumed after a key. This can be a useful hint to prevent parsing ambiguity.
*
* Optionally `.nargs()` can take an object of `key`/`narg` pairs.
*/
nargs(key: string, count: number): Argv<T>;
nargs(nargs: { [key: string]: number }): Argv<T>;
/** The key provided represents a path and should have `path.normalize()` applied. */
normalize<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>;
normalize<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>;
/**
* Tell the parser to always interpret key as a number.
*
* If `key` is an array, all elements will be parsed as numbers.
*
* If the option is given on the command line without a value, `argv` will be populated with `undefined`.
*
* If the value given on the command line cannot be parsed as a number, `argv` will be populated with `NaN`.
*
* Note that decimals, hexadecimals, and scientific notation are all accepted.
*/
number<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToNumber<T[key]> }>;
number<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: number | undefined }>;
/**
* This method can be used to make yargs aware of options that could exist.
* You can also pass an opt object which can hold further customization, like `.alias()`, `.demandOption()` etc. for that option.
*/
option<K extends keyof T, O extends Options>(key: K, options: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
option<K extends string, O extends Options>(key: K, options: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
option<O extends { [key: string]: Options }>(options: O): Argv<Omit<T, keyof O> & InferredOptionTypes<O>>;
/**
* This method can be used to make yargs aware of options that could exist.
* You can also pass an opt object which can hold further customization, like `.alias()`, `.demandOption()` etc. for that option.
*/
options<K extends keyof T, O extends Options>(key: K, options: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
options<K extends string, O extends Options>(key: K, options: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
options<O extends { [key: string]: Options }>(options: O): Argv<Omit<T, keyof O> & InferredOptionTypes<O>>;
/**
* Parse `args` instead of `process.argv`. Returns the `argv` object. `args` may either be a pre-processed argv array, or a raw argument string.
*
* Note: Providing a callback to parse() disables the `exitProcess` setting until after the callback is invoked.
* @param [context] Provides a useful mechanism for passing state information to commands
*/
parse(): { [key in keyof Arguments<T>]: Arguments<T>[key] };
parse(arg: string | ReadonlyArray<string>, context?: object, parseCallback?: ParseCallback<T>): { [key in keyof Arguments<T>]: Arguments<T>[key] };
/**
* If the arguments have not been parsed, this property is `false`.
*
* If the arguments have been parsed, this contain detailed parsed arguments.
*/
parsed: DetailedArguments | false;
/** Allows to configure advanced yargs features. */
parserConfiguration(configuration: Partial<Configuration>): Argv<T>;
/**
* Similar to `config()`, indicates that yargs should interpret the object from the specified key in package.json as a configuration object.
* @param [cwd] If provided, the package.json will be read from this location
*/
pkgConf(key: string | ReadonlyArray<string>, cwd?: string): Argv<T>;
/**
* Allows you to configure a command's positional arguments with an API similar to `.option()`.
* `.positional()` should be called in a command's builder function, and is not available on the top-level yargs instance. If so, it will throw an error.
*/
positional<K extends keyof T, O extends PositionalOptions>(key: K, opt: O): Argv<Omit<T, K> & { [key in K]: InferredOptionType<O> }>;
positional<K extends string, O extends PositionalOptions>(key: K, opt: O): Argv<T & { [key in K]: InferredOptionType<O> }>;
/** Should yargs provide suggestions regarding similar commands if no matching command is found? */
recommendCommands(): Argv<T>;
/**
* @deprecated since version 6.6.0
* Use '.demandCommand()' or '.demandOption()' instead
*/
require<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
require(key: string, msg: string): Argv<T>;
require(key: string, required: boolean): Argv<T>;
require(keys: ReadonlyArray<number>, msg: string): Argv<T>;
require(keys: ReadonlyArray<number>, required: boolean): Argv<T>;
require(positionals: number, required: boolean): Argv<T>;
require(positionals: number, msg: string): Argv<T>;
/**
* @deprecated since version 6.6.0
* Use '.demandCommand()' or '.demandOption()' instead
*/
required<K extends keyof T>(key: K | ReadonlyArray<K>, msg?: string | true): Argv<Defined<T, K>>;
required(key: string, msg: string): Argv<T>;
required(key: string, required: boolean): Argv<T>;
required(keys: ReadonlyArray<number>, msg: string): Argv<T>;
required(keys: ReadonlyArray<number>, required: boolean): Argv<T>;
required(positionals: number, required: boolean): Argv<T>;
required(positionals: number, msg: string): Argv<T>;
requiresArg(key: string | ReadonlyArray<string>): Argv<T>;
/**
* @deprecated since version 6.6.0
* Use '.global()' instead
*/
reset(): Argv<T>;
/** Set the name of your script ($0). Default is the base filename executed by node (`process.argv[1]`) */
scriptName($0: string): Argv<T>;
/**
* Generate a bash completion script.
* Users of your application can install this script in their `.bashrc`, and yargs will provide completion shortcuts for commands and options.
*/
showCompletionScript(): Argv<T>;
/**
* Configure the `--show-hidden` option that displays the hidden keys (see `hide()`).
* @param option If `boolean`, it enables/disables this option altogether. i.e. hidden keys will be permanently hidden if first argument is `false`.
* If `string` it changes the key name ("--show-hidden").
* @param description Changes the default description ("Show hidden options")
*/
showHidden(option?: string | boolean): Argv<T>;
showHidden(option: string, description?: string): Argv<T>;
/**
* Print the usage data using the console function consoleLevel for printing.
* @param [consoleLevel='error']
*/
showHelp(consoleLevel?: string): Argv<T>;
/**
* By default, yargs outputs a usage string if any error is detected.
* Use the `.showHelpOnFail()` method to customize this behavior.
* @param enable If `false`, the usage string is not output.
* @param [message] Message that is output after the error message.
*/
showHelpOnFail(enable: boolean, message?: string): Argv<T>;
/** Specifies either a single option key (string), or an array of options. If any of the options is present, yargs validation is skipped. */
skipValidation(key: string | ReadonlyArray<string>): Argv<T>;
/**
* Any command-line argument given that is not demanded, or does not have a corresponding description, will be reported as an error.
*
* Unrecognized commands will also be reported as errors.
*/
strict(): Argv<T>;
strict(enabled: boolean): Argv<T>;
/**
* Tell the parser logic not to interpret `key` as a number or boolean. This can be useful if you need to preserve leading zeros in an input.
*
* If `key` is an array, interpret all the elements as strings.
*
* `.string('_')` will result in non-hyphenated arguments being interpreted as strings, regardless of whether they resemble numbers.
*/
string<K extends keyof T>(key: K | ReadonlyArray<K>): Argv<Omit<T, K> & { [key in K]: ToString<T[key]> }>;
string<K extends string>(key: K | ReadonlyArray<K>): Argv<T & { [key in K]: string | undefined }>;
// Intended to be used with '.wrap()'
terminalWidth(): number;
updateLocale(obj: { [key: string]: string }): Argv<T>;
/**
* Override the default strings used by yargs with the key/value pairs provided in obj
*
* If you explicitly specify a locale(), you should do so before calling `updateStrings()`.
*/
updateStrings(obj: { [key: string]: string }): Argv<T>;
/**
* Set a usage message to show which commands to use.
* Inside `message`, the string `$0` will get interpolated to the current script name or node command for the present script similar to how `$0` works in bash or perl.
*
* If the optional `description`/`builder`/`handler` are provided, `.usage()` acts an an alias for `.command()`.
* This allows you to use `.usage()` to configure the default command that will be run as an entry-point to your application
* and allows you to provide configuration for the positional arguments accepted by your program:
*/
usage(message: string): Argv<T>;
usage<U>(command: string | ReadonlyArray<string>, description: string, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>;
usage<U>(command: string | ReadonlyArray<string>, showInHelp: boolean, builder?: (args: Argv<T>) => Argv<U>, handler?: (args: Arguments<U>) => void): Argv<T>;
usage<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, description: string, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
usage<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, showInHelp: boolean, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
/**
* Add an option (e.g. `--version`) that displays the version number (given by the version parameter) and exits the process.
* By default yargs enables version for the `--version` option.
*
* If no arguments are passed to version (`.version()`), yargs will parse the package.json of your module and use its version value.
*
* If the boolean argument `false` is provided, it will disable `--version`.
*/
version(): Argv<T>;
version(version: string): Argv<T>;
version(enable: boolean): Argv<T>;
version(optionKey: string, version: string): Argv<T>;
version(optionKey: string, description: string, version: string): Argv<T>;
/**
* Format usage output to wrap at columns many columns.
*
* By default wrap will be set to `Math.min(80, windowWidth)`. Use `.wrap(null)` to specify no column limit (no right-align).
* Use `.wrap(yargs.terminalWidth())` to maximize the width of yargs' usage instructions.
*/
wrap(columns: number | null): Argv<T>;
}
type Arguments<T = {}> = T & {
/** Non-option arguments */
_: string[];
/** The script name or node command */
$0: string;
/** All remaining options */
[argName: string]: unknown;
};
interface RequireDirectoryOptions {
/** Look for command modules in all subdirectories and apply them as a flattened (non-hierarchical) list. */
recurse?: boolean;
/** The types of files to look for when requiring command modules. */
extensions?: ReadonlyArray<string>;
/**
* A synchronous function called for each command module encountered.
* Accepts `commandObject`, `pathToFile`, and `filename` as arguments.
* Returns `commandObject` to include the command; any falsy value to exclude/skip it.
*/
visit?: (commandObject: any, pathToFile?: string, filename?: string) => any;
/** Whitelist certain modules */
include?: RegExp | ((pathToFile: string) => boolean);
/** Blacklist certain modules. */
exclude?: RegExp | ((pathToFile: string) => boolean);
}
interface Options {
/** string or array of strings, alias(es) for the canonical option key, see `alias()` */
alias?: string | ReadonlyArray<string>;
/** boolean, interpret option as an array, see `array()` */
array?: boolean;
/** boolean, interpret option as a boolean flag, see `boolean()` */
boolean?: boolean;
/** value or array of values, limit valid option arguments to a predefined set, see `choices()` */
choices?: Choices;
/** function, coerce or transform parsed command line values into another value, see `coerce()` */
coerce?: (arg: any) => any;
/** boolean, interpret option as a path to a JSON config file, see `config()` */
config?: boolean;
/** function, provide a custom config parsing function, see `config()` */
configParser?: (configPath: string) => object;
/** string or object, require certain keys not to be set, see `conflicts()` */
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
/** boolean, interpret option as a count of boolean flags, see `count()` */
count?: boolean;
/** value, set a default value for the option, see `default()` */
default?: any;
/** string, use this description for the default value in help content, see `default()` */
defaultDescription?: string;
/**
* @deprecated since version 6.6.0
* Use 'demandOption' instead
*/
demand?: boolean | string;
/** boolean or string, demand the option be given, with optional error message, see `demandOption()` */
demandOption?: boolean | string;
/** string, the option description for help content, see `describe()` */
desc?: string;
/** string, the option description for help content, see `describe()` */
describe?: string;
/** string, the option description for help content, see `describe()` */
description?: string;
/** boolean, indicate that this key should not be reset when a command is invoked, see `global()` */
global?: boolean;
/** string, when displaying usage instructions place the option under an alternative group heading, see `group()` */
group?: string;
/** don't display option in help output. */
hidden?: boolean;
/** string or object, require certain keys to be set, see `implies()` */
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
/** number, specify how many arguments should be consumed for the option, see `nargs()` */
nargs?: number;
/** boolean, apply path.normalize() to the option, see `normalize()` */
normalize?: boolean;
/** boolean, interpret option as a number, `number()` */
number?: boolean;
/**
* @deprecated since version 6.6.0
* Use 'demandOption' instead
*/
require?: boolean | string;
/**
* @deprecated since version 6.6.0
* Use 'demandOption' instead
*/
required?: boolean | string;
/** boolean, require the option be specified with a value, see `requiresArg()` */
requiresArg?: boolean;
/** boolean, skips validation if the option is present, see `skipValidation()` */
skipValidation?: boolean;
/** boolean, interpret option as a string, see `string()` */
string?: boolean;
type?: "array" | "count" | PositionalOptionsType;
}
interface PositionalOptions {
/** string or array of strings, see `alias()` */
alias?: string | ReadonlyArray<string>;
/** value or array of values, limit valid option arguments to a predefined set, see `choices()` */
choices?: Choices;
/** function, coerce or transform parsed command line values into another value, see `coerce()` */
coerce?: (arg: any) => any;
/** string or object, require certain keys not to be set, see `conflicts()` */
conflicts?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
/** value, set a default value for the option, see `default()` */
default?: any;
/** string, the option description for help content, see `describe()` */
desc?: string;
/** string, the option description for help content, see `describe()` */
describe?: string;
/** string, the option description for help content, see `describe()` */
description?: string;
/** string or object, require certain keys to be set, see `implies()` */
implies?: string | ReadonlyArray<string> | { [key: string]: string | ReadonlyArray<string> };
/** boolean, apply path.normalize() to the option, see normalize() */
normalize?: boolean;
type?: PositionalOptionsType;
}
/** Remove keys K in T */
type Omit<T, K> = { [key in Exclude<keyof T, K>]: T[key] };
/** Remove undefined as a possible value for keys K in T */
type Defined<T, K extends keyof T> = Omit<T, K> & { [key in K]: Exclude<T[key], undefined> };
/** Convert T to T[] and T | undefined to T[] | undefined */
type ToArray<T> = Array<Exclude<T, undefined>> | Extract<T, undefined>;
/** Gives string[] if T is an array type, otherwise string. Preserves | undefined. */
type ToString<T> = (Exclude<T, undefined> extends any[] ? string[] : string) | Extract<T, undefined>;
/** Gives number[] if T is an array type, otherwise number. Preserves | undefined. */
type ToNumber<T> = (Exclude<T, undefined> extends any[] ? number[] : number) | Extract<T, undefined>;
type InferredOptionType<O extends Options | PositionalOptions> =
O extends { default: infer D } ? D :
O extends { type: "count" } ? number :
O extends { count: true } ? number :
O extends { required: string | true } ? RequiredOptionType<O> :
O extends { require: string | true } ? RequiredOptionType<O> :
O extends { demand: string | true } ? RequiredOptionType<O> :
O extends { demandOption: string | true } ? RequiredOptionType<O> :
RequiredOptionType<O> | undefined;
type RequiredOptionType<O extends Options | PositionalOptions> =
O extends { type: "array", string: true } ? string[] :
O extends { type: "array", number: true } ? number[] :
O extends { type: "array", normalize: true } ? string[] :
O extends { type: "string", array: true } ? string[] :
O extends { type: "number", array: true } ? number[] :
O extends { string: true, array: true } ? string[] :
O extends { number: true, array: true } ? number[] :
O extends { normalize: true, array: true } ? string[] :
O extends { type: "array" } ? Array<string | number> :
O extends { type: "boolean" } ? boolean :
O extends { type: "number" } ? number :
O extends { type: "string" } ? string :
O extends { array: true } ? Array<string | number> :
O extends { boolean: true } ? boolean :
O extends { number: true } ? number :
O extends { string: true } ? string :
O extends { normalize: true } ? string :
O extends { choices: ReadonlyArray<infer C> } ? C :
O extends { coerce: (arg: any) => infer T } ? T :
unknown;
type InferredOptionTypes<O extends { [key: string]: Options }> = { [key in keyof O]: InferredOptionType<O[key]> };
interface CommandModule<T = {}, U = {}> {
/** array of strings (or a single string) representing aliases of `exports.command`, positional args defined in an alias are ignored */
aliases?: ReadonlyArray<string> | string;
/** object declaring the options the command accepts, or a function accepting and returning a yargs instance */
builder?: CommandBuilder<T, U>;
/** string (or array of strings) that executes this command when given on the command line, first string may contain positional args */
command?: ReadonlyArray<string> | string;
/** string used as the description for the command in help text, use `false` for a hidden command */
describe?: string | false;
/** a function which will be passed the parsed argv. */
handler: (args: Arguments<U>) => void;
}
type ParseCallback<T = {}> = (err: Error | undefined, argv: Arguments<T>, output: string) => void;
type CommandBuilder<T = {}, U = {}> = { [key: string]: Options } | ((args: Argv<T>) => Argv<U>);
type SyncCompletionFunction = (current: string, argv: any) => string[];
type AsyncCompletionFunction = (current: string, argv: any, done: (completion: ReadonlyArray<string>) => void) => void;
type PromiseCompletionFunction = (current: string, argv: any) => Promise<string[]>;
type MiddlewareFunction<T = {}> = (args: Arguments<T>) => void;
type Choices = ReadonlyArray<string | number | true | undefined>;
type PositionalOptionsType = "boolean" | "number" | "string";
}
declare var yargs: yargs.Argv;
export = yargs;

View file

@ -1,61 +0,0 @@
{
"name": "@types/yargs",
"version": "13.0.3",
"description": "TypeScript definitions for yargs",
"license": "MIT",
"contributors": [
{
"name": "Martin Poelstra",
"url": "https://github.com/poelstra",
"githubUsername": "poelstra"
},
{
"name": "Mizunashi Mana",
"url": "https://github.com/mizunashi-mana",
"githubUsername": "mizunashi-mana"
},
{
"name": "Jeffery Grajkowski",
"url": "https://github.com/pushplay",
"githubUsername": "pushplay"
},
{
"name": "Jeff Kenney",
"url": "https://github.com/jeffkenney",
"githubUsername": "jeffkenney"
},
{
"name": "Jimi (Dimitris) Charalampidis",
"url": "https://github.com/JimiC",
"githubUsername": "JimiC"
},
{
"name": "Steffen Viken Valvåg",
"url": "https://github.com/steffenvv",
"githubUsername": "steffenvv"
},
{
"name": "Emily Marigold Klassen",
"url": "https://github.com/forivall",
"githubUsername": "forivall"
},
{
"name": "ExE Boss",
"url": "https://github.com/ExE-Boss",
"githubUsername": "ExE-Boss"
}
],
"main": "",
"types": "index",
"repository": {
"type": "git",
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/yargs"
},
"scripts": {},
"dependencies": {
"@types/yargs-parser": "*"
},
"typesPublisherContentHash": "500be969ef6ef1e24d5f2d9a3961407976a93ae7e549d23c155cf9d680f1cf8a",
"typeScriptVersion": "3.0"
}

View file

@ -1,9 +0,0 @@
import { Argv } from '.';
export = Yargs;
declare function Yargs(
processArgs?: ReadonlyArray<string>,
cwd?: string,
parentRequire?: NodeRequireFunction,
): Argv;