1
0
mirror of https://github.com/actions/labeler synced 2026-05-08 01:51:02 +02:00
This commit is contained in:
David Kale
2020-09-08 13:25:36 -04:00
parent e4246d2b5b
commit 91fcbb0108
4227 changed files with 416837 additions and 457884 deletions

21
node_modules/@types/babel__core/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
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/babel__core/README.md generated vendored Normal file
View File

@@ -0,0 +1,16 @@
# 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: Sun, 21 Jun 2020 08:22:24 GMT
* Dependencies: [@types/babel__generator](https://npmjs.com/package/@types/babel__generator), [@types/babel__traverse](https://npmjs.com/package/@types/babel__traverse), [@types/babel__template](https://npmjs.com/package/@types/babel__template), [@types/babel__types](https://npmjs.com/package/@types/babel__types), [@types/babel__parser](https://npmjs.com/package/@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), [Jessica Franco](https://github.com/Jessidhia), and [Ifiok Jr.](https://github.com/ifiokjr).

753
node_modules/@types/babel__core/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,753 @@
// 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>
// Ifiok Jr. <https://github.com/ifiokjr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.4
import { GeneratorOptions } from '@babel/generator';
import traverse, { Visitor, NodePath, Hub, Scope } 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 | boolean | 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?: boolean | MatchPattern | MatchPattern[] | 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;
/**
* If any of patterns match, the current configuration object is considered inactive and is ignored during config processing.
*/
exclude?: MatchPattern | MatchPattern[];
/**
* 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?: MatchPattern[] | null;
/**
* This option is a synonym for "test"
*/
include?: MatchPattern | MatchPattern[];
/**
* 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?: MatchPattern[] | null;
/**
* Allows users to provide an array of options that will be merged into the current configuration one at a time.
* This feature is best used alongside the "test"/"include"/"exclude" options to provide conditions for which an override should apply
*/
overrides?: TransformOptions[];
/**
* 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;
/**
* If all patterns fail to match, the current configuration object is considered inactive and is ignored during config processing.
*/
test?: MatchPattern | MatchPattern[];
/**
* 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;
supportsDynamicImport?: boolean;
// augment this with a "declare module '@babel/core' { ... }" if you need more keys
}
export type FileResultCallback = (err: Error | null, result: BabelFileResult | null) => any;
export interface MatchPatternContext {
envName: string;
dirname: string;
caller: TransformCaller | undefined;
}
export type MatchPattern = string | RegExp | ((filename: string | undefined, context: MatchPatternContext) => boolean);
/**
* 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 = PluginPass> {
name?: string;
manipulateOptions?(opts: any, parserOpts: any): void;
pre?(this: S, state: S): void;
visitor: Visitor<S>;
post?(this: S, state: S): void;
inherits?: any;
}
export interface BabelFile {
ast: t.File;
opts: TransformOptions;
hub: Hub;
metadata: object;
path: NodePath;
scope: Scope;
inputMap: object | null;
code: string;
}
export interface PluginPass {
file: BabelFile;
key: string;
opts: PluginOptions;
cwd: string;
filename: string;
[key: string]: unknown;
}
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;
hasFilesystemConfig: () => boolean;
}
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;

75
node_modules/@types/babel__core/package.json generated vendored Normal file
View File

@@ -0,0 +1,75 @@
{
"_from": "@types/babel__core@^7.1.0",
"_id": "@types/babel__core@7.1.9",
"_inBundle": false,
"_integrity": "sha512-sY2RsIJ5rpER1u3/aQ8OFSI7qGIy8o1NEEbgb2UaJcvOtXOMpd39ko723NBpjQFg9SIX7TXtjejZVGeIMLhoOw==",
"_location": "/@types/babel__core",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/babel__core@^7.1.0",
"name": "@types/babel__core",
"escapedName": "@types%2fbabel__core",
"scope": "@types",
"rawSpec": "^7.1.0",
"saveSpec": null,
"fetchSpec": "^7.1.0"
},
"_requiredBy": [
"/babel-jest"
],
"_resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.9.tgz",
"_shasum": "77e59d438522a6fb898fa43dc3455c6e72f3963d",
"_spec": "@types/babel__core@^7.1.0",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/babel-jest",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Troy Gerwien",
"url": "https://github.com/yortus"
},
{
"name": "Marvin Hagemeister",
"url": "https://github.com/marvinhagemeister"
},
{
"name": "Melvin Groenhoff",
"url": "https://github.com/mgroenhoff"
},
{
"name": "Jessica Franco",
"url": "https://github.com/Jessidhia"
},
{
"name": "Ifiok Jr.",
"url": "https://github.com/ifiokjr"
}
],
"dependencies": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0",
"@types/babel__generator": "*",
"@types/babel__template": "*",
"@types/babel__traverse": "*"
},
"deprecated": false,
"description": "TypeScript definitions for @babel/core",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/babel__core",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/babel__core"
},
"scripts": {},
"typeScriptVersion": "3.4",
"types": "index.d.ts",
"typesPublisherContentHash": "26a4dc5658200c6408c23432c1f75108e2a178e8bc48479ee219337f00413d08",
"version": "7.1.9"
}

21
node_modules/@types/babel__generator/LICENSE generated vendored Normal file
View File

@@ -0,0 +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

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

@@ -0,0 +1,16 @@
# 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, 10 Dec 2019 19:31:19 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), Johnny Estilles (https://github.com/johnnyestilles), Melvin Groenhoff (https://github.com/mgroenhoff), Cameron Yan (https://github.com/khell), and Lyanbin (https://github.com/Lyanbin).

212
node_modules/@types/babel__generator/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,212 @@
// 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>
// Lyanbin <https://github.com/Lyanbin>
// 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 default value for the quotes option is 'single'. This means that any occurrences of ' in the input
* string are escaped as \', so that the output can be used in a string literal wrapped in single quotes.
*/
quotes?: 'single' | 'double' | 'backtick';
/**
* The default value for the numbers option is 'decimal'. This means that any numeric values are represented
* using decimal integer literals. Other valid options are binary, octal, and hexadecimal, which result in
* binary integer literals, octal integer literals, and hexadecimal integer literals, respectively.
*/
numbers?: 'binary' | 'octal' | 'decimal' | 'hexadecimal';
/**
* The wrap option takes a boolean value (true or false), and defaults to false (disabled). When enabled, the
* output is a valid JavaScript string literal wrapped in quotes. The type of quotes can be specified through
* the quotes setting.
*/
wrap?: boolean;
/**
* The es6 option takes a boolean value (true or false), and defaults to false (disabled). When enabled, any
* astral Unicode symbols in the input are escaped using ECMAScript 6 Unicode code point escape sequences
* instead of using separate escape sequences for each surrogate half. If backwards compatibility with ES5
* environments is a concern, dont enable this setting. If the json setting is enabled, the value for the es6
* setting is ignored (as if it was false).
*/
es6?: boolean;
/**
* The escapeEverything option takes a boolean value (true or false), and defaults to false (disabled). When
* enabled, all the symbols in the output are escaped — even printable ASCII symbols.
*/
escapeEverything?: boolean;
/**
* The minimal option takes a boolean value (true or false), and defaults to false (disabled). When enabled,
* only a limited set of symbols in the output are escaped: \0, \b, \t, \n, \f, \r, \\, \u2028, \u2029.
*/
minimal?: boolean;
/**
* The isScriptContext option takes a boolean value (true or false), and defaults to false (disabled). When
* enabled, occurrences of </script and </style in the output are escaped as <\/script and <\/style, and <!--
* is escaped as \x3C!-- (or \u003C!-- when the json option is enabled). This setting is useful when jsescs
* output ends up as part of a <script> or <style> element in an HTML document.
*/
isScriptContext?: boolean;
/**
* The compact option takes a boolean value (true or false), and defaults to true (enabled). When enabled,
* the output for arrays and objects is as compact as possible; its not formatted nicely.
*/
compact?: boolean;
/**
* The indent option takes a string value, and defaults to '\t'. When the compact setting is enabled (true),
* the value of the indent option is used to format the output for arrays and objects.
*/
indent?: string;
/**
* The indentLevel option takes a numeric value, and defaults to 0. It represents the current indentation level,
* i.e. the number of times the value of the indent option is repeated.
*/
indentLevel?: number;
/**
* The json option takes a boolean value (true or false), and defaults to false (disabled). When enabled, the
* output is valid JSON. Hexadecimal character escape sequences and the \v or \0 escape sequences are not used.
* Setting json: true implies quotes: 'double', wrap: true, es6: false, although these values can still be
* overridden if needed — but in such cases, the output wont be valid JSON anymore.
*/
json?: boolean;
/**
* The lowercaseHex option takes a boolean value (true or false), and defaults to false (disabled). When enabled,
* any alphabetical hexadecimal digits in escape sequences as well as any hexadecimal integer literals (see the
* numbers option) in the output are in lowercase.
*/
lowercaseHex?: 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;
}

71
node_modules/@types/babel__generator/package.json generated vendored Normal file
View File

@@ -0,0 +1,71 @@
{
"_from": "@types/babel__generator@*",
"_id": "@types/babel__generator@7.6.1",
"_inBundle": false,
"_integrity": "sha512-bBKm+2VPJcMRVwNhxKu8W+5/zT7pwNEqeokFOmbvVSqGzFneNxYcEBro9Ac7/N9tlsaPYnZLK8J1LWKkMsLAew==",
"_location": "/@types/babel__generator",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/babel__generator@*",
"name": "@types/babel__generator",
"escapedName": "@types%2fbabel__generator",
"scope": "@types",
"rawSpec": "*",
"saveSpec": null,
"fetchSpec": "*"
},
"_requiredBy": [
"/@types/babel__core"
],
"_resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.6.1.tgz",
"_shasum": "4901767b397e8711aeb99df8d396d7ba7b7f0e04",
"_spec": "@types/babel__generator@*",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@types/babel__core",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Troy Gerwien",
"url": "https://github.com/yortus"
},
{
"name": "Johnny Estilles",
"url": "https://github.com/johnnyestilles"
},
{
"name": "Melvin Groenhoff",
"url": "https://github.com/mgroenhoff"
},
{
"name": "Cameron Yan",
"url": "https://github.com/khell"
},
{
"name": "Lyanbin",
"url": "https://github.com/Lyanbin"
}
],
"dependencies": {
"@babel/types": "^7.0.0"
},
"deprecated": false,
"description": "TypeScript definitions for @babel/generator",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/babel__generator",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/babel__generator"
},
"scripts": {},
"typeScriptVersion": "2.9",
"types": "index.d.ts",
"typesPublisherContentHash": "d1a4de97751188457302802e3b6924105e2c9ac7830e22111f9d46abbc57908c",
"version": "7.6.1"
}

21
node_modules/@types/babel__template/LICENSE generated vendored Normal file
View File

@@ -0,0 +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

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

@@ -0,0 +1,16 @@
# 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>.

72
node_modules/@types/babel__template/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,72 @@
// 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;

63
node_modules/@types/babel__template/package.json generated vendored Normal file
View File

@@ -0,0 +1,63 @@
{
"_from": "@types/babel__template@*",
"_id": "@types/babel__template@7.0.2",
"_inBundle": false,
"_integrity": "sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==",
"_location": "/@types/babel__template",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/babel__template@*",
"name": "@types/babel__template",
"escapedName": "@types%2fbabel__template",
"scope": "@types",
"rawSpec": "*",
"saveSpec": null,
"fetchSpec": "*"
},
"_requiredBy": [
"/@types/babel__core"
],
"_resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz",
"_shasum": "4ff63d6b52eddac1de7b975a5223ed32ecea9307",
"_spec": "@types/babel__template@*",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@types/babel__core",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Troy Gerwien",
"url": "https://github.com/yortus"
},
{
"name": "Marvin Hagemeister",
"url": "https://github.com/marvinhagemeister"
},
{
"name": "Melvin Groenhoff",
"url": "https://github.com/mgroenhoff"
}
],
"dependencies": {
"@babel/parser": "^7.1.0",
"@babel/types": "^7.0.0"
},
"deprecated": false,
"description": "TypeScript definitions for @babel/template",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/babel__template",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"typeScriptVersion": "2.9",
"types": "index",
"typesPublisherContentHash": "fd665ffdd94e184259796e85ff1a8e8626a23fb0eeefd6cfb9f77a316eda2624",
"version": "7.0.2"
}

21
node_modules/@types/babel__traverse/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
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/babel__traverse/README.md generated vendored Normal file
View File

@@ -0,0 +1,16 @@
# 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: Mon, 06 Jul 2020 20:44:09 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), [Dean L.](https://github.com/dlgrit), and [Ifiok Jr.](https://github.com/ifiokjr).

875
node_modules/@types/babel__traverse/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,875 @@
// 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>
// Ifiok Jr. <https://github.com/ifiokjr>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Minimum TypeScript Version: 3.4
import * as t from '@babel/types';
export type Node = t.Node;
declare const traverse: {
<S>(
parent: Node | Node[],
opts: TraverseOptions<S>,
scope: Scope | undefined,
state: S,
parentPath?: NodePath,
): void;
(
parent: Node | Node[],
opts: TraverseOptions,
scope?: Scope,
state?: any,
parentPath?: NodePath,
): void;
visitors: {
merge: (visitors: Visitor[]) => Visitor
}
};
export default traverse;
export interface TraverseOptions<S = Node> extends Visitor<S> {
scope?: Scope;
noScope?: boolean;
}
export type ArrayKeys<T> = { [P in keyof T]: T[P] extends any[] ? P : never }[keyof T];
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 type NodePaths<T extends Node | Node[]> = T extends Node[] ? { [K in keyof T]: NodePath<T[K]> } : [NodePath<T>];
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 extends Node[]>(nodes: Nodes): NodePaths<Nodes>;
/**
* 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): [NodePath];
/** Replace the current node with another. */
replaceWith<T extends Node>(replacement: T | NodePath<T>): [NodePath<T>];
/**
* 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 extends Node[]>(nodes: Nodes): NodePaths<Nodes>;
replaceInline<Nodes extends Node | Node[]>(nodes: Nodes): NodePaths<Nodes>;
// ------------------------- 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 extends Node | Node[]>(nodes: Nodes): NodePaths<Nodes>;
/**
* 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 extends Node | Node[]>(nodes: Nodes): NodePaths<Nodes>;
/** 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<Nodes extends Node | Node[]>(listKey: ArrayKeys<T>, nodes: Nodes): NodePaths<Nodes>;
/**
* 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<Nodes extends Node | Node[]>(listKey: ArrayKeys<T>, nodes: Nodes): NodePaths<Nodes>;
/** 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 interface HubInterface {
getCode(): string | undefined;
getScope(): Scope | undefined;
addHelper(name: string): any;
buildError(node: any, msg: string, Error: ErrorConstructor): Error;
}
export class Hub implements HubInterface {
constructor(file: any, options: any);
file: any;
options: any;
getCode(): string | undefined;
getScope(): Scope | undefined;
addHelper(name: string): any;
buildError(node: any, msg: string, Constructor: typeof Error): Error;
}
export interface TraversalContext {
parentPath: NodePath;
scope: Scope;
state: any;
opts: any;
}

76
node_modules/@types/babel__traverse/package.json generated vendored Normal file
View File

@@ -0,0 +1,76 @@
{
"_from": "@types/babel__traverse@*",
"_id": "@types/babel__traverse@7.0.13",
"_inBundle": false,
"_integrity": "sha512-i+zS7t6/s9cdQvbqKDARrcbrPvtJGlbYsMkazo03nTAK3RX9FNrLllXys22uiTGJapPOTZTQ35nHh4ISph4SLQ==",
"_location": "/@types/babel__traverse",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/babel__traverse@*",
"name": "@types/babel__traverse",
"escapedName": "@types%2fbabel__traverse",
"scope": "@types",
"rawSpec": "*",
"saveSpec": null,
"fetchSpec": "*"
},
"_requiredBy": [
"/@types/babel__core",
"/babel-plugin-jest-hoist"
],
"_resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.13.tgz",
"_shasum": "1874914be974a492e1b4cb00585cabb274e8ba18",
"_spec": "@types/babel__traverse@*",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@types/babel__core",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Troy Gerwien",
"url": "https://github.com/yortus"
},
{
"name": "Marvin Hagemeister",
"url": "https://github.com/marvinhagemeister"
},
{
"name": "Ryan Petrich",
"url": "https://github.com/rpetrich"
},
{
"name": "Melvin Groenhoff",
"url": "https://github.com/mgroenhoff"
},
{
"name": "Dean L.",
"url": "https://github.com/dlgrit"
},
{
"name": "Ifiok Jr.",
"url": "https://github.com/ifiokjr"
}
],
"dependencies": {
"@babel/types": "^7.3.0"
},
"deprecated": false,
"description": "TypeScript definitions for @babel/traverse",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/babel__traverse",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/babel__traverse"
},
"scripts": {},
"typeScriptVersion": "3.4",
"types": "index.d.ts",
"typesPublisherContentHash": "463bcd9c36d32eb0717f749ae1d6c8002ce786ff8d74b5ba2dff5469507b4dc2",
"version": "7.0.13"
}

21
node_modules/@types/istanbul-lib-coverage/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
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/istanbul-lib-coverage/README.md generated vendored Normal file
View File

@@ -0,0 +1,16 @@
# 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: Tue, 09 Jun 2020 16:25:43 GMT
* Dependencies: none
* Global values: none
# Credits
These definitions were written by [Jason Cheatham](https://github.com/jason0x43), and [Lorenzo Rapetti](https://github.com/loryman).

118
node_modules/@types/istanbul-lib-coverage/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,118 @@
// 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 | FileCoverageData;
}
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;

60
node_modules/@types/istanbul-lib-coverage/package.json generated vendored Normal file
View File

@@ -0,0 +1,60 @@
{
"_from": "@types/istanbul-lib-coverage@^2.0.0",
"_id": "@types/istanbul-lib-coverage@2.0.3",
"_inBundle": false,
"_integrity": "sha512-sz7iLqvVUg1gIedBOvlkxPlc8/uVzyS5OwGz1cKjXzkl3FpL3al0crU8YGU1WoHkxn0Wxbw5tyi6hvzJKNzFsw==",
"_location": "/@types/istanbul-lib-coverage",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/istanbul-lib-coverage@^2.0.0",
"name": "@types/istanbul-lib-coverage",
"escapedName": "@types%2fistanbul-lib-coverage",
"scope": "@types",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/@jest/test-result",
"/@jest/types",
"/@types/istanbul-lib-report",
"/@types/istanbul-reports"
],
"_resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz",
"_shasum": "4ba8ddb720221f432e443bd5f9117fd22cfd4762",
"_spec": "@types/istanbul-lib-coverage@^2.0.0",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@jest/types",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Jason Cheatham",
"url": "https://github.com/jason0x43"
},
{
"name": "Lorenzo Rapetti",
"url": "https://github.com/loryman"
}
],
"dependencies": {},
"deprecated": false,
"description": "TypeScript definitions for istanbul-lib-coverage",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/istanbul-lib-coverage",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/istanbul-lib-coverage"
},
"scripts": {},
"typeScriptVersion": "3.0",
"types": "index.d.ts",
"typesPublisherContentHash": "a951ff253666ffd402e5ddf6b7d5a359e22c9a6574f6a799a39e1e793107b647",
"version": "2.0.3"
}

21
node_modules/@types/istanbul-lib-report/LICENSE generated vendored Normal file
View File

@@ -0,0 +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

16
node_modules/@types/istanbul-lib-report/README.md generated vendored Normal file
View File

@@ -0,0 +1,16 @@
# 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: Tue, 21 Jan 2020 01:00:06 GMT
* Dependencies: [@types/istanbul-lib-coverage](https://npmjs.com/package/@types/istanbul-lib-coverage)
* Global values: none
# Credits
These definitions were written by Jason Cheatham (https://github.com/jason0x43), and Zacharias Björngren (https://github.com/zache).

191
node_modules/@types/istanbul-lib-report/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,191 @@
// Type definitions for istanbul-lib-report 3.0
// Project: https://istanbul.js.org, https://github.com/istanbuljs/istanbuljs
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
// Zacharias Björngren <https://github.com/zache>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
import { CoverageMap, FileCoverage, CoverageSummary } from 'istanbul-lib-coverage';
/**
* returns a reporting context for the supplied options
*/
export function createContext(options?: Partial<ContextOptions>): Context;
/**
* returns the default watermarks that would be used when not
* overridden
*/
export function getDefaultWatermarks(): Watermarks;
export class ReportBase {
constructor(options?: Partial<ReportBaseOptions>);
execute(context: Context): void;
}
export interface ReportBaseOptions {
summarizer: Summarizers;
}
export type Summarizers = 'flat' | 'nested' | 'pkg' | 'defaultSummarizer';
export interface ContextOptions {
coverageMap: CoverageMap;
defaultSummarizer: Summarizers;
dir: string;
watermarks: Partial<Watermarks>;
sourceFinder(filepath: string): string;
}
export interface Context {
data: any;
dir: string;
sourceFinder(filepath: string): string;
watermarks: Watermarks;
writer: FileWriter;
/**
* returns the coverage class given a coverage
* types and a percentage value.
*/
classForPercent(type: keyof Watermarks, value: number): string;
/**
* returns the source code for the specified file path or throws if
* the source could not be found.
*/
getSource(filepath: string): string;
getTree(summarizer?: Summarizers): Tree;
/**
* returns a full visitor given a partial one.
*/
getVisitor<N extends Node = Node>(visitor: Partial<Visitor<N>>): Visitor<N>;
/**
* returns a FileWriter implementation for reporting use. Also available
* as the `writer` property on the context.
*/
getWriter(): FileWriter;
/**
* returns an XML writer for the supplied content writer
*/
getXmlWriter(contentWriter: ContentWriter): XmlWriter;
}
/**
* Base class for writing content
*/
export class ContentWriter {
/**
* returns the colorized version of a string. Typically,
* content writers that write to files will return the
* same string and ones writing to a tty will wrap it in
* appropriate escape sequences.
*/
colorize(str: string, clazz?: string): string;
/**
* writes a string appended with a newline to the destination
*/
println(str: string): void;
/**
* closes this content writer. Should be called after all writes are complete.
*/
close(): void;
}
/**
* a content writer that writes to a file
*/
export class FileContentWriter extends ContentWriter {
constructor(fileDescriptor: number);
write(str: string): void;
}
/**
* a content writer that writes to the console
*/
export class ConsoleWriter extends ContentWriter {
write(str: string): void;
}
/**
* utility for writing files under a specific directory
*/
export class FileWriter {
constructor(baseDir: string);
static startCapture(): void;
static stopCapture(): void;
static getOutput(): string;
static resetOutput(): void;
/**
* returns a FileWriter that is rooted at the supplied subdirectory
*/
writeForDir(subdir: string): FileWriter;
/**
* copies a file from a source directory to a destination name
*/
copyFile(source: string, dest: string, header?: string): void;
/**
* returns a content writer for writing content to the supplied file.
*/
writeFile(file: string | null): ContentWriter;
}
export interface XmlWriter {
indent(str: string): string;
/**
* writes the opening XML tag with the supplied attributes
*/
openTag(name: string, attrs?: any): void;
/**
* closes an open XML tag.
*/
closeTag(name: string): void;
/**
* writes a tag and its value opening and closing it at the same time
*/
inlineTag(name: string, attrs?: any, content?: string): void;
/**
* closes all open tags and ends the document
*/
closeAll(): void;
}
export type Watermark = [number, number];
export interface Watermarks {
statements: Watermark;
functions: Watermark;
branches: Watermark;
lines: Watermark;
}
export interface Node {
isRoot(): boolean;
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;
getQualifiedName(): string;
getRelativeName(): string;
getParent(): Node;
getChildren(): Node[];
isSummary(): boolean;
getFileCoverage(): FileCoverage;
getCoverageSummary(filesOnly: boolean): CoverageSummary;
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;
}

59
node_modules/@types/istanbul-lib-report/package.json generated vendored Normal file
View File

@@ -0,0 +1,59 @@
{
"_from": "@types/istanbul-lib-report@*",
"_id": "@types/istanbul-lib-report@3.0.0",
"_inBundle": false,
"_integrity": "sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg==",
"_location": "/@types/istanbul-lib-report",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/istanbul-lib-report@*",
"name": "@types/istanbul-lib-report",
"escapedName": "@types%2fistanbul-lib-report",
"scope": "@types",
"rawSpec": "*",
"saveSpec": null,
"fetchSpec": "*"
},
"_requiredBy": [
"/@types/istanbul-reports"
],
"_resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz",
"_shasum": "c14c24f18ea8190c118ee7562b7ff99a36552686",
"_spec": "@types/istanbul-lib-report@*",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@types/istanbul-reports",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Jason Cheatham",
"url": "https://github.com/jason0x43"
},
{
"name": "Zacharias Björngren",
"url": "https://github.com/zache"
}
],
"dependencies": {
"@types/istanbul-lib-coverage": "*"
},
"deprecated": false,
"description": "TypeScript definitions for istanbul-lib-report",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/istanbul-lib-report",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/istanbul-lib-report"
},
"scripts": {},
"typeScriptVersion": "2.8",
"types": "index.d.ts",
"typesPublisherContentHash": "f8b2f5e15a24d9f52a96c5cfadb0f582bf6200ce8643e15422c3c8f1a2bb1c63",
"version": "3.0.0"
}

21
node_modules/@types/istanbul-reports/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
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/istanbul-reports/README.md generated vendored Normal file
View File

@@ -0,0 +1,16 @@
# 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: Fri, 15 May 2020 04:09:43 GMT
* Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report), [@types/istanbul-lib-coverage](https://npmjs.com/package/@types/istanbul-lib-coverage)
* Global values: none
# Credits
These definitions were written by [Jason Cheatham](https://github.com/jason0x43).

50
node_modules/@types/istanbul-reports/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,50 @@
// 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;
}

56
node_modules/@types/istanbul-reports/package.json generated vendored Normal file
View File

@@ -0,0 +1,56 @@
{
"_from": "@types/istanbul-reports@^1.1.1",
"_id": "@types/istanbul-reports@1.1.2",
"_inBundle": false,
"_integrity": "sha512-P/W9yOX/3oPZSpaYOCQzGqgCQRXn0FFO/V8bWrCQs+wLmvVVxk6CRBXALEvNs9OHIatlnlFokfhuDo2ug01ciw==",
"_location": "/@types/istanbul-reports",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/istanbul-reports@^1.1.1",
"name": "@types/istanbul-reports",
"escapedName": "@types%2fistanbul-reports",
"scope": "@types",
"rawSpec": "^1.1.1",
"saveSpec": null,
"fetchSpec": "^1.1.1"
},
"_requiredBy": [
"/@jest/types"
],
"_resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.2.tgz",
"_shasum": "e875cc689e47bce549ec81f3df5e6f6f11cfaeb2",
"_spec": "@types/istanbul-reports@^1.1.1",
"_where": "/Users/dakale/dev/GitHub/actions/labeler/node_modules/@jest/types",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Jason Cheatham",
"url": "https://github.com/jason0x43"
}
],
"dependencies": {
"@types/istanbul-lib-coverage": "*",
"@types/istanbul-lib-report": "*"
},
"deprecated": false,
"description": "TypeScript definitions for istanbul-reports",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/istanbul-reports",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/istanbul-reports"
},
"scripts": {},
"typeScriptVersion": "3.0",
"types": "index.d.ts",
"typesPublisherContentHash": "c13cd090c027208710520a039ec004ef0045ea12516dc4c71d648e4fce9ff9f7",
"version": "1.1.2"
}

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

@@ -0,0 +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

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

@@ -0,0 +1,17 @@
# 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: Thu, 23 Jan 2020 18:15:59 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), Jason Yu (https://github.com/ycmjason), and Devansh Jethmalani (https://github.com/devanshj).

2053
node_modules/@types/jest/index.d.ts generated vendored Normal file

File diff suppressed because it is too large Load Diff

151
node_modules/@types/jest/package.json generated vendored Normal file
View File

@@ -0,0 +1,151 @@
{
"_from": "@types/jest@^24.0.13",
"_id": "@types/jest@24.9.1",
"_inBundle": false,
"_integrity": "sha512-Fb38HkXSVA4L8fGKEZ6le5bB8r6MRWlOCZbVuWZcmOMSCd2wCYOwN1ibj8daIoV9naq7aaOZjrLCoCMptKU/4Q==",
"_location": "/@types/jest",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/jest@^24.0.13",
"name": "@types/jest",
"escapedName": "@types%2fjest",
"scope": "@types",
"rawSpec": "^24.0.13",
"saveSpec": null,
"fetchSpec": "^24.0.13"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.9.1.tgz",
"_shasum": "02baf9573c78f1b9974a5f36778b366aa77bd534",
"_spec": "@types/jest@^24.0.13",
"_where": "/Users/dakale/dev/GitHub/actions/labeler",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Asana",
"url": "https://asana.com"
},
{
"name": "jwbay",
"url": "https://github.com/jwbay"
},
{
"name": "Alexey Svetliakov",
"url": "https://github.com/asvetliakov"
},
{
"name": "Alex Jover Morales",
"url": "https://github.com/alexjoverm"
},
{
"name": "Allan Lukwago",
"url": "https://github.com/epicallan"
},
{
"name": "Ika",
"url": "https://github.com/ikatyang"
},
{
"name": "Waseem Dahman",
"url": "https://github.com/wsmd"
},
{
"name": "Jamie Mason",
"url": "https://github.com/JamieMason"
},
{
"name": "Douglas Duteil",
"url": "https://github.com/douglasduteil"
},
{
"name": "Ahn",
"url": "https://github.com/ahnpnl"
},
{
"name": "Josh Goldberg",
"url": "https://github.com/joshuakgoldberg"
},
{
"name": "Jeff Lau",
"url": "https://github.com/UselessPickles"
},
{
"name": "Andrew Makarov",
"url": "https://github.com/r3nya"
},
{
"name": "Martin Hochel",
"url": "https://github.com/hotell"
},
{
"name": "Sebastian Sebald",
"url": "https://github.com/sebald"
},
{
"name": "Andy",
"url": "https://github.com/andys8"
},
{
"name": "Antoine Brault",
"url": "https://github.com/antoinebrault"
},
{
"name": "Jeroen Claassens",
"url": "https://github.com/favna"
},
{
"name": "Gregor Stamać",
"url": "https://github.com/gstamac"
},
{
"name": "ExE Boss",
"url": "https://github.com/ExE-Boss"
},
{
"name": "Alex Bolenok",
"url": "https://github.com/quassnoi"
},
{
"name": "Mario Beltrán Alarcón",
"url": "https://github.com/Belco90"
},
{
"name": "Tony Hallett",
"url": "https://github.com/tonyhallett"
},
{
"name": "Jason Yu",
"url": "https://github.com/ycmjason"
},
{
"name": "Devansh Jethmalani",
"url": "https://github.com/devanshj"
}
],
"dependencies": {
"jest-diff": "^24.3.0"
},
"deprecated": false,
"description": "TypeScript definitions for Jest",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/jest",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/jest"
},
"scripts": {},
"typeScriptVersion": "3.0",
"types": "index.d.ts",
"typesPublisherContentHash": "e4be51ee44b32b57cb06246475f09ba20f85eca27d7dc00caca51f5869069f14",
"version": "24.9.1"
}

21
node_modules/@types/js-yaml/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
MIT License
Copyright (c) Microsoft Corporation.
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/js-yaml/README.md generated vendored Normal file
View File

@@ -0,0 +1,16 @@
# Installation
> `npm install --save @types/js-yaml`
# Summary
This package contains type definitions for js-yaml (https://github.com/nodeca/js-yaml).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/js-yaml.
### Additional Details
* Last updated: Thu, 25 Jun 2020 02:29:19 GMT
* Dependencies: none
* Global values: `jsyaml`
# Credits
These definitions were written by [Bart van der Schoor](https://github.com/Bartvds), [Sebastian Clausen](https://github.com/sclausen), and [ExE Boss](https://github.com/ExE-Boss).

136
node_modules/@types/js-yaml/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,136 @@
// Type definitions for js-yaml 3.12
// Project: https://github.com/nodeca/js-yaml
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Sebastian Clausen <https://github.com/sclausen>
// ExE Boss <https://github.com/ExE-Boss>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
export as namespace jsyaml;
export function safeLoad(str: string, opts?: LoadOptions): string | object | undefined;
export function load(str: string, opts?: LoadOptions): any;
export class Type {
constructor(tag: string, opts?: TypeConstructorOptions);
kind: 'sequence' | 'scalar' | 'mapping' | null;
resolve(data: any): boolean;
construct(data: any): any;
instanceOf: object | null;
predicate: ((data: object) => boolean) | null;
represent: ((data: object) => any) | { [x: string]: (data: object) => any } | null;
defaultStyle: string | null;
styleAliases: { [x: string]: any };
}
/* tslint:disable-next-line:no-unnecessary-class */
export class Schema implements SchemaDefinition {
constructor(definition: SchemaDefinition);
static create(types: Type[] | Type): Schema;
static create(schemas: Schema[] | Schema, types: Type[] | Type): Schema;
}
export function safeLoadAll(str: string, iterator?: null, opts?: LoadOptions): any[];
export function safeLoadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): void;
export function loadAll(str: string, iterator?: null, opts?: LoadOptions): any[];
export function loadAll(str: string, iterator: (doc: any) => void, opts?: LoadOptions): void;
export function safeDump(obj: any, opts?: DumpOptions): string;
export function dump(obj: any, opts?: DumpOptions): string;
export interface LoadOptions {
/** string to be used as a file path in error/warning messages. */
filename?: string;
/** function to call on warning messages. */
onWarning?(this: null, e: YAMLException): void;
/** specifies a schema to use. */
schema?: SchemaDefinition;
/** compatibility with JSON.parse behaviour. */
json?: boolean;
/** listener for parse events */
listener?(this: State, eventType: EventType, state: State): void;
}
export type EventType = 'open' | 'close';
export interface State {
input: string;
filename: string | null;
schema: SchemaDefinition;
onWarning: (this: null, e: YAMLException) => void;
json: boolean;
length: number;
position: number;
line: number;
lineStart: number;
lineIndent: number;
version: null | number;
checkLineBreaks: boolean;
kind: string;
result: any;
implicitTypes: Type[];
}
export interface DumpOptions {
/** indentation width to use (in spaces). */
indent?: number;
/** when true, will not add an indentation level to array elements */
noArrayIndent?: boolean;
/** do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types. */
skipInvalid?: boolean;
/** specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere */
flowLevel?: number;
/** Each tag may have own set of styles. - "tag" => "style" map. */
styles?: { [x: string]: any };
/** specifies a schema to use. */
schema?: SchemaDefinition;
/** if true, sort keys when dumping YAML. If a function, use the function to sort the keys. (default: false) */
sortKeys?: boolean | ((a: any, b: any) => number);
/** set max line width. (default: 80) */
lineWidth?: number;
/** if true, don't convert duplicate objects into references (default: false) */
noRefs?: boolean;
/** if true don't try to be compatible with older yaml versions. Currently: don't quote "yes", "no" and so on, as required for YAML 1.1 (default: false) */
noCompatMode?: boolean;
/**
* if true flow sequences will be condensed, omitting the space between `key: value` or `a, b`. Eg. `'[a,b]'` or `{a:{b:c}}`.
* Can be useful when using yaml for pretty URL query params as spaces are %-encoded. (default: false).
*/
condenseFlow?: boolean;
}
export interface TypeConstructorOptions {
kind?: 'sequence' | 'scalar' | 'mapping';
resolve?: (data: any) => boolean;
construct?: (data: any) => any;
instanceOf?: object;
predicate?: (data: object) => boolean;
represent?: ((data: object) => any) | { [x: string]: (data: object) => any };
defaultStyle?: string;
styleAliases?: { [x: string]: any };
}
export interface SchemaDefinition {
implicit?: any[];
explicit?: Type[];
include?: Schema[];
}
/** only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 */
export let FAILSAFE_SCHEMA: Schema;
/** only strings, arrays and plain objects: http://www.yaml.org/spec/1.2/spec.html#id2802346 */
export let JSON_SCHEMA: Schema;
/** same as JSON_SCHEMA: http://www.yaml.org/spec/1.2/spec.html#id2804923 */
export let CORE_SCHEMA: Schema;
/** all supported YAML types, without unsafe ones (!!js/undefined, !!js/regexp and !!js/function): http://yaml.org/type/ */
export let DEFAULT_SAFE_SCHEMA: Schema;
/** all supported YAML types. */
export let DEFAULT_FULL_SCHEMA: Schema;
export let MINIMAL_SCHEMA: Schema;
export let SAFE_SCHEMA: Schema;
export class YAMLException extends Error {
constructor(reason?: any, mark?: any);
toString(compact?: boolean): string;
}

61
node_modules/@types/js-yaml/package.json generated vendored Normal file
View File

@@ -0,0 +1,61 @@
{
"_from": "@types/js-yaml@^3.12.1",
"_id": "@types/js-yaml@3.12.5",
"_inBundle": false,
"_integrity": "sha512-JCcp6J0GV66Y4ZMDAQCXot4xprYB+Zfd3meK9+INSJeVZwJmHAW30BBEEkPzXswMXuiyReUGOP3GxrADc9wPww==",
"_location": "/@types/js-yaml",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/js-yaml@^3.12.1",
"name": "@types/js-yaml",
"escapedName": "@types%2fjs-yaml",
"scope": "@types",
"rawSpec": "^3.12.1",
"saveSpec": null,
"fetchSpec": "^3.12.1"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/@types/js-yaml/-/js-yaml-3.12.5.tgz",
"_shasum": "136d5e6a57a931e1cce6f9d8126aa98a9c92a6bb",
"_spec": "@types/js-yaml@^3.12.1",
"_where": "/Users/dakale/dev/GitHub/actions/labeler",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Bart van der Schoor",
"url": "https://github.com/Bartvds"
},
{
"name": "Sebastian Clausen",
"url": "https://github.com/sclausen"
},
{
"name": "ExE Boss",
"url": "https://github.com/ExE-Boss"
}
],
"dependencies": {},
"deprecated": false,
"description": "TypeScript definitions for js-yaml",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/js-yaml",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
"directory": "types/js-yaml"
},
"scripts": {},
"typeScriptVersion": "3.0",
"types": "index.d.ts",
"typesPublisherContentHash": "152b780ed47626a634e193c96fa6105ae0258f6a061acb007314bc975ab51d8c",
"version": "3.12.5"
}

21
node_modules/@types/minimatch/LICENSE generated vendored Normal file
View File

@@ -0,0 +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

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;

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

@@ -0,0 +1,55 @@
{
"_from": "@types/minimatch@^3.0.0",
"_id": "@types/minimatch@3.0.3",
"_inBundle": false,
"_integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==",
"_location": "/@types/minimatch",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "@types/minimatch@^3.0.0",
"name": "@types/minimatch",
"escapedName": "@types%2fminimatch",
"scope": "@types",
"rawSpec": "^3.0.0",
"saveSpec": null,
"fetchSpec": "^3.0.0"
},
"_requiredBy": [
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz",
"_shasum": "3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d",
"_spec": "@types/minimatch@^3.0.0",
"_where": "/Users/dakale/dev/GitHub/actions/labeler",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "vvakame",
"url": "https://github.com/vvakame"
},
{
"name": "Shant Marouti",
"url": "https://github.com/shantmarouti"
}
],
"dependencies": {},
"deprecated": false,
"description": "TypeScript definitions for Minimatch",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
"main": "",
"name": "@types/minimatch",
"repository": {
"type": "git",
"url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git"
},
"scripts": {},
"typeScriptVersion": "2.0",
"typesPublisherContentHash": "e768e36348874adcc93ac67e9c3c7b5fcbd39079c0610ec16e410b8f851308d1",
"version": "3.0.3"
}

42
node_modules/@types/node/LICENSE generated vendored
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.
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

10
node_modules/@types/node/README.md generated vendored
View File

@@ -5,12 +5,12 @@
This package contains type definitions for Node.js (http://nodejs.org/).
# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v12.
Additional Details
* Last updated: Thu, 01 Aug 2019 19:43:21 GMT
### Additional Details
* Last updated: Tue, 08 Sep 2020 12:35:08 GMT
* Dependencies: none
* Global values: Buffer, NodeJS, Symbol, __dirname, __filename, clearImmediate, clearInterval, clearTimeout, console, exports, global, module, process, queueMicrotask, require, setImmediate, setInterval, setTimeout
* Global values: `Buffer`, `NodeJS`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`, `Symbol`
# Credits
These definitions were written by Microsoft TypeScript <https://github.com/Microsoft>, DefinitelyTyped <https://github.com/DefinitelyTyped>, Alberto Schiabel <https://github.com/jkomyno>, Alexander T. <https://github.com/a-tarasyuk>, Alvis HT Tang <https://github.com/alvis>, Andrew Makarov <https://github.com/r3nya>, Benjamin Toueg <https://github.com/btoueg>, Bruno Scheufler <https://github.com/brunoscheufler>, Chigozirim C. <https://github.com/smac89>, Christian Vaagland Tellnes <https://github.com/tellnes>, David Junger <https://github.com/touffy>, Deividas Bakanas <https://github.com/DeividasBakanas>, Eugene Y. Q. Shen <https://github.com/eyqs>, Flarna <https://github.com/Flarna>, Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>, Hoàng Văn Khải <https://github.com/KSXGitHub>, Huw <https://github.com/hoo29>, Kelvin Jin <https://github.com/kjin>, Klaus Meinhardt <https://github.com/ajafff>, Lishude <https://github.com/islishude>, Mariusz Wiktorczyk <https://github.com/mwiktorczyk>, Matthieu Sieben <https://github.com/matthieusieben>, Mohsen Azimi <https://github.com/mohsen1>, Nicolas Even <https://github.com/n-e>, Nicolas Voigt <https://github.com/octo-sniffle>, Parambir Singh <https://github.com/parambirs>, Sebastian Silbermann <https://github.com/eps1lon>, Simon Schick <https://github.com/SimonSchick>, Thomas den Hollander <https://github.com/ThomasdenH>, Wilco Bakker <https://github.com/WilcoBakker>, wwwy3y3 <https://github.com/wwwy3y3>, Zane Hannan AU <https://github.com/ZaneHannanAU>, Samuel Ainsworth <https://github.com/samuela>, Kyle Uehlein <https://github.com/kuehlein>, Jordi Oliveras Rovira <https://github.com/j-oliveras>, Thanik Bhongbhibhat <https://github.com/bhongy>, and Marcin Kopacz <https://github.com/chyzwar>.
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alexander T.](https://github.com/a-tarasyuk), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Bruno Scheufler](https://github.com/brunoscheufler), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Flarna](https://github.com/Flarna), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Zane Hannan AU](https://github.com/ZaneHannanAU), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Jordi Oliveras Rovira](https://github.com/j-oliveras), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), and [Jason Kwok](https://github.com/JasonHK).

16
node_modules/@types/node/assert.d.ts generated vendored
View File

@@ -1,6 +1,6 @@
declare module "assert" {
function internal(value: any, message?: string | Error): void;
namespace internal {
function assert(value: any, message?: string | Error): asserts value;
namespace assert {
class AssertionError implements Error {
name: string;
message: string;
@@ -19,7 +19,7 @@ declare module "assert" {
function fail(message?: string | Error): never;
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
function ok(value: any, message?: string | Error): void;
function ok(value: any, message?: string | Error): asserts value;
/** @deprecated since v9.9.0 - use strictEqual() instead. */
function equal(actual: any, expected: any, message?: string | Error): void;
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
@@ -28,9 +28,9 @@ declare module "assert" {
function deepEqual(actual: any, expected: any, message?: string | Error): void;
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
function strictEqual(actual: any, expected: any, message?: string | Error): void;
function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
function throws(block: () => any, message?: string | Error): void;
@@ -38,15 +38,15 @@ declare module "assert" {
function doesNotThrow(block: () => any, message?: string | Error): void;
function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
function ifError(value: any): void;
function ifError(value: any): asserts value is null | undefined;
function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
function rejects(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function | Object | Error, message?: string | Error): Promise<void>;
function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
const strict: typeof internal;
const strict: typeof assert;
}
export = internal;
export = assert;
}

View File

@@ -1,132 +0,0 @@
/**
* Async Hooks module: https://nodejs.org/api/async_hooks.html
*/
declare module "async_hooks" {
/**
* Returns the asyncId of the current execution context.
*/
function executionAsyncId(): number;
/**
* Returns the ID of the resource responsible for calling the callback that is currently being executed.
*/
function triggerAsyncId(): number;
interface HookCallbacks {
/**
* Called when a class is constructed that has the possibility to emit an asynchronous event.
* @param asyncId a unique ID for the async resource
* @param type the type of the async resource
* @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
* @param resource reference to the resource representing the async operation, needs to be released during destroy
*/
init?(asyncId: number, type: string, triggerAsyncId: number, resource: Object): void;
/**
* When an asynchronous operation is initiated or completes a callback is called to notify the user.
* The before callback is called just before said callback is executed.
* @param asyncId the unique identifier assigned to the resource about to execute the callback.
*/
before?(asyncId: number): void;
/**
* Called immediately after the callback specified in before is completed.
* @param asyncId the unique identifier assigned to the resource which has executed the callback.
*/
after?(asyncId: number): void;
/**
* Called when a promise has resolve() called. This may not be in the same execution id
* as the promise itself.
* @param asyncId the unique id for the promise that was resolve()d.
*/
promiseResolve?(asyncId: number): void;
/**
* Called after the resource corresponding to asyncId is destroyed
* @param asyncId a unique ID for the async resource
*/
destroy?(asyncId: number): void;
}
interface AsyncHook {
/**
* Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
*/
enable(): this;
/**
* Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
*/
disable(): this;
}
/**
* Registers functions to be called for different lifetime events of each async operation.
* @param options the callbacks to register
* @return an AsyncHooks instance used for disabling and enabling hooks
*/
function createHook(options: HookCallbacks): AsyncHook;
interface AsyncResourceOptions {
/**
* The ID of the execution context that created this async event.
* Default: `executionAsyncId()`
*/
triggerAsyncId?: number;
/**
* Disables automatic `emitDestroy` when the object is garbage collected.
* This usually does not need to be set (even if `emitDestroy` is called
* manually), unless the resource's `asyncId` is retrieved and the
* sensitive API's `emitDestroy` is called with it.
* Default: `false`
*/
requireManualDestroy?: boolean;
}
/**
* The class AsyncResource was designed to be extended by the embedder's async resources.
* Using this users can easily trigger the lifetime events of their own resources.
*/
class AsyncResource {
/**
* AsyncResource() is meant to be extended. Instantiating a
* new AsyncResource() also triggers init. If triggerAsyncId is omitted then
* async_hook.executionAsyncId() is used.
* @param type The type of async event.
* @param triggerAsyncId The ID of the execution context that created
* this async event (default: `executionAsyncId()`), or an
* AsyncResourceOptions object (since 9.3)
*/
constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
/**
* Call the provided function with the provided arguments in the
* execution context of the async resource. This will establish the
* context, trigger the AsyncHooks before callbacks, call the function,
* trigger the AsyncHooks after callbacks, and then restore the original
* execution context.
* @param fn The function to call in the execution context of this
* async resource.
* @param thisArg The receiver to be used for the function call.
* @param args Optional arguments to pass to the function.
*/
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
/**
* Call AsyncHooks destroy callbacks.
*/
emitDestroy(): void;
/**
* @return the unique ID assigned to this AsyncResource instance.
*/
asyncId(): number;
/**
* @return the trigger ID for this AsyncResource instance.
*/
triggerAsyncId(): number;
}
}

59
node_modules/@types/node/base.d.ts generated vendored
View File

@@ -1,41 +1,20 @@
// base definnitions for all NodeJS modules that are not specific to any version of TypeScript
/// <reference path="globals.d.ts" />
// NOTE: These definitions support NodeJS and TypeScript 3.7.
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
// - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7
// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
// Reference required types from the default lib:
/// <reference lib="es2018" />
/// <reference lib="esnext.asynciterable" />
/// <reference lib="esnext.intl" />
/// <reference lib="esnext.bigint" />
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
// tslint:disable-next-line:no-bad-reference
/// <reference path="ts3.6/base.d.ts" />
// TypeScript 3.7-specific augmentations:
/// <reference path="assert.d.ts" />
/// <reference path="async_hooks.d.ts" />
/// <reference path="buffer.d.ts" />
/// <reference path="child_process.d.ts" />
/// <reference path="cluster.d.ts" />
/// <reference path="console.d.ts" />
/// <reference path="constants.d.ts" />
/// <reference path="crypto.d.ts" />
/// <reference path="dgram.d.ts" />
/// <reference path="dns.d.ts" />
/// <reference path="domain.d.ts" />
/// <reference path="events.d.ts" />
/// <reference path="fs.d.ts" />
/// <reference path="http.d.ts" />
/// <reference path="http2.d.ts" />
/// <reference path="https.d.ts" />
/// <reference path="inspector.d.ts" />
/// <reference path="module.d.ts" />
/// <reference path="net.d.ts" />
/// <reference path="os.d.ts" />
/// <reference path="path.d.ts" />
/// <reference path="perf_hooks.d.ts" />
/// <reference path="process.d.ts" />
/// <reference path="punycode.d.ts" />
/// <reference path="querystring.d.ts" />
/// <reference path="readline.d.ts" />
/// <reference path="repl.d.ts" />
/// <reference path="stream.d.ts" />
/// <reference path="string_decoder.d.ts" />
/// <reference path="timers.d.ts" />
/// <reference path="tls.d.ts" />
/// <reference path="trace_events.d.ts" />
/// <reference path="tty.d.ts" />
/// <reference path="url.d.ts" />
/// <reference path="util.d.ts" />
/// <reference path="v8.d.ts" />
/// <reference path="vm.d.ts" />
/// <reference path="worker_threads.d.ts" />
/// <reference path="zlib.d.ts" />

View File

@@ -1,278 +0,0 @@
declare module "constants" {
const E2BIG: number;
const EACCES: number;
const EADDRINUSE: number;
const EADDRNOTAVAIL: number;
const EAFNOSUPPORT: number;
const EAGAIN: number;
const EALREADY: number;
const EBADF: number;
const EBADMSG: number;
const EBUSY: number;
const ECANCELED: number;
const ECHILD: number;
const ECONNABORTED: number;
const ECONNREFUSED: number;
const ECONNRESET: number;
const EDEADLK: number;
const EDESTADDRREQ: number;
const EDOM: number;
const EEXIST: number;
const EFAULT: number;
const EFBIG: number;
const EHOSTUNREACH: number;
const EIDRM: number;
const EILSEQ: number;
const EINPROGRESS: number;
const EINTR: number;
const EINVAL: number;
const EIO: number;
const EISCONN: number;
const EISDIR: number;
const ELOOP: number;
const EMFILE: number;
const EMLINK: number;
const EMSGSIZE: number;
const ENAMETOOLONG: number;
const ENETDOWN: number;
const ENETRESET: number;
const ENETUNREACH: number;
const ENFILE: number;
const ENOBUFS: number;
const ENODATA: number;
const ENODEV: number;
const ENOENT: number;
const ENOEXEC: number;
const ENOLCK: number;
const ENOLINK: number;
const ENOMEM: number;
const ENOMSG: number;
const ENOPROTOOPT: number;
const ENOSPC: number;
const ENOSR: number;
const ENOSTR: number;
const ENOSYS: number;
const ENOTCONN: number;
const ENOTDIR: number;
const ENOTEMPTY: number;
const ENOTSOCK: number;
const ENOTSUP: number;
const ENOTTY: number;
const ENXIO: number;
const EOPNOTSUPP: number;
const EOVERFLOW: number;
const EPERM: number;
const EPIPE: number;
const EPROTO: number;
const EPROTONOSUPPORT: number;
const EPROTOTYPE: number;
const ERANGE: number;
const EROFS: number;
const ESPIPE: number;
const ESRCH: number;
const ETIME: number;
const ETIMEDOUT: number;
const ETXTBSY: number;
const EWOULDBLOCK: number;
const EXDEV: number;
const WSAEINTR: number;
const WSAEBADF: number;
const WSAEACCES: number;
const WSAEFAULT: number;
const WSAEINVAL: number;
const WSAEMFILE: number;
const WSAEWOULDBLOCK: number;
const WSAEINPROGRESS: number;
const WSAEALREADY: number;
const WSAENOTSOCK: number;
const WSAEDESTADDRREQ: number;
const WSAEMSGSIZE: number;
const WSAEPROTOTYPE: number;
const WSAENOPROTOOPT: number;
const WSAEPROTONOSUPPORT: number;
const WSAESOCKTNOSUPPORT: number;
const WSAEOPNOTSUPP: number;
const WSAEPFNOSUPPORT: number;
const WSAEAFNOSUPPORT: number;
const WSAEADDRINUSE: number;
const WSAEADDRNOTAVAIL: number;
const WSAENETDOWN: number;
const WSAENETUNREACH: number;
const WSAENETRESET: number;
const WSAECONNABORTED: number;
const WSAECONNRESET: number;
const WSAENOBUFS: number;
const WSAEISCONN: number;
const WSAENOTCONN: number;
const WSAESHUTDOWN: number;
const WSAETOOMANYREFS: number;
const WSAETIMEDOUT: number;
const WSAECONNREFUSED: number;
const WSAELOOP: number;
const WSAENAMETOOLONG: number;
const WSAEHOSTDOWN: number;
const WSAEHOSTUNREACH: number;
const WSAENOTEMPTY: number;
const WSAEPROCLIM: number;
const WSAEUSERS: number;
const WSAEDQUOT: number;
const WSAESTALE: number;
const WSAEREMOTE: number;
const WSASYSNOTREADY: number;
const WSAVERNOTSUPPORTED: number;
const WSANOTINITIALISED: number;
const WSAEDISCON: number;
const WSAENOMORE: number;
const WSAECANCELLED: number;
const WSAEINVALIDPROCTABLE: number;
const WSAEINVALIDPROVIDER: number;
const WSAEPROVIDERFAILEDINIT: number;
const WSASYSCALLFAILURE: number;
const WSASERVICE_NOT_FOUND: number;
const WSATYPE_NOT_FOUND: number;
const WSA_E_NO_MORE: number;
const WSA_E_CANCELLED: number;
const WSAEREFUSED: number;
const SIGHUP: number;
const SIGINT: number;
const SIGILL: number;
const SIGABRT: number;
const SIGFPE: number;
const SIGKILL: number;
const SIGSEGV: number;
const SIGTERM: number;
const SIGBREAK: number;
const SIGWINCH: number;
const SSL_OP_ALL: number;
const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
const SSL_OP_CISCO_ANYCONNECT: number;
const SSL_OP_COOKIE_EXCHANGE: number;
const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
const SSL_OP_EPHEMERAL_RSA: number;
const SSL_OP_LEGACY_SERVER_CONNECT: number;
const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
const SSL_OP_MICROSOFT_SESS_ID_BUG: number;
const SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
const SSL_OP_NETSCAPE_CA_DN_BUG: number;
const SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
const SSL_OP_NO_COMPRESSION: number;
const SSL_OP_NO_QUERY_MTU: number;
const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
const SSL_OP_NO_SSLv2: number;
const SSL_OP_NO_SSLv3: number;
const SSL_OP_NO_TICKET: number;
const SSL_OP_NO_TLSv1: number;
const SSL_OP_NO_TLSv1_1: number;
const SSL_OP_NO_TLSv1_2: number;
const SSL_OP_PKCS1_CHECK_1: number;
const SSL_OP_PKCS1_CHECK_2: number;
const SSL_OP_SINGLE_DH_USE: number;
const SSL_OP_SINGLE_ECDH_USE: number;
const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
const SSL_OP_TLS_BLOCK_PADDING_BUG: number;
const SSL_OP_TLS_D5_BUG: number;
const SSL_OP_TLS_ROLLBACK_BUG: number;
const ENGINE_METHOD_DSA: number;
const ENGINE_METHOD_DH: number;
const ENGINE_METHOD_RAND: number;
const ENGINE_METHOD_ECDH: number;
const ENGINE_METHOD_ECDSA: number;
const ENGINE_METHOD_CIPHERS: number;
const ENGINE_METHOD_DIGESTS: number;
const ENGINE_METHOD_STORE: number;
const ENGINE_METHOD_PKEY_METHS: number;
const ENGINE_METHOD_PKEY_ASN1_METHS: number;
const ENGINE_METHOD_ALL: number;
const ENGINE_METHOD_NONE: number;
const DH_CHECK_P_NOT_SAFE_PRIME: number;
const DH_CHECK_P_NOT_PRIME: number;
const DH_UNABLE_TO_CHECK_GENERATOR: number;
const DH_NOT_SUITABLE_GENERATOR: number;
const RSA_PKCS1_PADDING: number;
const RSA_SSLV23_PADDING: number;
const RSA_NO_PADDING: number;
const RSA_PKCS1_OAEP_PADDING: number;
const RSA_X931_PADDING: number;
const RSA_PKCS1_PSS_PADDING: number;
const POINT_CONVERSION_COMPRESSED: number;
const POINT_CONVERSION_UNCOMPRESSED: number;
const POINT_CONVERSION_HYBRID: number;
const O_RDONLY: number;
const O_WRONLY: number;
const O_RDWR: number;
const S_IFMT: number;
const S_IFREG: number;
const S_IFDIR: number;
const S_IFCHR: number;
const S_IFBLK: number;
const S_IFIFO: number;
const S_IFSOCK: number;
const S_IRWXU: number;
const S_IRUSR: number;
const S_IWUSR: number;
const S_IXUSR: number;
const S_IRWXG: number;
const S_IRGRP: number;
const S_IWGRP: number;
const S_IXGRP: number;
const S_IRWXO: number;
const S_IROTH: number;
const S_IWOTH: number;
const S_IXOTH: number;
const S_IFLNK: number;
const O_CREAT: number;
const O_EXCL: number;
const O_NOCTTY: number;
const O_DIRECTORY: number;
const O_NOATIME: number;
const O_NOFOLLOW: number;
const O_SYNC: number;
const O_DSYNC: number;
const O_SYMLINK: number;
const O_DIRECT: number;
const O_NONBLOCK: number;
const O_TRUNC: number;
const O_APPEND: number;
const F_OK: number;
const R_OK: number;
const W_OK: number;
const X_OK: number;
const COPYFILE_EXCL: number;
const COPYFILE_FICLONE: number;
const COPYFILE_FICLONE_FORCE: number;
const UV_UDP_REUSEADDR: number;
const SIGQUIT: number;
const SIGTRAP: number;
const SIGIOT: number;
const SIGBUS: number;
const SIGUSR1: number;
const SIGUSR2: number;
const SIGPIPE: number;
const SIGALRM: number;
const SIGCHLD: number;
const SIGSTKFLT: number;
const SIGCONT: number;
const SIGSTOP: number;
const SIGTSTP: number;
const SIGTTIN: number;
const SIGTTOU: number;
const SIGURG: number;
const SIGXCPU: number;
const SIGXFSZ: number;
const SIGVTALRM: number;
const SIGPROF: number;
const SIGIO: number;
const SIGPOLL: number;
const SIGPWR: number;
const SIGSYS: number;
const SIGUNUSED: number;
const defaultCoreCipherList: string;
const defaultCipherList: string;
const ENGINE_METHOD_RSA: number;
const ALPN_ENABLED: number;
}

72
node_modules/@types/node/index.d.ts generated vendored
View File

@@ -1,4 +1,4 @@
// Type definitions for non-npm package Node.js 12.6
// Type definitions for non-npm package Node.js 12.12
// Project: http://nodejs.org/
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
// DefinitelyTyped <https://github.com/DefinitelyTyped>
@@ -9,7 +9,6 @@
// Benjamin Toueg <https://github.com/btoueg>
// Bruno Scheufler <https://github.com/brunoscheufler>
// Chigozirim C. <https://github.com/smac89>
// Christian Vaagland Tellnes <https://github.com/tellnes>
// David Junger <https://github.com/touffy>
// Deividas Bakanas <https://github.com/DeividasBakanas>
// Eugene Y. Q. Shen <https://github.com/eyqs>
@@ -21,10 +20,9 @@
// Klaus Meinhardt <https://github.com/ajafff>
// Lishude <https://github.com/islishude>
// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
// Matthieu Sieben <https://github.com/matthieusieben>
// Mohsen Azimi <https://github.com/mohsen1>
// Nicolas Even <https://github.com/n-e>
// Nicolas Voigt <https://github.com/octo-sniffle>
// Nikita Galkin <https://github.com/galkin>
// Parambir Singh <https://github.com/parambirs>
// Sebastian Silbermann <https://github.com/eps1lon>
// Simon Schick <https://github.com/SimonSchick>
@@ -37,64 +35,16 @@
// Jordi Oliveras Rovira <https://github.com/j-oliveras>
// Thanik Bhongbhibhat <https://github.com/bhongy>
// Marcin Kopacz <https://github.com/chyzwar>
// Trivikram Kamat <https://github.com/trivikr>
// Minh Son Nguyen <https://github.com/nguymin4>
// Junxiao Shi <https://github.com/yoursunny>
// Ilia Baryshnikov <https://github.com/qwelias>
// ExE Boss <https://github.com/ExE-Boss>
// Jason Kwok <https://github.com/JasonHK>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// NOTE: These definitions support NodeJS and TypeScript 3.2.
// NOTE: These definitions support NodeJS and TypeScript 3.7.
// This isn't strictly needed since 3.7 has the assert module, but this way we're consistent.
// Typically type modificatons should be made in base.d.ts instead of here
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2
// NOTE: Augmentations for TypeScript 3.2 and later should use individual files for overrides
// within the respective ~/ts3.2 (or later) folder. However, this is disallowed for versions
// prior to TypeScript 3.2, so the older definitions will be found here.
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
/// <reference path="base.d.ts" />
// TypeScript 2.1-specific augmentations:
// Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`)
// Empty interfaces are used here which merge fine with the real declarations in the lib XXX files
// just to ensure the names are known and node typings can be sued without importing these libs.
// if someone really needs these types the libs need to be added via --lib or in tsconfig.json
interface MapConstructor { }
interface WeakMapConstructor { }
interface SetConstructor { }
interface WeakSetConstructor { }
interface Set<T> {}
interface Map<K, V> {}
interface ReadonlySet<T> {}
interface IteratorResult<T> { }
interface Iterable<T> { }
interface AsyncIterable<T> { }
interface Iterator<T> {
next(value?: any): IteratorResult<T>;
}
interface IterableIterator<T> { }
interface AsyncIterableIterator<T> {}
interface SymbolConstructor {
readonly iterator: symbol;
readonly asyncIterator: symbol;
}
declare var Symbol: SymbolConstructor;
// even this is just a forward declaration some properties are added otherwise
// it would be allowed to pass anything to e.g. Buffer.from()
interface SharedArrayBuffer {
readonly byteLength: number;
slice(begin?: number, end?: number): SharedArrayBuffer;
}
declare module "util" {
namespace inspect {
const custom: symbol;
}
namespace promisify {
const custom: symbol;
}
namespace types {
function isBigInt64Array(value: any): boolean;
function isBigUint64Array(value: any): boolean;
}
}

View File

@@ -1,38 +1,32 @@
{
"_args": [
[
"@types/node@12.6.9",
"/Users/pjquirk/Source/GitHub/actions/labeler"
]
],
"_development": true,
"_from": "@types/node@12.6.9",
"_id": "@types/node@12.6.9",
"_from": "@types/node@^12.0.4",
"_id": "@types/node@12.12.56",
"_inBundle": false,
"_integrity": "sha512-+YB9FtyxXGyD54p8rXwWaN1EWEyar5L58GlGWgtH2I9rGmLGBQcw63+0jw+ujqVavNuO47S1ByAjm9zdHMnskw==",
"_integrity": "sha512-8OdIupOIZtmObR13fvGyTvpcuzKmMugkATeVcfNwCjGtHxhjEKmOvLqXwR8U9VOtNnZ4EXaSfNiLVsPinaCXkQ==",
"_location": "/@types/node",
"_phantomChildren": {},
"_requested": {
"type": "version",
"type": "range",
"registry": true,
"raw": "@types/node@12.6.9",
"raw": "@types/node@^12.0.4",
"name": "@types/node",
"escapedName": "@types%2fnode",
"scope": "@types",
"rawSpec": "12.6.9",
"rawSpec": "^12.0.4",
"saveSpec": null,
"fetchSpec": "12.6.9"
"fetchSpec": "^12.0.4"
},
"_requiredBy": [
"#DEV:/",
"/@octokit/types"
"#DEV:/"
],
"_resolved": "https://registry.npmjs.org/@types/node/-/node-12.6.9.tgz",
"_spec": "12.6.9",
"_where": "/Users/pjquirk/Source/GitHub/actions/labeler",
"_resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.56.tgz",
"_shasum": "83591a89723d8ec3eaf722137e1784a7351edb6c",
"_spec": "@types/node@^12.0.4",
"_where": "/Users/dakale/dev/GitHub/actions/labeler",
"bugs": {
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
},
"bundleDependencies": false,
"contributors": [
{
"name": "Microsoft TypeScript",
@@ -70,10 +64,6 @@
"name": "Chigozirim C.",
"url": "https://github.com/smac89"
},
{
"name": "Christian Vaagland Tellnes",
"url": "https://github.com/tellnes"
},
{
"name": "David Junger",
"url": "https://github.com/touffy"
@@ -118,10 +108,6 @@
"name": "Mariusz Wiktorczyk",
"url": "https://github.com/mwiktorczyk"
},
{
"name": "Matthieu Sieben",
"url": "https://github.com/matthieusieben"
},
{
"name": "Mohsen Azimi",
"url": "https://github.com/mohsen1"
@@ -131,8 +117,8 @@
"url": "https://github.com/n-e"
},
{
"name": "Nicolas Voigt",
"url": "https://github.com/octo-sniffle"
"name": "Nikita Galkin",
"url": "https://github.com/galkin"
},
{
"name": "Parambir Singh",
@@ -181,9 +167,34 @@
{
"name": "Marcin Kopacz",
"url": "https://github.com/chyzwar"
},
{
"name": "Trivikram Kamat",
"url": "https://github.com/trivikr"
},
{
"name": "Minh Son Nguyen",
"url": "https://github.com/nguymin4"
},
{
"name": "Junxiao Shi",
"url": "https://github.com/yoursunny"
},
{
"name": "Ilia Baryshnikov",
"url": "https://github.com/qwelias"
},
{
"name": "ExE Boss",
"url": "https://github.com/ExE-Boss"
},
{
"name": "Jason Kwok",
"url": "https://github.com/JasonHK"
}
],
"dependencies": {},
"deprecated": false,
"description": "TypeScript definitions for Node.js",
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
"license": "MIT",
@@ -195,15 +206,25 @@
"directory": "types/node"
},
"scripts": {},
"typeScriptVersion": "2.0",
"types": "index",
"typesPublisherContentHash": "5953833094f8f12d251b73b7eeb9158bcd2af53e785ba1b8709b994c2694f76c",
"typeScriptVersion": "3.1",
"types": "index.d.ts",
"typesPublisherContentHash": "9f707b838bda0c7ea2700c47796ac0721c841fc2cf80b7eec47e96c703522284",
"typesVersions": {
">=3.2.0-0": {
"<=3.1": {
"*": [
"ts3.2/*"
"ts3.1/*"
]
},
"<=3.3": {
"*": [
"ts3.3/*"
]
},
"<=3.6": {
"*": [
"ts3.6/*"
]
}
},
"version": "12.6.9"
"version": "12.12.56"
}

View File

@@ -1,3 +0,0 @@
declare module "process" {
export = process;
}

52
node_modules/@types/node/ts3.1/assert.d.ts generated vendored Normal file
View File

@@ -0,0 +1,52 @@
declare module "assert" {
function assert(value: any, message?: string | Error): void;
namespace assert {
class AssertionError implements Error {
name: string;
message: string;
actual: any;
expected: any;
operator: string;
generatedMessage: boolean;
code: 'ERR_ASSERTION';
constructor(options?: {
message?: string; actual?: any; expected?: any;
operator?: string; stackStartFn?: Function
});
}
function fail(message?: string | Error): never;
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
function ok(value: any, message?: string | Error): void;
/** @deprecated since v9.9.0 - use strictEqual() instead. */
function equal(actual: any, expected: any, message?: string | Error): void;
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
function notEqual(actual: any, expected: any, message?: string | Error): void;
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
function deepEqual(actual: any, expected: any, message?: string | Error): void;
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
function strictEqual(actual: any, expected: any, message?: string | Error): void;
function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
function throws(block: () => any, message?: string | Error): void;
function throws(block: () => any, error: RegExp | Function | Object | Error, message?: string | Error): void;
function doesNotThrow(block: () => any, message?: string | Error): void;
function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
function ifError(value: any): void;
function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
function rejects(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function | Object | Error, message?: string | Error): Promise<void>;
function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
const strict: typeof assert;
}
export = assert;
}

247
node_modules/@types/node/ts3.1/async_hooks.d.ts generated vendored Normal file
View File

@@ -0,0 +1,247 @@
/**
* Async Hooks module: https://nodejs.org/api/async_hooks.html
*/
declare module "async_hooks" {
/**
* Returns the asyncId of the current execution context.
*/
function executionAsyncId(): number;
/**
* The resource representing the current execution.
* Useful to store data within the resource.
*
* Resource objects returned by `executionAsyncResource()` are most often internal
* Node.js handle objects with undocumented APIs. Using any functions or properties
* on the object is likely to crash your application and should be avoided.
*
* Using `executionAsyncResource()` in the top-level execution context will
* return an empty object as there is no handle or request object to use,
* but having an object representing the top-level can be helpful.
*/
function executionAsyncResource(): object;
/**
* Returns the ID of the resource responsible for calling the callback that is currently being executed.
*/
function triggerAsyncId(): number;
interface HookCallbacks {
/**
* Called when a class is constructed that has the possibility to emit an asynchronous event.
* @param asyncId a unique ID for the async resource
* @param type the type of the async resource
* @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
* @param resource reference to the resource representing the async operation, needs to be released during destroy
*/
init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
/**
* When an asynchronous operation is initiated or completes a callback is called to notify the user.
* The before callback is called just before said callback is executed.
* @param asyncId the unique identifier assigned to the resource about to execute the callback.
*/
before?(asyncId: number): void;
/**
* Called immediately after the callback specified in before is completed.
* @param asyncId the unique identifier assigned to the resource which has executed the callback.
*/
after?(asyncId: number): void;
/**
* Called when a promise has resolve() called. This may not be in the same execution id
* as the promise itself.
* @param asyncId the unique id for the promise that was resolve()d.
*/
promiseResolve?(asyncId: number): void;
/**
* Called after the resource corresponding to asyncId is destroyed
* @param asyncId a unique ID for the async resource
*/
destroy?(asyncId: number): void;
}
interface AsyncHook {
/**
* Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
*/
enable(): this;
/**
* Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
*/
disable(): this;
}
/**
* Registers functions to be called for different lifetime events of each async operation.
* @param options the callbacks to register
* @return an AsyncHooks instance used for disabling and enabling hooks
*/
function createHook(options: HookCallbacks): AsyncHook;
interface AsyncResourceOptions {
/**
* The ID of the execution context that created this async event.
* Default: `executionAsyncId()`
*/
triggerAsyncId?: number;
/**
* Disables automatic `emitDestroy` when the object is garbage collected.
* This usually does not need to be set (even if `emitDestroy` is called
* manually), unless the resource's `asyncId` is retrieved and the
* sensitive API's `emitDestroy` is called with it.
* Default: `false`
*/
requireManualDestroy?: boolean;
}
/**
* The class AsyncResource was designed to be extended by the embedder's async resources.
* Using this users can easily trigger the lifetime events of their own resources.
*/
class AsyncResource {
/**
* AsyncResource() is meant to be extended. Instantiating a
* new AsyncResource() also triggers init. If triggerAsyncId is omitted then
* async_hook.executionAsyncId() is used.
* @param type The type of async event.
* @param triggerAsyncId The ID of the execution context that created
* this async event (default: `executionAsyncId()`), or an
* AsyncResourceOptions object (since 9.3)
*/
constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
/**
* Call the provided function with the provided arguments in the
* execution context of the async resource. This will establish the
* context, trigger the AsyncHooks before callbacks, call the function,
* trigger the AsyncHooks after callbacks, and then restore the original
* execution context.
* @param fn The function to call in the execution context of this
* async resource.
* @param thisArg The receiver to be used for the function call.
* @param args Optional arguments to pass to the function.
*/
runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
/**
* Call AsyncHooks destroy callbacks.
*/
emitDestroy(): void;
/**
* @return the unique ID assigned to this AsyncResource instance.
*/
asyncId(): number;
/**
* @return the trigger ID for this AsyncResource instance.
*/
triggerAsyncId(): number;
}
/**
* When having multiple instances of `AsyncLocalStorage`, they are independent
* from each other. It is safe to instantiate this class multiple times.
*/
class AsyncLocalStorage<T> {
/**
* This method disables the instance of `AsyncLocalStorage`. All subsequent calls
* to `asyncLocalStorage.getStore()` will return `undefined` until
* `asyncLocalStorage.run()` or `asyncLocalStorage.runSyncAndReturn()`
* is called again.
*
* When calling `asyncLocalStorage.disable()`, all current contexts linked to the
* instance will be exited.
*
* Calling `asyncLocalStorage.disable()` is required before the
* `asyncLocalStorage` can be garbage collected. This does not apply to stores
* provided by the `asyncLocalStorage`, as those objects are garbage collected
* along with the corresponding async resources.
*
* This method is to be used when the `asyncLocalStorage` is not in use anymore
* in the current process.
*/
disable(): void;
/**
* This method returns the current store.
* If this method is called outside of an asynchronous context initialized by
* calling `asyncLocalStorage.run` or `asyncLocalStorage.runAndReturn`, it will
* return `undefined`.
*/
getStore(): T | undefined;
/**
* Calling `asyncLocalStorage.run(callback)` will create a new asynchronous
* context.
* Within the callback function and the asynchronous operations from the callback,
* `asyncLocalStorage.getStore()` will return an instance of `Map` known as
* "the store". This store will be persistent through the following
* asynchronous calls.
*
* The callback will be ran asynchronously. Optionally, arguments can be passed
* to the function. They will be passed to the callback function.
*
* If an error is thrown by the callback function, it will not be caught by
* a `try/catch` block as the callback is ran in a new asynchronous resource.
* Also, the stacktrace will be impacted by the asynchronous call.
*/
// TODO: Apply generic vararg once available
run(store: T, callback: (...args: any[]) => void, ...args: any[]): void;
/**
* Calling `asyncLocalStorage.exit(callback)` will create a new asynchronous
* context.
* Within the callback function and the asynchronous operations from the callback,
* `asyncLocalStorage.getStore()` will return `undefined`.
*
* The callback will be ran asynchronously. Optionally, arguments can be passed
* to the function. They will be passed to the callback function.
*
* If an error is thrown by the callback function, it will not be caught by
* a `try/catch` block as the callback is ran in a new asynchronous resource.
* Also, the stacktrace will be impacted by the asynchronous call.
*/
exit(callback: (...args: any[]) => void, ...args: any[]): void;
/**
* This methods runs a function synchronously within a context and return its
* return value. The store is not accessible outside of the callback function or
* the asynchronous operations created within the callback.
*
* Optionally, arguments can be passed to the function. They will be passed to
* the callback function.
*
* If the callback function throws an error, it will be thrown by
* `runSyncAndReturn` too. The stacktrace will not be impacted by this call and
* the context will be exited.
*/
runSyncAndReturn<R>(store: T, callback: (...args: any[]) => R, ...args: any[]): R;
/**
* This methods runs a function synchronously outside of a context and return its
* return value. The store is not accessible within the callback function or
* the asynchronous operations created within the callback.
*
* Optionally, arguments can be passed to the function. They will be passed to
* the callback function.
*
* If the callback function throws an error, it will be thrown by
* `exitSyncAndReturn` too. The stacktrace will not be impacted by this call and
* the context will be re-entered.
*/
exitSyncAndReturn<R>(callback: (...args: any[]) => R, ...args: any[]): R;
/**
* Calling `asyncLocalStorage.enterWith(store)` will transition into the context
* for the remainder of the current synchronous execution and will persist
* through any following asynchronous calls.
*/
enterWith(store: T): void;
}
}

40
node_modules/@types/node/ts3.1/base.d.ts generated vendored Normal file
View File

@@ -0,0 +1,40 @@
// base definitions for all NodeJS modules that are not specific to any version of TypeScript
/// <reference path="globals.d.ts" />
/// <reference path="async_hooks.d.ts" />
/// <reference path="buffer.d.ts" />
/// <reference path="child_process.d.ts" />
/// <reference path="cluster.d.ts" />
/// <reference path="console.d.ts" />
/// <reference path="constants.d.ts" />
/// <reference path="crypto.d.ts" />
/// <reference path="dgram.d.ts" />
/// <reference path="dns.d.ts" />
/// <reference path="domain.d.ts" />
/// <reference path="events.d.ts" />
/// <reference path="fs.d.ts" />
/// <reference path="http.d.ts" />
/// <reference path="http2.d.ts" />
/// <reference path="https.d.ts" />
/// <reference path="inspector.d.ts" />
/// <reference path="module.d.ts" />
/// <reference path="net.d.ts" />
/// <reference path="os.d.ts" />
/// <reference path="path.d.ts" />
/// <reference path="perf_hooks.d.ts" />
/// <reference path="process.d.ts" />
/// <reference path="punycode.d.ts" />
/// <reference path="querystring.d.ts" />
/// <reference path="readline.d.ts" />
/// <reference path="repl.d.ts" />
/// <reference path="stream.d.ts" />
/// <reference path="string_decoder.d.ts" />
/// <reference path="timers.d.ts" />
/// <reference path="tls.d.ts" />
/// <reference path="trace_events.d.ts" />
/// <reference path="tty.d.ts" />
/// <reference path="url.d.ts" />
/// <reference path="util.d.ts" />
/// <reference path="v8.d.ts" />
/// <reference path="vm.d.ts" />
/// <reference path="worker_threads.d.ts" />
/// <reference path="zlib.d.ts" />

View File

@@ -18,7 +18,11 @@ declare module "child_process" {
readonly killed: boolean;
readonly pid: number;
readonly connected: boolean;
kill(signal?: string): void;
readonly exitCode: number | null;
readonly signalCode: number | null;
readonly spawnargs: string[];
readonly spawnfile: string;
kill(signal?: NodeJS.Signals | number): boolean;
send(message: any, callback?: (error: Error | null) => void): boolean;
send(message: any, sendHandle?: net.Socket | net.Server, callback?: (error: Error | null) => void): boolean;
send(message: any, sendHandle?: net.Socket | net.Server, options?: MessageOptions, callback?: (error: Error | null) => void): boolean;
@@ -36,45 +40,45 @@ declare module "child_process" {
*/
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "close", listener: (code: number, signal: string) => void): this;
addListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
addListener(event: "disconnect", listener: () => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
addListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: "close", code: number, signal: string): boolean;
emit(event: "close", code: number, signal: NodeJS.Signals): boolean;
emit(event: "disconnect"): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "exit", code: number | null, signal: string | null): boolean;
emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
emit(event: "message", message: any, sendHandle: net.Socket | net.Server): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: "close", listener: (code: number, signal: string) => void): this;
on(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
on(event: "disconnect", listener: () => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
on(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: "close", listener: (code: number, signal: string) => void): this;
once(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
once(event: "disconnect", listener: () => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
once(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: "close", listener: (code: number, signal: string) => void): this;
prependListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
prependListener(event: "disconnect", listener: () => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
prependListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: "close", listener: (code: number, signal: string) => void): this;
prependOnceListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
prependOnceListener(event: "disconnect", listener: () => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "exit", listener: (code: number | null, signal: string | null) => void): this;
prependOnceListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
prependOnceListener(event: "message", listener: (message: any, sendHandle: net.Socket | net.Server) => void): this;
}
@@ -92,6 +96,24 @@ declare module "child_process" {
];
}
// return this object when stdio option is a tuple of 3
interface ChildProcessByStdio<
I extends null | Writable,
O extends null | Readable,
E extends null | Readable,
> extends ChildProcess {
stdin: I;
stdout: O;
stderr: E;
readonly stdio: [
I,
O,
E,
Readable | Writable | null | undefined, // extra, no modification
Readable | Writable | null | undefined // extra, no modification
];
}
interface MessageOptions {
keepOpen?: boolean;
}
@@ -128,15 +150,105 @@ declare module "child_process" {
stdio?: 'pipe' | Array<null | undefined | 'pipe'>;
}
type StdioNull = 'inherit' | 'ignore' | Stream;
type StdioPipe = undefined | null | 'pipe';
interface SpawnOptionsWithStdioTuple<
Stdin extends StdioNull | StdioPipe,
Stdout extends StdioNull | StdioPipe,
Stderr extends StdioNull | StdioPipe,
> extends SpawnOptions {
stdio: [Stdin, Stdout, Stderr];
}
// overloads of spawn without 'args'
function spawn(command: string, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
function spawn(
command: string,
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
): ChildProcessByStdio<Writable, Readable, Readable>;
function spawn(
command: string,
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
): ChildProcessByStdio<Writable, Readable, null>;
function spawn(
command: string,
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
): ChildProcessByStdio<Writable, null, Readable>;
function spawn(
command: string,
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
): ChildProcessByStdio<null, Readable, Readable>;
function spawn(
command: string,
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
): ChildProcessByStdio<Writable, null, null>;
function spawn(
command: string,
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
): ChildProcessByStdio<null, Readable, null>;
function spawn(
command: string,
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
): ChildProcessByStdio<null, null, Readable>;
function spawn(
command: string,
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
): ChildProcessByStdio<null, null, null>;
function spawn(command: string, options: SpawnOptions): ChildProcess;
// overloads of spawn with 'args'
function spawn(command: string, args?: ReadonlyArray<string>, options?: SpawnOptionsWithoutStdio): ChildProcessWithoutNullStreams;
function spawn(
command: string,
args: ReadonlyArray<string>,
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioPipe>,
): ChildProcessByStdio<Writable, Readable, Readable>;
function spawn(
command: string,
args: ReadonlyArray<string>,
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioPipe, StdioNull>,
): ChildProcessByStdio<Writable, Readable, null>;
function spawn(
command: string,
args: ReadonlyArray<string>,
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioPipe>,
): ChildProcessByStdio<Writable, null, Readable>;
function spawn(
command: string,
args: ReadonlyArray<string>,
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioPipe>,
): ChildProcessByStdio<null, Readable, Readable>;
function spawn(
command: string,
args: ReadonlyArray<string>,
options: SpawnOptionsWithStdioTuple<StdioPipe, StdioNull, StdioNull>,
): ChildProcessByStdio<Writable, null, null>;
function spawn(
command: string,
args: ReadonlyArray<string>,
options: SpawnOptionsWithStdioTuple<StdioNull, StdioPipe, StdioNull>,
): ChildProcessByStdio<null, Readable, null>;
function spawn(
command: string,
args: ReadonlyArray<string>,
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioPipe>,
): ChildProcessByStdio<null, null, Readable>;
function spawn(
command: string,
args: ReadonlyArray<string>,
options: SpawnOptionsWithStdioTuple<StdioNull, StdioNull, StdioNull>,
): ChildProcessByStdio<null, null, null>;
function spawn(command: string, args: ReadonlyArray<string>, options: SpawnOptions): ChildProcess;
interface ExecOptions extends CommonOptions {
shell?: string;
maxBuffer?: number;
killSignal?: string;
killSignal?: NodeJS.Signals | number;
}
interface ExecOptionsWithStringEncoding extends ExecOptions {
@@ -151,7 +263,7 @@ declare module "child_process" {
cmd?: string;
killed?: boolean;
code?: number;
signal?: string;
signal?: NodeJS.Signals;
}
// no `options` definitely means stdout/stderr are `string`.
@@ -192,7 +304,7 @@ declare module "child_process" {
interface ExecFileOptions extends CommonOptions {
maxBuffer?: number;
killSignal?: string;
killSignal?: NodeJS.Signals | number;
windowsVerbatimArguments?: boolean;
shell?: boolean | string;
}
@@ -212,25 +324,25 @@ declare module "child_process" {
function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null): ChildProcess;
// no `options` definitely means stdout/stderr are `string`.
function execFile(file: string, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
function execFile(file: string, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
function execFile(file: string, args: ReadonlyArray<string> | undefined | null, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
// `options` with `"buffer"` or `null` for `encoding` means stdout/stderr are definitely `Buffer`.
function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
function execFile(file: string, options: ExecFileOptionsWithBufferEncoding, callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void): ChildProcess;
function execFile(
file: string,
args: ReadonlyArray<string> | undefined | null,
options: ExecFileOptionsWithBufferEncoding,
callback: (error: Error | null, stdout: Buffer, stderr: Buffer) => void,
callback: (error: ExecException | null, stdout: Buffer, stderr: Buffer) => void,
): ChildProcess;
// `options` with well known `encoding` means stdout/stderr are definitely `string`.
function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
function execFile(file: string, options: ExecFileOptionsWithStringEncoding, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
function execFile(
file: string,
args: ReadonlyArray<string> | undefined | null,
options: ExecFileOptionsWithStringEncoding,
callback: (error: Error | null, stdout: string, stderr: string) => void,
callback: (error: ExecException | null, stdout: string, stderr: string) => void,
): ChildProcess;
// `options` with an `encoding` whose type is `string` means stdout/stderr could either be `Buffer` or `string`.
@@ -238,30 +350,35 @@ declare module "child_process" {
function execFile(
file: string,
options: ExecFileOptionsWithOtherEncoding,
callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void,
callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
): ChildProcess;
function execFile(
file: string,
args: ReadonlyArray<string> | undefined | null,
options: ExecFileOptionsWithOtherEncoding,
callback: (error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void,
callback: (error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void,
): ChildProcess;
// `options` without an `encoding` means stdout/stderr are definitely `string`.
function execFile(file: string, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
function execFile(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptions, callback: (error: Error | null, stdout: string, stderr: string) => void): ChildProcess;
function execFile(file: string, options: ExecFileOptions, callback: (error: ExecException | null, stdout: string, stderr: string) => void): ChildProcess;
function execFile(
file: string,
args: ReadonlyArray<string> | undefined | null,
options: ExecFileOptions,
callback: (error: ExecException | null, stdout: string, stderr: string) => void
): ChildProcess;
// fallback if nothing else matches. Worst case is always `string | Buffer`.
function execFile(
file: string,
options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null,
callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
): ChildProcess;
function execFile(
file: string,
args: ReadonlyArray<string> | undefined | null,
options: ({ encoding?: string | null } & ExecFileOptions) | undefined | null,
callback: ((error: Error | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
callback: ((error: ExecException | null, stdout: string | Buffer, stderr: string | Buffer) => void) | undefined | null,
): ChildProcess;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
@@ -292,13 +409,14 @@ declare module "child_process" {
detached?: boolean;
windowsVerbatimArguments?: boolean;
}
function fork(modulePath: string, options?: ForkOptions): ChildProcess;
function fork(modulePath: string, args?: ReadonlyArray<string>, options?: ForkOptions): ChildProcess;
interface SpawnSyncOptions extends CommonOptions {
argv0?: string; // Not specified in the docs
input?: string | NodeJS.TypedArray | DataView;
input?: string | NodeJS.ArrayBufferView;
stdio?: StdioOptions;
killSignal?: string | number;
killSignal?: NodeJS.Signals | number;
maxBuffer?: number;
encoding?: string;
shell?: boolean | string;
@@ -316,7 +434,7 @@ declare module "child_process" {
stdout: T;
stderr: T;
status: number | null;
signal: string | null;
signal: NodeJS.Signals | null;
error?: Error;
}
function spawnSync(command: string): SpawnSyncReturns<Buffer>;
@@ -331,7 +449,7 @@ declare module "child_process" {
input?: string | Uint8Array;
stdio?: StdioOptions;
shell?: string;
killSignal?: string | number;
killSignal?: NodeJS.Signals | number;
maxBuffer?: number;
encoding?: string;
}
@@ -347,9 +465,9 @@ declare module "child_process" {
function execSync(command: string, options?: ExecSyncOptions): Buffer;
interface ExecFileSyncOptions extends CommonOptions {
input?: string | NodeJS.TypedArray | DataView;
input?: string | NodeJS.ArrayBufferView;
stdio?: StdioOptions;
killSignal?: string | number;
killSignal?: NodeJS.Signals | number;
maxBuffer?: number;
encoding?: string;
shell?: boolean | string;

448
node_modules/@types/node/ts3.1/constants.d.ts generated vendored Normal file
View File

@@ -0,0 +1,448 @@
/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
declare module "constants" {
/** @deprecated since v6.3.0 - use `os.constants.errno.E2BIG` instead. */
const E2BIG: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EACCES` instead. */
const EACCES: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EADDRINUSE` instead. */
const EADDRINUSE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EADDRNOTAVAIL` instead. */
const EADDRNOTAVAIL: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EAFNOSUPPORT` instead. */
const EAFNOSUPPORT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EAGAIN` instead. */
const EAGAIN: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EALREADY` instead. */
const EALREADY: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EBADF` instead. */
const EBADF: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EBADMSG` instead. */
const EBADMSG: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EBUSY` instead. */
const EBUSY: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ECANCELED` instead. */
const ECANCELED: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ECHILD` instead. */
const ECHILD: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ECONNABORTED` instead. */
const ECONNABORTED: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ECONNREFUSED` instead. */
const ECONNREFUSED: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ECONNRESET` instead. */
const ECONNRESET: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EDEADLK` instead. */
const EDEADLK: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EDESTADDRREQ` instead. */
const EDESTADDRREQ: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EDOM` instead. */
const EDOM: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EEXIST` instead. */
const EEXIST: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EFAULT` instead. */
const EFAULT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EFBIG` instead. */
const EFBIG: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EHOSTUNREACH` instead. */
const EHOSTUNREACH: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EIDRM` instead. */
const EIDRM: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EILSEQ` instead. */
const EILSEQ: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EINPROGRESS` instead. */
const EINPROGRESS: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EINTR` instead. */
const EINTR: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EINVAL` instead. */
const EINVAL: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EIO` instead. */
const EIO: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EISCONN` instead. */
const EISCONN: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EISDIR` instead. */
const EISDIR: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ELOOP` instead. */
const ELOOP: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EMFILE` instead. */
const EMFILE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EMLINK` instead. */
const EMLINK: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EMSGSIZE` instead. */
const EMSGSIZE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENAMETOOLONG` instead. */
const ENAMETOOLONG: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENETDOWN` instead. */
const ENETDOWN: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENETRESET` instead. */
const ENETRESET: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENETUNREACH` instead. */
const ENETUNREACH: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENFILE` instead. */
const ENFILE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOBUFS` instead. */
const ENOBUFS: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENODATA` instead. */
const ENODATA: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENODEV` instead. */
const ENODEV: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOENT` instead. */
const ENOENT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOEXEC` instead. */
const ENOEXEC: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOLCK` instead. */
const ENOLCK: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOLINK` instead. */
const ENOLINK: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOMEM` instead. */
const ENOMEM: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOMSG` instead. */
const ENOMSG: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOPROTOOPT` instead. */
const ENOPROTOOPT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOSPC` instead. */
const ENOSPC: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOSR` instead. */
const ENOSR: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOSTR` instead. */
const ENOSTR: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOSYS` instead. */
const ENOSYS: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTCONN` instead. */
const ENOTCONN: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTDIR` instead. */
const ENOTDIR: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTEMPTY` instead. */
const ENOTEMPTY: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTSOCK` instead. */
const ENOTSOCK: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTSUP` instead. */
const ENOTSUP: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENOTTY` instead. */
const ENOTTY: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ENXIO` instead. */
const ENXIO: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EOPNOTSUPP` instead. */
const EOPNOTSUPP: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EOVERFLOW` instead. */
const EOVERFLOW: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EPERM` instead. */
const EPERM: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EPIPE` instead. */
const EPIPE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EPROTO` instead. */
const EPROTO: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EPROTONOSUPPORT` instead. */
const EPROTONOSUPPORT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EPROTOTYPE` instead. */
const EPROTOTYPE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ERANGE` instead. */
const ERANGE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EROFS` instead. */
const EROFS: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ESPIPE` instead. */
const ESPIPE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ESRCH` instead. */
const ESRCH: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ETIME` instead. */
const ETIME: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ETIMEDOUT` instead. */
const ETIMEDOUT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.ETXTBSY` instead. */
const ETXTBSY: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EWOULDBLOCK` instead. */
const EWOULDBLOCK: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.EXDEV` instead. */
const EXDEV: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINTR` instead. */
const WSAEINTR: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEBADF` instead. */
const WSAEBADF: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEACCES` instead. */
const WSAEACCES: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEFAULT` instead. */
const WSAEFAULT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINVAL` instead. */
const WSAEINVAL: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEMFILE` instead. */
const WSAEMFILE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEWOULDBLOCK` instead. */
const WSAEWOULDBLOCK: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINPROGRESS` instead. */
const WSAEINPROGRESS: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEALREADY` instead. */
const WSAEALREADY: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOTSOCK` instead. */
const WSAENOTSOCK: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEDESTADDRREQ` instead. */
const WSAEDESTADDRREQ: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEMSGSIZE` instead. */
const WSAEMSGSIZE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPROTOTYPE` instead. */
const WSAEPROTOTYPE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOPROTOOPT` instead. */
const WSAENOPROTOOPT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPROTONOSUPPORT` instead. */
const WSAEPROTONOSUPPORT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAESOCKTNOSUPPORT` instead. */
const WSAESOCKTNOSUPPORT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEOPNOTSUPP` instead. */
const WSAEOPNOTSUPP: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPFNOSUPPORT` instead. */
const WSAEPFNOSUPPORT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEAFNOSUPPORT` instead. */
const WSAEAFNOSUPPORT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEADDRINUSE` instead. */
const WSAEADDRINUSE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEADDRNOTAVAIL` instead. */
const WSAEADDRNOTAVAIL: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENETDOWN` instead. */
const WSAENETDOWN: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENETUNREACH` instead. */
const WSAENETUNREACH: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENETRESET` instead. */
const WSAENETRESET: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAECONNABORTED` instead. */
const WSAECONNABORTED: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAECONNRESET` instead. */
const WSAECONNRESET: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOBUFS` instead. */
const WSAENOBUFS: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEISCONN` instead. */
const WSAEISCONN: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOTCONN` instead. */
const WSAENOTCONN: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAESHUTDOWN` instead. */
const WSAESHUTDOWN: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAETOOMANYREFS` instead. */
const WSAETOOMANYREFS: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAETIMEDOUT` instead. */
const WSAETIMEDOUT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAECONNREFUSED` instead. */
const WSAECONNREFUSED: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAELOOP` instead. */
const WSAELOOP: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENAMETOOLONG` instead. */
const WSAENAMETOOLONG: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEHOSTDOWN` instead. */
const WSAEHOSTDOWN: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEHOSTUNREACH` instead. */
const WSAEHOSTUNREACH: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOTEMPTY` instead. */
const WSAENOTEMPTY: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPROCLIM` instead. */
const WSAEPROCLIM: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEUSERS` instead. */
const WSAEUSERS: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEDQUOT` instead. */
const WSAEDQUOT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAESTALE` instead. */
const WSAESTALE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEREMOTE` instead. */
const WSAEREMOTE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSASYSNOTREADY` instead. */
const WSASYSNOTREADY: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAVERNOTSUPPORTED` instead. */
const WSAVERNOTSUPPORTED: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSANOTINITIALISED` instead. */
const WSANOTINITIALISED: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEDISCON` instead. */
const WSAEDISCON: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAENOMORE` instead. */
const WSAENOMORE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAECANCELLED` instead. */
const WSAECANCELLED: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINVALIDPROCTABLE` instead. */
const WSAEINVALIDPROCTABLE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEINVALIDPROVIDER` instead. */
const WSAEINVALIDPROVIDER: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEPROVIDERFAILEDINIT` instead. */
const WSAEPROVIDERFAILEDINIT: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSASYSCALLFAILURE` instead. */
const WSASYSCALLFAILURE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSASERVICE_NOT_FOUND` instead. */
const WSASERVICE_NOT_FOUND: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSATYPE_NOT_FOUND` instead. */
const WSATYPE_NOT_FOUND: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSA_E_NO_MORE` instead. */
const WSA_E_NO_MORE: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSA_E_CANCELLED` instead. */
const WSA_E_CANCELLED: number;
/** @deprecated since v6.3.0 - use `os.constants.errno.WSAEREFUSED` instead. */
const WSAEREFUSED: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGHUP` instead. */
const SIGHUP: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGINT` instead. */
const SIGINT: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGILL` instead. */
const SIGILL: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGABRT` instead. */
const SIGABRT: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGFPE` instead. */
const SIGFPE: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGKILL` instead. */
const SIGKILL: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGSEGV` instead. */
const SIGSEGV: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTERM` instead. */
const SIGTERM: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGBREAK` instead. */
const SIGBREAK: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGWINCH` instead. */
const SIGWINCH: number;
const SSL_OP_ALL: number;
const SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION: number;
const SSL_OP_CIPHER_SERVER_PREFERENCE: number;
const SSL_OP_CISCO_ANYCONNECT: number;
const SSL_OP_COOKIE_EXCHANGE: number;
const SSL_OP_CRYPTOPRO_TLSEXT_BUG: number;
const SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS: number;
const SSL_OP_EPHEMERAL_RSA: number;
const SSL_OP_LEGACY_SERVER_CONNECT: number;
const SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER: number;
const SSL_OP_MICROSOFT_SESS_ID_BUG: number;
const SSL_OP_MSIE_SSLV2_RSA_PADDING: number;
const SSL_OP_NETSCAPE_CA_DN_BUG: number;
const SSL_OP_NETSCAPE_CHALLENGE_BUG: number;
const SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG: number;
const SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG: number;
const SSL_OP_NO_COMPRESSION: number;
const SSL_OP_NO_QUERY_MTU: number;
const SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION: number;
const SSL_OP_NO_SSLv2: number;
const SSL_OP_NO_SSLv3: number;
const SSL_OP_NO_TICKET: number;
const SSL_OP_NO_TLSv1: number;
const SSL_OP_NO_TLSv1_1: number;
const SSL_OP_NO_TLSv1_2: number;
const SSL_OP_PKCS1_CHECK_1: number;
const SSL_OP_PKCS1_CHECK_2: number;
const SSL_OP_SINGLE_DH_USE: number;
const SSL_OP_SINGLE_ECDH_USE: number;
const SSL_OP_SSLEAY_080_CLIENT_DH_BUG: number;
const SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG: number;
const SSL_OP_TLS_BLOCK_PADDING_BUG: number;
const SSL_OP_TLS_D5_BUG: number;
const SSL_OP_TLS_ROLLBACK_BUG: number;
const ENGINE_METHOD_DSA: number;
const ENGINE_METHOD_DH: number;
const ENGINE_METHOD_RAND: number;
const ENGINE_METHOD_ECDH: number;
const ENGINE_METHOD_ECDSA: number;
const ENGINE_METHOD_CIPHERS: number;
const ENGINE_METHOD_DIGESTS: number;
const ENGINE_METHOD_STORE: number;
const ENGINE_METHOD_PKEY_METHS: number;
const ENGINE_METHOD_PKEY_ASN1_METHS: number;
const ENGINE_METHOD_ALL: number;
const ENGINE_METHOD_NONE: number;
const DH_CHECK_P_NOT_SAFE_PRIME: number;
const DH_CHECK_P_NOT_PRIME: number;
const DH_UNABLE_TO_CHECK_GENERATOR: number;
const DH_NOT_SUITABLE_GENERATOR: number;
const RSA_PKCS1_PADDING: number;
const RSA_SSLV23_PADDING: number;
const RSA_NO_PADDING: number;
const RSA_PKCS1_OAEP_PADDING: number;
const RSA_X931_PADDING: number;
const RSA_PKCS1_PSS_PADDING: number;
const POINT_CONVERSION_COMPRESSED: number;
const POINT_CONVERSION_UNCOMPRESSED: number;
const POINT_CONVERSION_HYBRID: number;
const O_RDONLY: number;
const O_WRONLY: number;
const O_RDWR: number;
const S_IFMT: number;
const S_IFREG: number;
const S_IFDIR: number;
const S_IFCHR: number;
const S_IFBLK: number;
const S_IFIFO: number;
const S_IFSOCK: number;
const S_IRWXU: number;
const S_IRUSR: number;
const S_IWUSR: number;
const S_IXUSR: number;
const S_IRWXG: number;
const S_IRGRP: number;
const S_IWGRP: number;
const S_IXGRP: number;
const S_IRWXO: number;
const S_IROTH: number;
const S_IWOTH: number;
const S_IXOTH: number;
const S_IFLNK: number;
const O_CREAT: number;
const O_EXCL: number;
const O_NOCTTY: number;
const O_DIRECTORY: number;
const O_NOATIME: number;
const O_NOFOLLOW: number;
const O_SYNC: number;
const O_DSYNC: number;
const O_SYMLINK: number;
const O_DIRECT: number;
const O_NONBLOCK: number;
const O_TRUNC: number;
const O_APPEND: number;
const F_OK: number;
const R_OK: number;
const W_OK: number;
const X_OK: number;
const COPYFILE_EXCL: number;
const COPYFILE_FICLONE: number;
const COPYFILE_FICLONE_FORCE: number;
const UV_UDP_REUSEADDR: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGQUIT` instead. */
const SIGQUIT: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTRAP` instead. */
const SIGTRAP: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGIOT` instead. */
const SIGIOT: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGBUS` instead. */
const SIGBUS: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGUSR1` instead. */
const SIGUSR1: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGUSR2` instead. */
const SIGUSR2: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGPIPE` instead. */
const SIGPIPE: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGALRM` instead. */
const SIGALRM: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGCHLD` instead. */
const SIGCHLD: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGSTKFLT` instead. */
const SIGSTKFLT: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGCONT` instead. */
const SIGCONT: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGSTOP` instead. */
const SIGSTOP: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTSTP` instead. */
const SIGTSTP: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTTIN` instead. */
const SIGTTIN: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGTTOU` instead. */
const SIGTTOU: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGURG` instead. */
const SIGURG: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGXCPU` instead. */
const SIGXCPU: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGXFSZ` instead. */
const SIGXFSZ: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGVTALRM` instead. */
const SIGVTALRM: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGPROF` instead. */
const SIGPROF: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGIO` instead. */
const SIGIO: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGPOLL` instead. */
const SIGPOLL: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGPWR` instead. */
const SIGPWR: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGSYS` instead. */
const SIGSYS: number;
/** @deprecated since v6.3.0 - use `os.constants.signals.SIGUNUSED` instead. */
const SIGUNUSED: number;
const defaultCoreCipherList: string;
const defaultCipherList: string;
const ENGINE_METHOD_RSA: number;
const ALPN_ENABLED: number;
}

View File

@@ -4,7 +4,7 @@ declare module "crypto" {
interface Certificate {
exportChallenge(spkac: BinaryLike): Buffer;
exportPublicKey(spkac: BinaryLike): Buffer;
verifySpkac(spkac: Binary): boolean;
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
}
const Certificate: {
new(): Certificate;
@@ -106,10 +106,18 @@ declare module "crypto" {
const defaultCipherList: string;
}
interface HashOptions extends stream.TransformOptions {
/**
* For XOF hash functions such as `shake256`, the
* outputLength option can be used to specify the desired output length in bytes.
*/
outputLength?: number;
}
/** @deprecated since v10.0.0 */
const fips: boolean;
function createHash(algorithm: string, options?: stream.TransformOptions): Hash;
function createHash(algorithm: string, options?: HashOptions): Hash;
function createHmac(algorithm: string, key: BinaryLike, options?: stream.TransformOptions): Hmac;
type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
@@ -118,14 +126,14 @@ declare module "crypto" {
type HexBase64BinaryEncoding = "binary" | "base64" | "hex";
type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
class Hash extends stream.Duplex {
class Hash extends stream.Transform {
private constructor();
update(data: BinaryLike): Hash;
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
digest(): Buffer;
digest(encoding: HexBase64Latin1Encoding): string;
}
class Hmac extends stream.Duplex {
class Hmac extends stream.Transform {
private constructor();
update(data: BinaryLike): Hmac;
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
@@ -133,7 +141,7 @@ declare module "crypto" {
digest(encoding: HexBase64Latin1Encoding): string;
}
export type KeyObjectType = 'secret' | 'public' | 'private';
type KeyObjectType = 'secret' | 'public' | 'private';
interface KeyExportOptions<T extends KeyFormat> {
type: 'pkcs1' | 'spki' | 'pkcs8' | 'sec1';
@@ -152,15 +160,14 @@ declare module "crypto" {
asymmetricKeySize?: number;
export(options: KeyExportOptions<'pem'>): string | Buffer;
export(options?: KeyExportOptions<'der'>): Buffer;
symmetricSize?: number;
symmetricKeySize?: number;
type: KeyObjectType;
}
type CipherCCMTypes = 'aes-128-ccm' | 'aes-192-ccm' | 'aes-256-ccm';
type CipherGCMTypes = 'aes-128-gcm' | 'aes-192-gcm' | 'aes-256-gcm';
type Binary = NodeJS.TypedArray | DataView;
type BinaryLike = string | Binary;
type BinaryLike = string | NodeJS.ArrayBufferView;
type CipherKey = BinaryLike | KeyObject;
@@ -193,11 +200,11 @@ declare module "crypto" {
algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions
): Cipher;
class Cipher extends stream.Duplex {
class Cipher extends stream.Transform {
private constructor();
update(data: BinaryLike): Buffer;
update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
update(data: Binary, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string;
update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string;
update(data: string, input_encoding: Utf8AsciiBinaryEncoding | undefined, output_encoding: HexBase64BinaryEncoding): string;
final(): Buffer;
final(output_encoding: string): string;
@@ -213,11 +220,11 @@ declare module "crypto" {
setAAD(buffer: Buffer, options?: { plaintextLength: number }): this;
getAuthTag(): Buffer;
}
/** @deprecated since v10.0.0 use createCipheriv() */
/** @deprecated since v10.0.0 use createDecipheriv() */
function createDecipher(algorithm: CipherCCMTypes, password: BinaryLike, options: CipherCCMOptions): DecipherCCM;
/** @deprecated since v10.0.0 use createCipheriv() */
/** @deprecated since v10.0.0 use createDecipheriv() */
function createDecipher(algorithm: CipherGCMTypes, password: BinaryLike, options?: CipherGCMOptions): DecipherGCM;
/** @deprecated since v10.0.0 use createCipheriv() */
/** @deprecated since v10.0.0 use createDecipheriv() */
function createDecipher(algorithm: string, password: BinaryLike, options?: stream.TransformOptions): Decipher;
function createDecipheriv(
@@ -234,25 +241,25 @@ declare module "crypto" {
): DecipherGCM;
function createDecipheriv(algorithm: string, key: BinaryLike, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher;
class Decipher extends stream.Duplex {
class Decipher extends stream.Transform {
private constructor();
update(data: Binary): Buffer;
update(data: NodeJS.ArrayBufferView): Buffer;
update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
update(data: Binary, input_encoding: undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
update(data: NodeJS.ArrayBufferView, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
update(data: string, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
final(): Buffer;
final(output_encoding: string): string;
setAutoPadding(auto_padding?: boolean): this;
// setAuthTag(tag: Binary): this;
// setAAD(buffer: Binary): this;
// setAuthTag(tag: NodeJS.ArrayBufferView): this;
// setAAD(buffer: NodeJS.ArrayBufferView): this;
}
interface DecipherCCM extends Decipher {
setAuthTag(buffer: Binary): this;
setAAD(buffer: Binary, options: { plaintextLength: number }): this;
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
setAAD(buffer: NodeJS.ArrayBufferView, options: { plaintextLength: number }): this;
}
interface DecipherGCM extends Decipher {
setAuthTag(buffer: Binary): this;
setAAD(buffer: Binary, options?: { plaintextLength: number }): this;
setAuthTag(buffer: NodeJS.ArrayBufferView): this;
setAAD(buffer: NodeJS.ArrayBufferView, options?: { plaintextLength: number }): this;
}
interface PrivateKeyInput {
@@ -302,23 +309,23 @@ declare module "crypto" {
update(data: BinaryLike): Verify;
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
verify(object: Object | KeyLike, signature: Binary): boolean;
verify(object: Object | KeyLike, signature: NodeJS.ArrayBufferView): boolean;
verify(object: Object | KeyLike, signature: string, signature_format?: HexBase64Latin1Encoding): boolean;
// https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
// The signature field accepts a TypedArray type, but it is only available starting ES2017
}
function createDiffieHellman(prime_length: number, generator?: number | Binary): DiffieHellman;
function createDiffieHellman(prime: Binary): DiffieHellman;
function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | Binary): DiffieHellman;
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman;
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
class DiffieHellman {
private constructor();
generateKeys(): Buffer;
generateKeys(encoding: HexBase64Latin1Encoding): string;
computeSecret(other_public_key: Binary): Buffer;
computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
computeSecret(other_public_key: Binary, output_encoding: HexBase64Latin1Encoding): string;
computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
getPrime(): Buffer;
getPrime(encoding: HexBase64Latin1Encoding): string;
@@ -328,9 +335,9 @@ declare module "crypto" {
getPublicKey(encoding: HexBase64Latin1Encoding): string;
getPrivateKey(): Buffer;
getPrivateKey(encoding: HexBase64Latin1Encoding): string;
setPublicKey(public_key: Binary): void;
setPublicKey(public_key: NodeJS.ArrayBufferView): void;
setPublicKey(public_key: string, encoding: string): void;
setPrivateKey(private_key: Binary): void;
setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
setPrivateKey(private_key: string, encoding: string): void;
verifyError: number;
}
@@ -350,10 +357,10 @@ declare module "crypto" {
function pseudoRandomBytes(size: number): Buffer;
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
function randomFillSync<T extends Binary>(buffer: T, offset?: number, size?: number): T;
function randomFill<T extends Binary>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
function randomFill<T extends Binary>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
function randomFill<T extends Binary>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
interface ScryptOptions {
N?: number;
@@ -382,14 +389,20 @@ declare module "crypto" {
interface RsaPrivateKey {
key: KeyLike;
passphrase?: string;
/**
* @default 'sha1'
*/
oaepHash?: string;
oaepLabel?: NodeJS.TypedArray;
padding?: number;
}
function publicEncrypt(public_key: RsaPublicKey | KeyLike, buffer: Binary): Buffer;
function privateDecrypt(private_key: RsaPrivateKey | KeyLike, buffer: Binary): Buffer;
function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: Binary): Buffer;
function publicDecrypt(public_key: RsaPublicKey | KeyLike, buffer: Binary): Buffer;
function publicEncrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
function publicDecrypt(key: RsaPublicKey | RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
function privateDecrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
function getCiphers(): string[];
function getCurves(): string[];
function getFips(): 1 | 0;
function getHashes(): string[];
class ECDH {
private constructor();
@@ -402,24 +415,24 @@ declare module "crypto" {
): Buffer | string;
generateKeys(): Buffer;
generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
computeSecret(other_public_key: Binary): Buffer;
computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
computeSecret(other_public_key: Binary, output_encoding: HexBase64Latin1Encoding): string;
computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
getPrivateKey(): Buffer;
getPrivateKey(encoding: HexBase64Latin1Encoding): string;
getPublicKey(): Buffer;
getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
setPrivateKey(private_key: Binary): void;
setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
}
function createECDH(curve_name: string): ECDH;
function timingSafeEqual(a: Binary, b: Binary): boolean;
function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
/** @deprecated since v10.0.0 */
const DEFAULT_ENCODING: string;
export type KeyType = 'rsa' | 'dsa' | 'ec';
export type KeyFormat = 'pem' | 'der';
type KeyType = 'rsa' | 'dsa' | 'ec';
type KeyFormat = 'pem' | 'der';
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
format: T;
@@ -585,7 +598,7 @@ declare module "crypto" {
* If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
* passed to [`crypto.createPrivateKey()`][].
*/
function sign(algorithm: string | null | undefined, data: Binary, key: KeyLike | SignPrivateKeyInput): Buffer;
function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignPrivateKeyInput): Buffer;
interface VerifyKeyWithOptions extends KeyObject, SigningOptions {
}
@@ -598,5 +611,5 @@ declare module "crypto" {
* If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
* passed to [`crypto.createPublicKey()`][].
*/
function verify(algorithm: string | null | undefined, data: Binary, key: KeyLike | VerifyKeyWithOptions, signature: Binary): Buffer;
function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyWithOptions, signature: NodeJS.ArrayBufferView): Buffer;
}

View File

@@ -11,9 +11,10 @@ declare module "dgram" {
}
interface BindOptions {
port: number;
port?: number;
address?: string;
exclusive?: boolean;
fd?: number;
}
type SocketType = "udp4" | "udp6";
@@ -34,67 +35,82 @@ declare module "dgram" {
function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
class Socket extends events.EventEmitter {
send(msg: string | Uint8Array | any[], port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, port: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
addMembership(multicastAddress: string, multicastInterface?: string): void;
address(): AddressInfo;
bind(port?: number, address?: string, callback?: () => void): void;
bind(port?: number, callback?: () => void): void;
bind(callback?: () => void): void;
bind(options: BindOptions, callback?: () => void): void;
close(callback?: () => void): void;
address(): AddressInfo | string;
setBroadcast(flag: boolean): void;
setTTL(ttl: number): void;
setMulticastTTL(ttl: number): void;
setMulticastInterface(multicastInterface: string): void;
setMulticastLoopback(flag: boolean): void;
addMembership(multicastAddress: string, multicastInterface?: string): void;
connect(port: number, address?: string, callback?: () => void): void;
connect(port: number, callback: () => void): void;
disconnect(): void;
dropMembership(multicastAddress: string, multicastInterface?: string): void;
ref(): this;
unref(): this;
setRecvBufferSize(size: number): void;
setSendBufferSize(size: number): void;
getRecvBufferSize(): number;
getSendBufferSize(): number;
ref(): this;
remoteAddress(): AddressInfo;
send(msg: string | Uint8Array | any[], port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array | any[], port?: number, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array | any[], callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
setBroadcast(flag: boolean): void;
setMulticastInterface(multicastInterface: string): void;
setMulticastLoopback(flag: boolean): void;
setMulticastTTL(ttl: number): void;
setRecvBufferSize(size: number): void;
setSendBufferSize(size: number): void;
setTTL(ttl: number): void;
unref(): this;
/**
* events.EventEmitter
* 1. close
* 2. error
* 3. listening
* 4. message
* 2. connect
* 3. error
* 4. listening
* 5. message
*/
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "close", listener: () => void): this;
addListener(event: "connect", listener: () => void): this;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "listening", listener: () => void): this;
addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
emit(event: string | symbol, ...args: any[]): boolean;
emit(event: "close"): boolean;
emit(event: "connect"): boolean;
emit(event: "error", err: Error): boolean;
emit(event: "listening"): boolean;
emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
on(event: string, listener: (...args: any[]) => void): this;
on(event: "close", listener: () => void): this;
on(event: "connect", listener: () => void): this;
on(event: "error", listener: (err: Error) => void): this;
on(event: "listening", listener: () => void): this;
on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: "close", listener: () => void): this;
once(event: "connect", listener: () => void): this;
once(event: "error", listener: (err: Error) => void): this;
once(event: "listening", listener: () => void): this;
once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: "close", listener: () => void): this;
prependListener(event: "connect", listener: () => void): this;
prependListener(event: "error", listener: (err: Error) => void): this;
prependListener(event: "listening", listener: () => void): this;
prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
prependOnceListener(event: "connect", listener: () => void): this;
prependOnceListener(event: "error", listener: (err: Error) => void): this;
prependOnceListener(event: "listening", listener: () => void): this;
prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;

View File

@@ -31,9 +31,9 @@ declare module "dns" {
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace lookup {
function __promisify__(hostname: string, options: LookupAllOptions): Promise<{ address: LookupAddress[] }>;
function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<{ address: string, family: number }>;
function __promisify__(hostname: string, options?: LookupOptions | number): Promise<{ address: string | LookupAddress[], family?: number }>;
function __promisify__(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
function __promisify__(hostname: string, options?: LookupOneOptions | number): Promise<LookupAddress>;
function __promisify__(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
}
function lookupService(address: string, port: number, callback: (err: NodeJS.ErrnoException | null, hostname: string, service: string) => void): void;

View File

@@ -1,9 +1,30 @@
declare module "events" {
class internal extends NodeJS.EventEmitter { }
interface NodeEventTarget {
once(event: string | symbol, listener: (...args: any[]) => void): this;
}
interface DOMEventTarget {
addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any;
}
namespace internal {
function once(emitter: EventEmitter, event: string | symbol): Promise<any[]>;
class EventEmitter extends internal {
function once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
function once(emitter: DOMEventTarget, event: string): Promise<any[]>;
/**
* This symbol shall be used to install a listener for only monitoring `'error'`
* events. Listeners installed using this symbol are called before the regular
* `'error'` listeners are called.
*
* Installing a listener using this symbol does not change the behavior once an
* `'error'` event is emitted, therefore the process will still crash if no
* regular `'error'` listener is installed.
*/
const errorMonitor: unique symbol;
class EventEmitter extends internal {
/** @deprecated since v4.0.0 */
static listenerCount(emitter: EventEmitter, event: string | symbol): number;
static defaultMaxListeners: number;

View File

@@ -8,8 +8,9 @@ declare module "fs" {
*/
type PathLike = string | Buffer | URL;
type BinaryData = DataView | NodeJS.TypedArray;
class Stats {
type NoParamCallback = (err: NodeJS.ErrnoException | null) => void;
interface StatsBase<T> {
isFile(): boolean;
isDirectory(): boolean;
isBlockDevice(): boolean;
@@ -17,26 +18,33 @@ declare module "fs" {
isSymbolicLink(): boolean;
isFIFO(): boolean;
isSocket(): boolean;
dev: number;
ino: number;
mode: number;
nlink: number;
uid: number;
gid: number;
rdev: number;
size: number;
blksize: number;
blocks: number;
atimeMs: number;
mtimeMs: number;
ctimeMs: number;
birthtimeMs: number;
dev: T;
ino: T;
mode: T;
nlink: T;
uid: T;
gid: T;
rdev: T;
size: T;
blksize: T;
blocks: T;
atimeMs: T;
mtimeMs: T;
ctimeMs: T;
birthtimeMs: T;
atime: Date;
mtime: Date;
ctime: Date;
birthtime: Date;
}
interface Stats extends StatsBase<number> {
}
class Stats {
}
class Dirent {
isFile(): boolean;
isDirectory(): boolean;
@@ -48,6 +56,46 @@ declare module "fs" {
name: string;
}
/**
* A class representing a directory stream.
*/
class Dir {
readonly path: string;
/**
* Asynchronously iterates over the directory via `readdir(3)` until all entries have been read.
*/
[Symbol.asyncIterator](): AsyncIterableIterator<Dirent>;
/**
* Asynchronously close the directory's underlying resource handle.
* Subsequent reads will result in errors.
*/
close(): Promise<void>;
close(cb: NoParamCallback): void;
/**
* Synchronously close the directory's underlying resource handle.
* Subsequent reads will result in errors.
*/
closeSync(): void;
/**
* Asynchronously read the next directory entry via `readdir(3)` as an `Dirent`.
* After the read is completed, a value is returned that will be resolved with an `Dirent`, or `null` if there are no more directory entries to read.
* Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms.
*/
read(): Promise<Dirent | null>;
read(cb: (err: NodeJS.ErrnoException | null, dirEnt: Dirent | null) => void): void;
/**
* Synchronously read the next directory entry via `readdir(3)` as a `Dirent`.
* If there are no more directory entries to read, null will be returned.
* Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms.
*/
readSync(): Dirent;
}
interface FSWatcher extends events.EventEmitter {
close(): void;
@@ -59,22 +107,27 @@ declare module "fs" {
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
addListener(event: "error", listener: (error: Error) => void): this;
addListener(event: "close", listener: () => void): this;
on(event: string, listener: (...args: any[]) => void): this;
on(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
on(event: "error", listener: (error: Error) => void): this;
on(event: "close", listener: () => void): this;
once(event: string, listener: (...args: any[]) => void): this;
once(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
once(event: "error", listener: (error: Error) => void): this;
once(event: "close", listener: () => void): this;
prependListener(event: string, listener: (...args: any[]) => void): this;
prependListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
prependListener(event: "error", listener: (error: Error) => void): this;
prependListener(event: "close", listener: () => void): this;
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: "change", listener: (eventType: string, filename: string | Buffer) => void): this;
prependOnceListener(event: "error", listener: (error: Error) => void): this;
prependOnceListener(event: "close", listener: () => void): this;
}
class ReadStream extends stream.Readable {
@@ -146,7 +199,7 @@ declare module "fs" {
* @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
* URL support is _experimental_.
*/
function rename(oldPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
function rename(oldPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace rename {
@@ -174,14 +227,14 @@ declare module "fs" {
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
* @param len If not specified, defaults to `0`.
*/
function truncate(path: PathLike, len: number | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
function truncate(path: PathLike, len: number | undefined | null, callback: NoParamCallback): void;
/**
* Asynchronous truncate(2) - Truncate a file to a specified length.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
* URL support is _experimental_.
*/
function truncate(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
function truncate(path: PathLike, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace truncate {
@@ -205,13 +258,13 @@ declare module "fs" {
* @param fd A file descriptor.
* @param len If not specified, defaults to `0`.
*/
function ftruncate(fd: number, len: number | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
function ftruncate(fd: number, len: number | undefined | null, callback: NoParamCallback): void;
/**
* Asynchronous ftruncate(2) - Truncate a file to a specified length.
* @param fd A file descriptor.
*/
function ftruncate(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function ftruncate(fd: number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace ftruncate {
@@ -234,7 +287,7 @@ declare module "fs" {
* Asynchronous chown(2) - Change ownership of a file.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function chown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function chown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace chown {
@@ -255,7 +308,7 @@ declare module "fs" {
* Asynchronous fchown(2) - Change ownership of a file.
* @param fd A file descriptor.
*/
function fchown(fd: number, uid: number, gid: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function fchown(fd: number, uid: number, gid: number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace fchown {
@@ -276,7 +329,7 @@ declare module "fs" {
* Asynchronous lchown(2) - Change ownership of a file. Does not dereference symbolic links.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function lchown(path: PathLike, uid: number, gid: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function lchown(path: PathLike, uid: number, gid: number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace lchown {
@@ -298,7 +351,7 @@ declare module "fs" {
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
* @param mode A file mode. If a string is passed, it is parsed as an octal integer.
*/
function chmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function chmod(path: PathLike, mode: string | number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace chmod {
@@ -322,7 +375,7 @@ declare module "fs" {
* @param fd A file descriptor.
* @param mode A file mode. If a string is passed, it is parsed as an octal integer.
*/
function fchmod(fd: number, mode: string | number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function fchmod(fd: number, mode: string | number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace fchmod {
@@ -346,7 +399,7 @@ declare module "fs" {
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
* @param mode A file mode. If a string is passed, it is parsed as an octal integer.
*/
function lchmod(path: PathLike, mode: string | number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function lchmod(path: PathLike, mode: string | number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace lchmod {
@@ -433,7 +486,7 @@ declare module "fs" {
* @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
* @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function link(existingPath: PathLike, newPath: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
function link(existingPath: PathLike, newPath: PathLike, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace link {
@@ -442,7 +495,7 @@ declare module "fs" {
* @param existingPath A path to a file. If a URL is provided, it must use the `file:` protocol.
* @param newPath A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function link(existingPath: PathLike, newPath: PathLike): Promise<void>;
function __promisify__(existingPath: PathLike, newPath: PathLike): Promise<void>;
}
/**
@@ -459,14 +512,14 @@ declare module "fs" {
* @param type May be set to `'dir'`, `'file'`, or `'junction'` (default is `'file'`) and is only available on Windows (ignored on other platforms).
* When using `'junction'`, the `target` argument will automatically be normalized to an absolute path.
*/
function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
function symlink(target: PathLike, path: PathLike, type: symlink.Type | undefined | null, callback: NoParamCallback): void;
/**
* Asynchronous symlink(2) - Create a new symbolic link to an existing file.
* @param target A path to an existing file. If a URL is provided, it must use the `file:` protocol.
* @param path A path to the new symlink. If a URL is provided, it must use the `file:` protocol.
*/
function symlink(target: PathLike, path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
function symlink(target: PathLike, path: PathLike, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace symlink {
@@ -662,7 +715,7 @@ declare module "fs" {
* Asynchronous unlink(2) - delete a name and possibly the file it refers to.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function unlink(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
function unlink(path: PathLike, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace unlink {
@@ -679,11 +732,42 @@ declare module "fs" {
*/
function unlinkSync(path: PathLike): void;
interface RmDirOptions {
/**
* If `true`, perform a recursive directory removal. In
* recursive mode, errors are not reported if `path` does not exist, and
* operations are retried on failure.
* @experimental
* @default false
*/
recursive?: boolean;
}
interface RmDirAsyncOptions extends RmDirOptions {
/**
* If an `EMFILE` error is encountered, Node.js will
* retry the operation with a linear backoff of 1ms longer on each try until the
* timeout duration passes this limit. This option is ignored if the `recursive`
* option is not `true`.
* @default 1000
*/
emfileWait?: number;
/**
* If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error is
* encountered, Node.js will retry the operation with a linear backoff wait of
* 100ms longer on each try. This option represents the number of retries. This
* option is ignored if the `recursive` option is not `true`.
* @default 3
*/
maxBusyTries?: number;
}
/**
* Asynchronous rmdir(2) - delete a directory.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function rmdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
function rmdir(path: PathLike, callback: NoParamCallback): void;
function rmdir(path: PathLike, options: RmDirAsyncOptions, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace rmdir {
@@ -691,16 +775,16 @@ declare module "fs" {
* Asynchronous rmdir(2) - delete a directory.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function __promisify__(path: PathLike): Promise<void>;
function __promisify__(path: PathLike, options?: RmDirAsyncOptions): Promise<void>;
}
/**
* Synchronous rmdir(2) - delete a directory.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function rmdirSync(path: PathLike): void;
function rmdirSync(path: PathLike, options?: RmDirOptions): void;
export interface MakeDirectoryOptions {
interface MakeDirectoryOptions {
/**
* Indicates whether parent folders should be created.
* @default false
@@ -710,7 +794,7 @@ declare module "fs" {
* A file mode. If a string is passed, it is parsed as an octal integer. If not specified
* @default 0o777.
*/
mode?: number;
mode?: number | string;
}
/**
@@ -719,13 +803,13 @@ declare module "fs" {
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
*/
function mkdir(path: PathLike, options: number | string | MakeDirectoryOptions | undefined | null, callback: (err: NodeJS.ErrnoException | null) => void): void;
function mkdir(path: PathLike, options: number | string | MakeDirectoryOptions | undefined | null, callback: NoParamCallback): void;
/**
* Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function mkdir(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
function mkdir(path: PathLike, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace mkdir {
@@ -923,7 +1007,7 @@ declare module "fs" {
* Asynchronous close(2) - close a file descriptor.
* @param fd A file descriptor.
*/
function close(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function close(fd: number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace close {
@@ -976,7 +1060,7 @@ declare module "fs" {
* @param atime The last access time. If a string is provided, it will be coerced to number.
* @param mtime The last modified time. If a string is provided, it will be coerced to number.
*/
function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException | null) => void): void;
function utimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace utimes {
@@ -1003,7 +1087,7 @@ declare module "fs" {
* @param atime The last access time. If a string is provided, it will be coerced to number.
* @param mtime The last modified time. If a string is provided, it will be coerced to number.
*/
function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: (err: NodeJS.ErrnoException | null) => void): void;
function futimes(fd: number, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace futimes {
@@ -1028,7 +1112,7 @@ declare module "fs" {
* Asynchronous fsync(2) - synchronize a file's in-core state with the underlying storage device.
* @param fd A file descriptor.
*/
function fsync(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function fsync(fd: number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace fsync {
@@ -1052,7 +1136,7 @@ declare module "fs" {
* @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
*/
function write<TBuffer extends BinaryData>(
function write<TBuffer extends NodeJS.ArrayBufferView>(
fd: number,
buffer: TBuffer,
offset: number | undefined | null,
@@ -1067,7 +1151,7 @@ declare module "fs" {
* @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
* @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
*/
function write<TBuffer extends BinaryData>(
function write<TBuffer extends NodeJS.ArrayBufferView>(
fd: number,
buffer: TBuffer,
offset: number | undefined | null,
@@ -1080,7 +1164,7 @@ declare module "fs" {
* @param fd A file descriptor.
* @param offset The part of the buffer to be written. If not supplied, defaults to `0`.
*/
function write<TBuffer extends BinaryData>(
function write<TBuffer extends NodeJS.ArrayBufferView>(
fd: number,
buffer: TBuffer,
offset: number | undefined | null,
@@ -1091,7 +1175,7 @@ declare module "fs" {
* Asynchronously writes `buffer` to the file referenced by the supplied file descriptor.
* @param fd A file descriptor.
*/
function write<TBuffer extends BinaryData>(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void;
function write<TBuffer extends NodeJS.ArrayBufferView>(fd: number, buffer: TBuffer, callback: (err: NodeJS.ErrnoException | null, written: number, buffer: TBuffer) => void): void;
/**
* Asynchronously writes `string` to the file referenced by the supplied file descriptor.
@@ -1132,7 +1216,7 @@ declare module "fs" {
* @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
*/
function __promisify__<TBuffer extends BinaryData>(
function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
fd: number,
buffer?: TBuffer,
offset?: number,
@@ -1157,7 +1241,7 @@ declare module "fs" {
* @param length The number of bytes to write. If not supplied, defaults to `buffer.length - offset`.
* @param position The offset from the beginning of the file where this data should be written. If not supplied, defaults to the current position.
*/
function writeSync(fd: number, buffer: BinaryData, offset?: number | null, length?: number | null, position?: number | null): number;
function writeSync(fd: number, buffer: NodeJS.ArrayBufferView, offset?: number | null, length?: number | null, position?: number | null): number;
/**
* Synchronously writes `string` to the file referenced by the supplied file descriptor, returning the number of bytes written.
@@ -1176,7 +1260,7 @@ declare module "fs" {
* @param length The number of bytes to read.
* @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
*/
function read<TBuffer extends BinaryData>(
function read<TBuffer extends NodeJS.ArrayBufferView>(
fd: number,
buffer: TBuffer,
offset: number,
@@ -1194,7 +1278,13 @@ declare module "fs" {
* @param length The number of bytes to read.
* @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
*/
function __promisify__<TBuffer extends BinaryData>(fd: number, buffer: TBuffer, offset: number, length: number, position: number | null): Promise<{ bytesRead: number, buffer: TBuffer }>;
function __promisify__<TBuffer extends NodeJS.ArrayBufferView>(
fd: number,
buffer: TBuffer,
offset: number,
length: number,
position: number | null
): Promise<{ bytesRead: number, buffer: TBuffer }>;
}
/**
@@ -1205,7 +1295,7 @@ declare module "fs" {
* @param length The number of bytes to read.
* @param position The offset from the beginning of the file from which data should be read. If `null`, data will be read from the current position.
*/
function readSync(fd: number, buffer: BinaryData, offset: number, length: number, position: number | null): number;
function readSync(fd: number, buffer: NodeJS.ArrayBufferView, offset: number, length: number, position: number | null): number;
/**
* Asynchronously reads the entire contents of a file.
@@ -1322,7 +1412,7 @@ declare module "fs" {
* If `mode` is a string, it is parsed as an octal integer.
* If `flag` is not supplied, the default of `'w'` is used.
*/
function writeFile(path: PathLike | number, data: any, options: WriteFileOptions, callback: (err: NodeJS.ErrnoException | null) => void): void;
function writeFile(path: PathLike | number, data: any, options: WriteFileOptions, callback: NoParamCallback): void;
/**
* Asynchronously writes data to a file, replacing the file if it already exists.
@@ -1331,7 +1421,7 @@ declare module "fs" {
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
* @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
*/
function writeFile(path: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void;
function writeFile(path: PathLike | number, data: any, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace writeFile {
@@ -1376,7 +1466,7 @@ declare module "fs" {
* If `mode` is a string, it is parsed as an octal integer.
* If `flag` is not supplied, the default of `'a'` is used.
*/
function appendFile(file: PathLike | number, data: any, options: WriteFileOptions, callback: (err: NodeJS.ErrnoException | null) => void): void;
function appendFile(file: PathLike | number, data: any, options: WriteFileOptions, callback: NoParamCallback): void;
/**
* Asynchronously append data to a file, creating the file if it does not exist.
@@ -1385,7 +1475,7 @@ declare module "fs" {
* If a file descriptor is provided, the underlying file will _not_ be closed automatically.
* @param data The data to write. If something other than a Buffer or Uint8Array is provided, the value is coerced to a string.
*/
function appendFile(file: PathLike | number, data: any, callback: (err: NodeJS.ErrnoException | null) => void): void;
function appendFile(file: PathLike | number, data: any, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace appendFile {
@@ -1663,6 +1753,13 @@ declare module "fs" {
/** Constant for fs.Stats mode property for determining access permissions for a file. File mode indicating executable by others. */
const S_IXOTH: number;
/**
* When set, a memory file mapping is used to access the file. This flag
* is available on Windows operating systems only. On other operating systems,
* this flag is ignored.
*/
const UV_FS_O_FILEMAP: number;
}
/**
@@ -1670,14 +1767,14 @@ declare module "fs" {
* @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
* URL support is _experimental_.
*/
function access(path: PathLike, mode: number | undefined, callback: (err: NodeJS.ErrnoException | null) => void): void;
function access(path: PathLike, mode: number | undefined, callback: NoParamCallback): void;
/**
* Asynchronously tests a user's permissions for the file specified by path.
* @param path A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
* URL support is _experimental_.
*/
function access(path: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
function access(path: PathLike, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace access {
@@ -1707,6 +1804,10 @@ declare module "fs" {
fd?: number;
mode?: number;
autoClose?: boolean;
/**
* @default false
*/
emitClose?: boolean;
start?: number;
end?: number;
highWaterMark?: number;
@@ -1723,6 +1824,7 @@ declare module "fs" {
fd?: number;
mode?: number;
autoClose?: boolean;
emitClose?: boolean;
start?: number;
highWaterMark?: number;
}): WriteStream;
@@ -1731,7 +1833,7 @@ declare module "fs" {
* Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
* @param fd A file descriptor.
*/
function fdatasync(fd: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function fdatasync(fd: number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace fdatasync {
@@ -1757,7 +1859,7 @@ declare module "fs" {
* @param src A path to the source file.
* @param dest A path to the destination file.
*/
function copyFile(src: PathLike, dest: PathLike, callback: (err: NodeJS.ErrnoException | null) => void): void;
function copyFile(src: PathLike, dest: PathLike, callback: NoParamCallback): void;
/**
* Asynchronously copies src to dest. By default, dest is overwritten if it already exists.
* No arguments other than a possible exception are given to the callback function.
@@ -1768,7 +1870,7 @@ declare module "fs" {
* @param dest A path to the destination file.
* @param flags An integer that specifies the behavior of the copy operation. The only supported flag is fs.constants.COPYFILE_EXCL, which causes the copy operation to fail if dest already exists.
*/
function copyFile(src: PathLike, dest: PathLike, flags: number, callback: (err: NodeJS.ErrnoException | null) => void): void;
function copyFile(src: PathLike, dest: PathLike, flags: number, callback: NoParamCallback): void;
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
namespace copyFile {
@@ -1799,6 +1901,52 @@ declare module "fs" {
*/
function copyFileSync(src: PathLike, dest: PathLike, flags?: number): void;
/**
* Write an array of ArrayBufferViews to the file specified by fd using writev().
* position is the offset from the beginning of the file where this data should be written.
* It is unsafe to use fs.writev() multiple times on the same file without waiting for the callback. For this scenario, use fs.createWriteStream().
* On Linux, positional writes don't work when the file is opened in append mode.
* The kernel ignores the position argument and always appends the data to the end of the file.
*/
function writev(
fd: number,
buffers: NodeJS.ArrayBufferView[],
cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void
): void;
function writev(
fd: number,
buffers: NodeJS.ArrayBufferView[],
position: number,
cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void
): void;
interface WriteVResult {
bytesWritten: number;
buffers: NodeJS.ArrayBufferView[];
}
namespace writev {
function __promisify__(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): Promise<WriteVResult>;
}
/**
* See `writev`.
*/
function writevSync(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): number;
interface OpenDirOptions {
encoding?: BufferEncoding;
}
function opendirSync(path: string, options?: OpenDirOptions): Dir;
function opendir(path: string, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
function opendir(path: string, options: OpenDirOptions, cb: (err: NodeJS.ErrnoException | null, dir: Dir) => void): void;
namespace opendir {
function __promisify__(path: string, options?: OpenDirOptions): Promise<Dir>;
}
namespace promises {
interface FileHandle {
/**
@@ -1925,6 +2073,11 @@ declare module "fs" {
*/
writeFile(data: any, options?: { encoding?: string | null, mode?: string | number, flag?: string | number } | string | null): Promise<void>;
/**
* See `fs.writev` promisified version.
*/
writev(buffers: NodeJS.ArrayBufferView[], position?: number): Promise<WriteVResult>;
/**
* Asynchronous close(2) - close a `FileHandle`.
*/
@@ -2030,7 +2183,7 @@ declare module "fs" {
* Asynchronous rmdir(2) - delete a directory.
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
*/
function rmdir(path: PathLike): Promise<void>;
function rmdir(path: PathLike, options?: RmDirAsyncOptions): Promise<void>;
/**
* Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
@@ -2293,5 +2446,7 @@ declare module "fs" {
* If a flag is not provided, it defaults to `'r'`.
*/
function readFile(path: PathLike | FileHandle, options?: { encoding?: string | null, flag?: string | number } | string | null): Promise<string | Buffer>;
function opendir(path: string, options?: OpenDirOptions): Promise<Dir>;
}
}

View File

@@ -164,7 +164,6 @@ interface ImportMeta {
* *
------------------------------------------------*/
declare var process: NodeJS.Process;
declare var global: NodeJS.Global;
declare var console: Console;
declare var __filename: string;
@@ -185,9 +184,6 @@ declare namespace setImmediate {
}
declare function clearImmediate(immediateId: NodeJS.Immediate): void;
/**
* @experimental
*/
declare function queueMicrotask(callback: () => void): void;
// TODO: change to `type NodeRequireFunction = (id: string) => any;` in next mayor version.
@@ -196,9 +192,13 @@ interface NodeRequireFunction {
(id: string): any;
}
interface NodeRequireCache {
[path: string]: NodeModule;
}
interface NodeRequire extends NodeRequireFunction {
resolve: RequireResolve;
cache: any;
cache: NodeRequireCache;
/**
* @deprecated
*/
@@ -228,6 +228,12 @@ interface NodeModule {
loaded: boolean;
parent: NodeModule | null;
children: NodeModule[];
/**
* @since 11.14.0
*
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
*/
path: string;
paths: string[];
}
@@ -309,6 +315,12 @@ declare class Buffer extends Uint8Array {
*/
static from(data: number[]): Buffer;
static from(data: Uint8Array): Buffer;
/**
* Creates a new buffer containing the coerced value of an object
* A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
* @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
*/
static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
/**
* Creates a new Buffer containing the given JavaScript string {str}.
* If provided, the {encoding} parameter identifies the character encoding.
@@ -341,7 +353,7 @@ declare class Buffer extends Uint8Array {
* @param encoding encoding used to evaluate (defaults to 'utf8')
*/
static byteLength(
string: string | NodeJS.TypedArray | DataView | ArrayBuffer | SharedArrayBuffer,
string: string | NodeJS.ArrayBufferView | ArrayBuffer | SharedArrayBuffer,
encoding?: BufferEncoding
): number;
/**
@@ -651,9 +663,7 @@ declare namespace NodeJS {
interface ReadWriteStream extends ReadableStream, WritableStream { }
interface Events extends EventEmitter { }
interface Domain extends Events {
interface Domain extends EventEmitter {
run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
add(emitter: EventEmitter | Timer): void;
remove(emitter: EventEmitter | Timer): void;
@@ -706,7 +716,8 @@ declare namespace NodeJS {
| 'openbsd'
| 'sunos'
| 'win32'
| 'cygwin';
| 'cygwin'
| 'netbsd';
type Signals =
"SIGABRT" | "SIGALRM" | "SIGBUS" | "SIGCHLD" | "SIGCONT" | "SIGFPE" | "SIGHUP" | "SIGILL" | "SIGINT" | "SIGIO" |
@@ -737,31 +748,6 @@ declare namespace NodeJS {
[key: string]: string | undefined;
}
interface WriteStream extends Socket {
readonly writableFinished: boolean;
readonly writableHighWaterMark: number;
readonly writableLength: number;
columns?: number;
rows?: number;
_write(chunk: any, encoding: string, callback: (err?: null | Error) => void): void;
_destroy(err: Error | null, callback: (err?: null | Error) => void): void;
_final(callback: (err?: null | Error) => void): void;
setDefaultEncoding(encoding: string): this;
cork(): void;
uncork(): void;
destroy(error?: Error): void;
}
interface ReadStream extends Socket {
readonly readableHighWaterMark: number;
readonly readableLength: number;
isRaw?: boolean;
setRawMode?(mode: boolean): void;
_read(size: number): void;
_destroy(err: Error | null, callback: (err?: null | Error) => void): void;
push(chunk: any, encoding?: string): boolean;
destroy(error?: Error): void;
}
interface HRTime {
(time?: [number, number]): [number, number];
}
@@ -913,7 +899,7 @@ declare namespace NodeJS {
visibility: string;
};
};
kill(pid: number, signal?: string | number): void;
kill(pid: number, signal?: string | number): true;
pid: number;
ppid: number;
title: string;
@@ -1159,7 +1145,12 @@ declare namespace NodeJS {
class Module {
static runMain(): void;
static wrap(code: string): string;
static createRequireFromPath(path: string): (path: string) => any;
/**
* @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
*/
static createRequireFromPath(path: string): NodeRequire;
static createRequire(path: string): NodeRequire;
static builtinModules: string[];
static Module: typeof Module;
@@ -1171,10 +1162,24 @@ declare namespace NodeJS {
loaded: boolean;
parent: Module | null;
children: Module[];
/**
* @since 11.14.0
*
* The directory name of the module. This is usually the same as the path.dirname() of the module.id.
*/
path: string;
paths: string[];
constructor(id: string, parent?: Module);
}
type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
type ArrayBufferView = TypedArray | DataView;
// TODO: The value type here is a version of `unknown` with an acceptably lossy amount of accuracy.
// Now that TypeScript's DT support is 3.0+, we can look into replacing this with `unknown`.
type UnknownFacade = {} | null | undefined;
/** @deprecated - Use `UnknownFacade` instead. It is a better classifier for the type */
type PoorMansUnknown = UnknownFacade;
}

1
node_modules/@types/node/ts3.1/globals.global.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
declare var global: NodeJS.Global;

View File

@@ -16,6 +16,8 @@ declare module "http" {
'access-control-allow-origin'?: string;
'access-control-expose-headers'?: string;
'access-control-max-age'?: string;
'access-control-request-headers'?: string;
'access-control-request-method'?: string;
'age'?: string;
'allow'?: string;
'alt-svc'?: string;
@@ -42,6 +44,7 @@ declare module "http" {
'if-unmodified-since'?: string;
'last-modified'?: string;
'location'?: string;
'origin'?: string;
'pragma'?: string;
'proxy-authenticate'?: string;
'proxy-authorization'?: string;
@@ -69,18 +72,18 @@ declare module "http" {
}
interface ClientRequestArgs {
protocol?: string;
host?: string;
hostname?: string;
protocol?: string | null;
host?: string | null;
hostname?: string | null;
family?: number;
port?: number | string;
port?: number | string | null;
defaultPort?: number | string;
localAddress?: string;
socketPath?: string;
method?: string;
path?: string;
path?: string | null;
headers?: OutgoingHttpHeaders;
auth?: string;
auth?: string | null;
agent?: Agent | boolean;
_defaultAgent?: Agent;
timeout?: number;
@@ -146,6 +149,7 @@ declare module "http" {
class ServerResponse extends OutgoingMessage {
statusCode: number;
statusMessage: string;
writableFinished: boolean;
constructor(req: IncomingMessage);
@@ -156,6 +160,17 @@ declare module "http" {
writeContinue(callback?: () => void): void;
writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): this;
writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
writeProcessing(): void;
}
interface InformationEvent {
statusCode: number;
statusMessage: string;
httpVersion: string;
httpVersionMajor: number;
httpVersionMinor: number;
headers: IncomingHttpHeaders;
rawHeaders: string[];
}
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
@@ -172,11 +187,92 @@ declare module "http" {
setTimeout(timeout: number, callback?: () => void): this;
setNoDelay(noDelay?: boolean): void;
setSocketKeepAlive(enable?: boolean, initialDelay?: number): void;
addListener(event: 'abort', listener: () => void): this;
addListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
addListener(event: 'continue', listener: () => void): this;
addListener(event: 'information', listener: (info: InformationEvent) => void): this;
addListener(event: 'response', listener: (response: IncomingMessage) => void): this;
addListener(event: 'socket', listener: (socket: Socket) => void): this;
addListener(event: 'timeout', listener: () => void): this;
addListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
addListener(event: 'close', listener: () => void): this;
addListener(event: 'drain', listener: () => void): this;
addListener(event: 'error', listener: (err: Error) => void): this;
addListener(event: 'finish', listener: () => void): this;
addListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
addListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
on(event: 'abort', listener: () => void): this;
on(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
on(event: 'continue', listener: () => void): this;
on(event: 'information', listener: (info: InformationEvent) => void): this;
on(event: 'response', listener: (response: IncomingMessage) => void): this;
on(event: 'socket', listener: (socket: Socket) => void): this;
on(event: 'timeout', listener: () => void): this;
on(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
on(event: 'close', listener: () => void): this;
on(event: 'drain', listener: () => void): this;
on(event: 'error', listener: (err: Error) => void): this;
on(event: 'finish', listener: () => void): this;
on(event: 'pipe', listener: (src: stream.Readable) => void): this;
on(event: 'unpipe', listener: (src: stream.Readable) => void): this;
on(event: string | symbol, listener: (...args: any[]) => void): this;
once(event: 'abort', listener: () => void): this;
once(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
once(event: 'continue', listener: () => void): this;
once(event: 'information', listener: (info: InformationEvent) => void): this;
once(event: 'response', listener: (response: IncomingMessage) => void): this;
once(event: 'socket', listener: (socket: Socket) => void): this;
once(event: 'timeout', listener: () => void): this;
once(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
once(event: 'close', listener: () => void): this;
once(event: 'drain', listener: () => void): this;
once(event: 'error', listener: (err: Error) => void): this;
once(event: 'finish', listener: () => void): this;
once(event: 'pipe', listener: (src: stream.Readable) => void): this;
once(event: 'unpipe', listener: (src: stream.Readable) => void): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
prependListener(event: 'abort', listener: () => void): this;
prependListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
prependListener(event: 'continue', listener: () => void): this;
prependListener(event: 'information', listener: (info: InformationEvent) => void): this;
prependListener(event: 'response', listener: (response: IncomingMessage) => void): this;
prependListener(event: 'socket', listener: (socket: Socket) => void): this;
prependListener(event: 'timeout', listener: () => void): this;
prependListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
prependListener(event: 'close', listener: () => void): this;
prependListener(event: 'drain', listener: () => void): this;
prependListener(event: 'error', listener: (err: Error) => void): this;
prependListener(event: 'finish', listener: () => void): this;
prependListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
prependListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
prependOnceListener(event: 'abort', listener: () => void): this;
prependOnceListener(event: 'connect', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
prependOnceListener(event: 'continue', listener: () => void): this;
prependOnceListener(event: 'information', listener: (info: InformationEvent) => void): this;
prependOnceListener(event: 'response', listener: (response: IncomingMessage) => void): this;
prependOnceListener(event: 'socket', listener: (socket: Socket) => void): this;
prependOnceListener(event: 'timeout', listener: () => void): this;
prependOnceListener(event: 'upgrade', listener: (response: IncomingMessage, socket: Socket, head: Buffer) => void): this;
prependOnceListener(event: 'close', listener: () => void): this;
prependOnceListener(event: 'drain', listener: () => void): this;
prependOnceListener(event: 'error', listener: (err: Error) => void): this;
prependOnceListener(event: 'finish', listener: () => void): this;
prependOnceListener(event: 'pipe', listener: (src: stream.Readable) => void): this;
prependOnceListener(event: 'unpipe', listener: (src: stream.Readable) => void): this;
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
}
class IncomingMessage extends stream.Readable {
constructor(socket: Socket);
aborted: boolean;
httpVersion: string;
httpVersionMajor: number;
httpVersionMinor: number;
@@ -186,7 +282,7 @@ declare module "http" {
rawHeaders: string[];
trailers: { [key: string]: string | undefined };
rawTrailers: string[];
setTimeout(msecs: number, callback: () => void): this;
setTimeout(msecs: number, callback?: () => void): this;
/**
* Only valid for request obtained from http.Server.
*/

View File

@@ -49,19 +49,17 @@ declare module "http2" {
}
export interface ServerStreamFileResponseOptions {
statCheck?: (stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions) => void | boolean;
statCheck?(stats: fs.Stats, headers: OutgoingHttpHeaders, statOptions: StatOptions): void | boolean;
waitForTrailers?: boolean;
offset?: number;
length?: number;
}
export interface ServerStreamFileResponseOptionsWithError extends ServerStreamFileResponseOptions {
onError?: (err: NodeJS.ErrnoException) => void;
onError?(err: NodeJS.ErrnoException): void;
}
export class Http2Stream extends stream.Duplex {
protected constructor();
export interface Http2Stream extends stream.Duplex {
readonly aborted: boolean;
readonly bufferSize: number;
readonly closed: boolean;
@@ -182,9 +180,7 @@ declare module "http2" {
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
}
export class ClientHttp2Stream extends Http2Stream {
private constructor();
export interface ClientHttp2Stream extends Http2Stream {
addListener(event: "continue", listener: () => {}): this;
addListener(event: "headers", listener: (headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number) => void): this;
addListener(event: "push", listener: (headers: IncomingHttpHeaders, flags: number) => void): this;
@@ -222,16 +218,14 @@ declare module "http2" {
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
}
export class ServerHttp2Stream extends Http2Stream {
private constructor();
additionalHeaders(headers: OutgoingHttpHeaders): void;
export interface ServerHttp2Stream extends Http2Stream {
readonly headersSent: boolean;
readonly pushAllowed: boolean;
additionalHeaders(headers: OutgoingHttpHeaders): void;
pushStream(headers: OutgoingHttpHeaders, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
pushStream(headers: OutgoingHttpHeaders, options?: StreamPriorityOptions, callback?: (err: Error | null, pushStream: ServerHttp2Stream, headers: OutgoingHttpHeaders) => void): void;
respond(headers?: OutgoingHttpHeaders, options?: ServerStreamResponseOptions): void;
respondWithFD(fd: number, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void;
respondWithFD(fd: number | fs.promises.FileHandle, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptions): void;
respondWithFile(path: string, headers?: OutgoingHttpHeaders, options?: ServerStreamFileResponseOptionsWithError): void;
}
@@ -267,29 +261,28 @@ declare module "http2" {
inflateDynamicTableSize?: number;
}
export class Http2Session extends events.EventEmitter {
protected constructor();
export interface Http2Session extends events.EventEmitter {
readonly alpnProtocol?: string;
close(callback?: () => void): void;
readonly closed: boolean;
readonly connecting: boolean;
destroy(error?: Error, code?: number): void;
readonly destroyed: boolean;
readonly encrypted?: boolean;
goaway(code?: number, lastStreamID?: number, opaqueData?: Buffer | DataView | NodeJS.TypedArray): void;
readonly localSettings: Settings;
readonly originSet?: string[];
readonly pendingSettingsAck: boolean;
ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
ping(payload: Buffer | DataView | NodeJS.TypedArray , callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
ref(): void;
readonly remoteSettings: Settings;
setTimeout(msecs: number, callback?: () => void): void;
readonly socket: net.Socket | tls.TLSSocket;
readonly state: SessionState;
settings(settings: Settings): void;
readonly type: number;
close(callback?: () => void): void;
destroy(error?: Error, code?: number): void;
goaway(code?: number, lastStreamID?: number, opaqueData?: NodeJS.ArrayBufferView): void;
ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
ref(): void;
setTimeout(msecs: number, callback?: () => void): void;
settings(settings: Settings): void;
unref(): void;
addListener(event: "close", listener: () => void): this;
@@ -353,9 +346,7 @@ declare module "http2" {
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
}
export class ClientHttp2Session extends Http2Session {
private constructor();
export interface ClientHttp2Session extends Http2Session {
request(headers?: OutgoingHttpHeaders, options?: ClientSessionRequestOptions): ClientHttp2Stream;
addListener(event: "altsvc", listener: (alt: string, origin: string, stream: number) => void): this;
@@ -399,12 +390,11 @@ declare module "http2" {
origin: number | string | url.URL;
}
export class ServerHttp2Session extends Http2Session {
private constructor();
export interface ServerHttp2Session extends Http2Session {
readonly server: Http2Server | Http2SecureServer;
altsvc(alt: string, originOrStream: number | string | url.URL | AlternativeServiceOptions): void;
origin(...args: Array<string | url.URL | { origin: string }>): void;
readonly server: Http2Server | Http2SecureServer;
addListener(event: "connect", listener: (session: ServerHttp2Session, socket: net.Socket | tls.TLSSocket) => void): this;
addListener(event: "stream", listener: (stream: ServerHttp2Stream, headers: IncomingHttpHeaders, flags: number) => void): this;
@@ -441,9 +431,10 @@ declare module "http2" {
maxSendHeaderBlockLength?: number;
paddingStrategy?: number;
peerMaxConcurrentStreams?: number;
selectPadding?: (frameLen: number, maxFrameLen: number) => number;
settings?: Settings;
createConnection?: (authority: url.URL, option: SessionOptions) => stream.Duplex;
selectPadding?(frameLen: number, maxFrameLen: number): number;
createConnection?(authority: url.URL, option: SessionOptions): stream.Duplex;
}
export interface ClientSessionOptions extends SessionOptions {
@@ -468,9 +459,7 @@ declare module "http2" {
origins?: string[];
}
export class Http2Server extends net.Server {
private constructor();
export interface Http2Server extends net.Server {
addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
@@ -522,9 +511,7 @@ declare module "http2" {
setTimeout(msec?: number, callback?: () => void): this;
}
export class Http2SecureServer extends tls.Server {
private constructor();
export interface Http2SecureServer extends tls.Server {
addListener(event: "checkContinue", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
addListener(event: "request", listener: (request: Http2ServerRequest, response: Http2ServerResponse) => void): this;
addListener(event: "session", listener: (session: ServerHttp2Session) => void): this;
@@ -593,12 +580,12 @@ declare module "http2" {
readonly rawHeaders: string[];
readonly rawTrailers: string[];
readonly scheme: string;
setTimeout(msecs: number, callback?: () => void): void;
readonly socket: net.Socket | tls.TLSSocket;
readonly stream: ServerHttp2Stream;
readonly trailers: IncomingHttpHeaders;
readonly url: string;
setTimeout(msecs: number, callback?: () => void): void;
read(size?: number): Buffer | string | null;
addListener(event: "aborted", listener: (hadError: boolean, code: number) => void): this;
@@ -653,25 +640,25 @@ declare module "http2" {
export class Http2ServerResponse extends stream.Stream {
constructor(stream: ServerHttp2Stream);
addTrailers(trailers: OutgoingHttpHeaders): void;
readonly connection: net.Socket | tls.TLSSocket;
readonly finished: boolean;
readonly headersSent: boolean;
readonly socket: net.Socket | tls.TLSSocket;
readonly stream: ServerHttp2Stream;
sendDate: boolean;
statusCode: number;
statusMessage: '';
addTrailers(trailers: OutgoingHttpHeaders): void;
end(callback?: () => void): void;
end(data: string | Uint8Array, callback?: () => void): void;
end(data: string | Uint8Array, encoding: string, callback?: () => void): void;
readonly finished: boolean;
getHeader(name: string): string;
getHeaderNames(): string[];
getHeaders(): OutgoingHttpHeaders;
hasHeader(name: string): boolean;
readonly headersSent: boolean;
removeHeader(name: string): void;
sendDate: boolean;
setHeader(name: string, value: number | string | string[]): void;
setTimeout(msecs: number, callback?: () => void): void;
readonly socket: net.Socket | tls.TLSSocket;
statusCode: number;
statusMessage: '';
readonly stream: ServerHttp2Stream;
write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean;
write(chunk: string | Uint8Array, encoding: string, callback?: (err: Error) => void): boolean;
writeContinue(): void;
@@ -951,10 +938,10 @@ declare module "http2" {
export function createSecureServer(onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
export function createSecureServer(options: SecureServerOptions, onRequestHandler?: (request: Http2ServerRequest, response: Http2ServerResponse) => void): Http2SecureServer;
export function connect(authority: string | url.URL, listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session;
export function connect(authority: string | url.URL, listener: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void): ClientHttp2Session;
export function connect(
authority: string | url.URL,
options?: ClientSessionOptions | SecureClientSessionOptions,
listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void,
listener?: (session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket) => void
): ClientHttp2Session;
}

65
node_modules/@types/node/ts3.1/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,65 @@
// NOTE: These definitions support NodeJS and TypeScript 3.2.
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2
// NOTE: Augmentations for TypeScript 3.2 and later should use individual files for overrides
// within the respective ~/ts3.2 (or later) folder. However, this is disallowed for versions
// prior to TypeScript 3.2, so the older definitions will be found here.
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
/// <reference path="base.d.ts" />
// We can't include globals.global.d.ts in globals.d.ts, as it'll cause duplication errors in TypeScript 3.4+
/// <reference path="globals.global.d.ts" />
// We can't include assert.d.ts in base.d.ts, as it'll cause duplication errors in TypeScript 3.7+
/// <reference path="assert.d.ts" />
// TypeScript 2.1-specific augmentations:
// Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`)
// Empty interfaces are used here which merge fine with the real declarations in the lib XXX files
// just to ensure the names are known and node typings can be used without importing these libs.
// if someone really needs these types the libs need to be added via --lib or in tsconfig.json
interface MapConstructor { }
interface WeakMapConstructor { }
interface SetConstructor { }
interface WeakSetConstructor { }
interface Set<T> {}
interface Map<K, V> {}
interface ReadonlySet<T> {}
interface Iterable<T> { }
interface IteratorResult<T> { }
interface AsyncIterable<T> { }
interface Iterator<T> {
next(value?: any): IteratorResult<T>;
}
interface IterableIterator<T> { }
interface AsyncIterableIterator<T> {}
interface SymbolConstructor {
readonly iterator: symbol;
readonly asyncIterator: symbol;
}
declare var Symbol: SymbolConstructor;
// even this is just a forward declaration some properties are added otherwise
// it would be allowed to pass anything to e.g. Buffer.from()
interface SharedArrayBuffer {
readonly byteLength: number;
slice(begin?: number, end?: number): SharedArrayBuffer;
}
declare module "util" {
namespace inspect {
const custom: symbol;
}
namespace promisify {
const custom: symbol;
}
namespace types {
function isBigInt64Array(value: any): boolean;
function isBigUint64Array(value: any): boolean;
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -18,7 +18,26 @@ declare module "net" {
writable?: boolean;
}
interface TcpSocketConnectOpts {
interface OnReadOpts {
buffer: Uint8Array | (() => Uint8Array);
/**
* This function is called for every chunk of incoming data.
* Two arguments are passed to it: the number of bytes written to buffer and a reference to buffer.
* Return false from this function to implicitly pause() the socket.
*/
callback(bytesWritten: number, buf: Uint8Array): boolean;
}
interface ConnectOpts {
/**
* If specified, incoming data is stored in a single buffer and passed to the supplied callback when data arrives on the socket.
* Note: this will cause the streaming functionality to not provide any data, however events like 'error', 'end', and 'close' will
* still be emitted as normal and methods like pause() and resume() will also behave as expected.
*/
onread?: OnReadOpts;
}
interface TcpSocketConnectOpts extends ConnectOpts {
port: number;
host?: string;
localAddress?: string;
@@ -28,7 +47,7 @@ declare module "net" {
lookup?: LookupFunction;
}
interface IpcSocketConnectOpts {
interface IpcSocketConnectOpts extends ConnectOpts {
path: string;
}

View File

@@ -52,6 +52,7 @@ declare module "os" {
function userInfo(options?: { encoding: string }): UserInfo<string>;
const constants: {
UV_UDP_REUSEADDR: number;
// signals: { [key in NodeJS.Signals]: number; }; @todo: change after migration to typescript 2.1
signals: {
SIGHUP: number;
SIGINT: number;
@@ -74,6 +75,7 @@ declare module "os" {
SIGCONT: number;
SIGSTOP: number;
SIGTSTP: number;
SIGBREAK: number;
SIGTTIN: number;
SIGTTOU: number;
SIGURG: number;
@@ -84,7 +86,9 @@ declare module "os" {
SIGWINCH: number;
SIGIO: number;
SIGPOLL: number;
SIGLOST: number;
SIGPWR: number;
SIGINFO: number;
SIGSYS: number;
SIGUNUSED: number;
};
@@ -168,6 +172,64 @@ declare module "os" {
ETXTBSY: number;
EWOULDBLOCK: number;
EXDEV: number;
WSAEINTR: number;
WSAEBADF: number;
WSAEACCES: number;
WSAEFAULT: number;
WSAEINVAL: number;
WSAEMFILE: number;
WSAEWOULDBLOCK: number;
WSAEINPROGRESS: number;
WSAEALREADY: number;
WSAENOTSOCK: number;
WSAEDESTADDRREQ: number;
WSAEMSGSIZE: number;
WSAEPROTOTYPE: number;
WSAENOPROTOOPT: number;
WSAEPROTONOSUPPORT: number;
WSAESOCKTNOSUPPORT: number;
WSAEOPNOTSUPP: number;
WSAEPFNOSUPPORT: number;
WSAEAFNOSUPPORT: number;
WSAEADDRINUSE: number;
WSAEADDRNOTAVAIL: number;
WSAENETDOWN: number;
WSAENETUNREACH: number;
WSAENETRESET: number;
WSAECONNABORTED: number;
WSAECONNRESET: number;
WSAENOBUFS: number;
WSAEISCONN: number;
WSAENOTCONN: number;
WSAESHUTDOWN: number;
WSAETOOMANYREFS: number;
WSAETIMEDOUT: number;
WSAECONNREFUSED: number;
WSAELOOP: number;
WSAENAMETOOLONG: number;
WSAEHOSTDOWN: number;
WSAEHOSTUNREACH: number;
WSAENOTEMPTY: number;
WSAEPROCLIM: number;
WSAEUSERS: number;
WSAEDQUOT: number;
WSAESTALE: number;
WSAEREMOTE: number;
WSASYSNOTREADY: number;
WSAVERNOTSUPPORTED: number;
WSANOTINITIALISED: number;
WSAEDISCON: number;
WSAENOMORE: number;
WSAECANCELLED: number;
WSAEINVALIDPROCTABLE: number;
WSAEINVALIDPROVIDER: number;
WSAEPROVIDERFAILEDINIT: number;
WSASYSCALLFAILURE: number;
WSASERVICE_NOT_FOUND: number;
WSATYPE_NOT_FOUND: number;
WSA_E_NO_MORE: number;
WSA_E_CANCELLED: number;
WSAEREFUSED: number;
};
priority: {
PRIORITY_LOW: number;

15
node_modules/@types/node/ts3.1/process.d.ts generated vendored Normal file
View File

@@ -0,0 +1,15 @@
declare module "process" {
import * as tty from "tty";
global {
namespace NodeJS {
// this namespace merge is here because these are specifically used
// as the type for process.stdin, process.stdout, and process.stderr.
// they can't live in tty.d.ts because we need to disambiguate the imported name.
interface ReadStream extends tty.ReadStream {}
interface WriteStream extends tty.WriteStream {}
}
}
export = process;
}

View File

@@ -11,10 +11,7 @@ declare module "querystring" {
interface ParsedUrlQuery { [key: string]: string | string[]; }
interface ParsedUrlQueryInput {
[key: string]:
// The value type here is a "poor man's `unknown`". When these types support TypeScript
// 3.0+, we can replace this with `unknown`.
{} | null | undefined;
[key: string]: string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | undefined | null;
}
function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;

View File

@@ -13,6 +13,13 @@ declare module "readline" {
class Interface extends events.EventEmitter {
readonly terminal: boolean;
// Need direct access to line/cursor data, for use in external processes
// see: https://github.com/nodejs/node/issues/30347
/** The current input data */
readonly line: string;
/** The current cursor position in the input line */
readonly cursor: number;
/**
* NOTE: According to the documentation:
*
@@ -123,14 +130,29 @@ declare module "readline" {
prompt?: string;
crlfDelay?: number;
removeHistoryDuplicates?: boolean;
escapeCodeTimeout?: number;
}
function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
function createInterface(options: ReadLineOptions): Interface;
function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number): void;
function emitKeypressEvents(stream: NodeJS.ReadableStream, interface?: Interface): void;
function moveCursor(stream: NodeJS.WritableStream, dx: number | string, dy: number | string): void;
function clearLine(stream: NodeJS.WritableStream, dir: number): void;
function clearScreenDown(stream: NodeJS.WritableStream): void;
type Direction = -1 | 0 | 1;
/**
* Clears the current line of this WriteStream in a direction identified by `dir`.
*/
function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
/**
* Clears this `WriteStream` from the current cursor down.
*/
function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
/**
* Moves this WriteStream's cursor to the specified position.
*/
function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
/**
* Moves this WriteStream's cursor relative to its current position.
*/
function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
}

View File

@@ -353,13 +353,13 @@ declare module "repl" {
/**
* A flag passed in the REPL options. Evaluates expressions in sloppy mode.
*/
export const REPL_MODE_SLOPPY: symbol; // TODO: unique symbol
const REPL_MODE_SLOPPY: symbol; // TODO: unique symbol
/**
* A flag passed in the REPL options. Evaluates expressions in strict mode.
* This is equivalent to prefacing every repl statement with `'use strict'`.
*/
export const REPL_MODE_STRICT: symbol; // TODO: unique symbol
const REPL_MODE_STRICT: symbol; // TODO: unique symbol
/**
* Creates and starts a `repl.REPLServer` instance.

View File

@@ -24,8 +24,13 @@ declare module "stream" {
static from(iterable: Iterable<any> | AsyncIterable<any>, options?: ReadableOptions): Readable;
readable: boolean;
readonly readableEncoding: BufferEncoding | null;
readonly readableEnded: boolean;
readonly readableFlowing: boolean | null;
readonly readableHighWaterMark: number;
readonly readableLength: number;
readonly readableObjectMode: boolean;
destroyed: boolean;
constructor(opts?: ReadableOptions);
_read(size: number): void;
read(size?: number): any;
@@ -116,9 +121,12 @@ declare module "stream" {
class Writable extends Stream implements NodeJS.WritableStream {
readonly writable: boolean;
readonly writableEnded: boolean;
readonly writableFinished: boolean;
readonly writableHighWaterMark: number;
readonly writableLength: number;
readonly writableObjectMode: boolean;
destroyed: boolean;
constructor(opts?: WritableOptions);
_write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
_writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
@@ -205,6 +213,8 @@ declare module "stream" {
allowHalfOpen?: boolean;
readableObjectMode?: boolean;
writableObjectMode?: boolean;
readableHighWaterMark?: number;
writableHighWaterMark?: number;
read?(this: Duplex, size: number): void;
write?(this: Duplex, chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
writev?(this: Duplex, chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
@@ -215,9 +225,11 @@ declare module "stream" {
// Note: Duplex extends both Readable and Writable.
class Duplex extends Readable implements Writable {
readonly writable: boolean;
readonly writableEnded: boolean;
readonly writableFinished: boolean;
readonly writableHighWaterMark: number;
readonly writableLength: number;
readonly writableObjectMode: boolean;
constructor(opts?: DuplexOptions);
_write(chunk: any, encoding: string, callback: (error?: Error | null) => void): void;
_writev?(chunks: Array<{ chunk: any, encoding: string }>, callback: (error?: Error | null) => void): void;
@@ -253,9 +265,15 @@ declare module "stream" {
class PassThrough extends Transform { }
interface FinishedOptions {
error?: boolean;
readable?: boolean;
writable?: boolean;
}
function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options: FinishedOptions, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, callback: (err?: NodeJS.ErrnoException | null) => void): () => void;
namespace finished {
function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream): Promise<void>;
function __promisify__(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
}
function pipeline<T extends NodeJS.WritableStream>(stream1: NodeJS.ReadableStream, stream2: T, callback?: (err: NodeJS.ErrnoException | null) => void): T;
@@ -300,7 +318,12 @@ declare module "stream" {
): Promise<void>;
}
interface Pipe { }
interface Pipe {
close(): void;
hasRef(): boolean;
ref(): void;
unref(): void;
}
}
export = internal;

View File

@@ -44,6 +44,7 @@ declare module "tls" {
valid_from: string;
valid_to: string;
fingerprint: string;
fingerprint256: string;
ext_key_usage: string[];
serialNumber: string;
raw: Buffer;
@@ -64,7 +65,44 @@ declare module "tls" {
version: string;
}
export interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
interface EphemeralKeyInfo {
/**
* The supported types are 'DH' and 'ECDH'.
*/
type: string;
/**
* The name property is available only when type is 'ECDH'.
*/
name?: string;
/**
* The size of parameter of an ephemeral key exchange.
*/
size: number;
}
interface KeyObject {
/**
* Private keys in PEM format.
*/
pem: string | Buffer;
/**
* Optional passphrase.
*/
passphrase?: string;
}
interface PxfObject {
/**
* PFX or PKCS12 encoded private key and certificate chain.
*/
buf: string | Buffer;
/**
* Optional passphrase.
*/
passphrase?: string;
}
interface TLSSocketOptions extends SecureContextOptions, CommonConnectionOptions {
/**
* If true the TLS socket will be instantiated in server-mode.
* Defaults to false.
@@ -114,12 +152,50 @@ declare module "tls" {
*/
alpnProtocol?: string;
/**
* Returns an object representing the local certificate. The returned
* object has some properties corresponding to the fields of the
* certificate.
*
* See tls.TLSSocket.getPeerCertificate() for an example of the
* certificate structure.
*
* If there is no local certificate, an empty object will be returned.
* If the socket has been destroyed, null will be returned.
*/
getCertificate(): PeerCertificate | object | null;
/**
* Returns an object representing the cipher name and the SSL/TLS protocol version of the current connection.
* @returns Returns an object representing the cipher name
* and the SSL/TLS protocol version of the current connection.
*/
getCipher(): CipherNameAndProtocol;
/**
* Returns an object representing the type, name, and size of parameter
* of an ephemeral key exchange in Perfect Forward Secrecy on a client
* connection. It returns an empty object when the key exchange is not
* ephemeral. As this is only supported on a client socket; null is
* returned if called on a server socket. The supported types are 'DH'
* and 'ECDH'. The name property is available only when type is 'ECDH'.
*
* For example: { type: 'ECDH', name: 'prime256v1', size: 256 }.
*/
getEphemeralKeyInfo(): EphemeralKeyInfo | object | null;
/**
* Returns the latest Finished message that has
* been sent to the socket as part of a SSL/TLS handshake, or undefined
* if no Finished message has been sent yet.
*
* As the Finished messages are message digests of the complete
* handshake (with a total of 192 bits for TLS 1.0 and more for SSL
* 3.0), they can be used for external authentication procedures when
* the authentication provided by SSL/TLS is not desired or is not
* enough.
*
* Corresponds to the SSL_get_finished routine in OpenSSL and may be
* used to implement the tls-unique channel binding from RFC 5929.
*/
getFinished(): Buffer | undefined;
/**
* Returns an object representing the peer's certificate.
* The returned object has some properties corresponding to the field of the certificate.
@@ -132,6 +208,21 @@ declare module "tls" {
getPeerCertificate(detailed: true): DetailedPeerCertificate;
getPeerCertificate(detailed?: false): PeerCertificate;
getPeerCertificate(detailed?: boolean): PeerCertificate | DetailedPeerCertificate;
/**
* Returns the latest Finished message that is expected or has actually
* been received from the socket as part of a SSL/TLS handshake, or
* undefined if there is no Finished message so far.
*
* As the Finished messages are message digests of the complete
* handshake (with a total of 192 bits for TLS 1.0 and more for SSL
* 3.0), they can be used for external authentication procedures when
* the authentication provided by SSL/TLS is not desired or is not
* enough.
*
* Corresponds to the SSL_get_peer_finished routine in OpenSSL and may
* be used to implement the tls-unique channel binding from RFC 5929.
*/
getPeerFinished(): Buffer | undefined;
/**
* Returns a string containing the negotiated SSL/TLS protocol version of the current connection.
* The value `'unknown'` will be returned for connected sockets that have not completed the handshaking process.
@@ -145,12 +236,21 @@ declare module "tls" {
* @returns ASN.1 encoded TLS session or undefined if none was negotiated.
*/
getSession(): Buffer | undefined;
/**
* Returns a list of signature algorithms shared between the server and
* the client in the order of decreasing preference.
*/
getSharedSigalgs(): string[];
/**
* NOTE: Works only with client TLS sockets.
* Useful only for debugging, for session reuse provide session option to tls.connect().
* @returns TLS session ticket or undefined if none was negotiated.
*/
getTLSTicket(): Buffer | undefined;
/**
* Returns true if the session was reused, false otherwise.
*/
isSessionReused(): boolean;
/**
* Initiate TLS renegotiation process.
*
@@ -175,6 +275,13 @@ declare module "tls" {
*/
setMaxSendFragment(size: number): boolean;
/**
* Disables TLS renegotiation for this TLSSocket instance. Once called,
* attempts to renegotiate will trigger an 'error' event on the
* TLSSocket.
*/
disableRenegotiation(): void;
/**
* When enabled, TLS packet trace information is written to `stderr`. This can be
* used to debug TLS connection problems.
@@ -266,8 +373,22 @@ declare module "tls" {
}
interface TlsOptions extends SecureContextOptions, CommonConnectionOptions {
/**
* Abort the connection if the SSL/TLS handshake does not finish in the
* specified number of milliseconds. A 'tlsClientError' is emitted on
* the tls.Server object whenever a handshake times out. Default:
* 120000 (120 seconds).
*/
handshakeTimeout?: number;
/**
* The number of seconds after which a TLS session created by the
* server will no longer be resumable. See Session Resumption for more
* information. Default: 300.
*/
sessionTimeout?: number;
/**
* 48-bytes of cryptographically strong pseudo-random data.
*/
ticketKeys?: Buffer;
}
@@ -285,7 +406,29 @@ declare module "tls" {
}
class Server extends net.Server {
/**
* The server.addContext() method adds a secure context that will be
* used if the client request's SNI name matches the supplied hostname
* (or wildcard).
*/
addContext(hostName: string, credentials: SecureContextOptions): void;
/**
* Returns the session ticket keys.
*/
getTicketKeys(): Buffer;
/**
*
* The server.setSecureContext() method replaces the
* secure context of an existing server. Existing connections to the
* server are not interrupted.
*/
setSecureContext(details: SecureContextOptions): void;
/**
* The server.setSecureContext() method replaces the secure context of
* an existing server. Existing connections to the server are not
* interrupted.
*/
setTicketKeys(keys: Buffer): void;
/**
* events.EventEmitter
@@ -294,6 +437,7 @@ declare module "tls" {
* 3. OCSPRequest
* 4. resumeSession
* 5. secureConnection
* 6. keylog
*/
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "tlsClientError", listener: (err: Error, tlsSocket: TLSSocket) => void): this;
@@ -352,20 +496,93 @@ declare module "tls" {
type SecureVersion = 'TLSv1.3' | 'TLSv1.2' | 'TLSv1.1' | 'TLSv1';
interface SecureContextOptions {
pfx?: string | Buffer | Array<string | Buffer | Object>;
key?: string | Buffer | Array<Buffer | Object>;
passphrase?: string;
cert?: string | Buffer | Array<string | Buffer>;
/**
* Optionally override the trusted CA certificates. Default is to trust
* the well-known CAs curated by Mozilla. Mozilla's CAs are completely
* replaced when CAs are explicitly specified using this option.
*/
ca?: string | Buffer | Array<string | Buffer>;
/**
* Cert chains in PEM format. One cert chain should be provided per
* private key. Each cert chain should consist of the PEM formatted
* certificate for a provided private key, followed by the PEM
* formatted intermediate certificates (if any), in order, and not
* including the root CA (the root CA must be pre-known to the peer,
* see ca). When providing multiple cert chains, they do not have to
* be in the same order as their private keys in key. If the
* intermediate certificates are not provided, the peer will not be
* able to validate the certificate, and the handshake will fail.
*/
cert?: string | Buffer | Array<string | Buffer>;
/**
* Colon-separated list of supported signature algorithms. The list
* can contain digest algorithms (SHA256, MD5 etc.), public key
* algorithms (RSA-PSS, ECDSA etc.), combination of both (e.g
* 'RSA+SHA384') or TLS v1.3 scheme names (e.g. rsa_pss_pss_sha512).
*/
sigalgs?: string;
/**
* Cipher suite specification, replacing the default. For more
* information, see modifying the default cipher suite. Permitted
* ciphers can be obtained via tls.getCiphers(). Cipher names must be
* uppercased in order for OpenSSL to accept them.
*/
ciphers?: string;
honorCipherOrder?: boolean;
ecdhCurve?: string;
/**
* Name of an OpenSSL engine which can provide the client certificate.
*/
clientCertEngine?: string;
/**
* PEM formatted CRLs (Certificate Revocation Lists).
*/
crl?: string | Buffer | Array<string | Buffer>;
/**
* Diffie Hellman parameters, required for Perfect Forward Secrecy. Use
* openssl dhparam to create the parameters. The key length must be
* greater than or equal to 1024 bits or else an error will be thrown.
* Although 1024 bits is permissible, use 2048 bits or larger for
* stronger security. If omitted or invalid, the parameters are
* silently discarded and DHE ciphers will not be available.
*/
dhparam?: string | Buffer;
secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options
secureProtocol?: string; // SSL Method, e.g. SSLv23_method
sessionIdContext?: string;
/**
* A string describing a named curve or a colon separated list of curve
* NIDs or names, for example P-521:P-384:P-256, to use for ECDH key
* agreement. Set to auto to select the curve automatically. Use
* crypto.getCurves() to obtain a list of available curve names. On
* recent releases, openssl ecparam -list_curves will also display the
* name and description of each available elliptic curve. Default:
* tls.DEFAULT_ECDH_CURVE.
*/
ecdhCurve?: string;
/**
* Attempt to use the server's cipher suite preferences instead of the
* client's. When true, causes SSL_OP_CIPHER_SERVER_PREFERENCE to be
* set in secureOptions
*/
honorCipherOrder?: boolean;
/**
* Private keys in PEM format. PEM allows the option of private keys
* being encrypted. Encrypted keys will be decrypted with
* options.passphrase. Multiple keys using different algorithms can be
* provided either as an array of unencrypted key strings or buffers,
* or an array of objects in the form {pem: <string|buffer>[,
* passphrase: <string>]}. The object form can only occur in an array.
* object.passphrase is optional. Encrypted keys will be decrypted with
* object.passphrase if provided, or options.passphrase if it is not.
*/
key?: string | Buffer | Array<Buffer | KeyObject>;
/**
* Name of an OpenSSL engine to get private key from. Should be used
* together with privateKeyIdentifier.
*/
privateKeyEngine?: string;
/**
* Identifier of a private key managed by an OpenSSL engine. Should be
* used together with privateKeyEngine. Should not be set together with
* key, because both options define a private key in different ways.
*/
privateKeyIdentifier?: string;
/**
* Optionally set the maximum TLS version to allow. One
* of `'TLSv1.3'`, `'TLSv1.2'`, `'TLSv1.1'`, or `'TLSv1'`. Cannot be specified along with the
@@ -386,6 +603,44 @@ declare module "tls" {
* 'TLSv1.3'. If multiple of the options are provided, the lowest minimum is used.
*/
minVersion?: SecureVersion;
/**
* Shared passphrase used for a single private key and/or a PFX.
*/
passphrase?: string;
/**
* PFX or PKCS12 encoded private key and certificate chain. pfx is an
* alternative to providing key and cert individually. PFX is usually
* encrypted, if it is, passphrase will be used to decrypt it. Multiple
* PFX can be provided either as an array of unencrypted PFX buffers,
* or an array of objects in the form {buf: <string|buffer>[,
* passphrase: <string>]}. The object form can only occur in an array.
* object.passphrase is optional. Encrypted PFX will be decrypted with
* object.passphrase if provided, or options.passphrase if it is not.
*/
pfx?: string | Buffer | Array<string | Buffer | PxfObject>;
/**
* Optionally affect the OpenSSL protocol behavior, which is not
* usually necessary. This should be used carefully if at all! Value is
* a numeric bitmask of the SSL_OP_* options from OpenSSL Options
*/
secureOptions?: number; // Value is a numeric bitmask of the `SSL_OP_*` options
/**
* Legacy mechanism to select the TLS protocol version to use, it does
* not support independent control of the minimum and maximum version,
* and does not support limiting the protocol to TLSv1.3. Use
* minVersion and maxVersion instead. The possible values are listed as
* SSL_METHODS, use the function names as strings. For example, use
* 'TLSv1_1_method' to force TLS version 1.1, or 'TLS_method' to allow
* any TLS protocol version up to TLSv1.3. It is not recommended to use
* TLS versions less than 1.2, but it may be required for
* interoperability. Default: none, see minVersion.
*/
secureProtocol?: string;
/**
* Opaque identifier used by servers to ensure session state is not
* shared between applications. Unused by clients.
*/
sessionIdContext?: string;
}
interface SecureContext {
@@ -412,7 +667,37 @@ declare module "tls" {
function createSecureContext(details: SecureContextOptions): SecureContext;
function getCiphers(): string[];
const DEFAULT_ECDH_CURVE: string;
/**
* The default curve name to use for ECDH key agreement in a tls server.
* The default value is 'auto'. See tls.createSecureContext() for further
* information.
*/
let DEFAULT_ECDH_CURVE: string;
/**
* The default value of the maxVersion option of
* tls.createSecureContext(). It can be assigned any of the supported TLS
* protocol versions, 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default:
* 'TLSv1.3', unless changed using CLI options. Using --tls-max-v1.2 sets
* the default to 'TLSv1.2'. Using --tls-max-v1.3 sets the default to
* 'TLSv1.3'. If multiple of the options are provided, the highest maximum
* is used.
*/
let DEFAULT_MAX_VERSION: SecureVersion;
/**
* The default value of the minVersion option of tls.createSecureContext().
* It can be assigned any of the supported TLS protocol versions,
* 'TLSv1.3', 'TLSv1.2', 'TLSv1.1', or 'TLSv1'. Default: 'TLSv1.2', unless
* changed using CLI options. Using --tls-min-v1.0 sets the default to
* 'TLSv1'. Using --tls-min-v1.1 sets the default to 'TLSv1.1'. Using
* --tls-min-v1.3 sets the default to 'TLSv1.3'. If multiple of the options
* are provided, the lowest minimum is used.
*/
let DEFAULT_MIN_VERSION: SecureVersion;
/**
* An immutable array of strings representing the root certificates (in PEM
* format) used for verifying peer certificates. This is the default value
* of the ca option to tls.createSecureContext().
*/
const rootCertificates: ReadonlyArray<string>;
}

View File

@@ -9,7 +9,7 @@ declare module "trace_events" {
* event categories. Calling `tracing.disable()` will remove the categories
* from the set of enabled trace event categories.
*/
export interface Tracing {
interface Tracing {
/**
* A comma-separated list of the trace event categories covered by this
* `Tracing` object.
@@ -49,7 +49,7 @@ declare module "trace_events" {
/**
* Creates and returns a Tracing object for the given set of categories.
*/
export function createTracing(options: CreateTracingOptions): Tracing;
function createTracing(options: CreateTracingOptions): Tracing;
/**
* Returns a comma-separated list of all currently-enabled trace event
@@ -57,5 +57,5 @@ declare module "trace_events" {
* determined by the union of all currently-enabled `Tracing` objects and
* any categories enabled using the `--trace-event-categories` flag.
*/
export function getEnabledCategories(): string;
function getEnabledCategories(): string | undefined;
}

View File

@@ -3,8 +3,9 @@ declare module "tty" {
function isatty(fd: number): boolean;
class ReadStream extends net.Socket {
constructor(fd: number, options?: net.SocketConstructorOpts);
isRaw: boolean;
setRawMode(mode: boolean): void;
setRawMode(mode: boolean): this;
isTTY: boolean;
}
/**
@@ -14,6 +15,7 @@ declare module "tty" {
*/
type Direction = -1 | 0 | 1;
class WriteStream extends net.Socket {
constructor(fd: number);
addListener(event: string, listener: (...args: any[]) => void): this;
addListener(event: "resize", listener: () => void): this;
@@ -32,9 +34,23 @@ declare module "tty" {
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
prependOnceListener(event: "resize", listener: () => void): this;
clearLine(dir: Direction): void;
clearScreenDown(): void;
cursorTo(x: number, y: number): void;
/**
* Clears the current line of this WriteStream in a direction identified by `dir`.
*/
clearLine(dir: Direction, callback?: () => void): boolean;
/**
* Clears this `WriteStream` from the current cursor down.
*/
clearScreenDown(callback?: () => void): boolean;
/**
* Moves this WriteStream's cursor to the specified position.
*/
cursorTo(x: number, y?: number, callback?: () => void): boolean;
cursorTo(x: number, callback: () => void): boolean;
/**
* Moves this WriteStream's cursor relative to its current position.
*/
moveCursor(dx: number, dy: number, callback?: () => void): boolean;
/**
* @default `process.env`
*/

View File

@@ -1,29 +1,36 @@
declare module "url" {
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
interface UrlObjectCommon {
auth?: string;
hash?: string;
host?: string;
hostname?: string;
href?: string;
path?: string;
pathname?: string;
protocol?: string;
search?: string;
slashes?: boolean;
}
// Input to `url.format`
interface UrlObject extends UrlObjectCommon {
port?: string | number;
interface UrlObject {
auth?: string | null;
hash?: string | null;
host?: string | null;
hostname?: string | null;
href?: string | null;
path?: string | null;
pathname?: string | null;
protocol?: string | null;
search?: string | null;
slashes?: boolean | null;
port?: string | number | null;
query?: string | null | ParsedUrlQueryInput;
}
// Output of `url.parse`
interface Url extends UrlObjectCommon {
port?: string;
query?: string | null | ParsedUrlQuery;
interface Url {
auth: string | null;
hash: string | null;
host: string | null;
hostname: string | null;
href: string;
path: string | null;
pathname: string | null;
protocol: string | null;
search: string | null;
slashes: boolean | null;
port: string | null;
query: string | null | ParsedUrlQuery;
}
interface UrlWithParsedQuery extends Url {

View File

@@ -51,7 +51,7 @@ declare module "util" {
function isSymbol(object: any): object is symbol;
/** @deprecated since v4.0.0 - use `value === undefined` instead. */
function isUndefined(object: any): object is undefined;
function deprecate<T extends Function>(fn: T, message: string): T;
function deprecate<T extends Function>(fn: T, message: string, code?: string): T;
function isDeepStrictEqual(val1: any, val2: any): boolean;
interface CustomPromisify<TCustom extends Function> extends Function {
@@ -84,23 +84,25 @@ declare module "util" {
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, arg6: T6, callback: (err: NodeJS.ErrnoException | null, result: TResult) => void) => void;
function promisify<TCustom extends Function>(fn: CustomPromisify<TCustom>): TCustom;
function promisify<TResult>(fn: (callback: (err: Error | null, result: TResult) => void) => void): () => Promise<TResult>;
function promisify(fn: (callback: (err?: Error | null) => void) => void): () => Promise<void>;
function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
function promisify<T1>(fn: (arg1: T1, callback: (err?: Error | null) => void) => void): (arg1: T1) => Promise<void>;
function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: Error | null, result: TResult) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
function promisify<TResult>(fn: (callback: (err: any, result: TResult) => void) => void): () => Promise<TResult>;
function promisify(fn: (callback: (err?: any) => void) => void): () => Promise<void>;
function promisify<T1, TResult>(fn: (arg1: T1, callback: (err: any, result: TResult) => void) => void): (arg1: T1) => Promise<TResult>;
function promisify<T1>(fn: (arg1: T1, callback: (err?: any) => void) => void): (arg1: T1) => Promise<void>;
function promisify<T1, T2, TResult>(fn: (arg1: T1, arg2: T2, callback: (err: any, result: TResult) => void) => void): (arg1: T1, arg2: T2) => Promise<TResult>;
function promisify<T1, T2>(fn: (arg1: T1, arg2: T2, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2) => Promise<void>;
function promisify<T1, T2, T3, TResult>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err: any, result: TResult) => void) => void):
(arg1: T1, arg2: T2, arg3: T3) => Promise<TResult>;
function promisify<T1, T2, T3>(fn: (arg1: T1, arg2: T2, arg3: T3, callback: (err?: any) => void) => void): (arg1: T1, arg2: T2, arg3: T3) => Promise<void>;
function promisify<T1, T2, T3, T4, TResult>(
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: Error | null, result: TResult) => void) => void,
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err: any, result: TResult) => void) => void,
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<TResult>;
function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: Error | null) => void) => void): (arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
function promisify<T1, T2, T3, T4>(fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, callback: (err?: any) => void) => void):
(arg1: T1, arg2: T2, arg3: T3, arg4: T4) => Promise<void>;
function promisify<T1, T2, T3, T4, T5, TResult>(
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: Error | null, result: TResult) => void) => void,
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err: any, result: TResult) => void) => void,
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<TResult>;
function promisify<T1, T2, T3, T4, T5>(
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: Error | null) => void) => void,
fn: (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5, callback: (err?: any) => void) => void,
): (arg1: T1, arg2: T2, arg3: T3, arg4: T4, arg5: T5) => Promise<void>;
function promisify(fn: Function): Function;
@@ -108,6 +110,7 @@ declare module "util" {
function isAnyArrayBuffer(object: any): boolean;
function isArgumentsObject(object: any): object is IArguments;
function isArrayBuffer(object: any): object is ArrayBuffer;
function isArrayBufferView(object: any): object is ArrayBufferView;
function isAsyncFunction(object: any): boolean;
function isBooleanObject(object: any): object is Boolean;
function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* | Object(BigInt) | Object(Symbol) */);
@@ -153,13 +156,26 @@ declare module "util" {
options?: { fatal?: boolean; ignoreBOM?: boolean }
);
decode(
input?: NodeJS.TypedArray | DataView | ArrayBuffer | null,
input?: NodeJS.ArrayBufferView | ArrayBuffer | null,
options?: { stream?: boolean }
): string;
}
interface EncodeIntoResult {
/**
* The read Unicode code units of input.
*/
read: number;
/**
* The written UTF-8 bytes of output.
*/
written: number;
}
class TextEncoder {
readonly encoding: string;
encode(input?: string): Uint8Array;
encodeInto(input: string, output: Uint8Array): EncodeIntoResult;
}
}

197
node_modules/@types/node/ts3.1/v8.d.ts generated vendored Normal file
View File

@@ -0,0 +1,197 @@
declare module "v8" {
import { Readable } from "stream";
interface HeapSpaceInfo {
space_name: string;
space_size: number;
space_used_size: number;
space_available_size: number;
physical_space_size: number;
}
// ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */
type DoesZapCodeSpaceFlag = 0 | 1;
interface HeapInfo {
total_heap_size: number;
total_heap_size_executable: number;
total_physical_size: number;
total_available_size: number;
used_heap_size: number;
heap_size_limit: number;
malloced_memory: number;
peak_malloced_memory: number;
does_zap_garbage: DoesZapCodeSpaceFlag;
number_of_native_contexts: number;
number_of_detached_contexts: number;
}
interface HeapCodeStatistics {
code_and_metadata_size: number;
bytecode_and_metadata_size: number;
external_script_source_size: number;
}
/**
* Returns an integer representing a "version tag" derived from the V8 version, command line flags and detected CPU features.
* This is useful for determining whether a vm.Script cachedData buffer is compatible with this instance of V8.
*/
function cachedDataVersionTag(): number;
function getHeapStatistics(): HeapInfo;
function getHeapSpaceStatistics(): HeapSpaceInfo[];
function setFlagsFromString(flags: string): void;
/**
* Generates a snapshot of the current V8 heap and returns a Readable
* Stream that may be used to read the JSON serialized representation.
* This conversation was marked as resolved by joyeecheung
* This JSON stream format is intended to be used with tools such as
* Chrome DevTools. The JSON schema is undocumented and specific to the
* V8 engine, and may change from one version of V8 to the next.
*/
function getHeapSnapshot(): Readable;
/**
*
* @param fileName The file path where the V8 heap snapshot is to be
* saved. If not specified, a file name with the pattern
* `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be
* generated, where `{pid}` will be the PID of the Node.js process,
* `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from
* the main Node.js thread or the id of a worker thread.
*/
function writeHeapSnapshot(fileName?: string): string;
function getHeapCodeStatistics(): HeapCodeStatistics;
/**
* @experimental
*/
class Serializer {
/**
* Writes out a header, which includes the serialization format version.
*/
writeHeader(): void;
/**
* Serializes a JavaScript value and adds the serialized representation to the internal buffer.
* This throws an error if value cannot be serialized.
*/
writeValue(val: any): boolean;
/**
* Returns the stored internal buffer.
* This serializer should not be used once the buffer is released.
* Calling this method results in undefined behavior if a previous write has failed.
*/
releaseBuffer(): Buffer;
/**
* Marks an ArrayBuffer as having its contents transferred out of band.\
* Pass the corresponding ArrayBuffer in the deserializing context to deserializer.transferArrayBuffer().
*/
transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
/**
* Write a raw 32-bit unsigned integer.
*/
writeUint32(value: number): void;
/**
* Write a raw 64-bit unsigned integer, split into high and low 32-bit parts.
*/
writeUint64(hi: number, lo: number): void;
/**
* Write a JS number value.
*/
writeDouble(value: number): void;
/**
* Write raw bytes into the serializers internal buffer.
* The deserializer will require a way to compute the length of the buffer.
*/
writeRawBytes(buffer: NodeJS.TypedArray): void;
}
/**
* A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
* and only stores the part of their underlying `ArrayBuffers` that they are referring to.
* @experimental
*/
class DefaultSerializer extends Serializer {
}
/**
* @experimental
*/
class Deserializer {
constructor(data: NodeJS.TypedArray);
/**
* Reads and validates a header (including the format version).
* May, for example, reject an invalid or unsupported wire format.
* In that case, an Error is thrown.
*/
readHeader(): boolean;
/**
* Deserializes a JavaScript value from the buffer and returns it.
*/
readValue(): any;
/**
* Marks an ArrayBuffer as having its contents transferred out of band.
* Pass the corresponding `ArrayBuffer` in the serializing context to serializer.transferArrayBuffer()
* (or return the id from serializer._getSharedArrayBufferId() in the case of SharedArrayBuffers).
*/
transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
/**
* Reads the underlying wire format version.
* Likely mostly to be useful to legacy code reading old wire format versions.
* May not be called before .readHeader().
*/
getWireFormatVersion(): number;
/**
* Read a raw 32-bit unsigned integer and return it.
*/
readUint32(): number;
/**
* Read a raw 64-bit unsigned integer and return it as an array [hi, lo] with two 32-bit unsigned integer entries.
*/
readUint64(): [number, number];
/**
* Read a JS number value.
*/
readDouble(): number;
/**
* Read raw bytes from the deserializers internal buffer.
* The length parameter must correspond to the length of the buffer that was passed to serializer.writeRawBytes().
*/
readRawBytes(length: number): Buffer;
}
/**
* A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
* and only stores the part of their underlying `ArrayBuffers` that they are referring to.
* @experimental
*/
class DefaultDeserializer extends Deserializer {
}
/**
* Uses a `DefaultSerializer` to serialize value into a buffer.
* @experimental
*/
function serialize(value: any): Buffer;
/**
* Uses a `DefaultDeserializer` with default options to read a JS value from a buffer.
* @experimental
*/
function deserialize(data: NodeJS.TypedArray): any;
}

View File

@@ -26,8 +26,23 @@ declare module "vm" {
produceCachedData?: boolean;
}
interface RunningScriptOptions extends BaseOptions {
/**
* When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace.
* Default: `true`.
*/
displayErrors?: boolean;
/**
* Specifies the number of milliseconds to execute code before terminating execution.
* If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.
*/
timeout?: number;
/**
* If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received.
* Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that.
* If execution is terminated, an `Error` will be thrown.
* Default: `false`.
*/
breakOnSigint?: boolean;
}
interface CompileFunctionOptions extends BaseOptions {
/**
@@ -91,5 +106,5 @@ declare module "vm" {
function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
function compileFunction(code: string, params: string[], options: CompileFunctionOptions): Function;
function compileFunction(code: string, params?: string[], options?: CompileFunctionOptions): Function;
}

View File

@@ -5,6 +5,7 @@ declare module "worker_threads" {
const isMainThread: boolean;
const parentPort: null | MessagePort;
const SHARE_ENV: unique symbol;
const threadId: number;
const workerData: any;
@@ -55,6 +56,7 @@ declare module "worker_threads" {
interface WorkerOptions {
eval?: boolean;
env?: NodeJS.ProcessEnv | typeof SHARE_ENV;
workerData?: any;
stdin?: boolean;
stdout?: boolean;
@@ -78,29 +80,6 @@ declare module "worker_threads" {
* Returns a Promise for the exit code that is fulfilled when the `exit` event is emitted.
*/
terminate(): Promise<number>;
/**
* Transfer a `MessagePort` to a different `vm` Context. The original `port`
* object will be rendered unusable, and the returned `MessagePort` instance will
* take its place.
*
* The returned `MessagePort` will be an object in the target context, and will
* inherit from its global `Object` class. Objects passed to the
* `port.onmessage()` listener will also be created in the target context
* and inherit from its global `Object` class.
*
* However, the created `MessagePort` will no longer inherit from
* `EventEmitter`, and only `port.onmessage()` can be used to receive
* events using it.
*/
moveMessagePortToContext(port: MessagePort, context: Context): MessagePort;
/**
* Receive a single message from a given `MessagePort`. If no message is available,
* `undefined` is returned, otherwise an object with a single `message` property
* that contains the message payload, corresponding to the oldest message in the
* `MessagePort`s queue.
*/
receiveMessageOnPort(port: MessagePort): {} | undefined;
addListener(event: "error", listener: (err: Error) => void): this;
addListener(event: "exit", listener: (exitCode: number) => void): this;
@@ -150,4 +129,28 @@ declare module "worker_threads" {
off(event: "online", listener: () => void): this;
off(event: string | symbol, listener: (...args: any[]) => void): this;
}
/**
* Transfer a `MessagePort` to a different `vm` Context. The original `port`
* object will be rendered unusable, and the returned `MessagePort` instance will
* take its place.
*
* The returned `MessagePort` will be an object in the target context, and will
* inherit from its global `Object` class. Objects passed to the
* `port.onmessage()` listener will also be created in the target context
* and inherit from its global `Object` class.
*
* However, the created `MessagePort` will no longer inherit from
* `EventEmitter`, and only `port.onmessage()` can be used to receive
* events using it.
*/
function moveMessagePortToContext(port: MessagePort, context: Context): MessagePort;
/**
* Receive a single message from a given `MessagePort`. If no message is available,
* `undefined` is returned, otherwise an object with a single `message` property
* that contains the message payload, corresponding to the oldest message in the
* `MessagePort`s queue.
*/
function receiveMessageOnPort(port: MessagePort): { message: any } | undefined;
}

View File

@@ -18,7 +18,7 @@ declare module "zlib" {
level?: number; // compression only
memLevel?: number; // compression only
strategy?: number; // compression only
dictionary?: NodeJS.TypedArray | DataView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
dictionary?: NodeJS.ArrayBufferView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
}
interface BrotliOptions {
@@ -79,7 +79,7 @@ declare module "zlib" {
function createInflateRaw(options?: ZlibOptions): InflateRaw;
function createUnzip(options?: ZlibOptions): Unzip;
type InputType = string | DataView | ArrayBuffer | NodeJS.TypedArray;
type InputType = string | ArrayBuffer | NodeJS.ArrayBufferView;
type CompressCallback = (error: Error | null, result: Buffer) => void;

View File

@@ -3,7 +3,8 @@
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2
// - ~/ts3.2/base.d.ts - Definitions specific to TypeScript 3.2
// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2 with global and assert pulled in
// Reference required types from the default lib:
/// <reference lib="es2018" />
@@ -13,8 +14,9 @@
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
// tslint:disable-next-line:no-bad-reference
/// <reference path="../base.d.ts" />
/// <reference path="../ts3.1/base.d.ts" />
// TypeScript 3.2-specific augmentations:
/// <reference path="fs.d.ts" />
/// <reference path="util.d.ts" />
/// <reference path="globals.d.ts" />

33
node_modules/@types/node/ts3.3/fs.d.ts generated vendored Normal file
View File

@@ -0,0 +1,33 @@
// tslint:disable-next-line:no-bad-reference
/// <reference path="../ts3.1/fs.d.ts" />
declare module 'fs' {
interface BigIntStats extends StatsBase<bigint> {
}
class BigIntStats {
atimeNs: bigint;
mtimeNs: bigint;
ctimeNs: bigint;
birthtimeNs: bigint;
}
interface BigIntOptions {
bigint: true;
}
interface StatOptions {
bigint: boolean;
}
function stat(path: PathLike, options: BigIntOptions, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
function stat(path: PathLike, options: StatOptions, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
namespace stat {
function __promisify__(path: PathLike, options: BigIntOptions): Promise<BigIntStats>;
function __promisify__(path: PathLike, options: StatOptions): Promise<Stats | BigIntStats>;
}
function statSync(path: PathLike, options: BigIntOptions): BigIntStats;
function statSync(path: PathLike, options: StatOptions): Stats | BigIntStats;
}

View File

@@ -1,5 +1,5 @@
// tslint:disable-next-line:no-bad-reference
/// <reference path="../globals.d.ts" />
/// <reference path="../ts3.1/globals.d.ts" />
declare namespace NodeJS {
interface HRTime {

12
node_modules/@types/node/ts3.3/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,12 @@
// NOTE: These definitions support NodeJS and TypeScript 3.2.
// This is requried to enable globalThis support for global in ts3.4 without causing errors
// This is requried to enable typing assert in ts3.7 without causing errors
// Typically type modifiations should be made in base.d.ts instead of here
/// <reference path="base.d.ts" />
// tslint:disable-next-line:no-bad-reference
/// <reference path="../ts3.1/assert.d.ts" />
// tslint:disable-next-line:no-bad-reference
/// <reference path="../ts3.1/globals.global.d.ts" />

View File

@@ -1,5 +1,5 @@
// tslint:disable-next-line:no-bad-reference
/// <reference path="../util.d.ts" />
/// <reference path="../ts3.1/util.d.ts" />
declare module "util" {
namespace inspect {

20
node_modules/@types/node/ts3.6/base.d.ts generated vendored Normal file
View File

@@ -0,0 +1,20 @@
// NOTE: These definitions support NodeJS and TypeScript 3.4.
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
// - ~/ts3.4/base.d.ts - Definitions specific to TypeScript 3.4
// - ~/ts3.4/index.d.ts - Definitions specific to TypeScript 3.4 with assert pulled in
// Reference required types from the default lib:
/// <reference lib="es2018" />
/// <reference lib="esnext.asynciterable" />
/// <reference lib="esnext.intl" />
/// <reference lib="esnext.bigint" />
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
// tslint:disable-next-line:no-bad-reference
/// <reference path="../ts3.3/base.d.ts" />
// TypeScript 3.5-specific augmentations:
/// <reference path="globals.global.d.ts" />

1
node_modules/@types/node/ts3.6/globals.global.d.ts generated vendored Normal file
View File

@@ -0,0 +1 @@
declare var global: NodeJS.Global & typeof globalThis;

8
node_modules/@types/node/ts3.6/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,8 @@
// NOTE: These definitions support NodeJS and TypeScript 3.4.
// This is required to enable typing assert in ts3.7 without causing errors
// Typically type modifications should be made in base.d.ts instead of here
/// <reference path="base.d.ts" />
// tslint:disable-next-line:no-bad-reference
/// <reference path="../ts3.1/assert.d.ts" />

Some files were not shown because too many files have changed in this diff Show More