Initial commit
This commit is contained in:
21
node_modules/@types/babel__core/LICENSE
generated
vendored
Normal file
21
node_modules/@types/babel__core/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/babel__core/README.md
generated
vendored
Normal file
15
node_modules/@types/babel__core/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# 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: Mon, 20 Nov 2023 23:36:23 GMT
|
||||
* Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types), [@types/babel__generator](https://npmjs.com/package/@types/babel__generator), [@types/babel__template](https://npmjs.com/package/@types/babel__template), [@types/babel__traverse](https://npmjs.com/package/@types/babel__traverse)
|
||||
|
||||
# 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).
|
||||
831
node_modules/@types/babel__core/index.d.ts
generated
vendored
Normal file
831
node_modules/@types/babel__core/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,831 @@
|
||||
import { GeneratorOptions } from "@babel/generator";
|
||||
import { ParserOptions } from "@babel/parser";
|
||||
import template from "@babel/template";
|
||||
import traverse, { Hub, NodePath, Scope, Visitor } from "@babel/traverse";
|
||||
import * as t from "@babel/types";
|
||||
|
||||
export { GeneratorOptions, NodePath, ParserOptions, t as types, template, traverse, Visitor };
|
||||
|
||||
export type Node = t.Node;
|
||||
export type ParseResult = ReturnType<typeof import("@babel/parser").parse>;
|
||||
export const version: string;
|
||||
export const DEFAULT_EXTENSIONS: [".js", ".jsx", ".es6", ".es", ".mjs"];
|
||||
|
||||
/**
|
||||
* Source map standard format as to revision 3
|
||||
* @see {@link https://sourcemaps.info/spec.html}
|
||||
* @see {@link https://github.com/mozilla/source-map/blob/HEAD/source-map.d.ts}
|
||||
*/
|
||||
interface InputSourceMap {
|
||||
version: number;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourceRoot?: string | undefined;
|
||||
sourcesContent?: string[] | undefined;
|
||||
mappings: string;
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface TransformOptions {
|
||||
/**
|
||||
* Specify which assumptions it can make about your code, to better optimize the compilation result. **NOTE**: This replaces the various `loose` options in plugins in favor of
|
||||
* top-level options that can apply to multiple plugins
|
||||
*
|
||||
* @see https://babeljs.io/docs/en/assumptions
|
||||
*/
|
||||
assumptions?: { [name: string]: boolean } | null | undefined;
|
||||
|
||||
/**
|
||||
* Include the AST in the returned object
|
||||
*
|
||||
* Default: `false`
|
||||
*/
|
||||
ast?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Attach a comment after all non-user injected code
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
auxiliaryCommentAfter?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* Attach a comment before all non-user injected code
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
auxiliaryCommentBefore?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* 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" | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* Specify whether or not to use .babelrc and
|
||||
* .babelignore files.
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
babelrc?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* Toggles whether or not browserslist config sources are used, which includes searching for any browserslist files or referencing the browserslist key inside package.json.
|
||||
* This is useful for projects that use a browserslist config for files that won't be compiled with Babel.
|
||||
*
|
||||
* If a string is specified, it must represent the path of a browserslist configuration file. Relative paths are resolved relative to the configuration file which specifies
|
||||
* this option, or to `cwd` when it's passed as part of the programmatic options.
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
browserslistConfigFile?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* The Browserslist environment to use.
|
||||
*
|
||||
* Default: `undefined`
|
||||
*/
|
||||
browserslistEnv?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* By default `babel.transformFromAst` will clone the input AST to avoid mutations.
|
||||
* Specifying `cloneInputAst: false` can improve parsing performance if the input AST is not used elsewhere.
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
cloneInputAst?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* If any of patterns match, the current configuration object is considered inactive and is ignored during config processing.
|
||||
*/
|
||||
exclude?: MatchPattern | MatchPattern[] | undefined;
|
||||
|
||||
/**
|
||||
* Enable code generation
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
code?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Output comments in generated output
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
comments?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* The working directory that Babel's programmatic options are loaded relative to.
|
||||
*
|
||||
* Default: `"."`
|
||||
*/
|
||||
cwd?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* A path to a `.babelrc` file to extend
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
extends?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* Filename for use in errors etc
|
||||
*
|
||||
* Default: `"unknown"`
|
||||
*/
|
||||
filename?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* Filename relative to `sourceRoot`
|
||||
*
|
||||
* Default: `(filename)`
|
||||
*/
|
||||
filenameRelative?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* An object containing the options to be passed down to the babel code generator, @babel/generator
|
||||
*
|
||||
* Default: `{}`
|
||||
*/
|
||||
generatorOpts?: GeneratorOptions | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* ANSI highlight syntax error code frames
|
||||
*
|
||||
* Default: `true`
|
||||
*/
|
||||
highlightCode?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Opposite to the `only` option. `ignore` is disregarded if `only` is specified
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
ignore?: MatchPattern[] | null | undefined;
|
||||
|
||||
/**
|
||||
* This option is a synonym for "test"
|
||||
*/
|
||||
include?: MatchPattern | MatchPattern[] | undefined;
|
||||
|
||||
/**
|
||||
* A source map object that the output source map will be based on
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
inputSourceMap?: InputSourceMap | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* Specify a custom name for module ids
|
||||
*
|
||||
* Default: `null`
|
||||
*/
|
||||
moduleId?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* If truthy, insert an explicit id for modules. By default, all modules are anonymous. (Not available for `common` modules)
|
||||
*
|
||||
* Default: `false`
|
||||
*/
|
||||
moduleIds?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Optional prefix for the AMD module formatter that will be prepend to the filename on module definitions
|
||||
*
|
||||
* Default: `(sourceRoot)`
|
||||
*/
|
||||
moduleRoot?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* 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[] | undefined;
|
||||
|
||||
/**
|
||||
* An object containing the options to be passed down to the babel parser, @babel/parser
|
||||
*
|
||||
* Default: `{}`
|
||||
*/
|
||||
parserOpts?: ParserOptions | null | undefined;
|
||||
|
||||
/**
|
||||
* List of plugins to load and use
|
||||
*
|
||||
* Default: `[]`
|
||||
*/
|
||||
plugins?: PluginItem[] | null | undefined;
|
||||
|
||||
/**
|
||||
* List of presets (a set of plugins) to load and use
|
||||
*
|
||||
* Default: `[]`
|
||||
*/
|
||||
presets?: PluginItem[] | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* Set `sources[0]` on returned source map
|
||||
*
|
||||
* Default: `(filenameRelative)`
|
||||
*/
|
||||
sourceFileName?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* The root from which all sources are relative
|
||||
*
|
||||
* Default: `(moduleRoot)`
|
||||
*/
|
||||
sourceRoot?: string | null | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* If all patterns fail to match, the current configuration object is considered inactive and is ignored during config processing.
|
||||
*/
|
||||
test?: MatchPattern | MatchPattern[] | undefined;
|
||||
|
||||
/**
|
||||
* Describes the environments you support/target for your project.
|
||||
* This can either be a [browserslist-compatible](https://github.com/ai/browserslist) query (with [caveats](https://babeljs.io/docs/en/babel-preset-env#ineffective-browserslist-queries))
|
||||
*
|
||||
* Default: `{}`
|
||||
*/
|
||||
targets?:
|
||||
| string
|
||||
| string[]
|
||||
| {
|
||||
esmodules?: boolean;
|
||||
node?: Omit<string, "current"> | "current" | true;
|
||||
safari?: Omit<string, "tp"> | "tp";
|
||||
browsers?: string | string[];
|
||||
android?: string;
|
||||
chrome?: string;
|
||||
deno?: string;
|
||||
edge?: string;
|
||||
electron?: string;
|
||||
firefox?: string;
|
||||
ie?: string;
|
||||
ios?: string;
|
||||
opera?: string;
|
||||
rhino?: string;
|
||||
samsung?: string;
|
||||
};
|
||||
|
||||
/**
|
||||
* 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
|
||||
| undefined;
|
||||
}
|
||||
|
||||
export interface TransformCaller {
|
||||
// the only required property
|
||||
name: string;
|
||||
// e.g. set to true by `babel-loader` and false by `babel-jest`
|
||||
supportsStaticESM?: boolean | undefined;
|
||||
supportsDynamicImport?: boolean | undefined;
|
||||
supportsExportNamespaceFrom?: boolean | undefined;
|
||||
supportsTopLevelAwait?: boolean | undefined;
|
||||
// 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 | undefined;
|
||||
manipulateOptions?(opts: any, parserOpts: any): void;
|
||||
pre?(this: S, file: BabelFile): void;
|
||||
visitor: Visitor<S>;
|
||||
post?(this: S, file: BabelFile): void;
|
||||
inherits?: any;
|
||||
}
|
||||
|
||||
export interface BabelFile {
|
||||
ast: t.File;
|
||||
opts: TransformOptions;
|
||||
hub: Hub;
|
||||
metadata: object;
|
||||
path: NodePath<t.Program>;
|
||||
scope: Scope;
|
||||
inputMap: object | null;
|
||||
code: string;
|
||||
}
|
||||
|
||||
export interface PluginPass {
|
||||
file: BabelFile;
|
||||
key: string;
|
||||
opts: object;
|
||||
cwd: string;
|
||||
filename: string | undefined;
|
||||
get(key: unknown): any;
|
||||
set(key: unknown, value: unknown): void;
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface BabelFileResult {
|
||||
ast?: t.File | null | undefined;
|
||||
code?: string | null | undefined;
|
||||
ignored?: boolean | undefined;
|
||||
map?:
|
||||
| {
|
||||
version: number;
|
||||
sources: string[];
|
||||
names: string[];
|
||||
sourceRoot?: string | undefined;
|
||||
sourcesContent?: string[] | undefined;
|
||||
mappings: string;
|
||||
file: string;
|
||||
}
|
||||
| null
|
||||
| undefined;
|
||||
metadata?: BabelFileMetadata | undefined;
|
||||
}
|
||||
|
||||
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 function loadPartialConfigAsync(options?: TransformOptions): Promise<Readonly<PartialConfig> | null>;
|
||||
|
||||
export interface PartialConfig {
|
||||
options: TransformOptions;
|
||||
babelrc?: string | undefined;
|
||||
babelignore?: string | undefined;
|
||||
config?: string | undefined;
|
||||
hasFilesystemConfig: () => boolean;
|
||||
}
|
||||
|
||||
export interface ConfigItem {
|
||||
/**
|
||||
* The name that the user gave the plugin instance, e.g. `plugins: [ ['env', {}, 'my-env'] ]`
|
||||
*/
|
||||
name?: string | undefined;
|
||||
|
||||
/**
|
||||
* The resolved value of the plugin.
|
||||
*/
|
||||
value: object | ((...args: any[]) => any);
|
||||
|
||||
/**
|
||||
* The options object passed to the plugin.
|
||||
*/
|
||||
options?: object | false | undefined;
|
||||
|
||||
/**
|
||||
* 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
|
||||
| undefined;
|
||||
}
|
||||
|
||||
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 | undefined;
|
||||
type?: "preset" | "plugin" | undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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 | readonly 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;
|
||||
51
node_modules/@types/babel__core/package.json
generated
vendored
Normal file
51
node_modules/@types/babel__core/package.json
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
{
|
||||
"name": "@types/babel__core",
|
||||
"version": "7.20.5",
|
||||
"description": "TypeScript definitions for @babel/core",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__core",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Troy Gerwien",
|
||||
"githubUsername": "yortus",
|
||||
"url": "https://github.com/yortus"
|
||||
},
|
||||
{
|
||||
"name": "Marvin Hagemeister",
|
||||
"githubUsername": "marvinhagemeister",
|
||||
"url": "https://github.com/marvinhagemeister"
|
||||
},
|
||||
{
|
||||
"name": "Melvin Groenhoff",
|
||||
"githubUsername": "mgroenhoff",
|
||||
"url": "https://github.com/mgroenhoff"
|
||||
},
|
||||
{
|
||||
"name": "Jessica Franco",
|
||||
"githubUsername": "Jessidhia",
|
||||
"url": "https://github.com/Jessidhia"
|
||||
},
|
||||
{
|
||||
"name": "Ifiok Jr.",
|
||||
"githubUsername": "ifiokjr",
|
||||
"url": "https://github.com/ifiokjr"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/babel__core"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.20.7",
|
||||
"@babel/types": "^7.20.7",
|
||||
"@types/babel__generator": "*",
|
||||
"@types/babel__template": "*",
|
||||
"@types/babel__traverse": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "3ece429b02ff9f70503a5644f2b303b04d10e6da7940c91a9eff5e52f2c76b91",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/babel__generator/LICENSE
generated
vendored
Normal file
21
node_modules/@types/babel__generator/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/babel__generator/README.md
generated
vendored
Normal file
15
node_modules/@types/babel__generator/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# 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: Sat, 16 Dec 2023 09:06:45 GMT
|
||||
* Dependencies: [@babel/types](https://npmjs.com/package/@babel/types)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Melvin Groenhoff](https://github.com/mgroenhoff), [Cameron Yan](https://github.com/khell), and [Lyanbin](https://github.com/Lyanbin).
|
||||
208
node_modules/@types/babel__generator/index.d.ts
generated
vendored
Normal file
208
node_modules/@types/babel__generator/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,208 @@
|
||||
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 | undefined;
|
||||
|
||||
/**
|
||||
* Optional string to add as a block comment at the end of the output file.
|
||||
*/
|
||||
auxiliaryCommentAfter?: string | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* Retain parens around function expressions (could be used to change engine parsing behavior)
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
retainFunctionParens?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Should comments be included in output? Defaults to `true`.
|
||||
*/
|
||||
comments?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Set to true to avoid adding whitespace for formatting. Defaults to the value of `opts.minified`.
|
||||
*/
|
||||
compact?: boolean | "auto" | undefined;
|
||||
|
||||
/**
|
||||
* Should the output be minified. Defaults to `false`.
|
||||
*/
|
||||
minified?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Set to true to reduce whitespace (but not as much as opts.compact). Defaults to `false`.
|
||||
*/
|
||||
concise?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Used in warning messages
|
||||
*/
|
||||
filename?: string | undefined;
|
||||
|
||||
/**
|
||||
* Enable generating source maps. Defaults to `false`.
|
||||
*/
|
||||
sourceMaps?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* A root for all relative URLs in the source map.
|
||||
*/
|
||||
sourceRoot?: string | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* Set to true to run jsesc with "json": true to print "\u00A9" vs. "©";
|
||||
*/
|
||||
jsonCompatibleStrings?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Set to true to enable support for experimental decorators syntax before module exports.
|
||||
* Defaults to `false`.
|
||||
*/
|
||||
decoratorsBeforeExport?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* The import attributes/assertions syntax to use.
|
||||
* When not specified, @babel/generator will try to match the style in the input code based on the AST shape.
|
||||
*/
|
||||
importAttributesKeyword?: "with" | "assert" | "with-legacy";
|
||||
|
||||
/**
|
||||
* 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" | undefined;
|
||||
|
||||
/**
|
||||
* 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" | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* 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, don’t enable this setting. If the json setting is enabled, the value for the es6
|
||||
* setting is ignored (as if it was false).
|
||||
*/
|
||||
es6?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* 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 jsesc’s
|
||||
* output ends up as part of a <script> or <style> element in an HTML document.
|
||||
*/
|
||||
isScriptContext?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* 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; it’s not formatted nicely.
|
||||
*/
|
||||
compact?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
|
||||
/**
|
||||
* 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 won’t be valid JSON anymore.
|
||||
*/
|
||||
json?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* 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 | undefined;
|
||||
} | undefined;
|
||||
}
|
||||
|
||||
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 | undefined;
|
||||
sourcesContent?: string[] | undefined;
|
||||
mappings: string;
|
||||
file: string;
|
||||
} | null;
|
||||
}
|
||||
42
node_modules/@types/babel__generator/package.json
generated
vendored
Normal file
42
node_modules/@types/babel__generator/package.json
generated
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
{
|
||||
"name": "@types/babel__generator",
|
||||
"version": "7.6.8",
|
||||
"description": "TypeScript definitions for @babel/generator",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__generator",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Troy Gerwien",
|
||||
"githubUsername": "yortus",
|
||||
"url": "https://github.com/yortus"
|
||||
},
|
||||
{
|
||||
"name": "Melvin Groenhoff",
|
||||
"githubUsername": "mgroenhoff",
|
||||
"url": "https://github.com/mgroenhoff"
|
||||
},
|
||||
{
|
||||
"name": "Cameron Yan",
|
||||
"githubUsername": "khell",
|
||||
"url": "https://github.com/khell"
|
||||
},
|
||||
{
|
||||
"name": "Lyanbin",
|
||||
"githubUsername": "Lyanbin",
|
||||
"url": "https://github.com/Lyanbin"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/babel__generator"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.0.0"
|
||||
},
|
||||
"typesPublisherContentHash": "23a97216c53cccf235c3fada4d15919d739c41570c91168dda0ad57cafd4ed4f",
|
||||
"typeScriptVersion": "4.6"
|
||||
}
|
||||
21
node_modules/@types/babel__template/LICENSE
generated
vendored
Normal file
21
node_modules/@types/babel__template/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/babel__template/README.md
generated
vendored
Normal file
15
node_modules/@types/babel__template/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# 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: Mon, 06 Nov 2023 22:41:04 GMT
|
||||
* Dependencies: [@babel/parser](https://npmjs.com/package/@babel/parser), [@babel/types](https://npmjs.com/package/@babel/types)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Troy Gerwien](https://github.com/yortus), [Marvin Hagemeister](https://github.com/marvinhagemeister), [Melvin Groenhoff](https://github.com/mgroenhoff), and [ExE Boss](https://github.com/ExE-Boss).
|
||||
92
node_modules/@types/babel__template/index.d.ts
generated
vendored
Normal file
92
node_modules/@types/babel__template/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
import { ParserOptions } from "@babel/parser";
|
||||
import { Expression, 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 `placeholderPattern`.
|
||||
*
|
||||
* This option cannot be used when using `%%foo%%` style placeholders.
|
||||
*/
|
||||
placeholderWhitelist?: Set<string> | null | undefined;
|
||||
|
||||
/**
|
||||
* A pattern to search for when looking for `Identifier` and `StringLiteral`
|
||||
* nodes that should be considered as placeholders.
|
||||
*
|
||||
* `false` will disable placeholder searching placeholders, leaving only
|
||||
* the `placeholderWhitelist` value to find replacements.
|
||||
*
|
||||
* This option cannot be used when using `%%foo%%` style placeholders.
|
||||
*
|
||||
* @default /^[_$A-Z0-9]+$/
|
||||
*/
|
||||
placeholderPattern?: RegExp | false | null | undefined;
|
||||
|
||||
/**
|
||||
* Set this to `true` to preserve comments from the template string
|
||||
* into the resulting AST, or `false` to automatically discard comments.
|
||||
*
|
||||
* @default false
|
||||
*/
|
||||
preserveComments?: boolean | null | undefined;
|
||||
|
||||
/**
|
||||
* Set to `true` to use `%%foo%%` style placeholders, `false` to use legacy placeholders
|
||||
* described by `placeholderPattern` or `placeholderWhitelist`.
|
||||
*
|
||||
* When it is not set, it behaves as `true` if there are syntactic placeholders, otherwise as `false`.
|
||||
*
|
||||
* @since 7.4.0
|
||||
*/
|
||||
syntacticPlaceholders?: boolean | null | undefined;
|
||||
}
|
||||
|
||||
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: unknown[]): (arg?: PublicReplacements) => T;
|
||||
|
||||
/**
|
||||
* Allow users to explicitly create templates that produce ASTs,
|
||||
* skipping the need for an intermediate function.
|
||||
*
|
||||
* Does not allow `%%foo%%` style placeholders.
|
||||
*/
|
||||
ast: {
|
||||
(tpl: string, opts?: TemplateBuilderOptions): T;
|
||||
(tpl: TemplateStringsArray, ...args: unknown[]): T;
|
||||
};
|
||||
}
|
||||
|
||||
export type PublicReplacements = { [index: string]: unknown } | unknown[];
|
||||
|
||||
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;
|
||||
43
node_modules/@types/babel__template/package.json
generated
vendored
Normal file
43
node_modules/@types/babel__template/package.json
generated
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
{
|
||||
"name": "@types/babel__template",
|
||||
"version": "7.4.4",
|
||||
"description": "TypeScript definitions for @babel/template",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__template",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Troy Gerwien",
|
||||
"githubUsername": "yortus",
|
||||
"url": "https://github.com/yortus"
|
||||
},
|
||||
{
|
||||
"name": "Marvin Hagemeister",
|
||||
"githubUsername": "marvinhagemeister",
|
||||
"url": "https://github.com/marvinhagemeister"
|
||||
},
|
||||
{
|
||||
"name": "Melvin Groenhoff",
|
||||
"githubUsername": "mgroenhoff",
|
||||
"url": "https://github.com/mgroenhoff"
|
||||
},
|
||||
{
|
||||
"name": "ExE Boss",
|
||||
"githubUsername": "ExE-Boss",
|
||||
"url": "https://github.com/ExE-Boss"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/babel__template"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.1.0",
|
||||
"@babel/types": "^7.0.0"
|
||||
},
|
||||
"typesPublisherContentHash": "5730d754b4d1fcd41676b093f9e32b340c749c4d37b126dfa312e394467e86c6",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/babel__traverse/LICENSE
generated
vendored
Normal file
21
node_modules/@types/babel__traverse/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/babel__traverse/README.md
generated
vendored
Normal file
15
node_modules/@types/babel__traverse/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/babel__traverse`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for @babel/traverse (https://github.com/babel/babel/tree/main/packages/babel-traverse).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__traverse.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 21 May 2024 21:07:11 GMT
|
||||
* Dependencies: [@babel/types](https://npmjs.com/package/@babel/types)
|
||||
|
||||
# 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), [Ifiok Jr.](https://github.com/ifiokjr), [ExE Boss](https://github.com/ExE-Boss), and [Daniel Tschinder](https://github.com/danez).
|
||||
1472
node_modules/@types/babel__traverse/index.d.ts
generated
vendored
Normal file
1472
node_modules/@types/babel__traverse/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
62
node_modules/@types/babel__traverse/package.json
generated
vendored
Normal file
62
node_modules/@types/babel__traverse/package.json
generated
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
{
|
||||
"name": "@types/babel__traverse",
|
||||
"version": "7.20.6",
|
||||
"description": "TypeScript definitions for @babel/traverse",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/babel__traverse",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Troy Gerwien",
|
||||
"githubUsername": "yortus",
|
||||
"url": "https://github.com/yortus"
|
||||
},
|
||||
{
|
||||
"name": "Marvin Hagemeister",
|
||||
"githubUsername": "marvinhagemeister",
|
||||
"url": "https://github.com/marvinhagemeister"
|
||||
},
|
||||
{
|
||||
"name": "Ryan Petrich",
|
||||
"githubUsername": "rpetrich",
|
||||
"url": "https://github.com/rpetrich"
|
||||
},
|
||||
{
|
||||
"name": "Melvin Groenhoff",
|
||||
"githubUsername": "mgroenhoff",
|
||||
"url": "https://github.com/mgroenhoff"
|
||||
},
|
||||
{
|
||||
"name": "Dean L.",
|
||||
"githubUsername": "dlgrit",
|
||||
"url": "https://github.com/dlgrit"
|
||||
},
|
||||
{
|
||||
"name": "Ifiok Jr.",
|
||||
"githubUsername": "ifiokjr",
|
||||
"url": "https://github.com/ifiokjr"
|
||||
},
|
||||
{
|
||||
"name": "ExE Boss",
|
||||
"githubUsername": "ExE-Boss",
|
||||
"url": "https://github.com/ExE-Boss"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Tschinder",
|
||||
"githubUsername": "danez",
|
||||
"url": "https://github.com/danez"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/babel__traverse"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.20.7"
|
||||
},
|
||||
"typesPublisherContentHash": "cbe25b5500aad0414e291c229529da2d7ee3ac79072c3c2f95bf1bde4d81316c",
|
||||
"typeScriptVersion": "4.7"
|
||||
}
|
||||
21
node_modules/@types/body-parser/LICENSE
generated
vendored
Normal file
21
node_modules/@types/body-parser/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/body-parser/README.md
generated
vendored
Normal file
15
node_modules/@types/body-parser/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/body-parser`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for body-parser (https://github.com/expressjs/body-parser).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 06 Nov 2023 22:41:05 GMT
|
||||
* Dependencies: [@types/connect](https://npmjs.com/package/@types/connect), [@types/node](https://npmjs.com/package/@types/node)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Santi Albo](https://github.com/santialbo), [Vilic Vane](https://github.com/vilic), [Jonathan Häberle](https://github.com/dreampulse), [Gevik Babakhani](https://github.com/blendsdk), [Tomasz Łaziuk](https://github.com/tlaziuk), [Jason Walton](https://github.com/jwalton), and [Piotr Błażejewicz](https://github.com/peterblazejewicz).
|
||||
95
node_modules/@types/body-parser/index.d.ts
generated
vendored
Normal file
95
node_modules/@types/body-parser/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,95 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import { NextHandleFunction } from "connect";
|
||||
import * as http from "http";
|
||||
|
||||
// for docs go to https://github.com/expressjs/body-parser/tree/1.19.0#body-parser
|
||||
|
||||
declare namespace bodyParser {
|
||||
interface BodyParser {
|
||||
/**
|
||||
* @deprecated use individual json/urlencoded middlewares
|
||||
*/
|
||||
(options?: OptionsJson & OptionsText & OptionsUrlencoded): NextHandleFunction;
|
||||
/**
|
||||
* Returns middleware that only parses json and only looks at requests
|
||||
* where the Content-Type header matches the type option.
|
||||
*/
|
||||
json(options?: OptionsJson): NextHandleFunction;
|
||||
/**
|
||||
* Returns middleware that parses all bodies as a Buffer and only looks at requests
|
||||
* where the Content-Type header matches the type option.
|
||||
*/
|
||||
raw(options?: Options): NextHandleFunction;
|
||||
|
||||
/**
|
||||
* Returns middleware that parses all bodies as a string and only looks at requests
|
||||
* where the Content-Type header matches the type option.
|
||||
*/
|
||||
text(options?: OptionsText): NextHandleFunction;
|
||||
/**
|
||||
* Returns middleware that only parses urlencoded bodies and only looks at requests
|
||||
* where the Content-Type header matches the type option
|
||||
*/
|
||||
urlencoded(options?: OptionsUrlencoded): NextHandleFunction;
|
||||
}
|
||||
|
||||
interface Options {
|
||||
/** When set to true, then deflated (compressed) bodies will be inflated; when false, deflated bodies are rejected. Defaults to true. */
|
||||
inflate?: boolean | undefined;
|
||||
/**
|
||||
* Controls the maximum request body size. If this is a number,
|
||||
* then the value specifies the number of bytes; if it is a string,
|
||||
* the value is passed to the bytes library for parsing. Defaults to '100kb'.
|
||||
*/
|
||||
limit?: number | string | undefined;
|
||||
/**
|
||||
* The type option is used to determine what media type the middleware will parse
|
||||
*/
|
||||
type?: string | string[] | ((req: http.IncomingMessage) => any) | undefined;
|
||||
/**
|
||||
* The verify option, if supplied, is called as verify(req, res, buf, encoding),
|
||||
* where buf is a Buffer of the raw request body and encoding is the encoding of the request.
|
||||
*/
|
||||
verify?(req: http.IncomingMessage, res: http.ServerResponse, buf: Buffer, encoding: string): void;
|
||||
}
|
||||
|
||||
interface OptionsJson extends Options {
|
||||
/**
|
||||
* The reviver option is passed directly to JSON.parse as the second argument.
|
||||
*/
|
||||
reviver?(key: string, value: any): any;
|
||||
/**
|
||||
* When set to `true`, will only accept arrays and objects;
|
||||
* when `false` will accept anything JSON.parse accepts. Defaults to `true`.
|
||||
*/
|
||||
strict?: boolean | undefined;
|
||||
}
|
||||
|
||||
interface OptionsText extends Options {
|
||||
/**
|
||||
* Specify the default character set for the text content if the charset
|
||||
* is not specified in the Content-Type header of the request.
|
||||
* Defaults to `utf-8`.
|
||||
*/
|
||||
defaultCharset?: string | undefined;
|
||||
}
|
||||
|
||||
interface OptionsUrlencoded extends Options {
|
||||
/**
|
||||
* The extended option allows to choose between parsing the URL-encoded data
|
||||
* with the querystring library (when `false`) or the qs library (when `true`).
|
||||
*/
|
||||
extended?: boolean | undefined;
|
||||
/**
|
||||
* The parameterLimit option controls the maximum number of parameters
|
||||
* that are allowed in the URL-encoded data. If a request contains more parameters than this value,
|
||||
* a 413 will be returned to the client. Defaults to 1000.
|
||||
*/
|
||||
parameterLimit?: number | undefined;
|
||||
}
|
||||
}
|
||||
|
||||
declare const bodyParser: bodyParser.BodyParser;
|
||||
|
||||
export = bodyParser;
|
||||
58
node_modules/@types/body-parser/package.json
generated
vendored
Normal file
58
node_modules/@types/body-parser/package.json
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"name": "@types/body-parser",
|
||||
"version": "1.19.5",
|
||||
"description": "TypeScript definitions for body-parser",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/body-parser",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Santi Albo",
|
||||
"githubUsername": "santialbo",
|
||||
"url": "https://github.com/santialbo"
|
||||
},
|
||||
{
|
||||
"name": "Vilic Vane",
|
||||
"githubUsername": "vilic",
|
||||
"url": "https://github.com/vilic"
|
||||
},
|
||||
{
|
||||
"name": "Jonathan Häberle",
|
||||
"githubUsername": "dreampulse",
|
||||
"url": "https://github.com/dreampulse"
|
||||
},
|
||||
{
|
||||
"name": "Gevik Babakhani",
|
||||
"githubUsername": "blendsdk",
|
||||
"url": "https://github.com/blendsdk"
|
||||
},
|
||||
{
|
||||
"name": "Tomasz Łaziuk",
|
||||
"githubUsername": "tlaziuk",
|
||||
"url": "https://github.com/tlaziuk"
|
||||
},
|
||||
{
|
||||
"name": "Jason Walton",
|
||||
"githubUsername": "jwalton",
|
||||
"url": "https://github.com/jwalton"
|
||||
},
|
||||
{
|
||||
"name": "Piotr Błażejewicz",
|
||||
"githubUsername": "peterblazejewicz",
|
||||
"url": "https://github.com/peterblazejewicz"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/body-parser"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/connect": "*",
|
||||
"@types/node": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "7be737b78c8aabd5436be840558b283182b44c3cf9da24fb1f2ff8f414db5802",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/connect/LICENSE
generated
vendored
Normal file
21
node_modules/@types/connect/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/connect/README.md
generated
vendored
Normal file
15
node_modules/@types/connect/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/connect`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for connect (https://github.com/senchalabs/connect).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 06 Nov 2023 22:41:05 GMT
|
||||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Maxime LUCE](https://github.com/SomaticIT), and [Evan Hahn](https://github.com/EvanHahn).
|
||||
91
node_modules/@types/connect/index.d.ts
generated
vendored
Normal file
91
node_modules/@types/connect/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,91 @@
|
||||
/// <reference types="node" />
|
||||
|
||||
import * as http from "http";
|
||||
|
||||
/**
|
||||
* Create a new connect server.
|
||||
*/
|
||||
declare function createServer(): createServer.Server;
|
||||
|
||||
declare namespace createServer {
|
||||
export type ServerHandle = HandleFunction | http.Server;
|
||||
|
||||
export class IncomingMessage extends http.IncomingMessage {
|
||||
originalUrl?: http.IncomingMessage["url"] | undefined;
|
||||
}
|
||||
|
||||
type NextFunction = (err?: any) => void;
|
||||
|
||||
export type SimpleHandleFunction = (req: IncomingMessage, res: http.ServerResponse) => void;
|
||||
export type NextHandleFunction = (req: IncomingMessage, res: http.ServerResponse, next: NextFunction) => void;
|
||||
export type ErrorHandleFunction = (
|
||||
err: any,
|
||||
req: IncomingMessage,
|
||||
res: http.ServerResponse,
|
||||
next: NextFunction,
|
||||
) => void;
|
||||
export type HandleFunction = SimpleHandleFunction | NextHandleFunction | ErrorHandleFunction;
|
||||
|
||||
export interface ServerStackItem {
|
||||
route: string;
|
||||
handle: ServerHandle;
|
||||
}
|
||||
|
||||
export interface Server extends NodeJS.EventEmitter {
|
||||
(req: http.IncomingMessage, res: http.ServerResponse, next?: Function): void;
|
||||
|
||||
route: string;
|
||||
stack: ServerStackItem[];
|
||||
|
||||
/**
|
||||
* Utilize the given middleware `handle` to the given `route`,
|
||||
* defaulting to _/_. This "route" is the mount-point for the
|
||||
* middleware, when given a value other than _/_ the middleware
|
||||
* is only effective when that segment is present in the request's
|
||||
* pathname.
|
||||
*
|
||||
* For example if we were to mount a function at _/admin_, it would
|
||||
* be invoked on _/admin_, and _/admin/settings_, however it would
|
||||
* not be invoked for _/_, or _/posts_.
|
||||
*/
|
||||
use(fn: NextHandleFunction): Server;
|
||||
use(fn: HandleFunction): Server;
|
||||
use(route: string, fn: NextHandleFunction): Server;
|
||||
use(route: string, fn: HandleFunction): Server;
|
||||
|
||||
/**
|
||||
* Handle server requests, punting them down
|
||||
* the middleware stack.
|
||||
*/
|
||||
handle(req: http.IncomingMessage, res: http.ServerResponse, next: Function): void;
|
||||
|
||||
/**
|
||||
* Listen for connections.
|
||||
*
|
||||
* This method takes the same arguments
|
||||
* as node's `http.Server#listen()`.
|
||||
*
|
||||
* HTTP and HTTPS:
|
||||
*
|
||||
* If you run your application both as HTTP
|
||||
* and HTTPS you may wrap them individually,
|
||||
* since your Connect "server" is really just
|
||||
* a JavaScript `Function`.
|
||||
*
|
||||
* var connect = require('connect')
|
||||
* , http = require('http')
|
||||
* , https = require('https');
|
||||
*
|
||||
* var app = connect();
|
||||
*
|
||||
* http.createServer(app).listen(80);
|
||||
* https.createServer(options, app).listen(443);
|
||||
*/
|
||||
listen(port: number, hostname?: string, backlog?: number, callback?: Function): http.Server;
|
||||
listen(port: number, hostname?: string, callback?: Function): http.Server;
|
||||
listen(path: string, callback?: Function): http.Server;
|
||||
listen(handle: any, listeningListener?: Function): http.Server;
|
||||
}
|
||||
}
|
||||
|
||||
export = createServer;
|
||||
32
node_modules/@types/connect/package.json
generated
vendored
Normal file
32
node_modules/@types/connect/package.json
generated
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
{
|
||||
"name": "@types/connect",
|
||||
"version": "3.4.38",
|
||||
"description": "TypeScript definitions for connect",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/connect",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Maxime LUCE",
|
||||
"githubUsername": "SomaticIT",
|
||||
"url": "https://github.com/SomaticIT"
|
||||
},
|
||||
{
|
||||
"name": "Evan Hahn",
|
||||
"githubUsername": "EvanHahn",
|
||||
"url": "https://github.com/EvanHahn"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/connect"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "8990242237504bdec53088b79e314b94bec69286df9de56db31f22de403b4092",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/d3-array/LICENSE
generated
vendored
Normal file
21
node_modules/@types/d3-array/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/d3-array/README.md
generated
vendored
Normal file
15
node_modules/@types/d3-array/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/d3-array`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for d3-array (https://github.com/d3/d3-array).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-array.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 15:11:36 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [Tom Wanzek](https://github.com/tomwanzek), [denisname](https://github.com/denisname), [Hugues Stefanski](https://github.com/ledragon), [Nathan Bierema](https://github.com/Methuselah96), and [Fil](https://github.com/Fil).
|
||||
1087
node_modules/@types/d3-array/index.d.ts
generated
vendored
Normal file
1087
node_modules/@types/d3-array/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
55
node_modules/@types/d3-array/package.json
generated
vendored
Normal file
55
node_modules/@types/d3-array/package.json
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "@types/d3-array",
|
||||
"version": "3.2.1",
|
||||
"description": "TypeScript definitions for d3-array",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-array",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Alex Ford",
|
||||
"githubUsername": "gustavderdrache",
|
||||
"url": "https://github.com/gustavderdrache"
|
||||
},
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "Tom Wanzek",
|
||||
"githubUsername": "tomwanzek",
|
||||
"url": "https://github.com/tomwanzek"
|
||||
},
|
||||
{
|
||||
"name": "denisname",
|
||||
"githubUsername": "denisname",
|
||||
"url": "https://github.com/denisname"
|
||||
},
|
||||
{
|
||||
"name": "Hugues Stefanski",
|
||||
"githubUsername": "ledragon",
|
||||
"url": "https://github.com/ledragon"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bierema",
|
||||
"githubUsername": "Methuselah96",
|
||||
"url": "https://github.com/Methuselah96"
|
||||
},
|
||||
{
|
||||
"name": "Fil",
|
||||
"githubUsername": "Fil",
|
||||
"url": "https://github.com/Fil"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/d3-array"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "b50eff598f27d034f8e6ff5b0f00103f3ba911073f16fe68999f19bc15ee6fc2",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/d3-color/LICENSE
generated
vendored
Normal file
21
node_modules/@types/d3-color/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/d3-color/README.md
generated
vendored
Normal file
15
node_modules/@types/d3-color/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/d3-color`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for d3-color (https://github.com/d3/d3-color/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-color.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 15:11:36 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), [Hugues Stefanski](https://github.com/ledragon), [Nathan Bierema](https://github.com/Methuselah96), and [Fil](https://github.com/Fil).
|
||||
669
node_modules/@types/d3-color/index.d.ts
generated
vendored
Normal file
669
node_modules/@types/d3-color/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,669 @@
|
||||
// Last module patch version validated against: 3.1.0
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Shared Type Definitions and Interfaces
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Type allowing for color objects from a specified color space
|
||||
*/
|
||||
export type ColorSpaceObject = RGBColor | HSLColor | LabColor | HCLColor | CubehelixColor;
|
||||
|
||||
/**
|
||||
* A helper interface of methods common to color objects (including colors defined outside the d3-color standard module,
|
||||
* e.g. in d3-hsv). This interface
|
||||
*/
|
||||
export interface ColorCommonInstance {
|
||||
/**
|
||||
* Returns true if and only if the color is displayable on standard hardware.
|
||||
* For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1].
|
||||
*/
|
||||
displayable(): boolean;
|
||||
/**
|
||||
* Returns a string representing this color according to the CSS Object Model specification,
|
||||
* such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2).
|
||||
* If this color is not displayable, a suitable displayable color is returned instead.
|
||||
* For example, RGB channel values greater than 255 are clamped to 255.
|
||||
*/
|
||||
toString(): string;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1. The behavior of this method is dependent on the implementing color space.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB equivalent of this color. For RGB colors, that’s "this".
|
||||
*/
|
||||
rgb(): RGBColor;
|
||||
/**
|
||||
* Returns a hexadecimal string representing this color.
|
||||
* If this color is not displayable, a suitable displayable color is returned instead.
|
||||
* For example, RGB channel values greater than 255 are clamped to 255.
|
||||
*/
|
||||
hex(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Color object which serves as a base class for
|
||||
* colorspace-specific sub-class implementations.
|
||||
*/
|
||||
export interface Color {
|
||||
/**
|
||||
* Returns true if and only if the color is displayable on standard hardware.
|
||||
* For example, this returns false for an RGB color if any channel value is less than zero or greater than 255, or if the opacity is not in the range [0, 1].
|
||||
*/
|
||||
displayable(): boolean; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color
|
||||
/**
|
||||
* Returns a string representing this color according to the CSS Object Model specification,
|
||||
* such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2).
|
||||
* If this color is not displayable, a suitable displayable color is returned instead.
|
||||
* For example, RGB channel values greater than 255 are clamped to 255.
|
||||
*/
|
||||
toString(): string; // Note: While this method is used in prototyping for colors of specific colorspaces, it should not be called directly, as 'this.rgb' would not be implemented on Color
|
||||
/**
|
||||
* Returns a hexadecimal string representing this color in RGB space, such as #f7eaba.
|
||||
* If this color is not displayable, a suitable displayable color is returned instead.
|
||||
* For example, RGB channel values greater than 255 are clamped to 255.
|
||||
*/
|
||||
formatHex(): string;
|
||||
/**
|
||||
* Returns a hexadecimal string representing this color in RGBA space, such as #f7eaba90.
|
||||
* If this color is not displayable, a suitable displayable color is returned instead.
|
||||
* For example, RGB channel values greater than 255 are clamped to 255.
|
||||
*/
|
||||
formatHex8(): string;
|
||||
/**
|
||||
* Returns a string representing this color according to the CSS Color Module Level 3 specification, such as hsl(257, 50%, 80%) or hsla(257, 50%, 80%, 0.2).
|
||||
* If this color is not displayable, a suitable displayable color is returned instead by clamping S and L channel values to the interval [0, 100].
|
||||
*/
|
||||
formatHsl(): string;
|
||||
/**
|
||||
* Returns a string representing this color according to the CSS Object Model specification, such as rgb(247, 234, 186) or rgba(247, 234, 186, 0.2).
|
||||
* If this color is not displayable, a suitable displayable color is returned instead by clamping RGB channel values to the interval [0, 255].
|
||||
*/
|
||||
formatRgb(): string;
|
||||
/**
|
||||
* @deprecated Use color.formatHex.
|
||||
*/
|
||||
hex(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Color factory object, which may also be used with instanceof to test if an object is a color instance.
|
||||
*/
|
||||
export interface ColorFactory extends Function {
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an RGB or HSL color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): RGBColor | HSLColor | null;
|
||||
/**
|
||||
* Converts the provided color instance and returns an RGB or HSL color.
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
(color: ColorSpaceObject | ColorCommonInstance): RGBColor | HSLColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: Color;
|
||||
}
|
||||
|
||||
/**
|
||||
* An RGB color object.
|
||||
*/
|
||||
export interface RGBColor extends Color {
|
||||
/**
|
||||
* Value of red channel
|
||||
*/
|
||||
r: number;
|
||||
/**
|
||||
* Value of green channel
|
||||
*/
|
||||
g: number;
|
||||
/**
|
||||
* Value of blue channel
|
||||
*/
|
||||
b: number;
|
||||
/**
|
||||
* Opacity value
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB equivalent of this color.
|
||||
*/
|
||||
rgb(): this;
|
||||
/**
|
||||
* Returns a copy of this color.
|
||||
*
|
||||
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
|
||||
*/
|
||||
copy(
|
||||
values?: {
|
||||
r?: number | undefined;
|
||||
g?: number | undefined;
|
||||
b?: number | undefined;
|
||||
opacity?: number | undefined;
|
||||
},
|
||||
): this;
|
||||
/**
|
||||
* Returns a new RGB color where the r, g, and b channels are clamped to the range [0, 255] and rounded to the nearest integer value,
|
||||
* and the opacity is clamped to the range [0, 1].
|
||||
*/
|
||||
clamp(): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An RGB color factory object, which may also be used with instanceof to test if an object
|
||||
* is an RGB color instance.
|
||||
*/
|
||||
export interface RGBColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new RGB color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param r Red channel value.
|
||||
* @param g Green channel value.
|
||||
* @param b Blue channel value.
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(r: number, g: number, b: number, opacity?: number): RGBColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an RGB color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): RGBColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns an RGB color. The color instance is converted to the RGB color space using color.rgb.
|
||||
* Note that unlike color.rgb this method always returns a new instance, even if color is already an RGB color.
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
(color: ColorSpaceObject | ColorCommonInstance): RGBColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: RGBColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* An HSL color object.
|
||||
*/
|
||||
export interface HSLColor extends Color {
|
||||
/**
|
||||
* Hue channel value.
|
||||
*/
|
||||
h: number;
|
||||
/**
|
||||
* Saturation channel value.
|
||||
*/
|
||||
s: number;
|
||||
/**
|
||||
* Lightness channel value.
|
||||
*/
|
||||
l: number;
|
||||
/**
|
||||
* Opacity value.
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB color equivalent of this color.
|
||||
*/
|
||||
rgb(): RGBColor;
|
||||
/**
|
||||
* Returns a copy of this color.
|
||||
*
|
||||
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
|
||||
*/
|
||||
copy(
|
||||
values?: {
|
||||
h?: number | undefined;
|
||||
s?: number | undefined;
|
||||
l?: number | undefined;
|
||||
opacity?: number | undefined;
|
||||
},
|
||||
): this;
|
||||
/**
|
||||
* Returns a new HSL color where the h channel is clamped to the range [0, 360), and the s, l, and opacity channels are clamped to the range [0, 1].
|
||||
*/
|
||||
clamp(): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An HSL color factory object, which may also be used with instanceof to test if an object
|
||||
* is an HSL color instance.
|
||||
*/
|
||||
export interface HSLColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new HSL color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param h Hue channel value.
|
||||
* @param s Saturation channel value.
|
||||
* @param l Lightness channel value.
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(h: number, s: number, l: number, opacity?: number): HSLColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an HSL color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): HSLColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns an HSL color.
|
||||
* The color instance is converted to the RGB color space using color.rgb and then converted to HSL.
|
||||
* (Colors already in the HSL color space skip the conversion to RGB.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
(color: ColorSpaceObject | ColorCommonInstance): HSLColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: HSLColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Lab (CIELAB) color object.
|
||||
*/
|
||||
export interface LabColor extends Color {
|
||||
/**
|
||||
* Lightness typically in the range [0, 100].
|
||||
*/
|
||||
l: number;
|
||||
/**
|
||||
* Position between red/magenta and green typically in [-160, +160].
|
||||
*/
|
||||
a: number;
|
||||
/**
|
||||
* Position between yellow and blue typically in [-160, +160].
|
||||
*/
|
||||
b: number;
|
||||
/**
|
||||
* Opacity value
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB color equivalent of this color.
|
||||
*/
|
||||
rgb(): RGBColor;
|
||||
/**
|
||||
* Returns a copy of this color.
|
||||
*
|
||||
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
|
||||
*/
|
||||
copy(
|
||||
values?: {
|
||||
l?: number | undefined;
|
||||
a?: number | undefined;
|
||||
b?: number | undefined;
|
||||
opacity?: number | undefined;
|
||||
},
|
||||
): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object
|
||||
* is a Lab color instance.
|
||||
*/
|
||||
export interface LabColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new CIELAB color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param l Lightness typically in the range [0, 100].
|
||||
* @param a Position between red/magenta and green typically in [-160, +160].
|
||||
* @param b Position between yellow and blue typically in [-160, +160].
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(l: number, a: number, b: number, opacity?: number): LabColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning a Lab color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): LabColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns a Lab color.
|
||||
* The color instance is converted to the RGB color space using color.rgb and then converted to CIELAB.
|
||||
* (Colors already in the Lab color space skip the conversion to RGB,
|
||||
* and colors in the HCL color space are converted directly to CIELAB.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
(color: ColorSpaceObject | ColorCommonInstance): LabColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: LabColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* A gray color factory for Lab (CIELAB) colors.
|
||||
*/
|
||||
export type GrayColorFactory =
|
||||
/**
|
||||
* Constructs a new CIELAB color with the specified l value and a = b = 0.
|
||||
*
|
||||
* @param l Lightness typically in the range [0, 100].
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(l: number, opacity?: number) => LabColor;
|
||||
|
||||
/**
|
||||
* An HCL (CIELCH) color object.
|
||||
*/
|
||||
export interface HCLColor extends Color {
|
||||
/**
|
||||
* Hue channel value typically in [0, 360).
|
||||
*/
|
||||
h: number;
|
||||
/**
|
||||
* Chroma channel value typically in [0, 230].
|
||||
*/
|
||||
c: number;
|
||||
/**
|
||||
* Luminance channel value typically in the range [0, 100].
|
||||
*/
|
||||
l: number;
|
||||
/**
|
||||
* Opacity value
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB color equivalent of this color.
|
||||
*/
|
||||
rgb(): RGBColor;
|
||||
/**
|
||||
* Returns a copy of this color.
|
||||
*
|
||||
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
|
||||
*/
|
||||
copy(
|
||||
values?: {
|
||||
h?: number | undefined;
|
||||
c?: number | undefined;
|
||||
l?: number | undefined;
|
||||
opacity?: number | undefined;
|
||||
},
|
||||
): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object
|
||||
* is an HCL color instance.
|
||||
*/
|
||||
export interface HCLColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new HCL color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param h Hue channel value typically in [0, 360).
|
||||
* @param c Chroma channel value typically in [0, 230].
|
||||
* @param l Luminance channel value typically in the range [0, 100].
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(h: number, c: number, l: number, opacity?: number): HCLColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): HCLColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns an HCL color.
|
||||
* The color instance is converted to the RGB color space using color.rgb and then converted to HCL.
|
||||
* (Colors already in the HCL color space skip the conversion to RGB,
|
||||
* and colors in the Lab color space are converted directly to HCL.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
(color: ColorSpaceObject | ColorCommonInstance): HCLColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: HCLColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* An LCH (CIELCH) color factory function to create an HCL color object.
|
||||
*/
|
||||
export interface LCHColorFactory {
|
||||
/**
|
||||
* Constructs a new HCL color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param l Luminance channel value typically in the range [0, 100].
|
||||
* @param c Chroma channel value typically in [0, 230].
|
||||
* @param h Hue channel value typically in [0, 360).
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(l: number, c: number, h: number, opacity?: number): HCLColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an HCL color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): HCLColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns an HCL color.
|
||||
* The color instance is converted to the RGB color space using color.rgb and then converted to HCL.
|
||||
* (Colors already in the HCL color space skip the conversion to RGB,
|
||||
* and colors in the Lab color space are converted directly to HCL.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
(color: ColorSpaceObject | ColorCommonInstance): HCLColor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dave Green’s Cubehelix color object.
|
||||
*/
|
||||
export interface CubehelixColor extends Color {
|
||||
/**
|
||||
* Hue channel value.
|
||||
*/
|
||||
h: number;
|
||||
/**
|
||||
* Saturation channel value.
|
||||
*/
|
||||
s: number;
|
||||
/**
|
||||
* Lightness channel value.
|
||||
*/
|
||||
l: number;
|
||||
/**
|
||||
* Opacity value.
|
||||
*/
|
||||
opacity: number;
|
||||
/**
|
||||
* Returns a brighter copy of this color. If k is specified, it controls how much brighter the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much brighter the returned color should be.
|
||||
*/
|
||||
brighter(k?: number): this;
|
||||
/**
|
||||
* Returns a darker copy of this color. If k is specified, it controls how much darker the returned color should be.
|
||||
* If k is not specified, it defaults to 1.
|
||||
*
|
||||
* @param k A color space dependent number to determine, how much darker the returned color should be.
|
||||
*/
|
||||
darker(k?: number): this;
|
||||
/**
|
||||
* Returns the RGB color equivalent of this color.
|
||||
*/
|
||||
rgb(): RGBColor;
|
||||
/**
|
||||
* Returns a copy of this color.
|
||||
*
|
||||
* @param values If values is specified, any enumerable own properties of values are assigned to the new returned color.
|
||||
*/
|
||||
copy(
|
||||
values?: {
|
||||
h?: number | undefined;
|
||||
s?: number | undefined;
|
||||
l?: number | undefined;
|
||||
opacity?: number | undefined;
|
||||
},
|
||||
): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object
|
||||
* is a Cubehelix color instance.
|
||||
*/
|
||||
export interface CubehelixColorFactory extends Function {
|
||||
/**
|
||||
* Constructs a new Cubehelix color based on the specified channel values and opacity.
|
||||
*
|
||||
* @param h Hue channel value.
|
||||
* @param s Saturation channel value.
|
||||
* @param l Lightness channel value.
|
||||
* @param opacity Optional opacity value, defaults to 1.
|
||||
*/
|
||||
(h: number, s: number, l: number, opacity?: number): CubehelixColor;
|
||||
/**
|
||||
* Parses the specified CSS Color Module Level 3 specifier string, returning an Cubehelix color.
|
||||
* If the specifier was not valid, null is returned.
|
||||
*
|
||||
* @param cssColorSpecifier A CSS Color Module Level 3 specifier string.
|
||||
*/
|
||||
(cssColorSpecifier: string): CubehelixColor;
|
||||
/**
|
||||
* Converts the provided color instance and returns a Cubehelix color.
|
||||
* The color instance is specified, it is converted to the RGB color space using color.rgb and then converted to Cubehelix.
|
||||
* (Colors already in the Cubehelix color space skip the conversion to RGB.)
|
||||
*
|
||||
* @param color A permissible color space instance.
|
||||
*/
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
(color: ColorSpaceObject | ColorCommonInstance): CubehelixColor;
|
||||
/**
|
||||
* Prototype of the factory, which can be used for instanceof testing
|
||||
*/
|
||||
readonly prototype: CubehelixColor;
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Color object factories
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A Color factory object, which may also be used with instanceof to test if an object is a color instance.
|
||||
*/
|
||||
export const color: ColorFactory;
|
||||
|
||||
/**
|
||||
* An RGB color factory object, which may also be used with instanceof to test if an object
|
||||
* is an RGB color instance.
|
||||
*/
|
||||
export const rgb: RGBColorFactory;
|
||||
|
||||
/**
|
||||
* An HSL color factory object, which may also be used with instanceof to test if an object
|
||||
* is an HSL color instance.
|
||||
*/
|
||||
export const hsl: HSLColorFactory;
|
||||
|
||||
/**
|
||||
* A Lab (CIELAB) color factory object, which may also be used with instanceof to test if an object
|
||||
* is a Lab color instance.
|
||||
*/
|
||||
export const lab: LabColorFactory;
|
||||
|
||||
/**
|
||||
* A gray color factory for Lab (CIELAB) colors.
|
||||
*/
|
||||
export const gray: GrayColorFactory;
|
||||
|
||||
/**
|
||||
* An HCL (CIELCH) color factory object, which may also be used with instanceof to test if an object
|
||||
* is an HCL color instance.
|
||||
*/
|
||||
export const hcl: HCLColorFactory;
|
||||
|
||||
/**
|
||||
* An LCH (CIELCH) color factory function to create an HCL color object.
|
||||
*/
|
||||
export const lch: LCHColorFactory;
|
||||
|
||||
/**
|
||||
* A color factory object for Dave Green's Cubehelix colors, which may also be used with instanceof to test if an object
|
||||
* is a Cubehelix color instance.
|
||||
*/
|
||||
export const cubehelix: CubehelixColorFactory;
|
||||
55
node_modules/@types/d3-color/package.json
generated
vendored
Normal file
55
node_modules/@types/d3-color/package.json
generated
vendored
Normal file
@ -0,0 +1,55 @@
|
||||
{
|
||||
"name": "@types/d3-color",
|
||||
"version": "3.1.3",
|
||||
"description": "TypeScript definitions for d3-color",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-color",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tom Wanzek",
|
||||
"githubUsername": "tomwanzek",
|
||||
"url": "https://github.com/tomwanzek"
|
||||
},
|
||||
{
|
||||
"name": "Alex Ford",
|
||||
"githubUsername": "gustavderdrache",
|
||||
"url": "https://github.com/gustavderdrache"
|
||||
},
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "denisname",
|
||||
"githubUsername": "denisname",
|
||||
"url": "https://github.com/denisname"
|
||||
},
|
||||
{
|
||||
"name": "Hugues Stefanski",
|
||||
"githubUsername": "ledragon",
|
||||
"url": "https://github.com/ledragon"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bierema",
|
||||
"githubUsername": "Methuselah96",
|
||||
"url": "https://github.com/Methuselah96"
|
||||
},
|
||||
{
|
||||
"name": "Fil",
|
||||
"githubUsername": "Fil",
|
||||
"url": "https://github.com/Fil"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/d3-color"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "89cf9357324cddaa31cfb539b1c33d118648ed55319f2a0d26f24b004975a947",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/d3-ease/LICENSE
generated
vendored
Normal file
21
node_modules/@types/d3-ease/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/d3-ease/README.md
generated
vendored
Normal file
15
node_modules/@types/d3-ease/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/d3-ease`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for d3-ease (https://github.com/d3/d3-ease/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-ease.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 15:11:36 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), and [Nathan Bierema](https://github.com/Methuselah96).
|
||||
316
node_modules/@types/d3-ease/index.d.ts
generated
vendored
Normal file
316
node_modules/@types/d3-ease/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,316 @@
|
||||
// Last module patch version validated against: 3.0.1
|
||||
|
||||
// --------------------------------------------------------------------------
|
||||
// Easing Functions
|
||||
// --------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Linear easing; the identity function; linear(t) returns t.
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeLinear(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric quadratic easing; scales quadIn for t in [0, 0.5] and quadOut for t in [0.5, 1]. Also equivalent to poly.exponent(2).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeQuad(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Quadratic easing; equivalent to polyIn.exponent(2).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeQuadIn(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Reverse quadratic easing; equivalent to 1 - quadIn(1 - t). Also equivalent to polyOut.exponent(2).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeQuadOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric quadratic easing; scales quadIn for t in [0, 0.5] and quadOut for t in [0.5, 1]. Also equivalent to poly.exponent(2).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeQuadInOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric cubic easing; scales cubicIn for t in [0, 0.5] and cubicOut for t in [0.5, 1]. Also equivalent to poly.exponent(3).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeCubic(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Cubic easing; equivalent to polyIn.exponent(3).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeCubicIn(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Reverse cubic easing; equivalent to 1 - cubicIn(1 - t). Also equivalent to polyOut.exponent(3).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeCubicOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric cubic easing; scales cubicIn for t in [0, 0.5] and cubicOut for t in [0.5, 1]. Also equivalent to poly.exponent(3).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeCubicInOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Polynomial easing function factory
|
||||
*/
|
||||
export interface PolynomialEasingFactory {
|
||||
/**
|
||||
* Calculate eased time.
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
(normalizedTime: number): number;
|
||||
/**
|
||||
* Returns a new polynomial easing with the specified exponent e.
|
||||
* If the exponent is not specified, it defaults to 3, equivalent to cubic.
|
||||
*
|
||||
* @param e Exponent for polynomial easing.
|
||||
*/
|
||||
exponent(e: number): PolynomialEasingFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Symmetric polynomial easing/easing factory; scales polyIn for t in [0, 0.5] and polyOut for t in [0.5, 1].
|
||||
* If the exponent is not specified, it defaults to 3, equivalent to cubic.
|
||||
*/
|
||||
export const easePoly: PolynomialEasingFactory;
|
||||
/**
|
||||
* Polynomial easing/easing factory; raises t to the specified exponent.
|
||||
* If the exponent is not specified, it defaults to 3, equivalent to cubicIn.
|
||||
*/
|
||||
export const easePolyIn: PolynomialEasingFactory;
|
||||
|
||||
/**
|
||||
* Reverse polynomial easing/easing factory; equivalent to 1 - polyIn(1 - t).
|
||||
* If the exponent is not specified, it defaults to 3, equivalent to cubicOut.
|
||||
*/
|
||||
export const easePolyOut: PolynomialEasingFactory;
|
||||
|
||||
/**
|
||||
* Symmetric polynomial easing/easing factory; scales polyIn for t in [0, 0.5] and polyOut for t in [0.5, 1].
|
||||
* If the exponent is not specified, it defaults to 3, equivalent to cubic.
|
||||
*/
|
||||
export const easePolyInOut: PolynomialEasingFactory;
|
||||
|
||||
/**
|
||||
* Symmetric sinusoidal easing; scales sinIn for t in [0, 0.5] and sinOut for t in [0.5, 1].
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeSin(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Sinusoidal easing; returns sin(t).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeSinIn(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Reverse sinusoidal easing; equivalent to 1 - sinIn(1 - t).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeSinOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric sinusoidal easing; scales sinIn for t in [0, 0.5] and sinOut for t in [0.5, 1].
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeSinInOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric exponential easing; scales expIn for t in [0, 0.5] and expOut for t in [0.5, 1].
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeExp(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Exponential easing; raises 2 to the exponent 10 * (t - 1).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeExpIn(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Reverse exponential easing; equivalent to 1 - expIn(1 - t).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeExpOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric exponential easing; scales expIn for t in [0, 0.5] and expOut for t in [0.5, 1].
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeExpInOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric circular easing; scales circleIn for t in [0, 0.5] and circleOut for t in [0.5, 1].
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeCircle(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Circular easing.
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeCircleIn(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Reverse circular easing; equivalent to 1 - circleIn(1 - t).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeCircleOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric circular easing; scales circleIn for t in [0, 0.5] and circleOut for t in [0.5, 1].
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeCircleInOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Reverse bounce easing; equivalent to 1 - bounceIn(1 - t).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeBounce(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Bounce easing, like a rubber ball.
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeBounceIn(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Reverse bounce easing; equivalent to 1 - bounceIn(1 - t).
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeBounceOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Symmetric bounce easing; scales bounceIn for t in [0, 0.5] and bounceOut for t in [0.5, 1].
|
||||
*
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
export function easeBounceInOut(normalizedTime: number): number;
|
||||
|
||||
/**
|
||||
* Anticipatory easing function factory
|
||||
*/
|
||||
export interface BackEasingFactory {
|
||||
/**
|
||||
* Calculate eased time.
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
(normalizedTime: number): number;
|
||||
/**
|
||||
* Returns a new back easing with the specified overshoot s.
|
||||
* The degree of overshoot is configurable; if not specified, it defaults to 1.70158.
|
||||
*
|
||||
* @param s Overshoot parameter
|
||||
*/
|
||||
overshoot(s: number): BackEasingFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Symmetric anticipatory easing; scales backIn for t in [0, 0.5] and backOut for t in [0.5, 1].
|
||||
* The degree of overshoot is configurable; it not specified, it defaults to 1.70158.
|
||||
*/
|
||||
export const easeBack: BackEasingFactory;
|
||||
|
||||
/**
|
||||
* Anticipatory easing, like a dancer bending their knees before jumping off the floor.
|
||||
* The degree of overshoot is configurable; it not specified, it defaults to 1.70158.
|
||||
*/
|
||||
export const easeBackIn: BackEasingFactory;
|
||||
|
||||
/**
|
||||
* Reverse anticipatory easing; equivalent to 1 - backIn(1 - t).
|
||||
* The degree of overshoot is configurable; it not specified, it defaults to 1.70158.
|
||||
*/
|
||||
export const easeBackOut: BackEasingFactory;
|
||||
|
||||
/**
|
||||
* Symmetric anticipatory easing; scales backIn for t in [0, 0.5] and backOut for t in [0.5, 1].
|
||||
* The degree of overshoot is configurable; it not specified, it defaults to 1.70158.
|
||||
*/
|
||||
export const easeBackInOut: BackEasingFactory;
|
||||
|
||||
/**
|
||||
* Elastic easing function factory
|
||||
*/
|
||||
export interface ElasticEasingFactory {
|
||||
/**
|
||||
* Calculate eased time.
|
||||
* @param normalizedTime Normalized time typically in the range [0, 1]
|
||||
*/
|
||||
(normalizedTime: number): number;
|
||||
/**
|
||||
* Returns a new elastic easing with the specified amplitude a.
|
||||
* Defaults to 1,if not specified.
|
||||
*
|
||||
* @param a Amplitude for elastic easing.
|
||||
*/
|
||||
amplitude(a: number): ElasticEasingFactory;
|
||||
/**
|
||||
* Returns a new elastic easing with the specified amplitude a.
|
||||
* Defaults to 0.3,if not specified.
|
||||
*
|
||||
* @param p Period for elastic easing.
|
||||
*/
|
||||
period(p: number): ElasticEasingFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse elastic easing; equivalent to 1 - elasticIn(1 - t).
|
||||
* The amplitude and period of the oscillation are configurable;
|
||||
* if not specified, they default to 1 and 0.3, respectively.
|
||||
*/
|
||||
export const easeElastic: ElasticEasingFactory;
|
||||
|
||||
/**
|
||||
* Elastic easing, like a rubber band.
|
||||
* The amplitude and period of the oscillation are configurable;
|
||||
* if not specified, they default to 1 and 0.3, respectively.
|
||||
*/
|
||||
export const easeElasticIn: ElasticEasingFactory;
|
||||
|
||||
/**
|
||||
* Reverse elastic easing; equivalent to 1 - elasticIn(1 - t).
|
||||
* The amplitude and period of the oscillation are configurable;
|
||||
* if not specified, they default to 1 and 0.3, respectively.
|
||||
*/
|
||||
export const easeElasticOut: ElasticEasingFactory;
|
||||
|
||||
/**
|
||||
* Symmetric elastic easing; scales elasticIn for t in [0, 0.5] and elasticOut for t in [0.5, 1].
|
||||
* The amplitude and period of the oscillation are configurable;
|
||||
* if not specified, they default to 1 and 0.3, respectively.
|
||||
*/
|
||||
export const easeElasticInOut: ElasticEasingFactory;
|
||||
40
node_modules/@types/d3-ease/package.json
generated
vendored
Normal file
40
node_modules/@types/d3-ease/package.json
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "@types/d3-ease",
|
||||
"version": "3.0.2",
|
||||
"description": "TypeScript definitions for d3-ease",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-ease",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tom Wanzek",
|
||||
"githubUsername": "tomwanzek",
|
||||
"url": "https://github.com/tomwanzek"
|
||||
},
|
||||
{
|
||||
"name": "Alex Ford",
|
||||
"githubUsername": "gustavderdrache",
|
||||
"url": "https://github.com/gustavderdrache"
|
||||
},
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bierema",
|
||||
"githubUsername": "Methuselah96",
|
||||
"url": "https://github.com/Methuselah96"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/d3-ease"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "2995c518f8de4fa6f2abb2f13065cb4fe65acaea9422f9883b24414ef50cd1ab",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/d3-interpolate/LICENSE
generated
vendored
Normal file
21
node_modules/@types/d3-interpolate/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/d3-interpolate/README.md
generated
vendored
Normal file
15
node_modules/@types/d3-interpolate/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/d3-interpolate`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for d3-interpolate (https://github.com/d3/d3-interpolate/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-interpolate.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 15:11:37 GMT
|
||||
* Dependencies: [@types/d3-color](https://npmjs.com/package/@types/d3-color)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).
|
||||
387
node_modules/@types/d3-interpolate/index.d.ts
generated
vendored
Normal file
387
node_modules/@types/d3-interpolate/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,387 @@
|
||||
// Last module patch version validated against: 3.0.1
|
||||
|
||||
import { ColorCommonInstance } from "d3-color";
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Shared Type Definitions and Interfaces
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
export interface ZoomInterpolator extends Function {
|
||||
(t: number): ZoomView;
|
||||
/**
|
||||
* Recommended duration of zoom transition in milliseconds.
|
||||
*/
|
||||
duration: number;
|
||||
|
||||
/**
|
||||
* Given a zoom interpolator, returns a new zoom interpolator using the specified curvature rho.
|
||||
* When rho is close to 0, the interpolator is almost linear.
|
||||
* The default curvature is sqrt(2).
|
||||
* @param rho
|
||||
*/
|
||||
rho(rho: number): this;
|
||||
}
|
||||
|
||||
export interface ColorGammaInterpolationFactory extends Function {
|
||||
(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string;
|
||||
/**
|
||||
* Returns a new interpolator factory of the same type using the specified *gamma*.
|
||||
* For example, to interpolate from purple to orange with a gamma of 2.2 in RGB space: `d3.interpolateRgb.gamma(2.2)("purple", "orange")`.
|
||||
* See Eric Brasseur’s article, [Gamma error in picture scaling](https://web.archive.org/web/20160112115812/http://www.4p8.com/eric.brasseur/gamma.html), for more on gamma correction.
|
||||
*/
|
||||
gamma(g: number): ColorGammaInterpolationFactory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Type zoomView is used to represent a numeric array with three elements.
|
||||
* In order of appearance the elements correspond to:
|
||||
* - cx: *x*-coordinate of the center of the viewport
|
||||
* - cy: *y*-coordinate of the center of the viewport
|
||||
* - width: size of the viewport
|
||||
*/
|
||||
export type ZoomView = [number, number, number];
|
||||
|
||||
export type TypedArray =
|
||||
| Int8Array
|
||||
| Uint8Array
|
||||
| Int16Array
|
||||
| Uint16Array
|
||||
| Int32Array
|
||||
| Uint32Array
|
||||
| Uint8ClampedArray
|
||||
| Float32Array
|
||||
| Float64Array;
|
||||
|
||||
export type NumberArray = TypedArray | DataView;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Interpolation Function Factories
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns an `null` constant interpolator.
|
||||
*/
|
||||
export function interpolate(a: any, b: null): (t: number) => null;
|
||||
/**
|
||||
* Returns an boolean constant interpolator of value `b`.
|
||||
*/
|
||||
export function interpolate(a: any, b: boolean): (t: number) => boolean;
|
||||
/**
|
||||
* Returns a `interpolateRgb` interpolator.
|
||||
*/
|
||||
export function interpolate(a: string | ColorCommonInstance, b: ColorCommonInstance): (t: number) => string;
|
||||
/**
|
||||
* Returns a `interpolateDate` interpolator.
|
||||
*/
|
||||
export function interpolate(a: Date, b: Date): (t: number) => Date;
|
||||
/**
|
||||
* Returns a `interpolateNumber` interpolator.
|
||||
*/
|
||||
export function interpolate(
|
||||
a: number | { valueOf(): number },
|
||||
b: number | { valueOf(): number },
|
||||
): (t: number) => number;
|
||||
/**
|
||||
* Returns a `interpolateNumberArray` interpolator.
|
||||
*/
|
||||
export function interpolate<T extends NumberArray>(a: NumberArray | number[], b: T): (t: number) => T;
|
||||
/**
|
||||
* Returns a `interpolateString` interpolator. If `b` is a string coercible to a color use use `interpolateRgb`.
|
||||
*/
|
||||
export function interpolate(a: string | { toString(): string }, b: string): (t: number) => string;
|
||||
/**
|
||||
* Returns a `interpolateArray` interpolator.
|
||||
*/
|
||||
export function interpolate<U extends any[]>(a: any[], b: U): (t: number) => U;
|
||||
/**
|
||||
* Returns a `interpolateObject` interpolator.
|
||||
*/
|
||||
export function interpolate<U extends object>(a: any, b: U): (t: number) => U;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two numbers `a` and `b`.
|
||||
* The returned interpolator is equivalent to: `(t) => a * (1 - t) + b * t`.
|
||||
*/
|
||||
export function interpolateNumber(
|
||||
a: number | { valueOf(): number },
|
||||
b: number | { valueOf(): number },
|
||||
): (t: number) => number;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two numbers `a` and `b`; the interpolator is similar to `interpolateNumber`,
|
||||
* except it will round the resulting value to the nearest integer.
|
||||
*/
|
||||
export function interpolateRound(
|
||||
a: number | { valueOf(): number },
|
||||
b: number | { valueOf(): number },
|
||||
): (t: number) => number;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two strings `a` and `b`.
|
||||
* The string interpolator finds numbers embedded in `a` and `b`, where each number is of the form understood by JavaScript.
|
||||
* A few examples of numbers that will be detected within a string: `-1`, `42`, `3.14159`, and `6.0221413e+23`.
|
||||
*
|
||||
* For each number embedded in `b`, the interpolator will attempt to find a corresponding number in `a`.
|
||||
* If a corresponding number is found, a numeric interpolator is created using `interpolateNumber`.
|
||||
* The remaining parts of the string `b` are used as a template.
|
||||
*
|
||||
* For example, if `a` is `"300 12px sans-serif"`, and `b` is `"500 36px Comic-Sans"`, two embedded numbers are found.
|
||||
* The remaining static parts (of string `b`) are a space between the two numbers (`" "`), and the suffix (`"px Comic-Sans"`).
|
||||
* The result of the interpolator at `t` = 0.5 is `"400 24px Comic-Sans"`.
|
||||
*/
|
||||
export function interpolateString(
|
||||
a: string | { toString(): string },
|
||||
b: string | { toString(): string },
|
||||
): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two dates `a` and `b`.
|
||||
*
|
||||
* Note: *no defensive copy* of the returned date is created; the same Date instance is returned for every evaluation of the interpolator.
|
||||
* No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions.
|
||||
*/
|
||||
export function interpolateDate(a: Date, b: Date): (t: number) => Date;
|
||||
|
||||
export type ArrayInterpolator<A extends any[]> = (t: number) => A;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two arrays `a` and `b`. Internally, an array template is created that is the same length in `b`.
|
||||
* For each element in `b`, if there exists a corresponding element in `a`, a generic interpolator is created for the two elements using `interpolate`.
|
||||
* If there is no such element, the static value from `b` is used in the template.
|
||||
* Then, for the given parameter `t`, the template’s embedded interpolators are evaluated. The updated array template is then returned.
|
||||
*
|
||||
* For example, if `a` is the array `[0, 1]` and `b` is the array `[1, 10, 100]`, then the result of the interpolator for `t = 0.5` is the array `[0.5, 5.5, 100]`.
|
||||
*
|
||||
* Note: *no defensive copy* of the template array is created; modifications of the returned array may adversely affect subsequent evaluation of the interpolator.
|
||||
* No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions.
|
||||
*/
|
||||
export function interpolateArray<A extends any[]>(a: any[], b: A): ArrayInterpolator<A>;
|
||||
/**
|
||||
* interpolateNumberArray is called
|
||||
*/
|
||||
export function interpolateArray<T extends NumberArray>(a: NumberArray | number[], b: T): (t: number) => T;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two arrays of numbers a and b.
|
||||
* Internally, an array template is created that is the same type and length as b.
|
||||
* For each element in b, if there exists a corresponding element in a, the values are directly interpolated in the array template.
|
||||
* If there is no such element, the static value from b is copied.
|
||||
* The updated array template is then returned.
|
||||
*
|
||||
* Note: For performance reasons, no defensive copy is made of the template array and the arguments a and b; modifications of these arrays may affect subsequent evaluation of the interpolator.
|
||||
*/
|
||||
export function interpolateNumberArray<T extends NumberArray | number[]>(
|
||||
a: NumberArray | number[],
|
||||
b: T,
|
||||
): (t: number) => T;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two objects `a` and `b`. Internally, an object template is created that has the same properties as `b`.
|
||||
* For each property in `b`, if there exists a corresponding property in `a`, a generic interpolator is created for the two elements using `interpolate`.
|
||||
* If there is no such property, the static value from `b` is used in the template.
|
||||
* Then, for the given parameter `t`, the template's embedded interpolators are evaluated and the updated object template is then returned.
|
||||
*
|
||||
* For example, if `a` is the object `{x: 0, y: 1}` and `b` is the object `{x: 1, y: 10, z: 100}`, the result of the interpolator for `t = 0.5` is the object `{x: 0.5, y: 5.5, z: 100}`.
|
||||
*
|
||||
* Note: *no defensive copy* of the template object is created; modifications of the returned object may adversely affect subsequent evaluation of the interpolator.
|
||||
* No copy is made for performance reasons; interpolators are often part of the inner loop of animated transitions.
|
||||
*/
|
||||
export function interpolateObject<U extends object>(a: any, b: U): (t: number) => U;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two 2D CSS transforms represented by `a` and `b`.
|
||||
* Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated.
|
||||
* This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition).
|
||||
*/
|
||||
export function interpolateTransformCss(a: string, b: string): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two 2D SVG transforms represented by `a` and `b`.
|
||||
* Each transform is decomposed to a standard representation of translate, rotate, *x*-skew and scale; these component transformations are then interpolated.
|
||||
* This behavior is standardized by CSS: see [matrix decomposition for animation](http://www.w3.org/TR/css3-2d-transforms/#matrix-decomposition).
|
||||
*/
|
||||
export function interpolateTransformSvg(a: string, b: string): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two views `a` and `b` of a two-dimensional plane,
|
||||
* based on [“Smooth and efficient zooming and panning”](http://www.win.tue.nl/~vanwijk/zoompan.pdf).
|
||||
* Each view is defined as an array of three numbers: *cx*, *cy* and *width*.
|
||||
* The first two coordinates *cx*, *cy* represent the center of the viewport; the last coordinate *width* represents the size of the viewport.
|
||||
*
|
||||
* The returned interpolator exposes a *duration* property which encodes the recommended transition duration in milliseconds.
|
||||
* This duration is based on the path length of the curved trajectory through *x,y* space.
|
||||
* If you want to a slower or faster transition, multiply this by an arbitrary scale factor (*V* as described in the original paper).
|
||||
*/
|
||||
export function interpolateZoom(a: ZoomView, b: ZoomView): ZoomInterpolator;
|
||||
|
||||
/**
|
||||
* Returns a discrete interpolator for the given array of values. The returned interpolator maps `t` in `[0, 1 / n)` to values[0],
|
||||
* `t` in `[1 / n, 2 / n)` to `values[1]`, and so on, where `n = values.length`. In effect, this is a lightweight quantize scale with a fixed domain of [0, 1].
|
||||
*/
|
||||
export function interpolateDiscrete<T>(values: T[]): (t: number) => T;
|
||||
|
||||
// Sampling ------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns `n` uniformly-spaced samples from the specified `interpolator`, where `n` is an integer greater than one.
|
||||
* The first sample is always at `t = 0`, and the last sample is always at `t = 1`.
|
||||
* This can be useful in generating a fixed number of samples from a given interpolator,
|
||||
* such as to derive the range of a [quantize scale](https://github.com/d3/d3-scale#quantize-scales) from a [continuous interpolator](https://github.com/d3/d3-scale#interpolateWarm).
|
||||
*
|
||||
* Caution: this method will not work with interpolators that do not return defensive copies of their output,
|
||||
* such as `d3.interpolateArray`, `d3.interpolateDate` and `d3.interpolateObject`. For those interpolators, you must wrap the interpolator and create a copy for each returned value.
|
||||
*/
|
||||
export function quantize<T>(interpolator: (t: number) => T, n: number): T[];
|
||||
|
||||
// Color Spaces
|
||||
|
||||
/**
|
||||
* Returns an RGB color space interpolator between the two colors `a` and `b` with a configurable gamma. If the gamma is not specified, it defaults to 1.0.
|
||||
* The colors `a` and `b` need not be in RGB; they will be converted to RGB using [`d3.rgb`](https://github.com/d3/d3-color#rgb). The return value of the interpolator is an RGB string.
|
||||
*/
|
||||
export const interpolateRgb: ColorGammaInterpolationFactory;
|
||||
|
||||
/**
|
||||
* Returns a uniform nonrational B-spline interpolator through the specified array of *colors*, which are converted to RGB color space.
|
||||
* Implicit control points are generated such that the interpolator returns `colors[0]` at `t = 0` and `colors[colors.length - 1]` at `t = 1`.
|
||||
* Opacity interpolation is not currently supported. See also `d3.interpolateBasis`, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples.
|
||||
*/
|
||||
export function interpolateRgbBasis(colors: Array<string | ColorCommonInstance>): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Returns a uniform nonrational B-spline interpolator through the specified array of colors, which are converted to RGB color space.
|
||||
* The control points are implicitly repeated such that the resulting spline has cyclical C² continuity when repeated around `t` in [0,1];
|
||||
* this is useful, for example, to create cyclical color scales. Opacity interpolation is not currently supported.
|
||||
* See also `d3.interpolateBasisClosed, and see [d3-scale-chromatic](https://github.com/d3/d3-scale-chromatic) for examples.
|
||||
*/
|
||||
export function interpolateRgbBasisClosed(colors: Array<string | ColorCommonInstance>): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Returns an HSL color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in HSL;
|
||||
* they will be converted to HSL using `d3.hsl`. If either color’s hue or saturation is NaN, the opposing color’s channel value is used.
|
||||
* The shortest path between hues is used. The return value of the interpolator is an RGB string.
|
||||
*/
|
||||
export function interpolateHsl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Like `interpolateHsl`, but does not use the shortest path between hues.
|
||||
*/
|
||||
export function interpolateHslLong(
|
||||
a: string | ColorCommonInstance,
|
||||
b: string | ColorCommonInstance,
|
||||
): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Returns a Lab color space interpolator between the two colors *a* and *b*. The colors *a* and *b* need not be in Lab;
|
||||
* they will be converted to Lab using `d3.lab`. The return value of the interpolator is an RGB string.
|
||||
*/
|
||||
export function interpolateLab(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Returns an HCL color space interpolator between the two colors `a` and `b`. The colors `a` and `b` need not be in HCL;
|
||||
* they will be converted to HCL using `d3.hcl`. If either color’s hue or chroma is NaN, the opposing color’s channel value is used.
|
||||
* The shortest path between hues is used. The return value of the interpolator is an RGB string.
|
||||
*/
|
||||
export function interpolateHcl(a: string | ColorCommonInstance, b: string | ColorCommonInstance): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Like `interpolateHcl`, but does not use the shortest path between hues.
|
||||
*/
|
||||
export function interpolateHclLong(
|
||||
a: string | ColorCommonInstance,
|
||||
b: string | ColorCommonInstance,
|
||||
): (t: number) => string;
|
||||
|
||||
/**
|
||||
* Returns a Cubehelix color space interpolator between the two colors `a` and `b` using a configurable `gamma`.
|
||||
* If the gamma is not specified, it defaults to 1.0. The colors `a` and `b` need not be in Cubehelix;
|
||||
* they will be converted to Cubehelix using [`d3.cubehelix`](https://github.com/d3/d3-color#cubehelix).
|
||||
* If either color’s hue or saturation is NaN, the opposing color’s channel value is used. The shortest path between hues is used. The return value of the interpolator is an RGB string.
|
||||
*/
|
||||
export const interpolateCubehelix: ColorGammaInterpolationFactory;
|
||||
|
||||
/**
|
||||
* Like `interpolateCubehelix`, but does not use the shortest path between hues.
|
||||
*/
|
||||
export const interpolateCubehelixLong: ColorGammaInterpolationFactory;
|
||||
|
||||
/**
|
||||
* Returns an interpolator between the two hue angles `a` and `b`. If either hue is NaN, the opposing value is used.
|
||||
* The shortest path between hues is used. The return value of the interpolator is a number in `[0, 360)`.
|
||||
*/
|
||||
export function interpolateHue(a: number, b: number): (t: number) => number;
|
||||
|
||||
// Splines -------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers.
|
||||
* Implicit control points are generated such that the interpolator returns `values[0]` at `t` = 0 and `values[values.length - 1]` at `t` = 1.
|
||||
* See also [`d3.curveBasis`](https://github.com/d3/d3-shape#curveBasis).
|
||||
*/
|
||||
export function interpolateBasis(splineNodes: number[]): (t: number) => number;
|
||||
|
||||
/**
|
||||
* Returns a uniform nonrational B-spline interpolator through the specified array of `values`, which must be numbers.
|
||||
* The control points are implicitly repeated such that the resulting one-dimensional spline has cyclical C² continuity when repeated around `t` in [0,1].
|
||||
* See also [`d3.curveBasisClosed`](https://github.com/d3/d3-shape#curveBasisClosed).
|
||||
*/
|
||||
export function interpolateBasisClosed(splineNodes: number[]): (t: number) => number;
|
||||
|
||||
// Piecewise -----------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Returns a piecewise zoom interpolator, composing zoom interpolators for each adjacent pair of zoom view.
|
||||
* The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`,
|
||||
* and so on, where `n = values.length`. In effect, this is a lightweight linear scale.
|
||||
* For example, to blend through three different zoom views: `d3.piecewise(d3.interpolateZoom, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`.
|
||||
*
|
||||
* interpolate defaults to d3.interpolate.
|
||||
*/
|
||||
export function piecewise(values: ZoomView[]): ZoomInterpolator;
|
||||
/**
|
||||
* Returns a piecewise zoom interpolator, composing zoom interpolators for each adjacent pair of zoom view.
|
||||
* The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`,
|
||||
* and so on, where `n = values.length`. In effect, this is a lightweight linear scale.
|
||||
* For example, to blend through three different zoom views: `d3.piecewise(d3.interpolateZoom, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`.
|
||||
*/
|
||||
export function piecewise(
|
||||
interpolate: (a: ZoomView, b: ZoomView) => ZoomInterpolator,
|
||||
values: ZoomView[],
|
||||
): ZoomInterpolator;
|
||||
|
||||
/**
|
||||
* Returns a piecewise array interpolator, composing array interpolators for each adjacent pair of arrays.
|
||||
* The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`,
|
||||
* and so on, where `n = values.length`. In effect, this is a lightweight linear scale.
|
||||
* For example, to blend through three different arrays: `d3.piecewise(d3.interpolateArray, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`.
|
||||
*
|
||||
* interpolate defaults to d3.interpolate.
|
||||
*/
|
||||
export function piecewise<A extends any[]>(values: A[]): ArrayInterpolator<A>;
|
||||
/**
|
||||
* Returns a piecewise array interpolator, composing array interpolators for each adjacent pair of arrays.
|
||||
* The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`,
|
||||
* and so on, where `n = values.length`. In effect, this is a lightweight linear scale.
|
||||
* For example, to blend through three different arrays: `d3.piecewise(d3.interpolateArray, [[0, 0, 1], [0, 0, 10], [0, 0, 15]])`.
|
||||
*/
|
||||
export function piecewise<A extends any[]>(
|
||||
interpolate: (a: any[], b: A) => ArrayInterpolator<A>,
|
||||
values: A[],
|
||||
): ArrayInterpolator<A>;
|
||||
|
||||
/**
|
||||
* Returns a piecewise interpolator, composing interpolators for each adjacent pair of values.
|
||||
* The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`,
|
||||
* and so on, where `n = values.length`. In effect, this is a lightweight linear scale.
|
||||
* For example, to blend through red, green and blue: `d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"])`.
|
||||
*
|
||||
* interpolate defaults to d3.interpolate.
|
||||
*/
|
||||
export function piecewise(values: unknown[]): (t: number) => any;
|
||||
/**
|
||||
* Returns a piecewise interpolator, composing interpolators for each adjacent pair of values.
|
||||
* The returned interpolator maps `t` in `[0, 1 / (n - 1)]` to `interpolate(values[0], values[1])`, `t` in `[1 / (n - 1), 2 / (n - 1)]` to `interpolate(values[1], values[2])`,
|
||||
* and so on, where `n = values.length`. In effect, this is a lightweight linear scale.
|
||||
* For example, to blend through red, green and blue: `d3.piecewise(d3.interpolateRgb.gamma(2.2), ["red", "green", "blue"])`.
|
||||
*/
|
||||
export function piecewise<TData>(interpolate: (a: TData, b: TData) => unknown, values: TData[]): (t: number) => any;
|
||||
47
node_modules/@types/d3-interpolate/package.json
generated
vendored
Normal file
47
node_modules/@types/d3-interpolate/package.json
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
"name": "@types/d3-interpolate",
|
||||
"version": "3.0.4",
|
||||
"description": "TypeScript definitions for d3-interpolate",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-interpolate",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tom Wanzek",
|
||||
"githubUsername": "tomwanzek",
|
||||
"url": "https://github.com/tomwanzek"
|
||||
},
|
||||
{
|
||||
"name": "Alex Ford",
|
||||
"githubUsername": "gustavderdrache",
|
||||
"url": "https://github.com/gustavderdrache"
|
||||
},
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "denisname",
|
||||
"githubUsername": "denisname",
|
||||
"url": "https://github.com/denisname"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bierema",
|
||||
"githubUsername": "Methuselah96",
|
||||
"url": "https://github.com/Methuselah96"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/d3-interpolate"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/d3-color": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "d315fc677144695b44f1447ef7429c9ff248886716c2e9f742d031abcb319115",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/d3-path/LICENSE
generated
vendored
Normal file
21
node_modules/@types/d3-path/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/d3-path/README.md
generated
vendored
Normal file
15
node_modules/@types/d3-path/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/d3-path`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for d3-path (https://github.com/d3/d3-path/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-path.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 07 Feb 2024 18:07:36 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), and [Nathan Bierema](https://github.com/Methuselah96).
|
||||
107
node_modules/@types/d3-path/index.d.ts
generated
vendored
Normal file
107
node_modules/@types/d3-path/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,107 @@
|
||||
// Last module patch version validated against: 3.1.0
|
||||
|
||||
/**
|
||||
* A D3 path serializer implementing CanvasPathMethods
|
||||
*/
|
||||
export interface Path {
|
||||
/**
|
||||
* Move to the specified point ⟨x, y⟩. Equivalent to context.moveTo and SVG’s “moveto” command.
|
||||
*
|
||||
* @param x x-Coordinate of point to move to
|
||||
* @param y y-Coordinate of point to move to
|
||||
*/
|
||||
moveTo(x: number, y: number): void;
|
||||
|
||||
/**
|
||||
* Ends the current subpath and causes an automatic straight line to be drawn from the current point to the initial point of the current subpath.
|
||||
* Equivalent to context.closePath and SVG’s “closepath” command.
|
||||
*/
|
||||
closePath(): void;
|
||||
|
||||
/**
|
||||
* Draws a straight line from the current point to the specified point ⟨x, y⟩.
|
||||
* Equivalent to context.lineTo and SVG’s “lineto” command.
|
||||
*
|
||||
* @param x x-Coordinate of point to draw the line to
|
||||
* @param y y-Coordinate of point to draw the line to
|
||||
*/
|
||||
lineTo(x: number, y: number): void;
|
||||
|
||||
/**
|
||||
* Draws a quadratic Bézier segment from the current point to the specified point ⟨x, y⟩, with the specified control point ⟨cpx, cpy⟩.
|
||||
* Equivalent to context.quadraticCurveTo and SVG’s quadratic Bézier curve commands.
|
||||
*
|
||||
* @param cpx x-Coordinate of the control point for the quadratic Bézier curve
|
||||
* @param cpy y-Coordinate of the control point for the quadratic Bézier curve
|
||||
* @param x x-Coordinate of point to draw the curve to
|
||||
* @param y y-Coordinate of point to draw the curve to
|
||||
*/
|
||||
quadraticCurveTo(cpx: number, cpy: number, x: number, y: number): void;
|
||||
|
||||
/**
|
||||
* Draws a cubic Bézier segment from the current point to the specified point ⟨x, y⟩, with the specified control points ⟨cpx1, cpy1⟩ and ⟨cpx2, cpy2⟩.
|
||||
* Equivalent to context.bezierCurveTo and SVG’s cubic Bézier curve commands.
|
||||
*
|
||||
* @param cpx1 x-Coordinate of the first control point for the Bézier curve
|
||||
* @param cpy1 y-Coordinate of the first control point for the Bézier curve
|
||||
* @param cpx2 x-Coordinate of the second control point for the Bézier curve
|
||||
* @param cpy2 y-Coordinate of the second control point for the Bézier curve
|
||||
* @param x x-Coordinate of point to draw the curve to
|
||||
* @param y y-Coordinate of point to draw the curve to
|
||||
*/
|
||||
bezierCurveTo(cpx1: number, cpy1: number, cpx2: number, cpy2: number, x: number, y: number): void;
|
||||
|
||||
/**
|
||||
* Draws a circular arc segment with the specified radius that starts tangent to the line between the current point and the specified point ⟨x1, y1⟩
|
||||
* and ends tangent to the line between the specified points ⟨x1, y1⟩ and ⟨x2, y2⟩. If the first tangent point is not equal to the current point,
|
||||
* a straight line is drawn between the current point and the first tangent point. Equivalent to context.arcTo and uses SVG’s elliptical arc curve commands.
|
||||
*
|
||||
* @param x1 x-Coordinate of the first tangent point
|
||||
* @param y1 y-Coordinate of the first tangent point
|
||||
* @param x2 x-Coordinate of the second tangent point
|
||||
* @param y2 y-Coordinate of the second tangent point
|
||||
* @param r Radius of the arc segment
|
||||
*/
|
||||
arcTo(x1: number, y1: number, x2: number, y2: number, radius: number): void;
|
||||
|
||||
/**
|
||||
* Draws a circular arc segment with the specified center ⟨x, y⟩, radius, startAngle and endAngle. If anticlockwise is true,
|
||||
* the arc is drawn in the anticlockwise direction; otherwise, it is drawn in the clockwise direction.
|
||||
* If the current point is not equal to the starting point of the arc, a straight line is drawn from the current point to the start of the arc.
|
||||
* Equivalent to context.arc and uses SVG’s elliptical arc curve commands.
|
||||
*
|
||||
* @param x x-Coordinate of the center point of the arc segment
|
||||
* @param y y-Coordinate of the center point of the arc segment
|
||||
* @param startAngle Start angle of arc segment
|
||||
* @param endAngle End angle of arc segment
|
||||
* @param anticlockwise Flag indicating directionality (true = anti-clockwise, false = clockwise)
|
||||
*/
|
||||
arc(x: number, y: number, radius: number, startAngle: number, endAngle: number, anticlockwise?: boolean): void;
|
||||
|
||||
/**
|
||||
* Creates a new subpath containing just the four points ⟨x, y⟩, ⟨x + w, y⟩, ⟨x + w, y + h⟩, ⟨x, y + h⟩,
|
||||
* with those four points connected by straight lines, and then marks the subpath as closed. Equivalent to context.rect and uses SVG’s “lineto” commands.
|
||||
*
|
||||
* @param x x-Coordinate of starting point for drawing the rectangle
|
||||
* @param y y-Coordinate of starting point for drawing the rectangle
|
||||
* @param w Width of rectangle
|
||||
* @param h Height of rectangle
|
||||
*/
|
||||
rect(x: number, y: number, w: number, h: number): void;
|
||||
|
||||
/**
|
||||
* Returns the string representation of this path according to SVG’s path data specification.
|
||||
*/
|
||||
toString(): string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Construct a D3 Path serializer
|
||||
*/
|
||||
export function path(): Path;
|
||||
|
||||
/**
|
||||
* Like {@link path}, except limits the digits after the decimal to the specified number of digits.
|
||||
* Useful for reducing the size of generated SVG path data.
|
||||
*/
|
||||
export function pathRound(digits?: number): Path;
|
||||
40
node_modules/@types/d3-path/package.json
generated
vendored
Normal file
40
node_modules/@types/d3-path/package.json
generated
vendored
Normal file
@ -0,0 +1,40 @@
|
||||
{
|
||||
"name": "@types/d3-path",
|
||||
"version": "3.1.0",
|
||||
"description": "TypeScript definitions for d3-path",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-path",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tom Wanzek",
|
||||
"githubUsername": "tomwanzek",
|
||||
"url": "https://github.com/tomwanzek"
|
||||
},
|
||||
{
|
||||
"name": "Alex Ford",
|
||||
"githubUsername": "gustavderdrache",
|
||||
"url": "https://github.com/gustavderdrache"
|
||||
},
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bierema",
|
||||
"githubUsername": "Methuselah96",
|
||||
"url": "https://github.com/Methuselah96"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/d3-path"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "cc456421f831e8c7ca2f1fcb6ccf69ab407b9e48cc962833feed68539f5d8099",
|
||||
"typeScriptVersion": "4.6"
|
||||
}
|
||||
21
node_modules/@types/d3-scale/LICENSE
generated
vendored
Normal file
21
node_modules/@types/d3-scale/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/d3-scale/README.md
generated
vendored
Normal file
15
node_modules/@types/d3-scale/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/d3-scale`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for d3-scale (https://github.com/d3/d3-scale/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-scale.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 15:11:37 GMT
|
||||
* Dependencies: [@types/d3-time](https://npmjs.com/package/@types/d3-time)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), [rulonder](https://github.com/rulonder), and [Nathan Bierema](https://github.com/Methuselah96).
|
||||
2669
node_modules/@types/d3-scale/index.d.ts
generated
vendored
Normal file
2669
node_modules/@types/d3-scale/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
52
node_modules/@types/d3-scale/package.json
generated
vendored
Normal file
52
node_modules/@types/d3-scale/package.json
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "@types/d3-scale",
|
||||
"version": "4.0.8",
|
||||
"description": "TypeScript definitions for d3-scale",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-scale",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tom Wanzek",
|
||||
"githubUsername": "tomwanzek",
|
||||
"url": "https://github.com/tomwanzek"
|
||||
},
|
||||
{
|
||||
"name": "Alex Ford",
|
||||
"githubUsername": "gustavderdrache",
|
||||
"url": "https://github.com/gustavderdrache"
|
||||
},
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "denisname",
|
||||
"githubUsername": "denisname",
|
||||
"url": "https://github.com/denisname"
|
||||
},
|
||||
{
|
||||
"name": "rulonder",
|
||||
"githubUsername": "rulonder",
|
||||
"url": "https://github.com/rulonder"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bierema",
|
||||
"githubUsername": "Methuselah96",
|
||||
"url": "https://github.com/Methuselah96"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/d3-scale"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/d3-time": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "d011a6aa109574819bfac8622eeec1dd82871341c6ab8945703ee10ef27013cc",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/d3-shape/LICENSE
generated
vendored
Normal file
21
node_modules/@types/d3-shape/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/d3-shape/README.md
generated
vendored
Normal file
15
node_modules/@types/d3-shape/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/d3-shape`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for d3-shape (https://github.com/d3/d3-shape/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-shape.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 20 Nov 2023 23:36:24 GMT
|
||||
* Dependencies: [@types/d3-path](https://npmjs.com/package/@types/d3-path)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), [Nathan Bierema](https://github.com/Methuselah96), and [Fil](https://github.com/Fil).
|
||||
2675
node_modules/@types/d3-shape/index.d.ts
generated
vendored
Normal file
2675
node_modules/@types/d3-shape/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
52
node_modules/@types/d3-shape/package.json
generated
vendored
Normal file
52
node_modules/@types/d3-shape/package.json
generated
vendored
Normal file
@ -0,0 +1,52 @@
|
||||
{
|
||||
"name": "@types/d3-shape",
|
||||
"version": "3.1.6",
|
||||
"description": "TypeScript definitions for d3-shape",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-shape",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tom Wanzek",
|
||||
"githubUsername": "tomwanzek",
|
||||
"url": "https://github.com/tomwanzek"
|
||||
},
|
||||
{
|
||||
"name": "Alex Ford",
|
||||
"githubUsername": "gustavderdrache",
|
||||
"url": "https://github.com/gustavderdrache"
|
||||
},
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "denisname",
|
||||
"githubUsername": "denisname",
|
||||
"url": "https://github.com/denisname"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bierema",
|
||||
"githubUsername": "Methuselah96",
|
||||
"url": "https://github.com/Methuselah96"
|
||||
},
|
||||
{
|
||||
"name": "Fil",
|
||||
"githubUsername": "Fil",
|
||||
"url": "https://github.com/Fil"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/d3-shape"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/d3-path": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "4aad0e2be93cb4cd6d504f63aaf9eac0fc2d55c130084c39371f93dc8fa80520",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/d3-time/LICENSE
generated
vendored
Normal file
21
node_modules/@types/d3-time/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/d3-time/README.md
generated
vendored
Normal file
15
node_modules/@types/d3-time/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/d3-time`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for d3-time (https://github.com/d3/d3-time/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-time.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 15:11:37 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).
|
||||
683
node_modules/@types/d3-time/index.d.ts
generated
vendored
Normal file
683
node_modules/@types/d3-time/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,683 @@
|
||||
// Last module patch version validated against: 3.0.0
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Interfaces
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* A D3 Time Interval
|
||||
*/
|
||||
export interface TimeInterval {
|
||||
/**
|
||||
* Returns a new date representing the latest interval boundary date before or equal to date.
|
||||
* Equivalent to interval.floor, except it date is not specified, it defaults to the current time.
|
||||
* For example, d3.timeYear(date) and d3.timeYear.floor(date) are equivalent.
|
||||
*
|
||||
* For example, timeDay(date) typically returns 12:00 AM local time on the given date.
|
||||
*
|
||||
* This function is idempotent: if the specified date is already floored to the current interval,
|
||||
* a new date with an identical time is returned.
|
||||
* Furthermore, the returned date is the minimum expressible value of the associated interval,
|
||||
* such that interval.floor(interval.floor(date) - 1) returns the preceding interval boundary date.
|
||||
*
|
||||
* Note that the == and === operators do not compare by value with Date objects,
|
||||
* and thus you cannot use them to tell whether the specified date has already been floored.
|
||||
* Instead, coerce to a number and then compare.
|
||||
*
|
||||
* This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving.
|
||||
*
|
||||
* @param date A date object.
|
||||
*/
|
||||
(date?: Date): Date;
|
||||
|
||||
/**
|
||||
* Returns a new date representing the latest interval boundary date before or equal to date.
|
||||
*
|
||||
* For example, timeDay.floor(date) typically returns 12:00 AM local time on the given date.
|
||||
*
|
||||
* This method is idempotent: if the specified date is already floored to the current interval,
|
||||
* a new date with an identical time is returned.
|
||||
* Furthermore, the returned date is the minimum expressible value of the associated interval,
|
||||
* such that interval.floor(interval.floor(date) - 1) returns the preceding interval boundary date.
|
||||
*
|
||||
* Note that the == and === operators do not compare by value with Date objects,
|
||||
* and thus you cannot use them to tell whether the specified date has already been floored.
|
||||
* Instead, coerce to a number and then compare.
|
||||
*
|
||||
* This is more reliable than testing whether the time is 12:00 AM, as in some time zones midnight may not exist due to daylight saving.
|
||||
*
|
||||
* @param date A date object.
|
||||
*/
|
||||
floor(date: Date): Date;
|
||||
|
||||
/**
|
||||
* Returns a new date representing the closest interval boundary date to date.
|
||||
*
|
||||
* For example, timeDay.round(date) typically returns 12:00 AM local time on the given date if it is on or before noon,
|
||||
* and 12:00 AM of the following day if it is after noon.
|
||||
*
|
||||
* This method is idempotent: if the specified date is already rounded to the current interval, a new date with an identical time is returned.
|
||||
*
|
||||
* @param date A date object.
|
||||
*/
|
||||
round(date: Date): Date;
|
||||
|
||||
/**
|
||||
* Returns a new date representing the earliest interval boundary date after or equal to date.
|
||||
*
|
||||
* For example, timeDay.ceil(date) typically returns 12:00 AM local time on the date following the given date.
|
||||
*
|
||||
* This method is idempotent: if the specified date is already ceilinged to the current interval,
|
||||
* a new date with an identical time is returned. Furthermore,
|
||||
* the returned date is the maximum expressible value of the associated interval,
|
||||
* such that interval.ceil(interval.ceil(date) + 1) returns the following interval boundary date.
|
||||
*
|
||||
* @param date A date object.
|
||||
*/
|
||||
ceil(date: Date): Date;
|
||||
|
||||
/**
|
||||
* Returns a new date equal to date plus step intervals.
|
||||
*
|
||||
* If step is not specified it defaults to 1.
|
||||
*
|
||||
* This method does not round the specified date to the interval. For example, if date is today at 5:34 PM,
|
||||
* then timeDay.offset(date, 1) returns 5:34 PM tomorrow (even if daylight saving changes!).
|
||||
*
|
||||
* @param date A date object.
|
||||
* @param step An optional number of steps to apply when calculating the offset date.
|
||||
* If step is negative, then the returned date will be before the specified date;
|
||||
* if step is zero, then a copy of the specified date is returned; if step is not an integer, it is floored.
|
||||
*/
|
||||
offset(date: Date, step?: number): Date;
|
||||
|
||||
/**
|
||||
* Returns an array of dates representing every interval boundary after or equal to start (inclusive) and before stop (exclusive).
|
||||
*
|
||||
* If step is specified, then every step-th boundary will be returned; for example,
|
||||
* for the timeDay interval a step of 2 will return every other day.
|
||||
* If step is not an integer, it is floored.
|
||||
*
|
||||
* The first date in the returned array is the earliest boundary after or equal to start;
|
||||
* subsequent dates are offset by step intervals and floored.
|
||||
* Thus, two overlapping ranges may be inconsistent.
|
||||
*
|
||||
* To make ranges consistent when a step is specified, use CountableInterval.every instead.
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
range(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Returns a new interval that is a filtered subset of this interval using the specified test function.
|
||||
*
|
||||
* @param test A test function which is passed a date and should return true if and only if
|
||||
* the specified date should be considered part of the interval.
|
||||
*/
|
||||
filter(test: (date: Date) => boolean): TimeInterval;
|
||||
}
|
||||
|
||||
/**
|
||||
* A D3 Countable Time Interval
|
||||
*/
|
||||
export interface CountableTimeInterval extends TimeInterval {
|
||||
/**
|
||||
* Returns the number of interval boundaries after start (exclusive) and before or equal to end (inclusive).
|
||||
*
|
||||
* Note that this behavior is slightly different than interval.range,
|
||||
* because its purpose is to return the zero-based number of the specified end date relative to the specified start date.
|
||||
*
|
||||
* @param start A start date object.
|
||||
* @param end An end date object.
|
||||
*/
|
||||
count(start: Date, end: Date): number;
|
||||
/**
|
||||
* Returns a filtered view of this interval representing every stepth date.
|
||||
*
|
||||
* The meaning of step is dependent on this interval’s parent interval as defined by the field function.
|
||||
*
|
||||
* For example, timeMinute.every(15) returns an interval representing every fifteen minutes,
|
||||
* starting on the hour: :00, :15, :30, :45, etc. Note that for some intervals,
|
||||
* the resulting dates may not be uniformly-spaced;
|
||||
* timeDay’s parent interval is timeMonth, and thus the interval number resets at the start of each month.
|
||||
*
|
||||
* If step is not valid, returns null. If step is one, returns this interval.
|
||||
*
|
||||
* This method can be used in conjunction with interval.range to ensure that two overlapping ranges are consistent.
|
||||
*
|
||||
* The returned filtered interval does not support interval.count. See also interval.filter.
|
||||
*
|
||||
* @param step Number of steps.
|
||||
*/
|
||||
every(step: number): TimeInterval | null;
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Custom (Countable)Interval Factories
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Constructs a new custom interval given the specified floor and offset functions.
|
||||
*
|
||||
* The returned custom interval is not countable, i.e. does not expose the methods "count(..)" and "every(...)".
|
||||
*
|
||||
* @param floor A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary.
|
||||
* @param offset An offset function which takes a date and an integer step as arguments and advances
|
||||
* the specified date by the specified number of boundaries; the step may be positive, negative or zero.
|
||||
*/
|
||||
export function timeInterval(
|
||||
floor: (date: Date) => void,
|
||||
offset: (date: Date, step: number) => void,
|
||||
): TimeInterval;
|
||||
/**
|
||||
* Constructs a new custom interval given the specified floor, offset and count functions.
|
||||
*
|
||||
* The returned custom interval is countable and exposes the methods "count(..)" and "every(...)".
|
||||
*
|
||||
* Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals.
|
||||
*
|
||||
* @param floor A floor function which takes a single date as an argument and rounds it down to the nearest interval boundary.
|
||||
* @param offset An offset function which takes a date and an integer step as arguments and advances
|
||||
* the specified date by the specified number of boundaries; the step may be positive, negative or zero.
|
||||
* @param count A count function which takes a start date and an end date, already floored to the current interval,
|
||||
* and returns the number of boundaries between the start (exclusive) and end (inclusive).
|
||||
* Note: due to an internal optimization, the specified count function must not invoke interval.count on other time intervals.
|
||||
* @param field An optional field function which takes a date, already floored to the current interval,
|
||||
* and returns the field value of the specified date,
|
||||
* corresponding to the number of boundaries between this date (exclusive) and the latest previous parent boundary.
|
||||
* For example, for the timeDay interval, this returns the number of days since the start of the month.
|
||||
* If a field function is not specified, it defaults to counting the number of interval boundaries since
|
||||
* the UNIX epoch of January 1, 1970 UTC. The field function defines the behavior of interval.every.
|
||||
*/
|
||||
export function timeInterval(
|
||||
floor: (date: Date) => void,
|
||||
offset: (date: Date, step: number) => void,
|
||||
count: (start: Date, end: Date) => number,
|
||||
field?: (date: Date) => number,
|
||||
): CountableTimeInterval;
|
||||
|
||||
// ---------------------------------------------------------------
|
||||
// Built-In Factories and Date Array Creators
|
||||
// ---------------------------------------------------------------
|
||||
|
||||
// local time ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Milliseconds Interval in Local Time; the shortest available time unit.
|
||||
*/
|
||||
export const timeMillisecond: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeMillisecond.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeMilliseconds(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Seconds Interval in Local Time; seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds.
|
||||
*/
|
||||
export const timeSecond: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeSecond.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeSeconds(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Minutes Interval in Local Time; minutes (e.g., 01:02:00 AM); 60 seconds. Note that ECMAScript ignores leap seconds.
|
||||
*/
|
||||
export const timeMinute: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeMinute.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeMinutes(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Hours Interval in Local Time; Hours (e.g., 01:00 AM); 60 minutes.
|
||||
*
|
||||
* Note that advancing time by one hour in local time can return the same hour or skip an hour due to daylight saving.
|
||||
*/
|
||||
export const timeHour: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeHour.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeHours(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Days Interval in Local Time; days (e.g., February 7, 2012 at 12:00 AM); typically 24 hours.
|
||||
* Days in local time may range from 23 to 25 hours due to daylight saving.
|
||||
*/
|
||||
export const timeDay: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeDay.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeDays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval in Local Time. Alias for sunday; 7 days and typically 168 hours.
|
||||
*
|
||||
* Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
||||
*/
|
||||
export const timeWeek: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeWeek.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeWeeks(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Sunday-based weeks in Local Time (e.g., February 5, 2012 at 12:00 AM).
|
||||
* 7 days and typically 168 hours.
|
||||
*
|
||||
* Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
||||
*/
|
||||
export const timeSunday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeSunday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeSundays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Monday-based weeks in Local Time (e.g., February 6, 2012 at 12:00 AM).
|
||||
* 7 days and typically 168 hours.
|
||||
*
|
||||
* Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
||||
*/
|
||||
export const timeMonday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeMonday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeMondays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Tuesday-based weeks in Local Time (e.g., February 7, 2012 at 12:00 AM).
|
||||
* 7 days and typically 168 hours.
|
||||
*
|
||||
* Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
||||
*/
|
||||
export const timeTuesday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeTuesday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeTuesdays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Wednesday-based weeks in Local Time (e.g., February 8, 2012 at 12:00 AM).
|
||||
* 7 days and typically 168 hours.
|
||||
*
|
||||
* Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
||||
*/
|
||||
export const timeWednesday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeWednesday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeWednesdays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Thursday-based weeks in Local Time (e.g., February 9, 2012 at 12:00 AM).
|
||||
* 7 days and typically 168 hours.
|
||||
*
|
||||
* Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
||||
*/
|
||||
export const timeThursday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeThursday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeThursdays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Friday-based weeks in Local Time (e.g., February 10, 2012 at 12:00 AM).
|
||||
* 7 days and typically 168 hours.
|
||||
*
|
||||
* Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
||||
*/
|
||||
export const timeFriday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeFriday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeFridays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Saturday-based weeks in Local Time (e.g., February 11, 2012 at 12:00 AM).
|
||||
* 7 days and typically 168 hours.
|
||||
*
|
||||
* Weeks in local time may range from 167 to 169 hours due on daylight saving.
|
||||
*/
|
||||
export const timeSaturday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeSaturday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeSaturdays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Month Interval in Local Time; months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days.
|
||||
*/
|
||||
export const timeMonth: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeMonth.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeMonths(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Year Interval in Local Time; years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days.
|
||||
*/
|
||||
export const timeYear: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for timeYear.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function timeYears(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
// utc Coordinated Universal Time ----------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Milliseconds Interval in Coordinated Universal Time (UTC); the shortest available time unit.
|
||||
*/
|
||||
export const utcMillisecond: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcMillisecond.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcMilliseconds(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Seconds Interval in Coordinated Universal Time (UTC); seconds (e.g., 01:23:45.0000 AM); 1,000 milliseconds.
|
||||
*/
|
||||
export const utcSecond: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcSecond.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcSeconds(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Minutes Interval in Coordinated Universal Time (UTC); minutes (e.g., 01:02:00 AM); 60 seconds.
|
||||
* Note that ECMAScript ignores leap seconds.
|
||||
*/
|
||||
export const utcMinute: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcMinute.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcMinutes(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Hours Interval in Coordinated Universal Time (UTC); Hours (e.g., 01:00 AM); 60 minutes.
|
||||
*/
|
||||
export const utcHour: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcHour.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcHours(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Days Interval in Coordinated Universal Time (UTC); days (e.g., February 7, 2012 at 12:00 AM); 24 hours.
|
||||
*/
|
||||
export const utcDay: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcDay.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcDays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval in Local Time. Alias for sunday; 7 days and 168 hours.
|
||||
*/
|
||||
export const utcWeek: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcWeek.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcWeeks(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Sunday-based weeks in Coordinated Universal Time (UTC) (e.g., February 5, 2012 at 12:00 AM).
|
||||
* 7 days and 168 hours.
|
||||
*/
|
||||
export const utcSunday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcSunday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcSundays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Monday-based weeks in Coordinated Universal Time (UTC) (e.g., February 6, 2012 at 12:00 AM).
|
||||
* 7 days and 168 hours.
|
||||
*/
|
||||
export const utcMonday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcMonday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcMondays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Tuesday-based weeks in Coordinated Universal Time (UTC) (e.g., February 7, 2012 at 12:00 AM).
|
||||
* 7 days and 168 hours.
|
||||
*/
|
||||
export const utcTuesday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcTuesday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcTuesdays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Wednesday-based weeks in Coordinated Universal Time (UTC) (e.g., February 8, 2012 at 12:00 AM).
|
||||
* 7 days and 168 hours.
|
||||
*/
|
||||
export const utcWednesday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcWednesday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcWednesdays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Thursday-based weeks in Coordinated Universal Time (UTC) (e.g., February 9, 2012 at 12:00 AM).
|
||||
* 7 days and 168 hours.
|
||||
*/
|
||||
export const utcThursday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcThursday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcThursdays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Friday-based weeks in Coordinated Universal Time (UTC) (e.g., February 10, 2012 at 12:00 AM).
|
||||
* 7 days and 168 hours.
|
||||
*/
|
||||
export const utcFriday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcFriday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcFridays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Week Interval for Saturday-based weeks in Coordinated Universal Time (UTC) (e.g., February 11, 2012 at 12:00 AM).
|
||||
* 7 days and 168 hours.
|
||||
*/
|
||||
export const utcSaturday: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcSaturday.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcSaturdays(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Month Interval in Coordinated Universal Time (UTC); months (e.g., February 1, 2012 at 12:00 AM); ranges from 28 to 31 days.
|
||||
*/
|
||||
export const utcMonth: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcMonth.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcMonths(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Year Interval in Coordinated Universal Time (UTC); years (e.g., January 1, 2012 at 12:00 AM); ranges from 365 to 366 days.
|
||||
*/
|
||||
export const utcYear: CountableTimeInterval;
|
||||
|
||||
/**
|
||||
* This is a convenience alias for utcYear.range(...).
|
||||
*
|
||||
* @param start A start date object for the range.
|
||||
* @param stop A stop date object for the range.
|
||||
* @param step An optional number of steps to apply when calculating the dates in the range.
|
||||
*/
|
||||
export function utcYears(start: Date, stop: Date, step?: number): Date[];
|
||||
|
||||
/**
|
||||
* Equivalent to d3.utcTicks, but in local time.
|
||||
*/
|
||||
export function timeTicks(start: Date, stop: Date, count: number): Date[];
|
||||
|
||||
/**
|
||||
* Returns the time interval that would be used by d3.timeTicks given the same arguments.
|
||||
*/
|
||||
export function timeTickInterval(start: Date, stop: Date, count: number): TimeInterval | null;
|
||||
|
||||
/**
|
||||
* Returns an array of approximately count dates at regular intervals between start and stop (inclusive).
|
||||
* If stop is before start, dates are returned in reverse chronological order; otherwise dates are returned in chronological order.
|
||||
*/
|
||||
export function utcTicks(start: Date, stop: Date, count: number): Date[];
|
||||
|
||||
/**
|
||||
* Returns the time interval that would be used by d3.utcTicks given the same arguments.
|
||||
* If there is no associated interval, such as when start or stop is invalid, returns null.
|
||||
*/
|
||||
export function utcTickInterval(start: Date, stop: Date, count: number): TimeInterval | null;
|
||||
45
node_modules/@types/d3-time/package.json
generated
vendored
Normal file
45
node_modules/@types/d3-time/package.json
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@types/d3-time",
|
||||
"version": "3.0.3",
|
||||
"description": "TypeScript definitions for d3-time",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-time",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tom Wanzek",
|
||||
"githubUsername": "tomwanzek",
|
||||
"url": "https://github.com/tomwanzek"
|
||||
},
|
||||
{
|
||||
"name": "Alex Ford",
|
||||
"githubUsername": "gustavderdrache",
|
||||
"url": "https://github.com/gustavderdrache"
|
||||
},
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "denisname",
|
||||
"githubUsername": "denisname",
|
||||
"url": "https://github.com/denisname"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bierema",
|
||||
"githubUsername": "Methuselah96",
|
||||
"url": "https://github.com/Methuselah96"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/d3-time"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "ab477b0625f6f9bfbf98fdbdd6d7d30d9b1e2fb1f9be4fc7d3dc0af65f198ba2",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/d3-timer/LICENSE
generated
vendored
Normal file
21
node_modules/@types/d3-timer/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/d3-timer/README.md
generated
vendored
Normal file
15
node_modules/@types/d3-timer/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/d3-timer`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for d3-timer (https://github.com/d3/d3-timer/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-timer.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 15:11:37 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Tom Wanzek](https://github.com/tomwanzek), [Alex Ford](https://github.com/gustavderdrache), [Boris Yankov](https://github.com/borisyankov), [denisname](https://github.com/denisname), and [Nathan Bierema](https://github.com/Methuselah96).
|
||||
68
node_modules/@types/d3-timer/index.d.ts
generated
vendored
Normal file
68
node_modules/@types/d3-timer/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
// Last module patch version validated against: 3.0.1
|
||||
|
||||
/**
|
||||
* Returns the current time as defined by performance.now if available, and Date.now if not.
|
||||
* The current time is updated at the start of a frame; it is thus consistent during the frame, and any timers scheduled during the same frame will be synchronized.
|
||||
* If this method is called outside of a frame, such as in response to a user event, the current time is calculated and then fixed until the next frame,
|
||||
* again ensuring consistent timing during event handling.
|
||||
*/
|
||||
export function now(): number;
|
||||
|
||||
export interface Timer {
|
||||
/**
|
||||
* Restart a timer with the specified callback and optional delay and time.
|
||||
* This is equivalent to stopping this timer and creating a new timer with the specified arguments,
|
||||
* although this timer retains the original invocation priority.
|
||||
*
|
||||
* @param callback A callback function to be invoked and passed in the apparent
|
||||
* elapsed time since the timer became active in milliseconds.
|
||||
* @param delay An optional numeric delay in milliseconds (default = 0) relative to time.
|
||||
* @param time An optional time in milliseconds relative to which the delay is calculated (default = now).
|
||||
*/
|
||||
restart(callbackFn: (elapsed: number) => void, delay?: number, time?: number): void;
|
||||
|
||||
/**
|
||||
* Stop the timer.
|
||||
*/
|
||||
stop(): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Schedules and returns a new timer, invoking the specified callback repeatedly until the timer is stopped.
|
||||
* The callback is passed the (apparent) elapsed time since the timer became active.
|
||||
*
|
||||
* @param callback A callback function to be invoked and passed in the apparent
|
||||
* elapsed time since the timer became active in milliseconds.
|
||||
* @param delay An optional numeric delay in milliseconds (default = 0) relative to time.
|
||||
* @param time An optional time in milliseconds relative to which the delay is calculated (default = now).
|
||||
*/
|
||||
export function timer(callback: (elapsed: number) => void, delay?: number, time?: number): Timer;
|
||||
|
||||
/**
|
||||
* Immediately invoke any eligible timer callbacks.
|
||||
*/
|
||||
export function timerFlush(): void;
|
||||
|
||||
/**
|
||||
* Schedules and returns a new timer, invoking the specified callback. The timer is stopped automatically
|
||||
* on its first callback. The callback is passed the (apparent) elapsed time since the timer became active.
|
||||
*
|
||||
* @param callback A callback function to be invoked and passed in the apparent
|
||||
* elapsed time since the timer became active in milliseconds.
|
||||
* @param delay An optional numeric delay in milliseconds (default = 0) relative to time.
|
||||
* @param time An optional time in milliseconds relative to which the delay is calculated (default = now).
|
||||
*/
|
||||
export function timeout(callback: (elapsed: number) => void, delay?: number, time?: number): Timer;
|
||||
|
||||
/**
|
||||
* Schedules and returns a new timer, invoking the specified callback repeatedly every 'delay' milliseconds
|
||||
* until the timer is stopped.
|
||||
* The callback is passed the (apparent) elapsed time since the timer became active.
|
||||
*
|
||||
* @param callback A callback function to be invoked and passed in the apparent
|
||||
* elapsed time since the timer became active in milliseconds.
|
||||
* @param delay An optional numeric delay in milliseconds between repeat invocations of the callback.
|
||||
* If not specified, the interval timer behaves like the regular timer.
|
||||
* @param time An optional time in milliseconds relative to which the initial delay is calculated (default = now).
|
||||
*/
|
||||
export function interval(callback: (elapsed: number) => void, delay?: number, time?: number): Timer;
|
||||
45
node_modules/@types/d3-timer/package.json
generated
vendored
Normal file
45
node_modules/@types/d3-timer/package.json
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@types/d3-timer",
|
||||
"version": "3.0.2",
|
||||
"description": "TypeScript definitions for d3-timer",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/d3-timer",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tom Wanzek",
|
||||
"githubUsername": "tomwanzek",
|
||||
"url": "https://github.com/tomwanzek"
|
||||
},
|
||||
{
|
||||
"name": "Alex Ford",
|
||||
"githubUsername": "gustavderdrache",
|
||||
"url": "https://github.com/gustavderdrache"
|
||||
},
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "denisname",
|
||||
"githubUsername": "denisname",
|
||||
"url": "https://github.com/denisname"
|
||||
},
|
||||
{
|
||||
"name": "Nathan Bierema",
|
||||
"githubUsername": "Methuselah96",
|
||||
"url": "https://github.com/Methuselah96"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/d3-timer"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "a51fc6981e6d12715fd052f7e598dd291c354465025cbb33ece1895bdab4109c",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/estree/LICENSE
generated
vendored
Normal file
21
node_modules/@types/estree/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/estree/README.md
generated
vendored
Normal file
15
node_modules/@types/estree/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/estree`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for estree (https://github.com/estree/estree).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 18 Sep 2024 09:37:00 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [RReverser](https://github.com/RReverser).
|
||||
167
node_modules/@types/estree/flow.d.ts
generated
vendored
Normal file
167
node_modules/@types/estree/flow.d.ts
generated
vendored
Normal file
@ -0,0 +1,167 @@
|
||||
declare namespace ESTree {
|
||||
interface FlowTypeAnnotation extends Node {}
|
||||
|
||||
interface FlowBaseTypeAnnotation extends FlowTypeAnnotation {}
|
||||
|
||||
interface FlowLiteralTypeAnnotation extends FlowTypeAnnotation, Literal {}
|
||||
|
||||
interface FlowDeclaration extends Declaration {}
|
||||
|
||||
interface AnyTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface ArrayTypeAnnotation extends FlowTypeAnnotation {
|
||||
elementType: FlowTypeAnnotation;
|
||||
}
|
||||
|
||||
interface BooleanLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}
|
||||
|
||||
interface BooleanTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface ClassImplements extends Node {
|
||||
id: Identifier;
|
||||
typeParameters?: TypeParameterInstantiation | null;
|
||||
}
|
||||
|
||||
interface ClassProperty {
|
||||
key: Expression;
|
||||
value?: Expression | null;
|
||||
typeAnnotation?: TypeAnnotation | null;
|
||||
computed: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
interface DeclareClass extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
typeParameters?: TypeParameterDeclaration | null;
|
||||
body: ObjectTypeAnnotation;
|
||||
extends: InterfaceExtends[];
|
||||
}
|
||||
|
||||
interface DeclareFunction extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
interface DeclareModule extends FlowDeclaration {
|
||||
id: Literal | Identifier;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
interface DeclareVariable extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
interface FunctionTypeAnnotation extends FlowTypeAnnotation {
|
||||
params: FunctionTypeParam[];
|
||||
returnType: FlowTypeAnnotation;
|
||||
rest?: FunctionTypeParam | null;
|
||||
typeParameters?: TypeParameterDeclaration | null;
|
||||
}
|
||||
|
||||
interface FunctionTypeParam {
|
||||
name: Identifier;
|
||||
typeAnnotation: FlowTypeAnnotation;
|
||||
optional: boolean;
|
||||
}
|
||||
|
||||
interface GenericTypeAnnotation extends FlowTypeAnnotation {
|
||||
id: Identifier | QualifiedTypeIdentifier;
|
||||
typeParameters?: TypeParameterInstantiation | null;
|
||||
}
|
||||
|
||||
interface InterfaceExtends extends Node {
|
||||
id: Identifier | QualifiedTypeIdentifier;
|
||||
typeParameters?: TypeParameterInstantiation | null;
|
||||
}
|
||||
|
||||
interface InterfaceDeclaration extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
typeParameters?: TypeParameterDeclaration | null;
|
||||
extends: InterfaceExtends[];
|
||||
body: ObjectTypeAnnotation;
|
||||
}
|
||||
|
||||
interface IntersectionTypeAnnotation extends FlowTypeAnnotation {
|
||||
types: FlowTypeAnnotation[];
|
||||
}
|
||||
|
||||
interface MixedTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface NullableTypeAnnotation extends FlowTypeAnnotation {
|
||||
typeAnnotation: TypeAnnotation;
|
||||
}
|
||||
|
||||
interface NumberLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}
|
||||
|
||||
interface NumberTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface StringLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}
|
||||
|
||||
interface StringTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
|
||||
interface TupleTypeAnnotation extends FlowTypeAnnotation {
|
||||
types: FlowTypeAnnotation[];
|
||||
}
|
||||
|
||||
interface TypeofTypeAnnotation extends FlowTypeAnnotation {
|
||||
argument: FlowTypeAnnotation;
|
||||
}
|
||||
|
||||
interface TypeAlias extends FlowDeclaration {
|
||||
id: Identifier;
|
||||
typeParameters?: TypeParameterDeclaration | null;
|
||||
right: FlowTypeAnnotation;
|
||||
}
|
||||
|
||||
interface TypeAnnotation extends Node {
|
||||
typeAnnotation: FlowTypeAnnotation;
|
||||
}
|
||||
|
||||
interface TypeCastExpression extends Expression {
|
||||
expression: Expression;
|
||||
typeAnnotation: TypeAnnotation;
|
||||
}
|
||||
|
||||
interface TypeParameterDeclaration extends Node {
|
||||
params: Identifier[];
|
||||
}
|
||||
|
||||
interface TypeParameterInstantiation extends Node {
|
||||
params: FlowTypeAnnotation[];
|
||||
}
|
||||
|
||||
interface ObjectTypeAnnotation extends FlowTypeAnnotation {
|
||||
properties: ObjectTypeProperty[];
|
||||
indexers: ObjectTypeIndexer[];
|
||||
callProperties: ObjectTypeCallProperty[];
|
||||
}
|
||||
|
||||
interface ObjectTypeCallProperty extends Node {
|
||||
value: FunctionTypeAnnotation;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
interface ObjectTypeIndexer extends Node {
|
||||
id: Identifier;
|
||||
key: FlowTypeAnnotation;
|
||||
value: FlowTypeAnnotation;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
interface ObjectTypeProperty extends Node {
|
||||
key: Expression;
|
||||
value: FlowTypeAnnotation;
|
||||
optional: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
interface QualifiedTypeIdentifier extends Node {
|
||||
qualification: Identifier | QualifiedTypeIdentifier;
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
interface UnionTypeAnnotation extends FlowTypeAnnotation {
|
||||
types: FlowTypeAnnotation[];
|
||||
}
|
||||
|
||||
interface VoidTypeAnnotation extends FlowBaseTypeAnnotation {}
|
||||
}
|
||||
684
node_modules/@types/estree/index.d.ts
generated
vendored
Normal file
684
node_modules/@types/estree/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,684 @@
|
||||
// This definition file follows a somewhat unusual format. ESTree allows
|
||||
// runtime type checks based on the `type` parameter. In order to explain this
|
||||
// to typescript we want to use discriminated union types:
|
||||
// https://github.com/Microsoft/TypeScript/pull/9163
|
||||
//
|
||||
// For ESTree this is a bit tricky because the high level interfaces like
|
||||
// Node or Function are pulling double duty. We want to pass common fields down
|
||||
// to the interfaces that extend them (like Identifier or
|
||||
// ArrowFunctionExpression), but you can't extend a type union or enforce
|
||||
// common fields on them. So we've split the high level interfaces into two
|
||||
// types, a base type which passes down inherited fields, and a type union of
|
||||
// all types which extend the base type. Only the type union is exported, and
|
||||
// the union is how other types refer to the collection of inheriting types.
|
||||
//
|
||||
// This makes the definitions file here somewhat more difficult to maintain,
|
||||
// but it has the notable advantage of making ESTree much easier to use as
|
||||
// an end user.
|
||||
|
||||
export interface BaseNodeWithoutComments {
|
||||
// Every leaf interface that extends BaseNode must specify a type property.
|
||||
// The type property should be a string literal. For example, Identifier
|
||||
// has: `type: "Identifier"`
|
||||
type: string;
|
||||
loc?: SourceLocation | null | undefined;
|
||||
range?: [number, number] | undefined;
|
||||
}
|
||||
|
||||
export interface BaseNode extends BaseNodeWithoutComments {
|
||||
leadingComments?: Comment[] | undefined;
|
||||
trailingComments?: Comment[] | undefined;
|
||||
}
|
||||
|
||||
export interface NodeMap {
|
||||
AssignmentProperty: AssignmentProperty;
|
||||
CatchClause: CatchClause;
|
||||
Class: Class;
|
||||
ClassBody: ClassBody;
|
||||
Expression: Expression;
|
||||
Function: Function;
|
||||
Identifier: Identifier;
|
||||
Literal: Literal;
|
||||
MethodDefinition: MethodDefinition;
|
||||
ModuleDeclaration: ModuleDeclaration;
|
||||
ModuleSpecifier: ModuleSpecifier;
|
||||
Pattern: Pattern;
|
||||
PrivateIdentifier: PrivateIdentifier;
|
||||
Program: Program;
|
||||
Property: Property;
|
||||
PropertyDefinition: PropertyDefinition;
|
||||
SpreadElement: SpreadElement;
|
||||
Statement: Statement;
|
||||
Super: Super;
|
||||
SwitchCase: SwitchCase;
|
||||
TemplateElement: TemplateElement;
|
||||
VariableDeclarator: VariableDeclarator;
|
||||
}
|
||||
|
||||
export type Node = NodeMap[keyof NodeMap];
|
||||
|
||||
export interface Comment extends BaseNodeWithoutComments {
|
||||
type: "Line" | "Block";
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface SourceLocation {
|
||||
source?: string | null | undefined;
|
||||
start: Position;
|
||||
end: Position;
|
||||
}
|
||||
|
||||
export interface Position {
|
||||
/** >= 1 */
|
||||
line: number;
|
||||
/** >= 0 */
|
||||
column: number;
|
||||
}
|
||||
|
||||
export interface Program extends BaseNode {
|
||||
type: "Program";
|
||||
sourceType: "script" | "module";
|
||||
body: Array<Directive | Statement | ModuleDeclaration>;
|
||||
comments?: Comment[] | undefined;
|
||||
}
|
||||
|
||||
export interface Directive extends BaseNode {
|
||||
type: "ExpressionStatement";
|
||||
expression: Literal;
|
||||
directive: string;
|
||||
}
|
||||
|
||||
export interface BaseFunction extends BaseNode {
|
||||
params: Pattern[];
|
||||
generator?: boolean | undefined;
|
||||
async?: boolean | undefined;
|
||||
// The body is either BlockStatement or Expression because arrow functions
|
||||
// can have a body that's either. FunctionDeclarations and
|
||||
// FunctionExpressions have only BlockStatement bodies.
|
||||
body: BlockStatement | Expression;
|
||||
}
|
||||
|
||||
export type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;
|
||||
|
||||
export type Statement =
|
||||
| ExpressionStatement
|
||||
| BlockStatement
|
||||
| StaticBlock
|
||||
| EmptyStatement
|
||||
| DebuggerStatement
|
||||
| WithStatement
|
||||
| ReturnStatement
|
||||
| LabeledStatement
|
||||
| BreakStatement
|
||||
| ContinueStatement
|
||||
| IfStatement
|
||||
| SwitchStatement
|
||||
| ThrowStatement
|
||||
| TryStatement
|
||||
| WhileStatement
|
||||
| DoWhileStatement
|
||||
| ForStatement
|
||||
| ForInStatement
|
||||
| ForOfStatement
|
||||
| Declaration;
|
||||
|
||||
export interface BaseStatement extends BaseNode {}
|
||||
|
||||
export interface EmptyStatement extends BaseStatement {
|
||||
type: "EmptyStatement";
|
||||
}
|
||||
|
||||
export interface BlockStatement extends BaseStatement {
|
||||
type: "BlockStatement";
|
||||
body: Statement[];
|
||||
innerComments?: Comment[] | undefined;
|
||||
}
|
||||
|
||||
export interface StaticBlock extends Omit<BlockStatement, "type"> {
|
||||
type: "StaticBlock";
|
||||
}
|
||||
|
||||
export interface ExpressionStatement extends BaseStatement {
|
||||
type: "ExpressionStatement";
|
||||
expression: Expression;
|
||||
}
|
||||
|
||||
export interface IfStatement extends BaseStatement {
|
||||
type: "IfStatement";
|
||||
test: Expression;
|
||||
consequent: Statement;
|
||||
alternate?: Statement | null | undefined;
|
||||
}
|
||||
|
||||
export interface LabeledStatement extends BaseStatement {
|
||||
type: "LabeledStatement";
|
||||
label: Identifier;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface BreakStatement extends BaseStatement {
|
||||
type: "BreakStatement";
|
||||
label?: Identifier | null | undefined;
|
||||
}
|
||||
|
||||
export interface ContinueStatement extends BaseStatement {
|
||||
type: "ContinueStatement";
|
||||
label?: Identifier | null | undefined;
|
||||
}
|
||||
|
||||
export interface WithStatement extends BaseStatement {
|
||||
type: "WithStatement";
|
||||
object: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface SwitchStatement extends BaseStatement {
|
||||
type: "SwitchStatement";
|
||||
discriminant: Expression;
|
||||
cases: SwitchCase[];
|
||||
}
|
||||
|
||||
export interface ReturnStatement extends BaseStatement {
|
||||
type: "ReturnStatement";
|
||||
argument?: Expression | null | undefined;
|
||||
}
|
||||
|
||||
export interface ThrowStatement extends BaseStatement {
|
||||
type: "ThrowStatement";
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
export interface TryStatement extends BaseStatement {
|
||||
type: "TryStatement";
|
||||
block: BlockStatement;
|
||||
handler?: CatchClause | null | undefined;
|
||||
finalizer?: BlockStatement | null | undefined;
|
||||
}
|
||||
|
||||
export interface WhileStatement extends BaseStatement {
|
||||
type: "WhileStatement";
|
||||
test: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface DoWhileStatement extends BaseStatement {
|
||||
type: "DoWhileStatement";
|
||||
body: Statement;
|
||||
test: Expression;
|
||||
}
|
||||
|
||||
export interface ForStatement extends BaseStatement {
|
||||
type: "ForStatement";
|
||||
init?: VariableDeclaration | Expression | null | undefined;
|
||||
test?: Expression | null | undefined;
|
||||
update?: Expression | null | undefined;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface BaseForXStatement extends BaseStatement {
|
||||
left: VariableDeclaration | Pattern;
|
||||
right: Expression;
|
||||
body: Statement;
|
||||
}
|
||||
|
||||
export interface ForInStatement extends BaseForXStatement {
|
||||
type: "ForInStatement";
|
||||
}
|
||||
|
||||
export interface DebuggerStatement extends BaseStatement {
|
||||
type: "DebuggerStatement";
|
||||
}
|
||||
|
||||
export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;
|
||||
|
||||
export interface BaseDeclaration extends BaseStatement {}
|
||||
|
||||
export interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
|
||||
type: "FunctionDeclaration";
|
||||
/** It is null when a function declaration is a part of the `export default function` statement */
|
||||
id: Identifier | null;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
export interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
export interface VariableDeclaration extends BaseDeclaration {
|
||||
type: "VariableDeclaration";
|
||||
declarations: VariableDeclarator[];
|
||||
kind: "var" | "let" | "const";
|
||||
}
|
||||
|
||||
export interface VariableDeclarator extends BaseNode {
|
||||
type: "VariableDeclarator";
|
||||
id: Pattern;
|
||||
init?: Expression | null | undefined;
|
||||
}
|
||||
|
||||
export interface ExpressionMap {
|
||||
ArrayExpression: ArrayExpression;
|
||||
ArrowFunctionExpression: ArrowFunctionExpression;
|
||||
AssignmentExpression: AssignmentExpression;
|
||||
AwaitExpression: AwaitExpression;
|
||||
BinaryExpression: BinaryExpression;
|
||||
CallExpression: CallExpression;
|
||||
ChainExpression: ChainExpression;
|
||||
ClassExpression: ClassExpression;
|
||||
ConditionalExpression: ConditionalExpression;
|
||||
FunctionExpression: FunctionExpression;
|
||||
Identifier: Identifier;
|
||||
ImportExpression: ImportExpression;
|
||||
Literal: Literal;
|
||||
LogicalExpression: LogicalExpression;
|
||||
MemberExpression: MemberExpression;
|
||||
MetaProperty: MetaProperty;
|
||||
NewExpression: NewExpression;
|
||||
ObjectExpression: ObjectExpression;
|
||||
SequenceExpression: SequenceExpression;
|
||||
TaggedTemplateExpression: TaggedTemplateExpression;
|
||||
TemplateLiteral: TemplateLiteral;
|
||||
ThisExpression: ThisExpression;
|
||||
UnaryExpression: UnaryExpression;
|
||||
UpdateExpression: UpdateExpression;
|
||||
YieldExpression: YieldExpression;
|
||||
}
|
||||
|
||||
export type Expression = ExpressionMap[keyof ExpressionMap];
|
||||
|
||||
export interface BaseExpression extends BaseNode {}
|
||||
|
||||
export type ChainElement = SimpleCallExpression | MemberExpression;
|
||||
|
||||
export interface ChainExpression extends BaseExpression {
|
||||
type: "ChainExpression";
|
||||
expression: ChainElement;
|
||||
}
|
||||
|
||||
export interface ThisExpression extends BaseExpression {
|
||||
type: "ThisExpression";
|
||||
}
|
||||
|
||||
export interface ArrayExpression extends BaseExpression {
|
||||
type: "ArrayExpression";
|
||||
elements: Array<Expression | SpreadElement | null>;
|
||||
}
|
||||
|
||||
export interface ObjectExpression extends BaseExpression {
|
||||
type: "ObjectExpression";
|
||||
properties: Array<Property | SpreadElement>;
|
||||
}
|
||||
|
||||
export interface PrivateIdentifier extends BaseNode {
|
||||
type: "PrivateIdentifier";
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface Property extends BaseNode {
|
||||
type: "Property";
|
||||
key: Expression | PrivateIdentifier;
|
||||
value: Expression | Pattern; // Could be an AssignmentProperty
|
||||
kind: "init" | "get" | "set";
|
||||
method: boolean;
|
||||
shorthand: boolean;
|
||||
computed: boolean;
|
||||
}
|
||||
|
||||
export interface PropertyDefinition extends BaseNode {
|
||||
type: "PropertyDefinition";
|
||||
key: Expression | PrivateIdentifier;
|
||||
value?: Expression | null | undefined;
|
||||
computed: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
export interface FunctionExpression extends BaseFunction, BaseExpression {
|
||||
id?: Identifier | null | undefined;
|
||||
type: "FunctionExpression";
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
export interface SequenceExpression extends BaseExpression {
|
||||
type: "SequenceExpression";
|
||||
expressions: Expression[];
|
||||
}
|
||||
|
||||
export interface UnaryExpression extends BaseExpression {
|
||||
type: "UnaryExpression";
|
||||
operator: UnaryOperator;
|
||||
prefix: true;
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
export interface BinaryExpression extends BaseExpression {
|
||||
type: "BinaryExpression";
|
||||
operator: BinaryOperator;
|
||||
left: Expression | PrivateIdentifier;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export interface AssignmentExpression extends BaseExpression {
|
||||
type: "AssignmentExpression";
|
||||
operator: AssignmentOperator;
|
||||
left: Pattern | MemberExpression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export interface UpdateExpression extends BaseExpression {
|
||||
type: "UpdateExpression";
|
||||
operator: UpdateOperator;
|
||||
argument: Expression;
|
||||
prefix: boolean;
|
||||
}
|
||||
|
||||
export interface LogicalExpression extends BaseExpression {
|
||||
type: "LogicalExpression";
|
||||
operator: LogicalOperator;
|
||||
left: Expression;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export interface ConditionalExpression extends BaseExpression {
|
||||
type: "ConditionalExpression";
|
||||
test: Expression;
|
||||
alternate: Expression;
|
||||
consequent: Expression;
|
||||
}
|
||||
|
||||
export interface BaseCallExpression extends BaseExpression {
|
||||
callee: Expression | Super;
|
||||
arguments: Array<Expression | SpreadElement>;
|
||||
}
|
||||
export type CallExpression = SimpleCallExpression | NewExpression;
|
||||
|
||||
export interface SimpleCallExpression extends BaseCallExpression {
|
||||
type: "CallExpression";
|
||||
optional: boolean;
|
||||
}
|
||||
|
||||
export interface NewExpression extends BaseCallExpression {
|
||||
type: "NewExpression";
|
||||
}
|
||||
|
||||
export interface MemberExpression extends BaseExpression, BasePattern {
|
||||
type: "MemberExpression";
|
||||
object: Expression | Super;
|
||||
property: Expression | PrivateIdentifier;
|
||||
computed: boolean;
|
||||
optional: boolean;
|
||||
}
|
||||
|
||||
export type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;
|
||||
|
||||
export interface BasePattern extends BaseNode {}
|
||||
|
||||
export interface SwitchCase extends BaseNode {
|
||||
type: "SwitchCase";
|
||||
test?: Expression | null | undefined;
|
||||
consequent: Statement[];
|
||||
}
|
||||
|
||||
export interface CatchClause extends BaseNode {
|
||||
type: "CatchClause";
|
||||
param: Pattern | null;
|
||||
body: BlockStatement;
|
||||
}
|
||||
|
||||
export interface Identifier extends BaseNode, BaseExpression, BasePattern {
|
||||
type: "Identifier";
|
||||
name: string;
|
||||
}
|
||||
|
||||
export type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;
|
||||
|
||||
export interface SimpleLiteral extends BaseNode, BaseExpression {
|
||||
type: "Literal";
|
||||
value: string | boolean | number | null;
|
||||
raw?: string | undefined;
|
||||
}
|
||||
|
||||
export interface RegExpLiteral extends BaseNode, BaseExpression {
|
||||
type: "Literal";
|
||||
value?: RegExp | null | undefined;
|
||||
regex: {
|
||||
pattern: string;
|
||||
flags: string;
|
||||
};
|
||||
raw?: string | undefined;
|
||||
}
|
||||
|
||||
export interface BigIntLiteral extends BaseNode, BaseExpression {
|
||||
type: "Literal";
|
||||
value?: bigint | null | undefined;
|
||||
bigint: string;
|
||||
raw?: string | undefined;
|
||||
}
|
||||
|
||||
export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
|
||||
|
||||
export type BinaryOperator =
|
||||
| "=="
|
||||
| "!="
|
||||
| "==="
|
||||
| "!=="
|
||||
| "<"
|
||||
| "<="
|
||||
| ">"
|
||||
| ">="
|
||||
| "<<"
|
||||
| ">>"
|
||||
| ">>>"
|
||||
| "+"
|
||||
| "-"
|
||||
| "*"
|
||||
| "/"
|
||||
| "%"
|
||||
| "**"
|
||||
| "|"
|
||||
| "^"
|
||||
| "&"
|
||||
| "in"
|
||||
| "instanceof";
|
||||
|
||||
export type LogicalOperator = "||" | "&&" | "??";
|
||||
|
||||
export type AssignmentOperator =
|
||||
| "="
|
||||
| "+="
|
||||
| "-="
|
||||
| "*="
|
||||
| "/="
|
||||
| "%="
|
||||
| "**="
|
||||
| "<<="
|
||||
| ">>="
|
||||
| ">>>="
|
||||
| "|="
|
||||
| "^="
|
||||
| "&="
|
||||
| "||="
|
||||
| "&&="
|
||||
| "??=";
|
||||
|
||||
export type UpdateOperator = "++" | "--";
|
||||
|
||||
export interface ForOfStatement extends BaseForXStatement {
|
||||
type: "ForOfStatement";
|
||||
await: boolean;
|
||||
}
|
||||
|
||||
export interface Super extends BaseNode {
|
||||
type: "Super";
|
||||
}
|
||||
|
||||
export interface SpreadElement extends BaseNode {
|
||||
type: "SpreadElement";
|
||||
argument: Expression;
|
||||
}
|
||||
|
||||
export interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
|
||||
type: "ArrowFunctionExpression";
|
||||
expression: boolean;
|
||||
body: BlockStatement | Expression;
|
||||
}
|
||||
|
||||
export interface YieldExpression extends BaseExpression {
|
||||
type: "YieldExpression";
|
||||
argument?: Expression | null | undefined;
|
||||
delegate: boolean;
|
||||
}
|
||||
|
||||
export interface TemplateLiteral extends BaseExpression {
|
||||
type: "TemplateLiteral";
|
||||
quasis: TemplateElement[];
|
||||
expressions: Expression[];
|
||||
}
|
||||
|
||||
export interface TaggedTemplateExpression extends BaseExpression {
|
||||
type: "TaggedTemplateExpression";
|
||||
tag: Expression;
|
||||
quasi: TemplateLiteral;
|
||||
}
|
||||
|
||||
export interface TemplateElement extends BaseNode {
|
||||
type: "TemplateElement";
|
||||
tail: boolean;
|
||||
value: {
|
||||
/** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */
|
||||
cooked?: string | null | undefined;
|
||||
raw: string;
|
||||
};
|
||||
}
|
||||
|
||||
export interface AssignmentProperty extends Property {
|
||||
value: Pattern;
|
||||
kind: "init";
|
||||
method: boolean; // false
|
||||
}
|
||||
|
||||
export interface ObjectPattern extends BasePattern {
|
||||
type: "ObjectPattern";
|
||||
properties: Array<AssignmentProperty | RestElement>;
|
||||
}
|
||||
|
||||
export interface ArrayPattern extends BasePattern {
|
||||
type: "ArrayPattern";
|
||||
elements: Array<Pattern | null>;
|
||||
}
|
||||
|
||||
export interface RestElement extends BasePattern {
|
||||
type: "RestElement";
|
||||
argument: Pattern;
|
||||
}
|
||||
|
||||
export interface AssignmentPattern extends BasePattern {
|
||||
type: "AssignmentPattern";
|
||||
left: Pattern;
|
||||
right: Expression;
|
||||
}
|
||||
|
||||
export type Class = ClassDeclaration | ClassExpression;
|
||||
export interface BaseClass extends BaseNode {
|
||||
superClass?: Expression | null | undefined;
|
||||
body: ClassBody;
|
||||
}
|
||||
|
||||
export interface ClassBody extends BaseNode {
|
||||
type: "ClassBody";
|
||||
body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
|
||||
}
|
||||
|
||||
export interface MethodDefinition extends BaseNode {
|
||||
type: "MethodDefinition";
|
||||
key: Expression | PrivateIdentifier;
|
||||
value: FunctionExpression;
|
||||
kind: "constructor" | "method" | "get" | "set";
|
||||
computed: boolean;
|
||||
static: boolean;
|
||||
}
|
||||
|
||||
export interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
|
||||
type: "ClassDeclaration";
|
||||
/** It is null when a class declaration is a part of the `export default class` statement */
|
||||
id: Identifier | null;
|
||||
}
|
||||
|
||||
export interface ClassDeclaration extends MaybeNamedClassDeclaration {
|
||||
id: Identifier;
|
||||
}
|
||||
|
||||
export interface ClassExpression extends BaseClass, BaseExpression {
|
||||
type: "ClassExpression";
|
||||
id?: Identifier | null | undefined;
|
||||
}
|
||||
|
||||
export interface MetaProperty extends BaseExpression {
|
||||
type: "MetaProperty";
|
||||
meta: Identifier;
|
||||
property: Identifier;
|
||||
}
|
||||
|
||||
export type ModuleDeclaration =
|
||||
| ImportDeclaration
|
||||
| ExportNamedDeclaration
|
||||
| ExportDefaultDeclaration
|
||||
| ExportAllDeclaration;
|
||||
export interface BaseModuleDeclaration extends BaseNode {}
|
||||
|
||||
export type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
|
||||
export interface BaseModuleSpecifier extends BaseNode {
|
||||
local: Identifier;
|
||||
}
|
||||
|
||||
export interface ImportDeclaration extends BaseModuleDeclaration {
|
||||
type: "ImportDeclaration";
|
||||
specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
|
||||
source: Literal;
|
||||
}
|
||||
|
||||
export interface ImportSpecifier extends BaseModuleSpecifier {
|
||||
type: "ImportSpecifier";
|
||||
imported: Identifier | Literal;
|
||||
}
|
||||
|
||||
export interface ImportExpression extends BaseExpression {
|
||||
type: "ImportExpression";
|
||||
source: Expression;
|
||||
}
|
||||
|
||||
export interface ImportDefaultSpecifier extends BaseModuleSpecifier {
|
||||
type: "ImportDefaultSpecifier";
|
||||
}
|
||||
|
||||
export interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
|
||||
type: "ImportNamespaceSpecifier";
|
||||
}
|
||||
|
||||
export interface ExportNamedDeclaration extends BaseModuleDeclaration {
|
||||
type: "ExportNamedDeclaration";
|
||||
declaration?: Declaration | null | undefined;
|
||||
specifiers: ExportSpecifier[];
|
||||
source?: Literal | null | undefined;
|
||||
}
|
||||
|
||||
export interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
|
||||
type: "ExportSpecifier";
|
||||
local: Identifier | Literal;
|
||||
exported: Identifier | Literal;
|
||||
}
|
||||
|
||||
export interface ExportDefaultDeclaration extends BaseModuleDeclaration {
|
||||
type: "ExportDefaultDeclaration";
|
||||
declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
|
||||
}
|
||||
|
||||
export interface ExportAllDeclaration extends BaseModuleDeclaration {
|
||||
type: "ExportAllDeclaration";
|
||||
exported: Identifier | Literal | null;
|
||||
source: Literal;
|
||||
}
|
||||
|
||||
export interface AwaitExpression extends BaseExpression {
|
||||
type: "AwaitExpression";
|
||||
argument: Expression;
|
||||
}
|
||||
26
node_modules/@types/estree/package.json
generated
vendored
Normal file
26
node_modules/@types/estree/package.json
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "@types/estree",
|
||||
"version": "1.0.6",
|
||||
"description": "TypeScript definitions for estree",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "RReverser",
|
||||
"githubUsername": "RReverser",
|
||||
"url": "https://github.com/RReverser"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/estree"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "0310b41994a6f8d7530af6c53d47d8b227f32925e43718507fdb1178e05006b1",
|
||||
"typeScriptVersion": "4.8",
|
||||
"nonNpm": true
|
||||
}
|
||||
21
node_modules/@types/express-serve-static-core/LICENSE
generated
vendored
Normal file
21
node_modules/@types/express-serve-static-core/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/express-serve-static-core/README.md
generated
vendored
Normal file
15
node_modules/@types/express-serve-static-core/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/express-serve-static-core`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for express-serve-static-core (http://expressjs.com).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-serve-static-core/v4.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 25 Sep 2024 19:19:36 GMT
|
||||
* Dependencies: [@types/node](https://npmjs.com/package/@types/node), [@types/qs](https://npmjs.com/package/@types/qs), [@types/range-parser](https://npmjs.com/package/@types/range-parser), [@types/send](https://npmjs.com/package/@types/send)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Boris Yankov](https://github.com/borisyankov), [Satana Charuwichitratana](https://github.com/micksatana), [Jose Luis Leon](https://github.com/JoseLion), [David Stephens](https://github.com/dwrss), and [Shin Ando](https://github.com/andoshin11).
|
||||
1295
node_modules/@types/express-serve-static-core/index.d.ts
generated
vendored
Normal file
1295
node_modules/@types/express-serve-static-core/index.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
50
node_modules/@types/express-serve-static-core/package.json
generated
vendored
Normal file
50
node_modules/@types/express-serve-static-core/package.json
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
{
|
||||
"name": "@types/express-serve-static-core",
|
||||
"version": "4.19.6",
|
||||
"description": "TypeScript definitions for express-serve-static-core",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-serve-static-core",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "Satana Charuwichitratana",
|
||||
"githubUsername": "micksatana",
|
||||
"url": "https://github.com/micksatana"
|
||||
},
|
||||
{
|
||||
"name": "Jose Luis Leon",
|
||||
"githubUsername": "JoseLion",
|
||||
"url": "https://github.com/JoseLion"
|
||||
},
|
||||
{
|
||||
"name": "David Stephens",
|
||||
"githubUsername": "dwrss",
|
||||
"url": "https://github.com/dwrss"
|
||||
},
|
||||
{
|
||||
"name": "Shin Ando",
|
||||
"githubUsername": "andoshin11",
|
||||
"url": "https://github.com/andoshin11"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/express-serve-static-core"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/node": "*",
|
||||
"@types/qs": "*",
|
||||
"@types/range-parser": "*",
|
||||
"@types/send": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "a6eae9098d851d3877b61f9dc806634a6174740520432b72c16dc4fdebca21a7",
|
||||
"typeScriptVersion": "4.8"
|
||||
}
|
||||
21
node_modules/@types/express-session/LICENSE
generated
vendored
Normal file
21
node_modules/@types/express-session/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/express-session/README.md
generated
vendored
Normal file
15
node_modules/@types/express-session/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/express-session`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for express-session (https://github.com/expressjs/session).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-session.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 26 Feb 2024 20:07:44 GMT
|
||||
* Dependencies: [@types/express](https://npmjs.com/package/@types/express)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Hiroki Horiuchi](https://github.com/horiuchi), [Jacob Bogers](https://github.com/jacobbogers), [Naoto Yokoyama](https://github.com/builtinnya), [Ryan Cannon](https://github.com/ry7n), [Tom Spencer](https://github.com/fiznool), [Piotr Błażejewicz](https://github.com/peterblazejewicz), and [Ravi van Rooijen](https://github.com/HoldYourWaffle).
|
||||
388
node_modules/@types/express-session/index.d.ts
generated
vendored
Normal file
388
node_modules/@types/express-session/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,388 @@
|
||||
import express = require("express");
|
||||
import { EventEmitter } from "events";
|
||||
|
||||
declare global {
|
||||
namespace Express {
|
||||
type SessionStore = session.Store & { generate: (req: Request) => void };
|
||||
|
||||
// Inject additional properties on express.Request
|
||||
interface Request {
|
||||
/**
|
||||
* This request's `Session` object.
|
||||
* Even though this property isn't marked as optional, it won't exist until you use the `express-session` middleware
|
||||
* [Declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html) can be used to add your own properties.
|
||||
*
|
||||
* @see SessionData
|
||||
*/
|
||||
session: session.Session & Partial<session.SessionData>;
|
||||
|
||||
/**
|
||||
* This request's session ID.
|
||||
* Even though this property isn't marked as optional, it won't exist until you use the `express-session` middleware
|
||||
*/
|
||||
sessionID: string;
|
||||
|
||||
/**
|
||||
* The Store in use.
|
||||
* Even though this property isn't marked as optional, it won't exist until you use the `express-session` middleware
|
||||
* The function `generate` is added by express-session
|
||||
*/
|
||||
sessionStore: SessionStore;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export = session;
|
||||
|
||||
declare function session(options?: session.SessionOptions): express.RequestHandler;
|
||||
|
||||
declare namespace session {
|
||||
interface SessionOptions {
|
||||
/**
|
||||
* This is the secret used to sign the session cookie. This can be either a string for a single secret, or an array of multiple secrets.
|
||||
* If an array of secrets is provided, **only the first element will be used to sign** the session ID cookie,
|
||||
* while **all the elements will be considered when verifying the signature** in requests.
|
||||
* The secret itself should be not easily parsed by a human and would best be a random set of characters
|
||||
*
|
||||
* Best practices may include:
|
||||
* - The use of environment variables to store the secret, ensuring the secret itself does not exist in your repository.
|
||||
* - Periodic updates of the secret, while ensuring the previous secret is in the array.
|
||||
*
|
||||
* Using a secret that cannot be guessed will reduce the ability to hijack a session to only guessing the session ID (as determined by the `genid` option).
|
||||
*
|
||||
* Changing the secret value will invalidate all existing sessions.
|
||||
* In order to rotate the secret without invalidating sessions, provide an array of secrets,
|
||||
* with the new secret as first element of the array, and including previous secrets as the later elements.
|
||||
*/
|
||||
secret: string | string[];
|
||||
|
||||
/**
|
||||
* Function to call to generate a new session ID. Provide a function that returns a string that will be used as a session ID.
|
||||
* The function is given the request as the first argument if you want to use some value attached to it when generating the ID.
|
||||
*
|
||||
* The default value is a function which uses the uid-safe library to generate IDs.
|
||||
* Be careful to generate unique IDs so your sessions do not conflict.
|
||||
*/
|
||||
genid?(req: express.Request): string;
|
||||
|
||||
/**
|
||||
* The name of the session ID cookie to set in the response (and read from in the request).
|
||||
* The default value is 'connect.sid'.
|
||||
*
|
||||
* Note if you have multiple apps running on the same hostname (this is just the name, i.e. `localhost` or `127.0.0.1`; different schemes and ports do not name a different hostname),
|
||||
* then you need to separate the session cookies from each other.
|
||||
* The simplest method is to simply set different names per app.
|
||||
*/
|
||||
name?: string | undefined;
|
||||
|
||||
/**
|
||||
* The session store instance, defaults to a new `MemoryStore` instance.
|
||||
* @see MemoryStore
|
||||
*/
|
||||
store?: Store | undefined;
|
||||
|
||||
/**
|
||||
* Settings object for the session ID cookie.
|
||||
* @see CookieOptions
|
||||
*/
|
||||
cookie?: CookieOptions | undefined;
|
||||
|
||||
/**
|
||||
* Force the session identifier cookie to be set on every response. The expiration is reset to the original `maxAge`, resetting the expiration countdown.
|
||||
* The default value is `false`.
|
||||
*
|
||||
* With this enabled, the session identifier cookie will expire in `maxAge` *since the last response was sent* instead of in `maxAge` *since the session was last modified by the server*.
|
||||
* This is typically used in conjuction with short, non-session-length `maxAge` values to provide a quick timeout of the session data
|
||||
* with reduced potential of it occurring during on going server interactions.
|
||||
*
|
||||
* Note that when this option is set to `true` but the `saveUninitialized` option is set to `false`, the cookie will not be set on a response with an uninitialized session.
|
||||
* This option only modifies the behavior when an existing session was loaded for the request.
|
||||
*
|
||||
* @see saveUninitialized
|
||||
*/
|
||||
rolling?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Forces the session to be saved back to the session store, even if the session was never modified during the request.
|
||||
* Depending on your store this may be necessary, but it can also create race conditions where a client makes two parallel requests to your server
|
||||
* and changes made to the session in one request may get overwritten when the other request ends, even if it made no changes (this behavior also depends on what store you're using).
|
||||
*
|
||||
* The default value is `true`, but using the default has been deprecated, as the default will change in the future.
|
||||
* Please research into this setting and choose what is appropriate to your use-case. Typically, you'll want `false`.
|
||||
*
|
||||
* How do I know if this is necessary for my store? The best way to know is to check with your store if it implements the `touch` method.
|
||||
* If it does, then you can safely set `resave: false`.
|
||||
* If it does not implement the `touch` method and your store sets an expiration date on stored sessions, then you likely need `resave: true`.
|
||||
*/
|
||||
resave?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Trust the reverse proxy when setting secure cookies (via the "X-Forwarded-Proto" header).
|
||||
* The default value is undefined.
|
||||
*
|
||||
* - `true`: The `X-Forwarded-Proto` header will be used.
|
||||
* - `false`: All headers are ignored and the connection is considered secure only if there is a direct TLS/SSL connection.
|
||||
* - `undefined`: Uses the "trust proxy" setting from express
|
||||
*/
|
||||
proxy?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Forces a session that is "uninitialized" to be saved to the store. A session is uninitialized when it is new but not modified.
|
||||
* Choosing `false` is useful for implementing login sessions, reducing server storage usage, or complying with laws that require permission before setting a cookie.
|
||||
* Choosing `false` will also help with race conditions where a client makes multiple parallel requests without a session.
|
||||
*
|
||||
* The default value is `true`, but using the default has been deprecated, as the default will change in the future.
|
||||
* Please research into this setting and choose what is appropriate to your use-case.
|
||||
*
|
||||
* **If you are using `express-session` in conjunction with PassportJS:**
|
||||
* Passport will add an empty Passport object to the session for use after a user is authenticated, which will be treated as a modification to the session, causing it to be saved.
|
||||
* This has been fixed in PassportJS 0.3.0.
|
||||
*/
|
||||
saveUninitialized?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Control the result of unsetting req.session (through delete, setting to null, etc.).
|
||||
* - `destroy`: The session will be destroyed (deleted) when the response ends.
|
||||
* - `keep`: The session in the store will be kept, but modifications made during the request are ignored and not saved.
|
||||
* @default 'keep'
|
||||
*/
|
||||
unset?: "destroy" | "keep" | undefined;
|
||||
}
|
||||
|
||||
class Session {
|
||||
private constructor(request: Express.Request, data: SessionData);
|
||||
|
||||
/**
|
||||
* Each session has a unique ID associated with it.
|
||||
* This property is an alias of `req.sessionID` and cannot be modified.
|
||||
* It has been added to make the session ID accessible from the session object.
|
||||
*/
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* Each session has a unique cookie object accompany it.
|
||||
* This allows you to alter the session cookie per visitor.
|
||||
* For example we can set `req.session.cookie.expires` to `false` to enable the cookie to remain for only the duration of the user-agent.
|
||||
*/
|
||||
cookie: Cookie;
|
||||
|
||||
/** To regenerate the session simply invoke the method. Once complete, a new SID and `Session` instance will be initialized at `req.session` and the `callback` will be invoked. */
|
||||
regenerate(callback: (err: any) => void): this;
|
||||
|
||||
/** Destroys the session and will unset the `req.session` property. Once complete, the `callback` will be invoked. */
|
||||
destroy(callback: (err: any) => void): this;
|
||||
|
||||
/** Reloads the session data from the store and re-populates the `req.session` object. Once complete, the `callback` will be invoked. */
|
||||
reload(callback: (err: any) => void): this;
|
||||
|
||||
/**
|
||||
* Resets the cookie's `maxAge` to `originalMaxAge`
|
||||
* @see Cookie
|
||||
*/
|
||||
resetMaxAge(): this;
|
||||
|
||||
/**
|
||||
* Save the session back to the store, replacing the contents on the store with the contents in memory
|
||||
* (though a store may do something else - consult the store's documentation for exact behavior).
|
||||
*
|
||||
* This method is automatically called at the end of the HTTP response if the session data has been altered
|
||||
* (though this behavior can be altered with various options in the middleware constructor).
|
||||
* Because of this, typically this method does not need to be called.
|
||||
* There are some cases where it is useful to call this method, for example: redirects, long-lived requests or in WebSockets.
|
||||
*/
|
||||
save(callback?: (err: any) => void): this;
|
||||
|
||||
/** Updates the `maxAge` property. Typically this is not necessary to call, as the session middleware does this for you. */
|
||||
touch(): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* This interface allows you to declare additional properties on your session object using [declaration merging](https://www.typescriptlang.org/docs/handbook/declaration-merging.html).
|
||||
*
|
||||
* @example
|
||||
* declare module 'express-session' {
|
||||
* interface SessionData {
|
||||
* views: number;
|
||||
* }
|
||||
* }
|
||||
*/
|
||||
interface SessionData {
|
||||
cookie: Cookie;
|
||||
}
|
||||
|
||||
interface CookieOptions {
|
||||
/**
|
||||
* Specifies the number (in milliseconds) to use when calculating the `Expires Set-Cookie` attribute.
|
||||
* This is done by taking the current server time and adding `maxAge` milliseconds to the value to calculate an `Expires` datetime. By default, no maximum age is set.
|
||||
*
|
||||
* If both `expires` and `maxAge` are set in the options, then the last one defined in the object is what is used.
|
||||
* `maxAge` should be preferred over `expires`.
|
||||
*
|
||||
* @see expires
|
||||
*/
|
||||
maxAge?: number | undefined;
|
||||
|
||||
/**
|
||||
* Specifies the `boolean` value for the [`Partitioned` `Set-Cookie`](https://tools.ietf.org/html/draft-cutler-httpbis-partitioned-cookies/)
|
||||
* attribute. When truthy, the `Partitioned` attribute is set, otherwise it is not.
|
||||
* By default, the `Partitioned` attribute is not set.
|
||||
*
|
||||
* **Note** This is an attribute that has not yet been fully standardized, and may
|
||||
* change in the future. This also means many clients may ignore this attribute until
|
||||
* they understand it.
|
||||
*/
|
||||
partitioned?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Specifies the `string` to be the value for the [`Priority` `Set-Cookie` attribute](https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1).
|
||||
*
|
||||
* - `'low'` will set the `Priority` attribute to `Low`.
|
||||
* - `'medium'` will set the `Priority` attribute to `Medium`, the default priority when not set.
|
||||
* - `'high'` will set the `Priority` attribute to `High`.
|
||||
*
|
||||
* More information about the different priority levels can be found in
|
||||
* [the specification](https://tools.ietf.org/html/draft-west-cookie-priority-00#section-4.1).
|
||||
*
|
||||
* **Note** This is an attribute that has not yet been fully standardized, and may change in the future.
|
||||
* This also means many clients may ignore this attribute until they understand it.
|
||||
*/
|
||||
priority?: "low" | "medium" | "high" | undefined;
|
||||
|
||||
signed?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Specifies the `Date` object to be the value for the `Expires Set-Cookie` attribute.
|
||||
* By default, no expiration is set, and most clients will consider this a "non-persistent cookie" and will delete it on a condition like exiting a web browser application.
|
||||
*
|
||||
* If both `expires` and `maxAge` are set in the options, then the last one defined in the object is what is used.
|
||||
*
|
||||
* @deprecated The `expires` option should not be set directly; instead only use the `maxAge` option
|
||||
* @see maxAge
|
||||
*/
|
||||
expires?: Date | null | undefined;
|
||||
|
||||
/**
|
||||
* Specifies the boolean value for the `HttpOnly Set-Cookie` attribute. When truthy, the `HttpOnly` attribute is set, otherwise it is not.
|
||||
* By default, the `HttpOnly` attribute is set.
|
||||
*
|
||||
* Be careful when setting this to `true`, as compliant clients will not allow client-side JavaScript to see the cookie in `document.cookie`.
|
||||
*/
|
||||
httpOnly?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Specifies the value for the `Path Set-Cookie` attribute.
|
||||
* By default, this is set to '/', which is the root path of the domain.
|
||||
*/
|
||||
path?: string | undefined;
|
||||
|
||||
/**
|
||||
* Specifies the value for the `Domain Set-Cookie` attribute.
|
||||
* By default, no domain is set, and most clients will consider the cookie to apply to only the current domain.
|
||||
*/
|
||||
domain?: string | undefined;
|
||||
|
||||
/**
|
||||
* Specifies the boolean value for the `Secure Set-Cookie` attribute. When truthy, the `Secure` attribute is set, otherwise it is not. By default, the `Secure` attribute is not set.
|
||||
* Be careful when setting this to true, as compliant clients will not send the cookie back to the server in the future if the browser does not have an HTTPS connection.
|
||||
*
|
||||
* Please note that `secure: true` is a **recommended option**.
|
||||
* However, it requires an https-enabled website, i.e., HTTPS is necessary for secure cookies.
|
||||
* If `secure` is set, and you access your site over HTTP, **the cookie will not be set**.
|
||||
*
|
||||
* The cookie.secure option can also be set to the special value `auto` to have this setting automatically match the determined security of the connection.
|
||||
* Be careful when using this setting if the site is available both as HTTP and HTTPS, as once the cookie is set on HTTPS, it will no longer be visible over HTTP.
|
||||
* This is useful when the Express "trust proxy" setting is properly setup to simplify development vs production configuration.
|
||||
*
|
||||
* If you have your node.js behind a proxy and are using `secure: true`, you need to set "trust proxy" in express. Please see the [README](https://github.com/expressjs/session) for details.
|
||||
*
|
||||
* Please see the [README](https://github.com/expressjs/session) for an example of using secure cookies in production, but allowing for testing in development based on NODE_ENV.
|
||||
*/
|
||||
secure?: boolean | "auto" | undefined;
|
||||
|
||||
encode?: ((val: string) => string) | undefined;
|
||||
|
||||
/**
|
||||
* Specifies the boolean or string to be the value for the `SameSite Set-Cookie` attribute.
|
||||
* - `true` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
|
||||
* - `false` will not set the `SameSite` attribute.
|
||||
* - `lax` will set the `SameSite` attribute to `Lax` for lax same site enforcement.
|
||||
* - `none` will set the `SameSite` attribute to `None` for an explicit cross-site cookie.
|
||||
* - `strict` will set the `SameSite` attribute to `Strict` for strict same site enforcement.
|
||||
*
|
||||
* More information about the different enforcement levels can be found in the specification.
|
||||
*
|
||||
* **Note:** This is an attribute that has not yet been fully standardized, and may change in the future.
|
||||
* This also means many clients may ignore this attribute until they understand it.
|
||||
*/
|
||||
sameSite?: boolean | "lax" | "strict" | "none" | undefined;
|
||||
}
|
||||
|
||||
class Cookie implements CookieOptions {
|
||||
/** Returns the original `maxAge` (time-to-live), in milliseconds, of the session cookie. */
|
||||
originalMaxAge: number | null;
|
||||
|
||||
maxAge?: number | undefined;
|
||||
signed?: boolean | undefined;
|
||||
expires?: Date | null | undefined;
|
||||
httpOnly?: boolean | undefined;
|
||||
path?: string | undefined;
|
||||
domain?: string | undefined;
|
||||
secure?: boolean | "auto" | undefined;
|
||||
sameSite?: boolean | "lax" | "strict" | "none" | undefined;
|
||||
}
|
||||
|
||||
abstract class Store extends EventEmitter {
|
||||
regenerate(req: express.Request, callback: (err?: any) => any): void;
|
||||
|
||||
load(sid: string, callback: (err: any, session?: SessionData) => any): void;
|
||||
|
||||
createSession(req: express.Request, session: SessionData): Session & SessionData;
|
||||
|
||||
/**
|
||||
* Gets the session from the store given a session ID and passes it to `callback`.
|
||||
*
|
||||
* The `session` argument should be a `Session` object if found, otherwise `null` or `undefined` if the session was not found and there was no error.
|
||||
* A special case is made when `error.code === 'ENOENT'` to act like `callback(null, null)`.
|
||||
*/
|
||||
abstract get(sid: string, callback: (err: any, session?: SessionData | null) => void): void;
|
||||
|
||||
/** Upsert a session in the store given a session ID and `SessionData` */
|
||||
abstract set(sid: string, session: SessionData, callback?: (err?: any) => void): void;
|
||||
|
||||
/** Destroys the session with the given session ID. */
|
||||
abstract destroy(sid: string, callback?: (err?: any) => void): void;
|
||||
|
||||
/** Returns all sessions in the store */
|
||||
// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/38783, https://github.com/expressjs/session/pull/700#issuecomment-540855551
|
||||
all?(callback: (err: any, obj?: SessionData[] | { [sid: string]: SessionData } | null) => void): void;
|
||||
|
||||
/** Returns the amount of sessions in the store. */
|
||||
length?(callback: (err: any, length?: number) => void): void;
|
||||
|
||||
/** Delete all sessions from the store. */
|
||||
clear?(callback?: (err?: any) => void): void;
|
||||
|
||||
/** "Touches" a given session, resetting the idle timer. */
|
||||
touch?(sid: string, session: SessionData, callback?: () => void): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* **Warning:** the default server-side session storage, `MemoryStore`, is purposely not designed for a production environment.
|
||||
* It will leak memory under most conditions, does not scale past a single process, and is only meant for debugging and developing.
|
||||
*/
|
||||
class MemoryStore extends Store {
|
||||
get(sid: string, callback: (err: any, session?: SessionData | null) => void): void;
|
||||
|
||||
set(sid: string, session: SessionData, callback?: (err?: any) => void): void;
|
||||
|
||||
destroy(sid: string, callback?: (err?: any) => void): void;
|
||||
|
||||
all(callback: (err: any, obj?: { [sid: string]: SessionData } | null) => void): void;
|
||||
|
||||
length(callback: (err: any, length?: number) => void): void;
|
||||
|
||||
clear(callback?: (err?: any) => void): void;
|
||||
|
||||
touch(sid: string, session: SessionData, callback?: () => void): void;
|
||||
}
|
||||
}
|
||||
57
node_modules/@types/express-session/package.json
generated
vendored
Normal file
57
node_modules/@types/express-session/package.json
generated
vendored
Normal file
@ -0,0 +1,57 @@
|
||||
{
|
||||
"name": "@types/express-session",
|
||||
"version": "1.18.0",
|
||||
"description": "TypeScript definitions for express-session",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express-session",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Hiroki Horiuchi",
|
||||
"githubUsername": "horiuchi",
|
||||
"url": "https://github.com/horiuchi"
|
||||
},
|
||||
{
|
||||
"name": "Jacob Bogers",
|
||||
"githubUsername": "jacobbogers",
|
||||
"url": "https://github.com/jacobbogers"
|
||||
},
|
||||
{
|
||||
"name": "Naoto Yokoyama",
|
||||
"githubUsername": "builtinnya",
|
||||
"url": "https://github.com/builtinnya"
|
||||
},
|
||||
{
|
||||
"name": "Ryan Cannon",
|
||||
"githubUsername": "ry7n",
|
||||
"url": "https://github.com/ry7n"
|
||||
},
|
||||
{
|
||||
"name": "Tom Spencer",
|
||||
"githubUsername": "fiznool",
|
||||
"url": "https://github.com/fiznool"
|
||||
},
|
||||
{
|
||||
"name": "Piotr Błażejewicz",
|
||||
"githubUsername": "peterblazejewicz",
|
||||
"url": "https://github.com/peterblazejewicz"
|
||||
},
|
||||
{
|
||||
"name": "Ravi van Rooijen",
|
||||
"githubUsername": "HoldYourWaffle",
|
||||
"url": "https://github.com/HoldYourWaffle"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/express-session"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/express": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "d2eafc3037eb746a0592bb0ff07e6ab9e965e6460f319eecb844a696b4e4850f",
|
||||
"typeScriptVersion": "4.6"
|
||||
}
|
||||
21
node_modules/@types/express/LICENSE
generated
vendored
Normal file
21
node_modules/@types/express/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/express/README.md
generated
vendored
Normal file
15
node_modules/@types/express/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/express`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for express (http://expressjs.com).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 03:09:36 GMT
|
||||
* Dependencies: [@types/body-parser](https://npmjs.com/package/@types/body-parser), [@types/express-serve-static-core](https://npmjs.com/package/@types/express-serve-static-core), [@types/qs](https://npmjs.com/package/@types/qs), [@types/serve-static](https://npmjs.com/package/@types/serve-static)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Boris Yankov](https://github.com/borisyankov), [China Medical University Hospital](https://github.com/CMUH), [Puneet Arora](https://github.com/puneetar), and [Dylan Frankland](https://github.com/dfrankland).
|
||||
128
node_modules/@types/express/index.d.ts
generated
vendored
Normal file
128
node_modules/@types/express/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,128 @@
|
||||
/* =================== USAGE ===================
|
||||
|
||||
import express = require("express");
|
||||
var app = express();
|
||||
|
||||
=============================================== */
|
||||
|
||||
/// <reference types="express-serve-static-core" />
|
||||
/// <reference types="serve-static" />
|
||||
|
||||
import * as bodyParser from "body-parser";
|
||||
import * as core from "express-serve-static-core";
|
||||
import * as qs from "qs";
|
||||
import * as serveStatic from "serve-static";
|
||||
|
||||
/**
|
||||
* Creates an Express application. The express() function is a top-level function exported by the express module.
|
||||
*/
|
||||
declare function e(): core.Express;
|
||||
|
||||
declare namespace e {
|
||||
/**
|
||||
* This is a built-in middleware function in Express. It parses incoming requests with JSON payloads and is based on body-parser.
|
||||
* @since 4.16.0
|
||||
*/
|
||||
var json: typeof bodyParser.json;
|
||||
|
||||
/**
|
||||
* This is a built-in middleware function in Express. It parses incoming requests with Buffer payloads and is based on body-parser.
|
||||
* @since 4.17.0
|
||||
*/
|
||||
var raw: typeof bodyParser.raw;
|
||||
|
||||
/**
|
||||
* This is a built-in middleware function in Express. It parses incoming requests with text payloads and is based on body-parser.
|
||||
* @since 4.17.0
|
||||
*/
|
||||
var text: typeof bodyParser.text;
|
||||
|
||||
/**
|
||||
* These are the exposed prototypes.
|
||||
*/
|
||||
var application: Application;
|
||||
var request: Request;
|
||||
var response: Response;
|
||||
|
||||
/**
|
||||
* This is a built-in middleware function in Express. It serves static files and is based on serve-static.
|
||||
*/
|
||||
var static: serveStatic.RequestHandlerConstructor<Response>;
|
||||
|
||||
/**
|
||||
* This is a built-in middleware function in Express. It parses incoming requests with urlencoded payloads and is based on body-parser.
|
||||
* @since 4.16.0
|
||||
*/
|
||||
var urlencoded: typeof bodyParser.urlencoded;
|
||||
|
||||
/**
|
||||
* This is a built-in middleware function in Express. It parses incoming request query parameters.
|
||||
*/
|
||||
export function query(options: qs.IParseOptions | typeof qs.parse): Handler;
|
||||
|
||||
export function Router(options?: RouterOptions): core.Router;
|
||||
|
||||
interface RouterOptions {
|
||||
/**
|
||||
* Enable case sensitivity.
|
||||
*/
|
||||
caseSensitive?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Preserve the req.params values from the parent router.
|
||||
* If the parent and the child have conflicting param names, the child’s value take precedence.
|
||||
*
|
||||
* @default false
|
||||
* @since 4.5.0
|
||||
*/
|
||||
mergeParams?: boolean | undefined;
|
||||
|
||||
/**
|
||||
* Enable strict routing.
|
||||
*/
|
||||
strict?: boolean | undefined;
|
||||
}
|
||||
|
||||
interface Application extends core.Application {}
|
||||
interface CookieOptions extends core.CookieOptions {}
|
||||
interface Errback extends core.Errback {}
|
||||
interface ErrorRequestHandler<
|
||||
P = core.ParamsDictionary,
|
||||
ResBody = any,
|
||||
ReqBody = any,
|
||||
ReqQuery = core.Query,
|
||||
Locals extends Record<string, any> = Record<string, any>,
|
||||
> extends core.ErrorRequestHandler<P, ResBody, ReqBody, ReqQuery, Locals> {}
|
||||
interface Express extends core.Express {}
|
||||
interface Handler extends core.Handler {}
|
||||
interface IRoute extends core.IRoute {}
|
||||
interface IRouter extends core.IRouter {}
|
||||
interface IRouterHandler<T> extends core.IRouterHandler<T> {}
|
||||
interface IRouterMatcher<T> extends core.IRouterMatcher<T> {}
|
||||
interface MediaType extends core.MediaType {}
|
||||
interface NextFunction extends core.NextFunction {}
|
||||
interface Locals extends core.Locals {}
|
||||
interface Request<
|
||||
P = core.ParamsDictionary,
|
||||
ResBody = any,
|
||||
ReqBody = any,
|
||||
ReqQuery = core.Query,
|
||||
Locals extends Record<string, any> = Record<string, any>,
|
||||
> extends core.Request<P, ResBody, ReqBody, ReqQuery, Locals> {}
|
||||
interface RequestHandler<
|
||||
P = core.ParamsDictionary,
|
||||
ResBody = any,
|
||||
ReqBody = any,
|
||||
ReqQuery = core.Query,
|
||||
Locals extends Record<string, any> = Record<string, any>,
|
||||
> extends core.RequestHandler<P, ResBody, ReqBody, ReqQuery, Locals> {}
|
||||
interface RequestParamHandler extends core.RequestParamHandler {}
|
||||
interface Response<
|
||||
ResBody = any,
|
||||
Locals extends Record<string, any> = Record<string, any>,
|
||||
> extends core.Response<ResBody, Locals> {}
|
||||
interface Router extends core.Router {}
|
||||
interface Send extends core.Send {}
|
||||
}
|
||||
|
||||
export = e;
|
||||
45
node_modules/@types/express/package.json
generated
vendored
Normal file
45
node_modules/@types/express/package.json
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
{
|
||||
"name": "@types/express",
|
||||
"version": "4.17.21",
|
||||
"description": "TypeScript definitions for express",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/express",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Boris Yankov",
|
||||
"githubUsername": "borisyankov",
|
||||
"url": "https://github.com/borisyankov"
|
||||
},
|
||||
{
|
||||
"name": "China Medical University Hospital",
|
||||
"githubUsername": "CMUH",
|
||||
"url": "https://github.com/CMUH"
|
||||
},
|
||||
{
|
||||
"name": "Puneet Arora",
|
||||
"githubUsername": "puneetar",
|
||||
"url": "https://github.com/puneetar"
|
||||
},
|
||||
{
|
||||
"name": "Dylan Frankland",
|
||||
"githubUsername": "dfrankland",
|
||||
"url": "https://github.com/dfrankland"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/express"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/body-parser": "*",
|
||||
"@types/express-serve-static-core": "^4.17.33",
|
||||
"@types/qs": "*",
|
||||
"@types/serve-static": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "fa18ce9be07653182e2674f9a13cf8347ffb270031a7a8d22ba0e785bbc16ce4",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/http-errors/LICENSE
generated
vendored
Normal file
21
node_modules/@types/http-errors/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/http-errors/README.md
generated
vendored
Normal file
15
node_modules/@types/http-errors/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/http-errors`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for http-errors (https://github.com/jshttp/http-errors).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-errors.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 03:09:37 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Tanguy Krotoff](https://github.com/tkrotoff), and [BendingBender](https://github.com/BendingBender).
|
||||
77
node_modules/@types/http-errors/index.d.ts
generated
vendored
Normal file
77
node_modules/@types/http-errors/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,77 @@
|
||||
export = createHttpError;
|
||||
|
||||
declare const createHttpError: createHttpError.CreateHttpError & createHttpError.NamedConstructors & {
|
||||
isHttpError: createHttpError.IsHttpError;
|
||||
};
|
||||
|
||||
declare namespace createHttpError {
|
||||
interface HttpError<N extends number = number> extends Error {
|
||||
status: N;
|
||||
statusCode: N;
|
||||
expose: boolean;
|
||||
headers?: {
|
||||
[key: string]: string;
|
||||
} | undefined;
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
type UnknownError = Error | string | { [key: string]: any };
|
||||
|
||||
interface HttpErrorConstructor<N extends number = number> {
|
||||
(msg?: string): HttpError<N>;
|
||||
new(msg?: string): HttpError<N>;
|
||||
}
|
||||
|
||||
interface CreateHttpError {
|
||||
<N extends number = number>(arg: N, ...rest: UnknownError[]): HttpError<N>;
|
||||
(...rest: UnknownError[]): HttpError;
|
||||
}
|
||||
|
||||
type IsHttpError = (error: unknown) => error is HttpError;
|
||||
|
||||
type NamedConstructors =
|
||||
& {
|
||||
HttpError: HttpErrorConstructor;
|
||||
}
|
||||
& Record<"BadRequest" | "400", HttpErrorConstructor<400>>
|
||||
& Record<"Unauthorized" | "401", HttpErrorConstructor<401>>
|
||||
& Record<"PaymentRequired" | "402", HttpErrorConstructor<402>>
|
||||
& Record<"Forbidden" | "403", HttpErrorConstructor<403>>
|
||||
& Record<"NotFound" | "404", HttpErrorConstructor<404>>
|
||||
& Record<"MethodNotAllowed" | "405", HttpErrorConstructor<405>>
|
||||
& Record<"NotAcceptable" | "406", HttpErrorConstructor<406>>
|
||||
& Record<"ProxyAuthenticationRequired" | "407", HttpErrorConstructor<407>>
|
||||
& Record<"RequestTimeout" | "408", HttpErrorConstructor<408>>
|
||||
& Record<"Conflict" | "409", HttpErrorConstructor<409>>
|
||||
& Record<"Gone" | "410", HttpErrorConstructor<410>>
|
||||
& Record<"LengthRequired" | "411", HttpErrorConstructor<411>>
|
||||
& Record<"PreconditionFailed" | "412", HttpErrorConstructor<412>>
|
||||
& Record<"PayloadTooLarge" | "413", HttpErrorConstructor<413>>
|
||||
& Record<"URITooLong" | "414", HttpErrorConstructor<414>>
|
||||
& Record<"UnsupportedMediaType" | "415", HttpErrorConstructor<415>>
|
||||
& Record<"RangeNotSatisfiable" | "416", HttpErrorConstructor<416>>
|
||||
& Record<"ExpectationFailed" | "417", HttpErrorConstructor<417>>
|
||||
& Record<"ImATeapot" | "418", HttpErrorConstructor<418>>
|
||||
& Record<"MisdirectedRequest" | "421", HttpErrorConstructor<421>>
|
||||
& Record<"UnprocessableEntity" | "422", HttpErrorConstructor<422>>
|
||||
& Record<"Locked" | "423", HttpErrorConstructor<423>>
|
||||
& Record<"FailedDependency" | "424", HttpErrorConstructor<424>>
|
||||
& Record<"TooEarly" | "425", HttpErrorConstructor<425>>
|
||||
& Record<"UpgradeRequired" | "426", HttpErrorConstructor<426>>
|
||||
& Record<"PreconditionRequired" | "428", HttpErrorConstructor<428>>
|
||||
& Record<"TooManyRequests" | "429", HttpErrorConstructor<429>>
|
||||
& Record<"RequestHeaderFieldsTooLarge" | "431", HttpErrorConstructor<431>>
|
||||
& Record<"UnavailableForLegalReasons" | "451", HttpErrorConstructor<451>>
|
||||
& Record<"InternalServerError" | "500", HttpErrorConstructor<500>>
|
||||
& Record<"NotImplemented" | "501", HttpErrorConstructor<501>>
|
||||
& Record<"BadGateway" | "502", HttpErrorConstructor<502>>
|
||||
& Record<"ServiceUnavailable" | "503", HttpErrorConstructor<503>>
|
||||
& Record<"GatewayTimeout" | "504", HttpErrorConstructor<504>>
|
||||
& Record<"HTTPVersionNotSupported" | "505", HttpErrorConstructor<505>>
|
||||
& Record<"VariantAlsoNegotiates" | "506", HttpErrorConstructor<506>>
|
||||
& Record<"InsufficientStorage" | "507", HttpErrorConstructor<507>>
|
||||
& Record<"LoopDetected" | "508", HttpErrorConstructor<508>>
|
||||
& Record<"BandwidthLimitExceeded" | "509", HttpErrorConstructor<509>>
|
||||
& Record<"NotExtended" | "510", HttpErrorConstructor<510>>
|
||||
& Record<"NetworkAuthenticationRequire" | "511", HttpErrorConstructor<511>>;
|
||||
}
|
||||
30
node_modules/@types/http-errors/package.json
generated
vendored
Normal file
30
node_modules/@types/http-errors/package.json
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "@types/http-errors",
|
||||
"version": "2.0.4",
|
||||
"description": "TypeScript definitions for http-errors",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/http-errors",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Tanguy Krotoff",
|
||||
"githubUsername": "tkrotoff",
|
||||
"url": "https://github.com/tkrotoff"
|
||||
},
|
||||
{
|
||||
"name": "BendingBender",
|
||||
"githubUsername": "BendingBender",
|
||||
"url": "https://github.com/BendingBender"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/http-errors"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "06e33723b60f818facd3b7dd2025f043142fb7c56ab4832babafeb9470f2086f",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/mime/LICENSE
generated
vendored
Normal file
21
node_modules/@types/mime/LICENSE
generated
vendored
Normal 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
|
||||
10
node_modules/@types/mime/Mime.d.ts
generated
vendored
Normal file
10
node_modules/@types/mime/Mime.d.ts
generated
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
import { TypeMap } from "./index";
|
||||
|
||||
export default class Mime {
|
||||
constructor(mimes: TypeMap);
|
||||
|
||||
lookup(path: string, fallback?: string): string;
|
||||
extension(mime: string): string | undefined;
|
||||
load(filepath: string): void;
|
||||
define(mimes: TypeMap): void;
|
||||
}
|
||||
15
node_modules/@types/mime/README.md
generated
vendored
Normal file
15
node_modules/@types/mime/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/mime`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for mime (https://github.com/broofa/node-mime).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mime/v1.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 07 Nov 2023 20:08:00 GMT
|
||||
* Dependencies: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Jeff Goddard](https://github.com/jedigo), and [Daniel Hritzkiv](https://github.com/dhritzkiv).
|
||||
31
node_modules/@types/mime/index.d.ts
generated
vendored
Normal file
31
node_modules/@types/mime/index.d.ts
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
// Originally imported from: https://github.com/soywiz/typescript-node-definitions/mime.d.ts
|
||||
|
||||
export as namespace mime;
|
||||
|
||||
export interface TypeMap {
|
||||
[key: string]: string[];
|
||||
}
|
||||
|
||||
/**
|
||||
* Look up a mime type based on extension.
|
||||
*
|
||||
* If not found, uses the fallback argument if provided, and otherwise
|
||||
* uses `default_type`.
|
||||
*/
|
||||
export function lookup(path: string, fallback?: string): string;
|
||||
/**
|
||||
* Return a file extensions associated with a mime type.
|
||||
*/
|
||||
export function extension(mime: string): string | undefined;
|
||||
/**
|
||||
* Load an Apache2-style ".types" file.
|
||||
*/
|
||||
export function load(filepath: string): void;
|
||||
export function define(mimes: TypeMap): void;
|
||||
|
||||
export interface Charsets {
|
||||
lookup(mime: string, fallback: string): string;
|
||||
}
|
||||
|
||||
export const charsets: Charsets;
|
||||
export const default_type: string;
|
||||
7
node_modules/@types/mime/lite.d.ts
generated
vendored
Normal file
7
node_modules/@types/mime/lite.d.ts
generated
vendored
Normal file
@ -0,0 +1,7 @@
|
||||
import { default as Mime } from "./Mime";
|
||||
|
||||
declare const mimelite: Mime;
|
||||
|
||||
export as namespace mimelite;
|
||||
|
||||
export = mimelite;
|
||||
30
node_modules/@types/mime/package.json
generated
vendored
Normal file
30
node_modules/@types/mime/package.json
generated
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "@types/mime",
|
||||
"version": "1.3.5",
|
||||
"description": "TypeScript definitions for mime",
|
||||
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mime",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jeff Goddard",
|
||||
"githubUsername": "jedigo",
|
||||
"url": "https://github.com/jedigo"
|
||||
},
|
||||
{
|
||||
"name": "Daniel Hritzkiv",
|
||||
"githubUsername": "dhritzkiv",
|
||||
"url": "https://github.com/dhritzkiv"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
"directory": "types/mime"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "2ad7ee9a549e6721825e733c6a1a7e8bee0ca7ba93d9ab922c8f4558def52d77",
|
||||
"typeScriptVersion": "4.5"
|
||||
}
|
||||
21
node_modules/@types/node/LICENSE
generated
vendored
Normal file
21
node_modules/@types/node/LICENSE
generated
vendored
Normal 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
|
||||
15
node_modules/@types/node/README.md
generated
vendored
Normal file
15
node_modules/@types/node/README.md
generated
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# Installation
|
||||
> `npm install --save @types/node`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for node (https://nodejs.org/).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v20.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 07 Oct 2024 22:07:58 GMT
|
||||
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [Alberto Schiabel](https://github.com/jkomyno), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [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), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [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), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Victor Perin](https://github.com/victorperin), [Yongsheng Zhang](https://github.com/ZYSzys), [NodeJS Contributors](https://github.com/NodeJS), [Linus Unnebäck](https://github.com/LinusU), [wafuwafu13](https://github.com/wafuwafu13), [Matteo Collina](https://github.com/mcollina), and [Dmitry Semigradsky](https://github.com/Semigradsky).
|
||||
1040
node_modules/@types/node/assert.d.ts
generated
vendored
Normal file
1040
node_modules/@types/node/assert.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
8
node_modules/@types/node/assert/strict.d.ts
generated
vendored
Normal file
8
node_modules/@types/node/assert/strict.d.ts
generated
vendored
Normal file
@ -0,0 +1,8 @@
|
||||
declare module "assert/strict" {
|
||||
import { strict } from "node:assert";
|
||||
export = strict;
|
||||
}
|
||||
declare module "node:assert/strict" {
|
||||
import { strict } from "node:assert";
|
||||
export = strict;
|
||||
}
|
||||
541
node_modules/@types/node/async_hooks.d.ts
generated
vendored
Normal file
541
node_modules/@types/node/async_hooks.d.ts
generated
vendored
Normal file
@ -0,0 +1,541 @@
|
||||
/**
|
||||
* We strongly discourage the use of the `async_hooks` API.
|
||||
* Other APIs that can cover most of its use cases include:
|
||||
*
|
||||
* * [`AsyncLocalStorage`](https://nodejs.org/docs/latest-v20.x/api/async_context.html#class-asynclocalstorage) tracks async context
|
||||
* * [`process.getActiveResourcesInfo()`](https://nodejs.org/docs/latest-v20.x/api/process.html#processgetactiveresourcesinfo) tracks active resources
|
||||
*
|
||||
* The `node:async_hooks` module provides an API to track asynchronous resources.
|
||||
* It can be accessed using:
|
||||
*
|
||||
* ```js
|
||||
* import async_hooks from 'node:async_hooks';
|
||||
* ```
|
||||
* @experimental
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/async_hooks.js)
|
||||
*/
|
||||
declare module "async_hooks" {
|
||||
/**
|
||||
* ```js
|
||||
* import { executionAsyncId } from 'node:async_hooks';
|
||||
* import fs from 'node:fs';
|
||||
*
|
||||
* console.log(executionAsyncId()); // 1 - bootstrap
|
||||
* const path = '.';
|
||||
* fs.open(path, 'r', (err, fd) => {
|
||||
* console.log(executionAsyncId()); // 6 - open()
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* The ID returned from `executionAsyncId()` is related to execution timing, not
|
||||
* causality (which is covered by `triggerAsyncId()`):
|
||||
*
|
||||
* ```js
|
||||
* const server = net.createServer((conn) => {
|
||||
* // Returns the ID of the server, not of the new connection, because the
|
||||
* // callback runs in the execution scope of the server's MakeCallback().
|
||||
* async_hooks.executionAsyncId();
|
||||
*
|
||||
* }).listen(port, () => {
|
||||
* // Returns the ID of a TickObject (process.nextTick()) because all
|
||||
* // callbacks passed to .listen() are wrapped in a nextTick().
|
||||
* async_hooks.executionAsyncId();
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Promise contexts may not get precise `executionAsyncIds` by default.
|
||||
* See the section on [promise execution tracking](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking).
|
||||
* @since v8.1.0
|
||||
* @return The `asyncId` of the current execution context. Useful to track when something calls.
|
||||
*/
|
||||
function executionAsyncId(): number;
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* ```js
|
||||
* import { open } from 'node:fs';
|
||||
* import { executionAsyncId, executionAsyncResource } from 'node:async_hooks';
|
||||
*
|
||||
* console.log(executionAsyncId(), executionAsyncResource()); // 1 {}
|
||||
* open(new URL(import.meta.url), 'r', (err, fd) => {
|
||||
* console.log(executionAsyncId(), executionAsyncResource()); // 7 FSReqWrap
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* This can be used to implement continuation local storage without the
|
||||
* use of a tracking `Map` to store the metadata:
|
||||
*
|
||||
* ```js
|
||||
* import { createServer } from 'node:http';
|
||||
* import {
|
||||
* executionAsyncId,
|
||||
* executionAsyncResource,
|
||||
* createHook,
|
||||
* } from 'async_hooks';
|
||||
* const sym = Symbol('state'); // Private symbol to avoid pollution
|
||||
*
|
||||
* createHook({
|
||||
* init(asyncId, type, triggerAsyncId, resource) {
|
||||
* const cr = executionAsyncResource();
|
||||
* if (cr) {
|
||||
* resource[sym] = cr[sym];
|
||||
* }
|
||||
* },
|
||||
* }).enable();
|
||||
*
|
||||
* const server = createServer((req, res) => {
|
||||
* executionAsyncResource()[sym] = { state: req.url };
|
||||
* setTimeout(function() {
|
||||
* res.end(JSON.stringify(executionAsyncResource()[sym]));
|
||||
* }, 100);
|
||||
* }).listen(3000);
|
||||
* ```
|
||||
* @since v13.9.0, v12.17.0
|
||||
* @return The resource representing the current execution. Useful to store data within the resource.
|
||||
*/
|
||||
function executionAsyncResource(): object;
|
||||
/**
|
||||
* ```js
|
||||
* const server = net.createServer((conn) => {
|
||||
* // The resource that caused (or triggered) this callback to be called
|
||||
* // was that of the new connection. Thus the return value of triggerAsyncId()
|
||||
* // is the asyncId of "conn".
|
||||
* async_hooks.triggerAsyncId();
|
||||
*
|
||||
* }).listen(port, () => {
|
||||
* // Even though all callbacks passed to .listen() are wrapped in a nextTick()
|
||||
* // the callback itself exists because the call to the server's .listen()
|
||||
* // was made. So the return value would be the ID of the server.
|
||||
* async_hooks.triggerAsyncId();
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Promise contexts may not get valid `triggerAsyncId`s by default. See
|
||||
* the section on [promise execution tracking](https://nodejs.org/docs/latest-v20.x/api/async_hooks.html#promise-execution-tracking).
|
||||
* @return 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.
|
||||
*
|
||||
* If an uncaught exception occurs during execution of the callback, then `after` will run after the `'uncaughtException'` event is emitted or a `domain`'s handler runs.
|
||||
* @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.
|
||||
*
|
||||
* The callbacks `init()`/`before()`/`after()`/`destroy()` are called for the
|
||||
* respective asynchronous event during a resource's lifetime.
|
||||
*
|
||||
* All callbacks are optional. For example, if only resource cleanup needs to
|
||||
* be tracked, then only the `destroy` callback needs to be passed. The
|
||||
* specifics of all functions that can be passed to `callbacks` is in the `Hook Callbacks` section.
|
||||
*
|
||||
* ```js
|
||||
* import { createHook } from 'node:async_hooks';
|
||||
*
|
||||
* const asyncHook = createHook({
|
||||
* init(asyncId, type, triggerAsyncId, resource) { },
|
||||
* destroy(asyncId) { },
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* The callbacks will be inherited via the prototype chain:
|
||||
*
|
||||
* ```js
|
||||
* class MyAsyncCallbacks {
|
||||
* init(asyncId, type, triggerAsyncId, resource) { }
|
||||
* destroy(asyncId) {}
|
||||
* }
|
||||
*
|
||||
* class MyAddedCallbacks extends MyAsyncCallbacks {
|
||||
* before(asyncId) { }
|
||||
* after(asyncId) { }
|
||||
* }
|
||||
*
|
||||
* const asyncHook = async_hooks.createHook(new MyAddedCallbacks());
|
||||
* ```
|
||||
*
|
||||
* Because promises are asynchronous resources whose lifecycle is tracked
|
||||
* via the async hooks mechanism, the `init()`, `before()`, `after()`, and`destroy()` callbacks _must not_ be async functions that return promises.
|
||||
* @since v8.1.0
|
||||
* @param callbacks The `Hook Callbacks` to register
|
||||
* @return Instance used for disabling and enabling hooks
|
||||
*/
|
||||
function createHook(callbacks: HookCallbacks): AsyncHook;
|
||||
interface AsyncResourceOptions {
|
||||
/**
|
||||
* The ID of the execution context that created this async event.
|
||||
* @default executionAsyncId()
|
||||
*/
|
||||
triggerAsyncId?: number | undefined;
|
||||
/**
|
||||
* 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 | undefined;
|
||||
}
|
||||
/**
|
||||
* The class `AsyncResource` is designed to be extended by the embedder's async
|
||||
* resources. Using this, users can easily trigger the lifetime events of their
|
||||
* own resources.
|
||||
*
|
||||
* The `init` hook will trigger when an `AsyncResource` is instantiated.
|
||||
*
|
||||
* The following is an overview of the `AsyncResource` API.
|
||||
*
|
||||
* ```js
|
||||
* import { AsyncResource, executionAsyncId } from 'node:async_hooks';
|
||||
*
|
||||
* // AsyncResource() is meant to be extended. Instantiating a
|
||||
* // new AsyncResource() also triggers init. If triggerAsyncId is omitted then
|
||||
* // async_hook.executionAsyncId() is used.
|
||||
* const asyncResource = new AsyncResource(
|
||||
* type, { triggerAsyncId: executionAsyncId(), requireManualDestroy: false },
|
||||
* );
|
||||
*
|
||||
* // Run a function in the execution context of the resource. This will
|
||||
* // * establish the context of the resource
|
||||
* // * trigger the AsyncHooks before callbacks
|
||||
* // * call the provided function `fn` with the supplied arguments
|
||||
* // * trigger the AsyncHooks after callbacks
|
||||
* // * restore the original execution context
|
||||
* asyncResource.runInAsyncScope(fn, thisArg, ...args);
|
||||
*
|
||||
* // Call AsyncHooks destroy callbacks.
|
||||
* asyncResource.emitDestroy();
|
||||
*
|
||||
* // Return the unique ID assigned to the AsyncResource instance.
|
||||
* asyncResource.asyncId();
|
||||
*
|
||||
* // Return the trigger ID for the AsyncResource instance.
|
||||
* asyncResource.triggerAsyncId();
|
||||
* ```
|
||||
*/
|
||||
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 v9.3.0)
|
||||
*/
|
||||
constructor(type: string, triggerAsyncId?: number | AsyncResourceOptions);
|
||||
/**
|
||||
* Binds the given function to the current execution context.
|
||||
* @since v14.8.0, v12.19.0
|
||||
* @param fn The function to bind to the current execution context.
|
||||
* @param type An optional name to associate with the underlying `AsyncResource`.
|
||||
*/
|
||||
static bind<Func extends (this: ThisArg, ...args: any[]) => any, ThisArg>(
|
||||
fn: Func,
|
||||
type?: string,
|
||||
thisArg?: ThisArg,
|
||||
): Func;
|
||||
/**
|
||||
* Binds the given function to execute to this `AsyncResource`'s scope.
|
||||
* @since v14.8.0, v12.19.0
|
||||
* @param fn The function to bind to the current `AsyncResource`.
|
||||
*/
|
||||
bind<Func extends (...args: any[]) => any>(fn: Func): Func;
|
||||
/**
|
||||
* 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.
|
||||
* @since v9.6.0
|
||||
* @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 all `destroy` hooks. This should only ever be called once. An error will
|
||||
* be thrown if it is called more than once. This **must** be manually called. If
|
||||
* the resource is left to be collected by the GC then the `destroy` hooks will
|
||||
* never be called.
|
||||
* @return A reference to `asyncResource`.
|
||||
*/
|
||||
emitDestroy(): this;
|
||||
/**
|
||||
* @return The unique `asyncId` assigned to the resource.
|
||||
*/
|
||||
asyncId(): number;
|
||||
/**
|
||||
* @return The same `triggerAsyncId` that is passed to the `AsyncResource` constructor.
|
||||
*/
|
||||
triggerAsyncId(): number;
|
||||
}
|
||||
/**
|
||||
* This class creates stores that stay coherent through asynchronous operations.
|
||||
*
|
||||
* While you can create your own implementation on top of the `node:async_hooks` module, `AsyncLocalStorage` should be preferred as it is a performant and memory
|
||||
* safe implementation that involves significant optimizations that are non-obvious
|
||||
* to implement.
|
||||
*
|
||||
* The following example uses `AsyncLocalStorage` to build a simple logger
|
||||
* that assigns IDs to incoming HTTP requests and includes them in messages
|
||||
* logged within each request.
|
||||
*
|
||||
* ```js
|
||||
* import http from 'node:http';
|
||||
* import { AsyncLocalStorage } from 'node:async_hooks';
|
||||
*
|
||||
* const asyncLocalStorage = new AsyncLocalStorage();
|
||||
*
|
||||
* function logWithId(msg) {
|
||||
* const id = asyncLocalStorage.getStore();
|
||||
* console.log(`${id !== undefined ? id : '-'}:`, msg);
|
||||
* }
|
||||
*
|
||||
* let idSeq = 0;
|
||||
* http.createServer((req, res) => {
|
||||
* asyncLocalStorage.run(idSeq++, () => {
|
||||
* logWithId('start');
|
||||
* // Imagine any chain of async operations here
|
||||
* setImmediate(() => {
|
||||
* logWithId('finish');
|
||||
* res.end();
|
||||
* });
|
||||
* });
|
||||
* }).listen(8080);
|
||||
*
|
||||
* http.get('http://localhost:8080');
|
||||
* http.get('http://localhost:8080');
|
||||
* // Prints:
|
||||
* // 0: start
|
||||
* // 1: start
|
||||
* // 0: finish
|
||||
* // 1: finish
|
||||
* ```
|
||||
*
|
||||
* Each instance of `AsyncLocalStorage` maintains an independent storage context.
|
||||
* Multiple instances can safely exist simultaneously without risk of interfering
|
||||
* with each other's data.
|
||||
* @since v13.10.0, v12.17.0
|
||||
*/
|
||||
class AsyncLocalStorage<T> {
|
||||
/**
|
||||
* Binds the given function to the current execution context.
|
||||
* @since v19.8.0
|
||||
* @experimental
|
||||
* @param fn The function to bind to the current execution context.
|
||||
* @return A new function that calls `fn` within the captured execution context.
|
||||
*/
|
||||
static bind<Func extends (...args: any[]) => any>(fn: Func): Func;
|
||||
/**
|
||||
* Captures the current execution context and returns a function that accepts a
|
||||
* function as an argument. Whenever the returned function is called, it
|
||||
* calls the function passed to it within the captured context.
|
||||
*
|
||||
* ```js
|
||||
* const asyncLocalStorage = new AsyncLocalStorage();
|
||||
* const runInAsyncScope = asyncLocalStorage.run(123, () => AsyncLocalStorage.snapshot());
|
||||
* const result = asyncLocalStorage.run(321, () => runInAsyncScope(() => asyncLocalStorage.getStore()));
|
||||
* console.log(result); // returns 123
|
||||
* ```
|
||||
*
|
||||
* AsyncLocalStorage.snapshot() can replace the use of AsyncResource for simple
|
||||
* async context tracking purposes, for example:
|
||||
*
|
||||
* ```js
|
||||
* class Foo {
|
||||
* #runInAsyncScope = AsyncLocalStorage.snapshot();
|
||||
*
|
||||
* get() { return this.#runInAsyncScope(() => asyncLocalStorage.getStore()); }
|
||||
* }
|
||||
*
|
||||
* const foo = asyncLocalStorage.run(123, () => new Foo());
|
||||
* console.log(asyncLocalStorage.run(321, () => foo.get())); // returns 123
|
||||
* ```
|
||||
* @since v19.8.0
|
||||
* @experimental
|
||||
* @return A new function with the signature `(fn: (...args) : R, ...args) : R`.
|
||||
*/
|
||||
static snapshot(): <R, TArgs extends any[]>(fn: (...args: TArgs) => R, ...args: TArgs) => R;
|
||||
/**
|
||||
* Disables the instance of `AsyncLocalStorage`. All subsequent calls
|
||||
* to `asyncLocalStorage.getStore()` will return `undefined` until `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()` 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.
|
||||
*
|
||||
* Use this method when the `asyncLocalStorage` is not in use anymore
|
||||
* in the current process.
|
||||
* @since v13.10.0, v12.17.0
|
||||
* @experimental
|
||||
*/
|
||||
disable(): void;
|
||||
/**
|
||||
* Returns the current store.
|
||||
* If called outside of an asynchronous context initialized by
|
||||
* calling `asyncLocalStorage.run()` or `asyncLocalStorage.enterWith()`, it
|
||||
* returns `undefined`.
|
||||
* @since v13.10.0, v12.17.0
|
||||
*/
|
||||
getStore(): T | undefined;
|
||||
/**
|
||||
* Runs a function synchronously within a context and returns its
|
||||
* return value. The store is not accessible outside of the callback function.
|
||||
* The store is accessible to any asynchronous operations created within the
|
||||
* callback.
|
||||
*
|
||||
* The optional `args` are passed to the callback function.
|
||||
*
|
||||
* If the callback function throws an error, the error is thrown by `run()` too.
|
||||
* The stacktrace is not impacted by this call and the context is exited.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```js
|
||||
* const store = { id: 2 };
|
||||
* try {
|
||||
* asyncLocalStorage.run(store, () => {
|
||||
* asyncLocalStorage.getStore(); // Returns the store object
|
||||
* setTimeout(() => {
|
||||
* asyncLocalStorage.getStore(); // Returns the store object
|
||||
* }, 200);
|
||||
* throw new Error();
|
||||
* });
|
||||
* } catch (e) {
|
||||
* asyncLocalStorage.getStore(); // Returns undefined
|
||||
* // The error will be caught here
|
||||
* }
|
||||
* ```
|
||||
* @since v13.10.0, v12.17.0
|
||||
*/
|
||||
run<R>(store: T, callback: () => R): R;
|
||||
run<R, TArgs extends any[]>(store: T, callback: (...args: TArgs) => R, ...args: TArgs): R;
|
||||
/**
|
||||
* Runs a function synchronously outside of a context and returns its
|
||||
* return value. The store is not accessible within the callback function or
|
||||
* the asynchronous operations created within the callback. Any `getStore()` call done within the callback function will always return `undefined`.
|
||||
*
|
||||
* The optional `args` are passed to the callback function.
|
||||
*
|
||||
* If the callback function throws an error, the error is thrown by `exit()` too.
|
||||
* The stacktrace is not impacted by this call and the context is re-entered.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```js
|
||||
* // Within a call to run
|
||||
* try {
|
||||
* asyncLocalStorage.getStore(); // Returns the store object or value
|
||||
* asyncLocalStorage.exit(() => {
|
||||
* asyncLocalStorage.getStore(); // Returns undefined
|
||||
* throw new Error();
|
||||
* });
|
||||
* } catch (e) {
|
||||
* asyncLocalStorage.getStore(); // Returns the same object or value
|
||||
* // The error will be caught here
|
||||
* }
|
||||
* ```
|
||||
* @since v13.10.0, v12.17.0
|
||||
* @experimental
|
||||
*/
|
||||
exit<R, TArgs extends any[]>(callback: (...args: TArgs) => R, ...args: TArgs): R;
|
||||
/**
|
||||
* Transitions into the context for the remainder of the current
|
||||
* synchronous execution and then persists the store through any following
|
||||
* asynchronous calls.
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* ```js
|
||||
* const store = { id: 1 };
|
||||
* // Replaces previous store with the given store object
|
||||
* asyncLocalStorage.enterWith(store);
|
||||
* asyncLocalStorage.getStore(); // Returns the store object
|
||||
* someAsyncOperation(() => {
|
||||
* asyncLocalStorage.getStore(); // Returns the same object
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* This transition will continue for the _entire_ synchronous execution.
|
||||
* This means that if, for example, the context is entered within an event
|
||||
* handler subsequent event handlers will also run within that context unless
|
||||
* specifically bound to another context with an `AsyncResource`. That is why `run()` should be preferred over `enterWith()` unless there are strong reasons
|
||||
* to use the latter method.
|
||||
*
|
||||
* ```js
|
||||
* const store = { id: 1 };
|
||||
*
|
||||
* emitter.on('my-event', () => {
|
||||
* asyncLocalStorage.enterWith(store);
|
||||
* });
|
||||
* emitter.on('my-event', () => {
|
||||
* asyncLocalStorage.getStore(); // Returns the same object
|
||||
* });
|
||||
*
|
||||
* asyncLocalStorage.getStore(); // Returns undefined
|
||||
* emitter.emit('my-event');
|
||||
* asyncLocalStorage.getStore(); // Returns the same object
|
||||
* ```
|
||||
* @since v13.11.0, v12.17.0
|
||||
* @experimental
|
||||
*/
|
||||
enterWith(store: T): void;
|
||||
}
|
||||
}
|
||||
declare module "node:async_hooks" {
|
||||
export * from "async_hooks";
|
||||
}
|
||||
385
node_modules/@types/node/buffer.buffer.d.ts
generated
vendored
Normal file
385
node_modules/@types/node/buffer.buffer.d.ts
generated
vendored
Normal file
@ -0,0 +1,385 @@
|
||||
declare module "buffer" {
|
||||
global {
|
||||
interface BufferConstructor {
|
||||
// see buffer.d.ts for implementation shared with all TypeScript versions
|
||||
|
||||
/**
|
||||
* Allocates a new buffer containing the given {str}.
|
||||
*
|
||||
* @param str String to store in buffer.
|
||||
* @param encoding encoding to use, optional. Default is 'utf8'
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(string[, encoding])` instead.
|
||||
*/
|
||||
new(str: string, encoding?: BufferEncoding): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Allocates a new buffer of {size} octets.
|
||||
*
|
||||
* @param size count of octets to allocate.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.alloc()` instead (also see `Buffer.allocUnsafe()`).
|
||||
*/
|
||||
new(size: number): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Allocates a new buffer containing the given {array} of octets.
|
||||
*
|
||||
* @param array The octets to store.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
|
||||
*/
|
||||
new(array: Uint8Array): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Produces a Buffer backed by the same allocated memory as
|
||||
* the given {ArrayBuffer}/{SharedArrayBuffer}.
|
||||
*
|
||||
* @param arrayBuffer The ArrayBuffer with which to share memory.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(arrayBuffer[, byteOffset[, length]])` instead.
|
||||
*/
|
||||
new<TArrayBuffer extends ArrayBufferLike = ArrayBuffer>(arrayBuffer: TArrayBuffer): Buffer<TArrayBuffer>;
|
||||
/**
|
||||
* Allocates a new buffer containing the given {array} of octets.
|
||||
*
|
||||
* @param array The octets to store.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
|
||||
*/
|
||||
new(array: readonly any[]): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Copies the passed {buffer} data onto a new {Buffer} instance.
|
||||
*
|
||||
* @param buffer The buffer to copy.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(buffer)` instead.
|
||||
*/
|
||||
new(buffer: Buffer): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Allocates a new `Buffer` using an `array` of bytes in the range `0` – `255`.
|
||||
* Array entries outside that range will be truncated to fit into it.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* // Creates a new Buffer containing the UTF-8 bytes of the string 'buffer'.
|
||||
* const buf = Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]);
|
||||
* ```
|
||||
*
|
||||
* If `array` is an `Array`\-like object (that is, one with a `length` property of
|
||||
* type `number`), it is treated as if it is an array, unless it is a `Buffer` or
|
||||
* a `Uint8Array`. This means all other `TypedArray` variants get treated as an `Array`. To create a `Buffer` from the bytes backing a `TypedArray`, use `Buffer.copyBytesFrom()`.
|
||||
*
|
||||
* A `TypeError` will be thrown if `array` is not an `Array` or another type
|
||||
* appropriate for `Buffer.from()` variants.
|
||||
*
|
||||
* `Buffer.from(array)` and `Buffer.from(string)` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
|
||||
* @since v5.10.0
|
||||
*/
|
||||
from<TArrayBuffer extends ArrayBufferLike>(
|
||||
arrayBuffer: WithImplicitCoercion<TArrayBuffer>,
|
||||
byteOffset?: number,
|
||||
length?: number,
|
||||
): Buffer<TArrayBuffer>;
|
||||
/**
|
||||
* Creates a new Buffer using the passed {data}
|
||||
* @param data data to create a new Buffer
|
||||
*/
|
||||
from(data: Uint8Array | readonly number[]): Buffer<ArrayBuffer>;
|
||||
from(data: WithImplicitCoercion<Uint8Array | readonly number[] | string>): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Creates a new Buffer containing the given JavaScript string {str}.
|
||||
* If provided, the {encoding} parameter identifies the character encoding.
|
||||
* If not provided, {encoding} defaults to 'utf8'.
|
||||
*/
|
||||
from(
|
||||
str:
|
||||
| WithImplicitCoercion<string>
|
||||
| {
|
||||
[Symbol.toPrimitive](hint: "string"): string;
|
||||
},
|
||||
encoding?: BufferEncoding,
|
||||
): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Creates a new Buffer using the passed {data}
|
||||
* @param values to create a new Buffer
|
||||
*/
|
||||
of(...items: number[]): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Returns a new `Buffer` which is the result of concatenating all the `Buffer` instances in the `list` together.
|
||||
*
|
||||
* If the list has no items, or if the `totalLength` is 0, then a new zero-length `Buffer` is returned.
|
||||
*
|
||||
* If `totalLength` is not provided, it is calculated from the `Buffer` instances
|
||||
* in `list` by adding their lengths.
|
||||
*
|
||||
* If `totalLength` is provided, it is coerced to an unsigned integer. If the
|
||||
* combined length of the `Buffer`s in `list` exceeds `totalLength`, the result is
|
||||
* truncated to `totalLength`.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* // Create a single `Buffer` from a list of three `Buffer` instances.
|
||||
*
|
||||
* const buf1 = Buffer.alloc(10);
|
||||
* const buf2 = Buffer.alloc(14);
|
||||
* const buf3 = Buffer.alloc(18);
|
||||
* const totalLength = buf1.length + buf2.length + buf3.length;
|
||||
*
|
||||
* console.log(totalLength);
|
||||
* // Prints: 42
|
||||
*
|
||||
* const bufA = Buffer.concat([buf1, buf2, buf3], totalLength);
|
||||
*
|
||||
* console.log(bufA);
|
||||
* // Prints: <Buffer 00 00 00 00 ...>
|
||||
* console.log(bufA.length);
|
||||
* // Prints: 42
|
||||
* ```
|
||||
*
|
||||
* `Buffer.concat()` may also use the internal `Buffer` pool like `Buffer.allocUnsafe()` does.
|
||||
* @since v0.7.11
|
||||
* @param list List of `Buffer` or {@link Uint8Array} instances to concatenate.
|
||||
* @param totalLength Total length of the `Buffer` instances in `list` when concatenated.
|
||||
*/
|
||||
concat(list: readonly Uint8Array[], totalLength?: number): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Copies the underlying memory of `view` into a new `Buffer`.
|
||||
*
|
||||
* ```js
|
||||
* const u16 = new Uint16Array([0, 0xffff]);
|
||||
* const buf = Buffer.copyBytesFrom(u16, 1, 1);
|
||||
* u16[1] = 0;
|
||||
* console.log(buf.length); // 2
|
||||
* console.log(buf[0]); // 255
|
||||
* console.log(buf[1]); // 255
|
||||
* ```
|
||||
* @since v19.8.0
|
||||
* @param view The {TypedArray} to copy.
|
||||
* @param [offset=0] The starting offset within `view`.
|
||||
* @param [length=view.length - offset] The number of elements from `view` to copy.
|
||||
*/
|
||||
copyBytesFrom(view: NodeJS.TypedArray, offset?: number, length?: number): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Allocates a new `Buffer` of `size` bytes. If `fill` is `undefined`, the`Buffer` will be zero-filled.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.alloc(5);
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints: <Buffer 00 00 00 00 00>
|
||||
* ```
|
||||
*
|
||||
* If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
|
||||
*
|
||||
* If `fill` is specified, the allocated `Buffer` will be initialized by calling `buf.fill(fill)`.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.alloc(5, 'a');
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints: <Buffer 61 61 61 61 61>
|
||||
* ```
|
||||
*
|
||||
* If both `fill` and `encoding` are specified, the allocated `Buffer` will be
|
||||
* initialized by calling `buf.fill(fill, encoding)`.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.alloc(11, 'aGVsbG8gd29ybGQ=', 'base64');
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints: <Buffer 68 65 6c 6c 6f 20 77 6f 72 6c 64>
|
||||
* ```
|
||||
*
|
||||
* Calling `Buffer.alloc()` can be measurably slower than the alternative `Buffer.allocUnsafe()` but ensures that the newly created `Buffer` instance
|
||||
* contents will never contain sensitive data from previous allocations, including
|
||||
* data that might not have been allocated for `Buffer`s.
|
||||
*
|
||||
* A `TypeError` will be thrown if `size` is not a number.
|
||||
* @since v5.10.0
|
||||
* @param size The desired length of the new `Buffer`.
|
||||
* @param [fill=0] A value to pre-fill the new `Buffer` with.
|
||||
* @param [encoding='utf8'] If `fill` is a string, this is its encoding.
|
||||
*/
|
||||
alloc(size: number, fill?: string | Uint8Array | number, encoding?: BufferEncoding): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown.
|
||||
*
|
||||
* The underlying memory for `Buffer` instances created in this way is _not_
|
||||
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `Buffer.alloc()` instead to initialize`Buffer` instances with zeroes.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.allocUnsafe(10);
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints (contents may vary): <Buffer a0 8b 28 3f 01 00 00 00 50 32>
|
||||
*
|
||||
* buf.fill(0);
|
||||
*
|
||||
* console.log(buf);
|
||||
* // Prints: <Buffer 00 00 00 00 00 00 00 00 00 00>
|
||||
* ```
|
||||
*
|
||||
* A `TypeError` will be thrown if `size` is not a number.
|
||||
*
|
||||
* The `Buffer` module pre-allocates an internal `Buffer` instance of
|
||||
* size `Buffer.poolSize` that is used as a pool for the fast allocation of new `Buffer` instances created using `Buffer.allocUnsafe()`, `Buffer.from(array)`,
|
||||
* and `Buffer.concat()` only when `size` is less than `Buffer.poolSize >>> 1` (floor of `Buffer.poolSize` divided by two).
|
||||
*
|
||||
* Use of this pre-allocated internal memory pool is a key difference between
|
||||
* calling `Buffer.alloc(size, fill)` vs. `Buffer.allocUnsafe(size).fill(fill)`.
|
||||
* Specifically, `Buffer.alloc(size, fill)` will _never_ use the internal `Buffer`pool, while `Buffer.allocUnsafe(size).fill(fill)`_will_ use the internal`Buffer` pool if `size` is less
|
||||
* than or equal to half `Buffer.poolSize`. The
|
||||
* difference is subtle but can be important when an application requires the
|
||||
* additional performance that `Buffer.allocUnsafe()` provides.
|
||||
* @since v5.10.0
|
||||
* @param size The desired length of the new `Buffer`.
|
||||
*/
|
||||
allocUnsafe(size: number): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Allocates a new `Buffer` of `size` bytes. If `size` is larger than {@link constants.MAX_LENGTH} or smaller than 0, `ERR_OUT_OF_RANGE` is thrown. A zero-length `Buffer` is created if
|
||||
* `size` is 0.
|
||||
*
|
||||
* The underlying memory for `Buffer` instances created in this way is _not_
|
||||
* _initialized_. The contents of the newly created `Buffer` are unknown and _may contain sensitive data_. Use `buf.fill(0)` to initialize
|
||||
* such `Buffer` instances with zeroes.
|
||||
*
|
||||
* When using `Buffer.allocUnsafe()` to allocate new `Buffer` instances,
|
||||
* allocations under 4 KiB are sliced from a single pre-allocated `Buffer`. This
|
||||
* allows applications to avoid the garbage collection overhead of creating many
|
||||
* individually allocated `Buffer` instances. This approach improves both
|
||||
* performance and memory usage by eliminating the need to track and clean up as
|
||||
* many individual `ArrayBuffer` objects.
|
||||
*
|
||||
* However, in the case where a developer may need to retain a small chunk of
|
||||
* memory from a pool for an indeterminate amount of time, it may be appropriate
|
||||
* to create an un-pooled `Buffer` instance using `Buffer.allocUnsafeSlow()` and
|
||||
* then copying out the relevant bits.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* // Need to keep around a few small chunks of memory.
|
||||
* const store = [];
|
||||
*
|
||||
* socket.on('readable', () => {
|
||||
* let data;
|
||||
* while (null !== (data = readable.read())) {
|
||||
* // Allocate for retained data.
|
||||
* const sb = Buffer.allocUnsafeSlow(10);
|
||||
*
|
||||
* // Copy the data into the new allocation.
|
||||
* data.copy(sb, 0, 0, 10);
|
||||
*
|
||||
* store.push(sb);
|
||||
* }
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* A `TypeError` will be thrown if `size` is not a number.
|
||||
* @since v5.12.0
|
||||
* @param size The desired length of the new `Buffer`.
|
||||
*/
|
||||
allocUnsafeSlow(size: number): Buffer<ArrayBuffer>;
|
||||
}
|
||||
interface Buffer<TArrayBuffer extends ArrayBufferLike = ArrayBufferLike> extends Uint8Array<TArrayBuffer> {
|
||||
// see buffer.d.ts for implementation shared with all TypeScript versions
|
||||
|
||||
/**
|
||||
* Returns a new `Buffer` that references the same memory as the original, but
|
||||
* offset and cropped by the `start` and `end` indices.
|
||||
*
|
||||
* This method is not compatible with the `Uint8Array.prototype.slice()`,
|
||||
* which is a superclass of `Buffer`. To copy the slice, use`Uint8Array.prototype.slice()`.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.from('buffer');
|
||||
*
|
||||
* const copiedBuf = Uint8Array.prototype.slice.call(buf);
|
||||
* copiedBuf[0]++;
|
||||
* console.log(copiedBuf.toString());
|
||||
* // Prints: cuffer
|
||||
*
|
||||
* console.log(buf.toString());
|
||||
* // Prints: buffer
|
||||
*
|
||||
* // With buf.slice(), the original buffer is modified.
|
||||
* const notReallyCopiedBuf = buf.slice();
|
||||
* notReallyCopiedBuf[0]++;
|
||||
* console.log(notReallyCopiedBuf.toString());
|
||||
* // Prints: cuffer
|
||||
* console.log(buf.toString());
|
||||
* // Also prints: cuffer (!)
|
||||
* ```
|
||||
* @since v0.3.0
|
||||
* @deprecated Use `subarray` instead.
|
||||
* @param [start=0] Where the new `Buffer` will start.
|
||||
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
|
||||
*/
|
||||
slice(start?: number, end?: number): Buffer<ArrayBuffer>;
|
||||
/**
|
||||
* Returns a new `Buffer` that references the same memory as the original, but
|
||||
* offset and cropped by the `start` and `end` indices.
|
||||
*
|
||||
* Specifying `end` greater than `buf.length` will return the same result as
|
||||
* that of `end` equal to `buf.length`.
|
||||
*
|
||||
* This method is inherited from [`TypedArray.prototype.subarray()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/subarray).
|
||||
*
|
||||
* Modifying the new `Buffer` slice will modify the memory in the original `Buffer`because the allocated memory of the two objects overlap.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* // Create a `Buffer` with the ASCII alphabet, take a slice, and modify one byte
|
||||
* // from the original `Buffer`.
|
||||
*
|
||||
* const buf1 = Buffer.allocUnsafe(26);
|
||||
*
|
||||
* for (let i = 0; i < 26; i++) {
|
||||
* // 97 is the decimal ASCII value for 'a'.
|
||||
* buf1[i] = i + 97;
|
||||
* }
|
||||
*
|
||||
* const buf2 = buf1.subarray(0, 3);
|
||||
*
|
||||
* console.log(buf2.toString('ascii', 0, buf2.length));
|
||||
* // Prints: abc
|
||||
*
|
||||
* buf1[0] = 33;
|
||||
*
|
||||
* console.log(buf2.toString('ascii', 0, buf2.length));
|
||||
* // Prints: !bc
|
||||
* ```
|
||||
*
|
||||
* Specifying negative indexes causes the slice to be generated relative to the
|
||||
* end of `buf` rather than the beginning.
|
||||
*
|
||||
* ```js
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf = Buffer.from('buffer');
|
||||
*
|
||||
* console.log(buf.subarray(-6, -1).toString());
|
||||
* // Prints: buffe
|
||||
* // (Equivalent to buf.subarray(0, 5).)
|
||||
*
|
||||
* console.log(buf.subarray(-6, -2).toString());
|
||||
* // Prints: buff
|
||||
* // (Equivalent to buf.subarray(0, 4).)
|
||||
*
|
||||
* console.log(buf.subarray(-5, -2).toString());
|
||||
* // Prints: uff
|
||||
* // (Equivalent to buf.subarray(1, 4).)
|
||||
* ```
|
||||
* @since v3.0.0
|
||||
* @param [start=0] Where the new `Buffer` will start.
|
||||
* @param [end=buf.length] Where the new `Buffer` will end (not inclusive).
|
||||
*/
|
||||
subarray(start?: number, end?: number): Buffer<TArrayBuffer>;
|
||||
}
|
||||
}
|
||||
}
|
||||
1934
node_modules/@types/node/buffer.d.ts
generated
vendored
Normal file
1934
node_modules/@types/node/buffer.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1548
node_modules/@types/node/child_process.d.ts
generated
vendored
Normal file
1548
node_modules/@types/node/child_process.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
578
node_modules/@types/node/cluster.d.ts
generated
vendored
Normal file
578
node_modules/@types/node/cluster.d.ts
generated
vendored
Normal file
@ -0,0 +1,578 @@
|
||||
/**
|
||||
* Clusters of Node.js processes can be used to run multiple instances of Node.js
|
||||
* that can distribute workloads among their application threads. When process isolation
|
||||
* is not needed, use the [`worker_threads`](https://nodejs.org/docs/latest-v20.x/api/worker_threads.html)
|
||||
* module instead, which allows running multiple application threads within a single Node.js instance.
|
||||
*
|
||||
* The cluster module allows easy creation of child processes that all share
|
||||
* server ports.
|
||||
*
|
||||
* ```js
|
||||
* import cluster from 'node:cluster';
|
||||
* import http from 'node:http';
|
||||
* import { availableParallelism } from 'node:os';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* const numCPUs = availableParallelism();
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* console.log(`Primary ${process.pid} is running`);
|
||||
*
|
||||
* // Fork workers.
|
||||
* for (let i = 0; i < numCPUs; i++) {
|
||||
* cluster.fork();
|
||||
* }
|
||||
*
|
||||
* cluster.on('exit', (worker, code, signal) => {
|
||||
* console.log(`worker ${worker.process.pid} died`);
|
||||
* });
|
||||
* } else {
|
||||
* // Workers can share any TCP connection
|
||||
* // In this case it is an HTTP server
|
||||
* http.createServer((req, res) => {
|
||||
* res.writeHead(200);
|
||||
* res.end('hello world\n');
|
||||
* }).listen(8000);
|
||||
*
|
||||
* console.log(`Worker ${process.pid} started`);
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* Running Node.js will now share port 8000 between the workers:
|
||||
*
|
||||
* ```console
|
||||
* $ node server.js
|
||||
* Primary 3596 is running
|
||||
* Worker 4324 started
|
||||
* Worker 4520 started
|
||||
* Worker 6056 started
|
||||
* Worker 5644 started
|
||||
* ```
|
||||
*
|
||||
* On Windows, it is not yet possible to set up a named pipe server in a worker.
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/cluster.js)
|
||||
*/
|
||||
declare module "cluster" {
|
||||
import * as child from "node:child_process";
|
||||
import EventEmitter = require("node:events");
|
||||
import * as net from "node:net";
|
||||
type SerializationType = "json" | "advanced";
|
||||
export interface ClusterSettings {
|
||||
/**
|
||||
* List of string arguments passed to the Node.js executable.
|
||||
* @default process.execArgv
|
||||
*/
|
||||
execArgv?: string[] | undefined;
|
||||
/**
|
||||
* File path to worker file.
|
||||
* @default process.argv[1]
|
||||
*/
|
||||
exec?: string | undefined;
|
||||
/**
|
||||
* String arguments passed to worker.
|
||||
* @default process.argv.slice(2)
|
||||
*/
|
||||
args?: string[] | undefined;
|
||||
/**
|
||||
* Whether or not to send output to parent's stdio.
|
||||
* @default false
|
||||
*/
|
||||
silent?: boolean | undefined;
|
||||
/**
|
||||
* Configures the stdio of forked processes. Because the cluster module relies on IPC to function, this configuration must
|
||||
* contain an `'ipc'` entry. When this option is provided, it overrides `silent`. See [`child_prcess.spawn()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processspawncommand-args-options)'s
|
||||
* [`stdio`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#optionsstdio).
|
||||
*/
|
||||
stdio?: any[] | undefined;
|
||||
/**
|
||||
* Sets the user identity of the process. (See [`setuid(2)`](https://man7.org/linux/man-pages/man2/setuid.2.html).)
|
||||
*/
|
||||
uid?: number | undefined;
|
||||
/**
|
||||
* Sets the group identity of the process. (See [`setgid(2)`](https://man7.org/linux/man-pages/man2/setgid.2.html).)
|
||||
*/
|
||||
gid?: number | undefined;
|
||||
/**
|
||||
* Sets inspector port of worker. This can be a number, or a function that takes no arguments and returns a number.
|
||||
* By default each worker gets its own port, incremented from the primary's `process.debugPort`.
|
||||
*/
|
||||
inspectPort?: number | (() => number) | undefined;
|
||||
/**
|
||||
* Specify the kind of serialization used for sending messages between processes. Possible values are `'json'` and `'advanced'`.
|
||||
* See [Advanced serialization for `child_process`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#advanced-serialization) for more details.
|
||||
* @default false
|
||||
*/
|
||||
serialization?: SerializationType | undefined;
|
||||
/**
|
||||
* Current working directory of the worker process.
|
||||
* @default undefined (inherits from parent process)
|
||||
*/
|
||||
cwd?: string | undefined;
|
||||
/**
|
||||
* Hide the forked processes console window that would normally be created on Windows systems.
|
||||
* @default false
|
||||
*/
|
||||
windowsHide?: boolean | undefined;
|
||||
}
|
||||
export interface Address {
|
||||
address: string;
|
||||
port: number;
|
||||
/**
|
||||
* The `addressType` is one of:
|
||||
*
|
||||
* * `4` (TCPv4)
|
||||
* * `6` (TCPv6)
|
||||
* * `-1` (Unix domain socket)
|
||||
* * `'udp4'` or `'udp6'` (UDPv4 or UDPv6)
|
||||
*/
|
||||
addressType: 4 | 6 | -1 | "udp4" | "udp6";
|
||||
}
|
||||
/**
|
||||
* A `Worker` object contains all public information and method about a worker.
|
||||
* In the primary it can be obtained using `cluster.workers`. In a worker
|
||||
* it can be obtained using `cluster.worker`.
|
||||
* @since v0.7.0
|
||||
*/
|
||||
export class Worker extends EventEmitter {
|
||||
/**
|
||||
* Each new worker is given its own unique id, this id is stored in the `id`.
|
||||
*
|
||||
* While a worker is alive, this is the key that indexes it in `cluster.workers`.
|
||||
* @since v0.8.0
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* All workers are created using [`child_process.fork()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options), the returned object
|
||||
* from this function is stored as `.process`. In a worker, the global `process` is stored.
|
||||
*
|
||||
* See: [Child Process module](https://nodejs.org/docs/latest-v20.x/api/child_process.html#child_processforkmodulepath-args-options).
|
||||
*
|
||||
* Workers will call `process.exit(0)` if the `'disconnect'` event occurs
|
||||
* on `process` and `.exitedAfterDisconnect` is not `true`. This protects against
|
||||
* accidental disconnection.
|
||||
* @since v0.7.0
|
||||
*/
|
||||
process: child.ChildProcess;
|
||||
/**
|
||||
* Send a message to a worker or primary, optionally with a handle.
|
||||
*
|
||||
* In the primary, this sends a message to a specific worker. It is identical to [`ChildProcess.send()`](https://nodejs.org/docs/latest-v20.x/api/child_process.html#subprocesssendmessage-sendhandle-options-callback).
|
||||
*
|
||||
* In a worker, this sends a message to the primary. It is identical to `process.send()`.
|
||||
*
|
||||
* This example will echo back all messages from the primary:
|
||||
*
|
||||
* ```js
|
||||
* if (cluster.isPrimary) {
|
||||
* const worker = cluster.fork();
|
||||
* worker.send('hi there');
|
||||
*
|
||||
* } else if (cluster.isWorker) {
|
||||
* process.on('message', (msg) => {
|
||||
* process.send(msg);
|
||||
* });
|
||||
* }
|
||||
* ```
|
||||
* @since v0.7.0
|
||||
* @param options The `options` argument, if present, is an object used to parameterize the sending of certain types of handles.
|
||||
*/
|
||||
send(message: child.Serializable, callback?: (error: Error | null) => void): boolean;
|
||||
send(
|
||||
message: child.Serializable,
|
||||
sendHandle: child.SendHandle,
|
||||
callback?: (error: Error | null) => void,
|
||||
): boolean;
|
||||
send(
|
||||
message: child.Serializable,
|
||||
sendHandle: child.SendHandle,
|
||||
options?: child.MessageOptions,
|
||||
callback?: (error: Error | null) => void,
|
||||
): boolean;
|
||||
/**
|
||||
* This function will kill the worker. In the primary worker, it does this by
|
||||
* disconnecting the `worker.process`, and once disconnected, killing with `signal`. In the worker, it does it by killing the process with `signal`.
|
||||
*
|
||||
* The `kill()` function kills the worker process without waiting for a graceful
|
||||
* disconnect, it has the same behavior as `worker.process.kill()`.
|
||||
*
|
||||
* This method is aliased as `worker.destroy()` for backwards compatibility.
|
||||
*
|
||||
* In a worker, `process.kill()` exists, but it is not this function;
|
||||
* it is [`kill()`](https://nodejs.org/docs/latest-v20.x/api/process.html#processkillpid-signal).
|
||||
* @since v0.9.12
|
||||
* @param [signal='SIGTERM'] Name of the kill signal to send to the worker process.
|
||||
*/
|
||||
kill(signal?: string): void;
|
||||
destroy(signal?: string): void;
|
||||
/**
|
||||
* In a worker, this function will close all servers, wait for the `'close'` event
|
||||
* on those servers, and then disconnect the IPC channel.
|
||||
*
|
||||
* In the primary, an internal message is sent to the worker causing it to call `.disconnect()` on itself.
|
||||
*
|
||||
* Causes `.exitedAfterDisconnect` to be set.
|
||||
*
|
||||
* After a server is closed, it will no longer accept new connections,
|
||||
* but connections may be accepted by any other listening worker. Existing
|
||||
* connections will be allowed to close as usual. When no more connections exist,
|
||||
* see `server.close()`, the IPC channel to the worker will close allowing it
|
||||
* to die gracefully.
|
||||
*
|
||||
* The above applies _only_ to server connections, client connections are not
|
||||
* automatically closed by workers, and disconnect does not wait for them to close
|
||||
* before exiting.
|
||||
*
|
||||
* In a worker, `process.disconnect` exists, but it is not this function;
|
||||
* it is `disconnect()`.
|
||||
*
|
||||
* Because long living server connections may block workers from disconnecting, it
|
||||
* may be useful to send a message, so application specific actions may be taken to
|
||||
* close them. It also may be useful to implement a timeout, killing a worker if
|
||||
* the `'disconnect'` event has not been emitted after some time.
|
||||
*
|
||||
* ```js
|
||||
* import net from 'node:net';
|
||||
* if (cluster.isPrimary) {
|
||||
* const worker = cluster.fork();
|
||||
* let timeout;
|
||||
*
|
||||
* worker.on('listening', (address) => {
|
||||
* worker.send('shutdown');
|
||||
* worker.disconnect();
|
||||
* timeout = setTimeout(() => {
|
||||
* worker.kill();
|
||||
* }, 2000);
|
||||
* });
|
||||
*
|
||||
* worker.on('disconnect', () => {
|
||||
* clearTimeout(timeout);
|
||||
* });
|
||||
*
|
||||
* } else if (cluster.isWorker) {
|
||||
* const server = net.createServer((socket) => {
|
||||
* // Connections never end
|
||||
* });
|
||||
*
|
||||
* server.listen(8000);
|
||||
*
|
||||
* process.on('message', (msg) => {
|
||||
* if (msg === 'shutdown') {
|
||||
* // Initiate graceful close of any connections to server
|
||||
* }
|
||||
* });
|
||||
* }
|
||||
* ```
|
||||
* @since v0.7.7
|
||||
* @return A reference to `worker`.
|
||||
*/
|
||||
disconnect(): void;
|
||||
/**
|
||||
* This function returns `true` if the worker is connected to its primary via its
|
||||
* IPC channel, `false` otherwise. A worker is connected to its primary after it
|
||||
* has been created. It is disconnected after the `'disconnect'` event is emitted.
|
||||
* @since v0.11.14
|
||||
*/
|
||||
isConnected(): boolean;
|
||||
/**
|
||||
* This function returns `true` if the worker's process has terminated (either
|
||||
* because of exiting or being signaled). Otherwise, it returns `false`.
|
||||
*
|
||||
* ```js
|
||||
* import cluster from 'node:cluster';
|
||||
* import http from 'node:http';
|
||||
* import { availableParallelism } from 'node:os';
|
||||
* import process from 'node:process';
|
||||
*
|
||||
* const numCPUs = availableParallelism();
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* console.log(`Primary ${process.pid} is running`);
|
||||
*
|
||||
* // Fork workers.
|
||||
* for (let i = 0; i < numCPUs; i++) {
|
||||
* cluster.fork();
|
||||
* }
|
||||
*
|
||||
* cluster.on('fork', (worker) => {
|
||||
* console.log('worker is dead:', worker.isDead());
|
||||
* });
|
||||
*
|
||||
* cluster.on('exit', (worker, code, signal) => {
|
||||
* console.log('worker is dead:', worker.isDead());
|
||||
* });
|
||||
* } else {
|
||||
* // Workers can share any TCP connection. In this case, it is an HTTP server.
|
||||
* http.createServer((req, res) => {
|
||||
* res.writeHead(200);
|
||||
* res.end(`Current process\n ${process.pid}`);
|
||||
* process.kill(process.pid);
|
||||
* }).listen(8000);
|
||||
* }
|
||||
* ```
|
||||
* @since v0.11.14
|
||||
*/
|
||||
isDead(): boolean;
|
||||
/**
|
||||
* This property is `true` if the worker exited due to `.disconnect()`.
|
||||
* If the worker exited any other way, it is `false`. If the
|
||||
* worker has not exited, it is `undefined`.
|
||||
*
|
||||
* The boolean `worker.exitedAfterDisconnect` allows distinguishing between
|
||||
* voluntary and accidental exit, the primary may choose not to respawn a worker
|
||||
* based on this value.
|
||||
*
|
||||
* ```js
|
||||
* cluster.on('exit', (worker, code, signal) => {
|
||||
* if (worker.exitedAfterDisconnect === true) {
|
||||
* console.log('Oh, it was just voluntary – no need to worry');
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* // kill worker
|
||||
* worker.kill();
|
||||
* ```
|
||||
* @since v6.0.0
|
||||
*/
|
||||
exitedAfterDisconnect: boolean;
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. disconnect
|
||||
* 2. error
|
||||
* 3. exit
|
||||
* 4. listening
|
||||
* 5. message
|
||||
* 6. online
|
||||
*/
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "disconnect", listener: () => void): this;
|
||||
addListener(event: "error", listener: (error: Error) => void): this;
|
||||
addListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
addListener(event: "listening", listener: (address: Address) => void): this;
|
||||
addListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
addListener(event: "online", listener: () => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "disconnect"): boolean;
|
||||
emit(event: "error", error: Error): boolean;
|
||||
emit(event: "exit", code: number, signal: string): boolean;
|
||||
emit(event: "listening", address: Address): boolean;
|
||||
emit(event: "message", message: any, handle: net.Socket | net.Server): boolean;
|
||||
emit(event: "online"): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "disconnect", listener: () => void): this;
|
||||
on(event: "error", listener: (error: Error) => void): this;
|
||||
on(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
on(event: "listening", listener: (address: Address) => void): this;
|
||||
on(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
on(event: "online", listener: () => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "disconnect", listener: () => void): this;
|
||||
once(event: "error", listener: (error: Error) => void): this;
|
||||
once(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
once(event: "listening", listener: (address: Address) => void): this;
|
||||
once(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
once(event: "online", listener: () => void): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "disconnect", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (error: Error) => void): this;
|
||||
prependListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
prependListener(event: "listening", listener: (address: Address) => void): this;
|
||||
prependListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependListener(event: "online", listener: () => void): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "disconnect", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (error: Error) => void): this;
|
||||
prependOnceListener(event: "exit", listener: (code: number, signal: string) => void): this;
|
||||
prependOnceListener(event: "listening", listener: (address: Address) => void): this;
|
||||
prependOnceListener(event: "message", listener: (message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependOnceListener(event: "online", listener: () => void): this;
|
||||
}
|
||||
export interface Cluster extends EventEmitter {
|
||||
disconnect(callback?: () => void): void;
|
||||
/**
|
||||
* Spawn a new worker process.
|
||||
*
|
||||
* This can only be called from the primary process.
|
||||
* @param env Key/value pairs to add to worker process environment.
|
||||
* @since v0.6.0
|
||||
*/
|
||||
fork(env?: any): Worker;
|
||||
/** @deprecated since v16.0.0 - use isPrimary. */
|
||||
readonly isMaster: boolean;
|
||||
/**
|
||||
* True if the process is a primary. This is determined by the `process.env.NODE_UNIQUE_ID`. If `process.env.NODE_UNIQUE_ID`
|
||||
* is undefined, then `isPrimary` is `true`.
|
||||
* @since v16.0.0
|
||||
*/
|
||||
readonly isPrimary: boolean;
|
||||
/**
|
||||
* True if the process is not a primary (it is the negation of `cluster.isPrimary`).
|
||||
* @since v0.6.0
|
||||
*/
|
||||
readonly isWorker: boolean;
|
||||
/**
|
||||
* The scheduling policy, either `cluster.SCHED_RR` for round-robin or `cluster.SCHED_NONE` to leave it to the operating system. This is a
|
||||
* global setting and effectively frozen once either the first worker is spawned, or [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings)
|
||||
* is called, whichever comes first.
|
||||
*
|
||||
* `SCHED_RR` is the default on all operating systems except Windows. Windows will change to `SCHED_RR` once libuv is able to effectively distribute
|
||||
* IOCP handles without incurring a large performance hit.
|
||||
*
|
||||
* `cluster.schedulingPolicy` can also be set through the `NODE_CLUSTER_SCHED_POLICY` environment variable. Valid values are `'rr'` and `'none'`.
|
||||
* @since v0.11.2
|
||||
*/
|
||||
schedulingPolicy: number;
|
||||
/**
|
||||
* After calling [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings)
|
||||
* (or [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv)) this settings object will contain
|
||||
* the settings, including the default values.
|
||||
*
|
||||
* This object is not intended to be changed or set manually.
|
||||
* @since v0.7.1
|
||||
*/
|
||||
readonly settings: ClusterSettings;
|
||||
/** @deprecated since v16.0.0 - use [`.setupPrimary()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clustersetupprimarysettings) instead. */
|
||||
setupMaster(settings?: ClusterSettings): void;
|
||||
/**
|
||||
* `setupPrimary` is used to change the default 'fork' behavior. Once called, the settings will be present in `cluster.settings`.
|
||||
*
|
||||
* Any settings changes only affect future calls to [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv)
|
||||
* and have no effect on workers that are already running.
|
||||
*
|
||||
* The only attribute of a worker that cannot be set via `.setupPrimary()` is the `env` passed to
|
||||
* [`.fork()`](https://nodejs.org/docs/latest-v20.x/api/cluster.html#clusterforkenv).
|
||||
*
|
||||
* The defaults above apply to the first call only; the defaults for later calls are the current values at the time of
|
||||
* `cluster.setupPrimary()` is called.
|
||||
*
|
||||
* ```js
|
||||
* import cluster from 'node:cluster';
|
||||
*
|
||||
* cluster.setupPrimary({
|
||||
* exec: 'worker.js',
|
||||
* args: ['--use', 'https'],
|
||||
* silent: true,
|
||||
* });
|
||||
* cluster.fork(); // https worker
|
||||
* cluster.setupPrimary({
|
||||
* exec: 'worker.js',
|
||||
* args: ['--use', 'http'],
|
||||
* });
|
||||
* cluster.fork(); // http worker
|
||||
* ```
|
||||
*
|
||||
* This can only be called from the primary process.
|
||||
* @since v16.0.0
|
||||
*/
|
||||
setupPrimary(settings?: ClusterSettings): void;
|
||||
/**
|
||||
* A reference to the current worker object. Not available in the primary process.
|
||||
*
|
||||
* ```js
|
||||
* import cluster from 'node:cluster';
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* console.log('I am primary');
|
||||
* cluster.fork();
|
||||
* cluster.fork();
|
||||
* } else if (cluster.isWorker) {
|
||||
* console.log(`I am worker #${cluster.worker.id}`);
|
||||
* }
|
||||
* ```
|
||||
* @since v0.7.0
|
||||
*/
|
||||
readonly worker?: Worker | undefined;
|
||||
/**
|
||||
* A hash that stores the active worker objects, keyed by `id` field. This makes it easy to loop through all the workers. It is only available in the primary process.
|
||||
*
|
||||
* A worker is removed from `cluster.workers` after the worker has disconnected _and_ exited. The order between these two events cannot be determined in advance. However, it
|
||||
* is guaranteed that the removal from the `cluster.workers` list happens before the last `'disconnect'` or `'exit'` event is emitted.
|
||||
*
|
||||
* ```js
|
||||
* import cluster from 'node:cluster';
|
||||
*
|
||||
* for (const worker of Object.values(cluster.workers)) {
|
||||
* worker.send('big announcement to all workers');
|
||||
* }
|
||||
* ```
|
||||
* @since v0.7.0
|
||||
*/
|
||||
readonly workers?: NodeJS.Dict<Worker> | undefined;
|
||||
readonly SCHED_NONE: number;
|
||||
readonly SCHED_RR: number;
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. disconnect
|
||||
* 2. exit
|
||||
* 3. fork
|
||||
* 4. listening
|
||||
* 5. message
|
||||
* 6. online
|
||||
* 7. setup
|
||||
*/
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
addListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
addListener(event: "fork", listener: (worker: Worker) => void): this;
|
||||
addListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
addListener(
|
||||
event: "message",
|
||||
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
||||
): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
addListener(event: "online", listener: (worker: Worker) => void): this;
|
||||
addListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "disconnect", worker: Worker): boolean;
|
||||
emit(event: "exit", worker: Worker, code: number, signal: string): boolean;
|
||||
emit(event: "fork", worker: Worker): boolean;
|
||||
emit(event: "listening", worker: Worker, address: Address): boolean;
|
||||
emit(event: "message", worker: Worker, message: any, handle: net.Socket | net.Server): boolean;
|
||||
emit(event: "online", worker: Worker): boolean;
|
||||
emit(event: "setup", settings: ClusterSettings): boolean;
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
on(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
on(event: "fork", listener: (worker: Worker) => void): this;
|
||||
on(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
on(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
on(event: "online", listener: (worker: Worker) => void): this;
|
||||
on(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
once(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
once(event: "fork", listener: (worker: Worker) => void): this;
|
||||
once(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
once(event: "message", listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void): this; // the handle is a net.Socket or net.Server object, or undefined.
|
||||
once(event: "online", listener: (worker: Worker) => void): this;
|
||||
once(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
prependListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
prependListener(event: "fork", listener: (worker: Worker) => void): this;
|
||||
prependListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
// the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependListener(
|
||||
event: "message",
|
||||
listener: (worker: Worker, message: any, handle?: net.Socket | net.Server) => void,
|
||||
): this;
|
||||
prependListener(event: "online", listener: (worker: Worker) => void): this;
|
||||
prependListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "disconnect", listener: (worker: Worker) => void): this;
|
||||
prependOnceListener(event: "exit", listener: (worker: Worker, code: number, signal: string) => void): this;
|
||||
prependOnceListener(event: "fork", listener: (worker: Worker) => void): this;
|
||||
prependOnceListener(event: "listening", listener: (worker: Worker, address: Address) => void): this;
|
||||
// the handle is a net.Socket or net.Server object, or undefined.
|
||||
prependOnceListener(
|
||||
event: "message",
|
||||
listener: (worker: Worker, message: any, handle: net.Socket | net.Server) => void,
|
||||
): this;
|
||||
prependOnceListener(event: "online", listener: (worker: Worker) => void): this;
|
||||
prependOnceListener(event: "setup", listener: (settings: ClusterSettings) => void): this;
|
||||
}
|
||||
const cluster: Cluster;
|
||||
export default cluster;
|
||||
}
|
||||
declare module "node:cluster" {
|
||||
export * from "cluster";
|
||||
export { default as default } from "cluster";
|
||||
}
|
||||
452
node_modules/@types/node/console.d.ts
generated
vendored
Normal file
452
node_modules/@types/node/console.d.ts
generated
vendored
Normal file
@ -0,0 +1,452 @@
|
||||
/**
|
||||
* The `node:console` module provides a simple debugging console that is similar to
|
||||
* the JavaScript console mechanism provided by web browsers.
|
||||
*
|
||||
* The module exports two specific components:
|
||||
*
|
||||
* * A `Console` class with methods such as `console.log()`, `console.error()`, and `console.warn()` that can be used to write to any Node.js stream.
|
||||
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and
|
||||
* [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
|
||||
*
|
||||
* _**Warning**_: The global console object's methods are neither consistently
|
||||
* synchronous like the browser APIs they resemble, nor are they consistently
|
||||
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v20.x/api/process.html#a-note-on-process-io) for
|
||||
* more information.
|
||||
*
|
||||
* Example using the global `console`:
|
||||
*
|
||||
* ```js
|
||||
* console.log('hello world');
|
||||
* // Prints: hello world, to stdout
|
||||
* console.log('hello %s', 'world');
|
||||
* // Prints: hello world, to stdout
|
||||
* console.error(new Error('Whoops, something bad happened'));
|
||||
* // Prints error message and stack trace to stderr:
|
||||
* // Error: Whoops, something bad happened
|
||||
* // at [eval]:5:15
|
||||
* // at Script.runInThisContext (node:vm:132:18)
|
||||
* // at Object.runInThisContext (node:vm:309:38)
|
||||
* // at node:internal/process/execution:77:19
|
||||
* // at [eval]-wrapper:6:22
|
||||
* // at evalScript (node:internal/process/execution:76:60)
|
||||
* // at node:internal/main/eval_string:23:3
|
||||
*
|
||||
* const name = 'Will Robinson';
|
||||
* console.warn(`Danger ${name}! Danger!`);
|
||||
* // Prints: Danger Will Robinson! Danger!, to stderr
|
||||
* ```
|
||||
*
|
||||
* Example using the `Console` class:
|
||||
*
|
||||
* ```js
|
||||
* const out = getStreamSomehow();
|
||||
* const err = getStreamSomehow();
|
||||
* const myConsole = new console.Console(out, err);
|
||||
*
|
||||
* myConsole.log('hello world');
|
||||
* // Prints: hello world, to out
|
||||
* myConsole.log('hello %s', 'world');
|
||||
* // Prints: hello world, to out
|
||||
* myConsole.error(new Error('Whoops, something bad happened'));
|
||||
* // Prints: [Error: Whoops, something bad happened], to err
|
||||
*
|
||||
* const name = 'Will Robinson';
|
||||
* myConsole.warn(`Danger ${name}! Danger!`);
|
||||
* // Prints: Danger Will Robinson! Danger!, to err
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/console.js)
|
||||
*/
|
||||
declare module "console" {
|
||||
import console = require("node:console");
|
||||
export = console;
|
||||
}
|
||||
declare module "node:console" {
|
||||
import { InspectOptions } from "node:util";
|
||||
global {
|
||||
// This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
|
||||
interface Console {
|
||||
Console: console.ConsoleConstructor;
|
||||
/**
|
||||
* `console.assert()` writes a message if `value` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) or omitted. It only
|
||||
* writes a message and does not otherwise affect execution. The output always
|
||||
* starts with `"Assertion failed"`. If provided, `message` is formatted using
|
||||
* [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args).
|
||||
*
|
||||
* If `value` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), nothing happens.
|
||||
*
|
||||
* ```js
|
||||
* console.assert(true, 'does nothing');
|
||||
*
|
||||
* console.assert(false, 'Whoops %s work', 'didn\'t');
|
||||
* // Assertion failed: Whoops didn't work
|
||||
*
|
||||
* console.assert();
|
||||
* // Assertion failed
|
||||
* ```
|
||||
* @since v0.1.101
|
||||
* @param value The value tested for being truthy.
|
||||
* @param message All arguments besides `value` are used as error message.
|
||||
*/
|
||||
assert(value: any, message?: string, ...optionalParams: any[]): void;
|
||||
/**
|
||||
* When `stdout` is a TTY, calling `console.clear()` will attempt to clear the
|
||||
* TTY. When `stdout` is not a TTY, this method does nothing.
|
||||
*
|
||||
* The specific operation of `console.clear()` can vary across operating systems
|
||||
* and terminal types. For most Linux operating systems, `console.clear()` operates similarly to the `clear` shell command. On Windows, `console.clear()` will clear only the output in the
|
||||
* current terminal viewport for the Node.js
|
||||
* binary.
|
||||
* @since v8.3.0
|
||||
*/
|
||||
clear(): void;
|
||||
/**
|
||||
* Maintains an internal counter specific to `label` and outputs to `stdout` the
|
||||
* number of times `console.count()` has been called with the given `label`.
|
||||
*
|
||||
* ```js
|
||||
* > console.count()
|
||||
* default: 1
|
||||
* undefined
|
||||
* > console.count('default')
|
||||
* default: 2
|
||||
* undefined
|
||||
* > console.count('abc')
|
||||
* abc: 1
|
||||
* undefined
|
||||
* > console.count('xyz')
|
||||
* xyz: 1
|
||||
* undefined
|
||||
* > console.count('abc')
|
||||
* abc: 2
|
||||
* undefined
|
||||
* > console.count()
|
||||
* default: 3
|
||||
* undefined
|
||||
* >
|
||||
* ```
|
||||
* @since v8.3.0
|
||||
* @param [label='default'] The display label for the counter.
|
||||
*/
|
||||
count(label?: string): void;
|
||||
/**
|
||||
* Resets the internal counter specific to `label`.
|
||||
*
|
||||
* ```js
|
||||
* > console.count('abc');
|
||||
* abc: 1
|
||||
* undefined
|
||||
* > console.countReset('abc');
|
||||
* undefined
|
||||
* > console.count('abc');
|
||||
* abc: 1
|
||||
* undefined
|
||||
* >
|
||||
* ```
|
||||
* @since v8.3.0
|
||||
* @param [label='default'] The display label for the counter.
|
||||
*/
|
||||
countReset(label?: string): void;
|
||||
/**
|
||||
* The `console.debug()` function is an alias for {@link log}.
|
||||
* @since v8.0.0
|
||||
*/
|
||||
debug(message?: any, ...optionalParams: any[]): void;
|
||||
/**
|
||||
* Uses [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options) on `obj` and prints the resulting string to `stdout`.
|
||||
* This function bypasses any custom `inspect()` function defined on `obj`.
|
||||
* @since v0.1.101
|
||||
*/
|
||||
dir(obj: any, options?: InspectOptions): void;
|
||||
/**
|
||||
* This method calls `console.log()` passing it the arguments received.
|
||||
* This method does not produce any XML formatting.
|
||||
* @since v8.0.0
|
||||
*/
|
||||
dirxml(...data: any[]): void;
|
||||
/**
|
||||
* Prints to `stderr` with newline. Multiple arguments can be passed, with the
|
||||
* first used as the primary message and all additional used as substitution
|
||||
* values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html)
|
||||
* (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)).
|
||||
*
|
||||
* ```js
|
||||
* const code = 5;
|
||||
* console.error('error #%d', code);
|
||||
* // Prints: error #5, to stderr
|
||||
* console.error('error', code);
|
||||
* // Prints: error 5, to stderr
|
||||
* ```
|
||||
*
|
||||
* If formatting elements (e.g. `%d`) are not found in the first string then
|
||||
* [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options) is called on each argument and the
|
||||
* resulting string values are concatenated. See [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)
|
||||
* for more information.
|
||||
* @since v0.1.100
|
||||
*/
|
||||
error(message?: any, ...optionalParams: any[]): void;
|
||||
/**
|
||||
* Increases indentation of subsequent lines by spaces for `groupIndentation` length.
|
||||
*
|
||||
* If one or more `label`s are provided, those are printed first without the
|
||||
* additional indentation.
|
||||
* @since v8.5.0
|
||||
*/
|
||||
group(...label: any[]): void;
|
||||
/**
|
||||
* An alias for {@link group}.
|
||||
* @since v8.5.0
|
||||
*/
|
||||
groupCollapsed(...label: any[]): void;
|
||||
/**
|
||||
* Decreases indentation of subsequent lines by spaces for `groupIndentation` length.
|
||||
* @since v8.5.0
|
||||
*/
|
||||
groupEnd(): void;
|
||||
/**
|
||||
* The `console.info()` function is an alias for {@link log}.
|
||||
* @since v0.1.100
|
||||
*/
|
||||
info(message?: any, ...optionalParams: any[]): void;
|
||||
/**
|
||||
* Prints to `stdout` with newline. Multiple arguments can be passed, with the
|
||||
* first used as the primary message and all additional used as substitution
|
||||
* values similar to [`printf(3)`](http://man7.org/linux/man-pages/man3/printf.3.html)
|
||||
* (the arguments are all passed to [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)).
|
||||
*
|
||||
* ```js
|
||||
* const count = 5;
|
||||
* console.log('count: %d', count);
|
||||
* // Prints: count: 5, to stdout
|
||||
* console.log('count:', count);
|
||||
* // Prints: count: 5, to stdout
|
||||
* ```
|
||||
*
|
||||
* See [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args) for more information.
|
||||
* @since v0.1.100
|
||||
*/
|
||||
log(message?: any, ...optionalParams: any[]): void;
|
||||
/**
|
||||
* Try to construct a table with the columns of the properties of `tabularData` (or use `properties`) and rows of `tabularData` and log it. Falls back to just
|
||||
* logging the argument if it can't be parsed as tabular.
|
||||
*
|
||||
* ```js
|
||||
* // These can't be parsed as tabular data
|
||||
* console.table(Symbol());
|
||||
* // Symbol()
|
||||
*
|
||||
* console.table(undefined);
|
||||
* // undefined
|
||||
*
|
||||
* console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }]);
|
||||
* // ┌─────────┬─────┬─────┐
|
||||
* // │ (index) │ a │ b │
|
||||
* // ├─────────┼─────┼─────┤
|
||||
* // │ 0 │ 1 │ 'Y' │
|
||||
* // │ 1 │ 'Z' │ 2 │
|
||||
* // └─────────┴─────┴─────┘
|
||||
*
|
||||
* console.table([{ a: 1, b: 'Y' }, { a: 'Z', b: 2 }], ['a']);
|
||||
* // ┌─────────┬─────┐
|
||||
* // │ (index) │ a │
|
||||
* // ├─────────┼─────┤
|
||||
* // │ 0 │ 1 │
|
||||
* // │ 1 │ 'Z' │
|
||||
* // └─────────┴─────┘
|
||||
* ```
|
||||
* @since v10.0.0
|
||||
* @param properties Alternate properties for constructing the table.
|
||||
*/
|
||||
table(tabularData: any, properties?: readonly string[]): void;
|
||||
/**
|
||||
* Starts a timer that can be used to compute the duration of an operation. Timers
|
||||
* are identified by a unique `label`. Use the same `label` when calling {@link timeEnd} to stop the timer and output the elapsed time in
|
||||
* suitable time units to `stdout`. For example, if the elapsed
|
||||
* time is 3869ms, `console.timeEnd()` displays "3.869s".
|
||||
* @since v0.1.104
|
||||
* @param [label='default']
|
||||
*/
|
||||
time(label?: string): void;
|
||||
/**
|
||||
* Stops a timer that was previously started by calling {@link time} and
|
||||
* prints the result to `stdout`:
|
||||
*
|
||||
* ```js
|
||||
* console.time('bunch-of-stuff');
|
||||
* // Do a bunch of stuff.
|
||||
* console.timeEnd('bunch-of-stuff');
|
||||
* // Prints: bunch-of-stuff: 225.438ms
|
||||
* ```
|
||||
* @since v0.1.104
|
||||
* @param [label='default']
|
||||
*/
|
||||
timeEnd(label?: string): void;
|
||||
/**
|
||||
* For a timer that was previously started by calling {@link time}, prints
|
||||
* the elapsed time and other `data` arguments to `stdout`:
|
||||
*
|
||||
* ```js
|
||||
* console.time('process');
|
||||
* const value = expensiveProcess1(); // Returns 42
|
||||
* console.timeLog('process', value);
|
||||
* // Prints "process: 365.227ms 42".
|
||||
* doExpensiveProcess2(value);
|
||||
* console.timeEnd('process');
|
||||
* ```
|
||||
* @since v10.7.0
|
||||
* @param [label='default']
|
||||
*/
|
||||
timeLog(label?: string, ...data: any[]): void;
|
||||
/**
|
||||
* Prints to `stderr` the string `'Trace: '`, followed by the [`util.format()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilformatformat-args)
|
||||
* formatted message and stack trace to the current position in the code.
|
||||
*
|
||||
* ```js
|
||||
* console.trace('Show me');
|
||||
* // Prints: (stack trace will vary based on where trace is called)
|
||||
* // Trace: Show me
|
||||
* // at repl:2:9
|
||||
* // at REPLServer.defaultEval (repl.js:248:27)
|
||||
* // at bound (domain.js:287:14)
|
||||
* // at REPLServer.runBound [as eval] (domain.js:300:12)
|
||||
* // at REPLServer.<anonymous> (repl.js:412:12)
|
||||
* // at emitOne (events.js:82:20)
|
||||
* // at REPLServer.emit (events.js:169:7)
|
||||
* // at REPLServer.Interface._onLine (readline.js:210:10)
|
||||
* // at REPLServer.Interface._line (readline.js:549:8)
|
||||
* // at REPLServer.Interface._ttyWrite (readline.js:826:14)
|
||||
* ```
|
||||
* @since v0.1.104
|
||||
*/
|
||||
trace(message?: any, ...optionalParams: any[]): void;
|
||||
/**
|
||||
* The `console.warn()` function is an alias for {@link error}.
|
||||
* @since v0.1.100
|
||||
*/
|
||||
warn(message?: any, ...optionalParams: any[]): void;
|
||||
// --- Inspector mode only ---
|
||||
/**
|
||||
* This method does not display anything unless used in the inspector. The `console.profile()`
|
||||
* method starts a JavaScript CPU profile with an optional label until {@link profileEnd}
|
||||
* is called. The profile is then added to the Profile panel of the inspector.
|
||||
*
|
||||
* ```js
|
||||
* console.profile('MyLabel');
|
||||
* // Some code
|
||||
* console.profileEnd('MyLabel');
|
||||
* // Adds the profile 'MyLabel' to the Profiles panel of the inspector.
|
||||
* ```
|
||||
* @since v8.0.0
|
||||
*/
|
||||
profile(label?: string): void;
|
||||
/**
|
||||
* This method does not display anything unless used in the inspector. Stops the current
|
||||
* JavaScript CPU profiling session if one has been started and prints the report to the
|
||||
* Profiles panel of the inspector. See {@link profile} for an example.
|
||||
*
|
||||
* If this method is called without a label, the most recently started profile is stopped.
|
||||
* @since v8.0.0
|
||||
*/
|
||||
profileEnd(label?: string): void;
|
||||
/**
|
||||
* This method does not display anything unless used in the inspector. The `console.timeStamp()`
|
||||
* method adds an event with the label `'label'` to the Timeline panel of the inspector.
|
||||
* @since v8.0.0
|
||||
*/
|
||||
timeStamp(label?: string): void;
|
||||
}
|
||||
/**
|
||||
* The `console` module provides a simple debugging console that is similar to the
|
||||
* JavaScript console mechanism provided by web browsers.
|
||||
*
|
||||
* The module exports two specific components:
|
||||
*
|
||||
* * A `Console` class with methods such as `console.log()`, `console.error()` and `console.warn()` that can be used to write to any Node.js stream.
|
||||
* * A global `console` instance configured to write to [`process.stdout`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstdout) and
|
||||
* [`process.stderr`](https://nodejs.org/docs/latest-v20.x/api/process.html#processstderr). The global `console` can be used without importing the `node:console` module.
|
||||
*
|
||||
* _**Warning**_: The global console object's methods are neither consistently
|
||||
* synchronous like the browser APIs they resemble, nor are they consistently
|
||||
* asynchronous like all other Node.js streams. See the [`note on process I/O`](https://nodejs.org/docs/latest-v20.x/api/process.html#a-note-on-process-io) for
|
||||
* more information.
|
||||
*
|
||||
* Example using the global `console`:
|
||||
*
|
||||
* ```js
|
||||
* console.log('hello world');
|
||||
* // Prints: hello world, to stdout
|
||||
* console.log('hello %s', 'world');
|
||||
* // Prints: hello world, to stdout
|
||||
* console.error(new Error('Whoops, something bad happened'));
|
||||
* // Prints error message and stack trace to stderr:
|
||||
* // Error: Whoops, something bad happened
|
||||
* // at [eval]:5:15
|
||||
* // at Script.runInThisContext (node:vm:132:18)
|
||||
* // at Object.runInThisContext (node:vm:309:38)
|
||||
* // at node:internal/process/execution:77:19
|
||||
* // at [eval]-wrapper:6:22
|
||||
* // at evalScript (node:internal/process/execution:76:60)
|
||||
* // at node:internal/main/eval_string:23:3
|
||||
*
|
||||
* const name = 'Will Robinson';
|
||||
* console.warn(`Danger ${name}! Danger!`);
|
||||
* // Prints: Danger Will Robinson! Danger!, to stderr
|
||||
* ```
|
||||
*
|
||||
* Example using the `Console` class:
|
||||
*
|
||||
* ```js
|
||||
* const out = getStreamSomehow();
|
||||
* const err = getStreamSomehow();
|
||||
* const myConsole = new console.Console(out, err);
|
||||
*
|
||||
* myConsole.log('hello world');
|
||||
* // Prints: hello world, to out
|
||||
* myConsole.log('hello %s', 'world');
|
||||
* // Prints: hello world, to out
|
||||
* myConsole.error(new Error('Whoops, something bad happened'));
|
||||
* // Prints: [Error: Whoops, something bad happened], to err
|
||||
*
|
||||
* const name = 'Will Robinson';
|
||||
* myConsole.warn(`Danger ${name}! Danger!`);
|
||||
* // Prints: Danger Will Robinson! Danger!, to err
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.11.1/lib/console.js)
|
||||
*/
|
||||
namespace console {
|
||||
interface ConsoleConstructorOptions {
|
||||
stdout: NodeJS.WritableStream;
|
||||
stderr?: NodeJS.WritableStream | undefined;
|
||||
/**
|
||||
* Ignore errors when writing to the underlying streams.
|
||||
* @default true
|
||||
*/
|
||||
ignoreErrors?: boolean | undefined;
|
||||
/**
|
||||
* Set color support for this `Console` instance. Setting to true enables coloring while inspecting
|
||||
* values. Setting to `false` disables coloring while inspecting values. Setting to `'auto'` makes color
|
||||
* support depend on the value of the `isTTY` property and the value returned by `getColorDepth()` on the
|
||||
* respective stream. This option can not be used, if `inspectOptions.colors` is set as well.
|
||||
* @default auto
|
||||
*/
|
||||
colorMode?: boolean | "auto" | undefined;
|
||||
/**
|
||||
* Specifies options that are passed along to
|
||||
* [`util.inspect()`](https://nodejs.org/docs/latest-v20.x/api/util.html#utilinspectobject-options).
|
||||
*/
|
||||
inspectOptions?: InspectOptions | undefined;
|
||||
/**
|
||||
* Set group indentation.
|
||||
* @default 2
|
||||
*/
|
||||
groupIndentation?: number | undefined;
|
||||
}
|
||||
interface ConsoleConstructor {
|
||||
prototype: Console;
|
||||
new(stdout: NodeJS.WritableStream, stderr?: NodeJS.WritableStream, ignoreErrors?: boolean): Console;
|
||||
new(options: ConsoleConstructorOptions): Console;
|
||||
}
|
||||
}
|
||||
var console: Console;
|
||||
}
|
||||
export = globalThis.console;
|
||||
}
|
||||
19
node_modules/@types/node/constants.d.ts
generated
vendored
Normal file
19
node_modules/@types/node/constants.d.ts
generated
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
|
||||
declare module "constants" {
|
||||
import { constants as osConstants, SignalConstants } from "node:os";
|
||||
import { constants as cryptoConstants } from "node:crypto";
|
||||
import { constants as fsConstants } from "node:fs";
|
||||
|
||||
const exp:
|
||||
& typeof osConstants.errno
|
||||
& typeof osConstants.priority
|
||||
& SignalConstants
|
||||
& typeof cryptoConstants
|
||||
& typeof fsConstants;
|
||||
export = exp;
|
||||
}
|
||||
|
||||
declare module "node:constants" {
|
||||
import constants = require("constants");
|
||||
export = constants;
|
||||
}
|
||||
4524
node_modules/@types/node/crypto.d.ts
generated
vendored
Normal file
4524
node_modules/@types/node/crypto.d.ts
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
596
node_modules/@types/node/dgram.d.ts
generated
vendored
Normal file
596
node_modules/@types/node/dgram.d.ts
generated
vendored
Normal file
@ -0,0 +1,596 @@
|
||||
/**
|
||||
* The `node:dgram` module provides an implementation of UDP datagram sockets.
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'node:dgram';
|
||||
*
|
||||
* const server = dgram.createSocket('udp4');
|
||||
*
|
||||
* server.on('error', (err) => {
|
||||
* console.error(`server error:\n${err.stack}`);
|
||||
* server.close();
|
||||
* });
|
||||
*
|
||||
* server.on('message', (msg, rinfo) => {
|
||||
* console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
|
||||
* });
|
||||
*
|
||||
* server.on('listening', () => {
|
||||
* const address = server.address();
|
||||
* console.log(`server listening ${address.address}:${address.port}`);
|
||||
* });
|
||||
*
|
||||
* server.bind(41234);
|
||||
* // Prints: server listening 0.0.0.0:41234
|
||||
* ```
|
||||
* @see [source](https://github.com/nodejs/node/blob/v20.13.1/lib/dgram.js)
|
||||
*/
|
||||
declare module "dgram" {
|
||||
import { AddressInfo } from "node:net";
|
||||
import * as dns from "node:dns";
|
||||
import { Abortable, EventEmitter } from "node:events";
|
||||
interface RemoteInfo {
|
||||
address: string;
|
||||
family: "IPv4" | "IPv6";
|
||||
port: number;
|
||||
size: number;
|
||||
}
|
||||
interface BindOptions {
|
||||
port?: number | undefined;
|
||||
address?: string | undefined;
|
||||
exclusive?: boolean | undefined;
|
||||
fd?: number | undefined;
|
||||
}
|
||||
type SocketType = "udp4" | "udp6";
|
||||
interface SocketOptions extends Abortable {
|
||||
type: SocketType;
|
||||
reuseAddr?: boolean | undefined;
|
||||
/**
|
||||
* @default false
|
||||
*/
|
||||
ipv6Only?: boolean | undefined;
|
||||
recvBufferSize?: number | undefined;
|
||||
sendBufferSize?: number | undefined;
|
||||
lookup?:
|
||||
| ((
|
||||
hostname: string,
|
||||
options: dns.LookupOneOptions,
|
||||
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
||||
) => void)
|
||||
| undefined;
|
||||
}
|
||||
/**
|
||||
* Creates a `dgram.Socket` object. Once the socket is created, calling `socket.bind()` will instruct the socket to begin listening for datagram
|
||||
* messages. When `address` and `port` are not passed to `socket.bind()` the
|
||||
* method will bind the socket to the "all interfaces" address on a random port
|
||||
* (it does the right thing for both `udp4` and `udp6` sockets). The bound address
|
||||
* and port can be retrieved using `socket.address().address` and `socket.address().port`.
|
||||
*
|
||||
* If the `signal` option is enabled, calling `.abort()` on the corresponding `AbortController` is similar to calling `.close()` on the socket:
|
||||
*
|
||||
* ```js
|
||||
* const controller = new AbortController();
|
||||
* const { signal } = controller;
|
||||
* const server = dgram.createSocket({ type: 'udp4', signal });
|
||||
* server.on('message', (msg, rinfo) => {
|
||||
* console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
|
||||
* });
|
||||
* // Later, when you want to close the server.
|
||||
* controller.abort();
|
||||
* ```
|
||||
* @since v0.11.13
|
||||
* @param options Available options are:
|
||||
* @param callback Attached as a listener for `'message'` events. Optional.
|
||||
*/
|
||||
function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
/**
|
||||
* Encapsulates the datagram functionality.
|
||||
*
|
||||
* New instances of `dgram.Socket` are created using {@link createSocket}.
|
||||
* The `new` keyword is not to be used to create `dgram.Socket` instances.
|
||||
* @since v0.1.99
|
||||
*/
|
||||
class Socket extends EventEmitter {
|
||||
/**
|
||||
* Tells the kernel to join a multicast group at the given `multicastAddress` and `multicastInterface` using the `IP_ADD_MEMBERSHIP` socket option. If the `multicastInterface` argument is not
|
||||
* specified, the operating system will choose
|
||||
* one interface and will add membership to it. To add membership to every
|
||||
* available interface, call `addMembership` multiple times, once per interface.
|
||||
*
|
||||
* When called on an unbound socket, this method will implicitly bind to a random
|
||||
* port, listening on all interfaces.
|
||||
*
|
||||
* When sharing a UDP socket across multiple `cluster` workers, the`socket.addMembership()` function must be called only once or an`EADDRINUSE` error will occur:
|
||||
*
|
||||
* ```js
|
||||
* import cluster from 'node:cluster';
|
||||
* import dgram from 'node:dgram';
|
||||
*
|
||||
* if (cluster.isPrimary) {
|
||||
* cluster.fork(); // Works ok.
|
||||
* cluster.fork(); // Fails with EADDRINUSE.
|
||||
* } else {
|
||||
* const s = dgram.createSocket('udp4');
|
||||
* s.bind(1234, () => {
|
||||
* s.addMembership('224.0.0.114');
|
||||
* });
|
||||
* }
|
||||
* ```
|
||||
* @since v0.6.9
|
||||
*/
|
||||
addMembership(multicastAddress: string, multicastInterface?: string): void;
|
||||
/**
|
||||
* Returns an object containing the address information for a socket.
|
||||
* For UDP sockets, this object will contain `address`, `family`, and `port` properties.
|
||||
*
|
||||
* This method throws `EBADF` if called on an unbound socket.
|
||||
* @since v0.1.99
|
||||
*/
|
||||
address(): AddressInfo;
|
||||
/**
|
||||
* For UDP sockets, causes the `dgram.Socket` to listen for datagram
|
||||
* messages on a named `port` and optional `address`. If `port` is not
|
||||
* specified or is `0`, the operating system will attempt to bind to a
|
||||
* random port. If `address` is not specified, the operating system will
|
||||
* attempt to listen on all addresses. Once binding is complete, a `'listening'` event is emitted and the optional `callback` function is
|
||||
* called.
|
||||
*
|
||||
* Specifying both a `'listening'` event listener and passing a `callback` to the `socket.bind()` method is not harmful but not very
|
||||
* useful.
|
||||
*
|
||||
* A bound datagram socket keeps the Node.js process running to receive
|
||||
* datagram messages.
|
||||
*
|
||||
* If binding fails, an `'error'` event is generated. In rare case (e.g.
|
||||
* attempting to bind with a closed socket), an `Error` may be thrown.
|
||||
*
|
||||
* Example of a UDP server listening on port 41234:
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'node:dgram';
|
||||
*
|
||||
* const server = dgram.createSocket('udp4');
|
||||
*
|
||||
* server.on('error', (err) => {
|
||||
* console.error(`server error:\n${err.stack}`);
|
||||
* server.close();
|
||||
* });
|
||||
*
|
||||
* server.on('message', (msg, rinfo) => {
|
||||
* console.log(`server got: ${msg} from ${rinfo.address}:${rinfo.port}`);
|
||||
* });
|
||||
*
|
||||
* server.on('listening', () => {
|
||||
* const address = server.address();
|
||||
* console.log(`server listening ${address.address}:${address.port}`);
|
||||
* });
|
||||
*
|
||||
* server.bind(41234);
|
||||
* // Prints: server listening 0.0.0.0:41234
|
||||
* ```
|
||||
* @since v0.1.99
|
||||
* @param callback with no parameters. Called when binding is complete.
|
||||
*/
|
||||
bind(port?: number, address?: string, callback?: () => void): this;
|
||||
bind(port?: number, callback?: () => void): this;
|
||||
bind(callback?: () => void): this;
|
||||
bind(options: BindOptions, callback?: () => void): this;
|
||||
/**
|
||||
* Close the underlying socket and stop listening for data on it. If a callback is
|
||||
* provided, it is added as a listener for the `'close'` event.
|
||||
* @since v0.1.99
|
||||
* @param callback Called when the socket has been closed.
|
||||
*/
|
||||
close(callback?: () => void): this;
|
||||
/**
|
||||
* Associates the `dgram.Socket` to a remote address and port. Every
|
||||
* message sent by this handle is automatically sent to that destination. Also,
|
||||
* the socket will only receive messages from that remote peer.
|
||||
* Trying to call `connect()` on an already connected socket will result
|
||||
* in an `ERR_SOCKET_DGRAM_IS_CONNECTED` exception. If `address` is not
|
||||
* provided, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets)
|
||||
* will be used by default. Once the connection is complete, a `'connect'` event
|
||||
* is emitted and the optional `callback` function is called. In case of failure,
|
||||
* the `callback` is called or, failing this, an `'error'` event is emitted.
|
||||
* @since v12.0.0
|
||||
* @param callback Called when the connection is completed or on error.
|
||||
*/
|
||||
connect(port: number, address?: string, callback?: () => void): void;
|
||||
connect(port: number, callback: () => void): void;
|
||||
/**
|
||||
* A synchronous function that disassociates a connected `dgram.Socket` from
|
||||
* its remote address. Trying to call `disconnect()` on an unbound or already
|
||||
* disconnected socket will result in an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception.
|
||||
* @since v12.0.0
|
||||
*/
|
||||
disconnect(): void;
|
||||
/**
|
||||
* Instructs the kernel to leave a multicast group at `multicastAddress` using the `IP_DROP_MEMBERSHIP` socket option. This method is automatically called by the
|
||||
* kernel when the socket is closed or the process terminates, so most apps will
|
||||
* never have reason to call this.
|
||||
*
|
||||
* If `multicastInterface` is not specified, the operating system will attempt to
|
||||
* drop membership on all valid interfaces.
|
||||
* @since v0.6.9
|
||||
*/
|
||||
dropMembership(multicastAddress: string, multicastInterface?: string): void;
|
||||
/**
|
||||
* This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
|
||||
* @since v8.7.0
|
||||
* @return the `SO_RCVBUF` socket receive buffer size in bytes.
|
||||
*/
|
||||
getRecvBufferSize(): number;
|
||||
/**
|
||||
* This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
|
||||
* @since v8.7.0
|
||||
* @return the `SO_SNDBUF` socket send buffer size in bytes.
|
||||
*/
|
||||
getSendBufferSize(): number;
|
||||
/**
|
||||
* @since v18.8.0, v16.19.0
|
||||
* @return Number of bytes queued for sending.
|
||||
*/
|
||||
getSendQueueSize(): number;
|
||||
/**
|
||||
* @since v18.8.0, v16.19.0
|
||||
* @return Number of send requests currently in the queue awaiting to be processed.
|
||||
*/
|
||||
getSendQueueCount(): number;
|
||||
/**
|
||||
* By default, binding a socket will cause it to block the Node.js process from
|
||||
* exiting as long as the socket is open. The `socket.unref()` method can be used
|
||||
* to exclude the socket from the reference counting that keeps the Node.js
|
||||
* process active. The `socket.ref()` method adds the socket back to the reference
|
||||
* counting and restores the default behavior.
|
||||
*
|
||||
* Calling `socket.ref()` multiples times will have no additional effect.
|
||||
*
|
||||
* The `socket.ref()` method returns a reference to the socket so calls can be
|
||||
* chained.
|
||||
* @since v0.9.1
|
||||
*/
|
||||
ref(): this;
|
||||
/**
|
||||
* Returns an object containing the `address`, `family`, and `port` of the remote
|
||||
* endpoint. This method throws an `ERR_SOCKET_DGRAM_NOT_CONNECTED` exception
|
||||
* if the socket is not connected.
|
||||
* @since v12.0.0
|
||||
*/
|
||||
remoteAddress(): AddressInfo;
|
||||
/**
|
||||
* Broadcasts a datagram on the socket.
|
||||
* For connectionless sockets, the destination `port` and `address` must be
|
||||
* specified. Connected sockets, on the other hand, will use their associated
|
||||
* remote endpoint, so the `port` and `address` arguments must not be set.
|
||||
*
|
||||
* The `msg` argument contains the message to be sent.
|
||||
* Depending on its type, different behavior can apply. If `msg` is a `Buffer`,
|
||||
* any `TypedArray` or a `DataView`,
|
||||
* the `offset` and `length` specify the offset within the `Buffer` where the
|
||||
* message begins and the number of bytes in the message, respectively.
|
||||
* If `msg` is a `String`, then it is automatically converted to a `Buffer` with `'utf8'` encoding. With messages that
|
||||
* contain multi-byte characters, `offset` and `length` will be calculated with
|
||||
* respect to `byte length` and not the character position.
|
||||
* If `msg` is an array, `offset` and `length` must not be specified.
|
||||
*
|
||||
* The `address` argument is a string. If the value of `address` is a host name,
|
||||
* DNS will be used to resolve the address of the host. If `address` is not
|
||||
* provided or otherwise nullish, `'127.0.0.1'` (for `udp4` sockets) or `'::1'` (for `udp6` sockets) will be used by default.
|
||||
*
|
||||
* If the socket has not been previously bound with a call to `bind`, the socket
|
||||
* is assigned a random port number and is bound to the "all interfaces" address
|
||||
* (`'0.0.0.0'` for `udp4` sockets, `'::0'` for `udp6` sockets.)
|
||||
*
|
||||
* An optional `callback` function may be specified to as a way of reporting
|
||||
* DNS errors or for determining when it is safe to reuse the `buf` object.
|
||||
* DNS lookups delay the time to send for at least one tick of the
|
||||
* Node.js event loop.
|
||||
*
|
||||
* The only way to know for sure that the datagram has been sent is by using a `callback`. If an error occurs and a `callback` is given, the error will be
|
||||
* passed as the first argument to the `callback`. If a `callback` is not given,
|
||||
* the error is emitted as an `'error'` event on the `socket` object.
|
||||
*
|
||||
* Offset and length are optional but both _must_ be set if either are used.
|
||||
* They are supported only when the first argument is a `Buffer`, a `TypedArray`,
|
||||
* or a `DataView`.
|
||||
*
|
||||
* This method throws `ERR_SOCKET_BAD_PORT` if called on an unbound socket.
|
||||
*
|
||||
* Example of sending a UDP packet to a port on `localhost`;
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'node:dgram';
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const message = Buffer.from('Some bytes');
|
||||
* const client = dgram.createSocket('udp4');
|
||||
* client.send(message, 41234, 'localhost', (err) => {
|
||||
* client.close();
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Example of sending a UDP packet composed of multiple buffers to a port on`127.0.0.1`;
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'node:dgram';
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const buf1 = Buffer.from('Some ');
|
||||
* const buf2 = Buffer.from('bytes');
|
||||
* const client = dgram.createSocket('udp4');
|
||||
* client.send([buf1, buf2], 41234, (err) => {
|
||||
* client.close();
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* Sending multiple buffers might be faster or slower depending on the
|
||||
* application and operating system. Run benchmarks to
|
||||
* determine the optimal strategy on a case-by-case basis. Generally speaking,
|
||||
* however, sending multiple buffers is faster.
|
||||
*
|
||||
* Example of sending a UDP packet using a socket connected to a port on `localhost`:
|
||||
*
|
||||
* ```js
|
||||
* import dgram from 'node:dgram';
|
||||
* import { Buffer } from 'node:buffer';
|
||||
*
|
||||
* const message = Buffer.from('Some bytes');
|
||||
* const client = dgram.createSocket('udp4');
|
||||
* client.connect(41234, 'localhost', (err) => {
|
||||
* client.send(message, (err) => {
|
||||
* client.close();
|
||||
* });
|
||||
* });
|
||||
* ```
|
||||
* @since v0.1.99
|
||||
* @param msg Message to be sent.
|
||||
* @param offset Offset in the buffer where the message starts.
|
||||
* @param length Number of bytes in the message.
|
||||
* @param port Destination port.
|
||||
* @param address Destination host name or IP address.
|
||||
* @param callback Called when the message has been sent.
|
||||
*/
|
||||
send(
|
||||
msg: string | Uint8Array | readonly any[],
|
||||
port?: number,
|
||||
address?: string,
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
): void;
|
||||
send(
|
||||
msg: string | Uint8Array | readonly any[],
|
||||
port?: number,
|
||||
callback?: (error: Error | null, bytes: number) => void,
|
||||
): void;
|
||||
send(
|
||||
msg: string | Uint8Array | readonly 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;
|
||||
/**
|
||||
* Sets or clears the `SO_BROADCAST` socket option. When set to `true`, UDP
|
||||
* packets may be sent to a local interface's broadcast address.
|
||||
*
|
||||
* This method throws `EBADF` if called on an unbound socket.
|
||||
* @since v0.6.9
|
||||
*/
|
||||
setBroadcast(flag: boolean): void;
|
||||
/**
|
||||
* _All references to scope in this section are referring to [IPv6 Zone Indices](https://en.wikipedia.org/wiki/IPv6_address#Scoped_literal_IPv6_addresses), which are defined by [RFC
|
||||
* 4007](https://tools.ietf.org/html/rfc4007). In string form, an IP_
|
||||
* _with a scope index is written as `'IP%scope'` where scope is an interface name_
|
||||
* _or interface number._
|
||||
*
|
||||
* Sets the default outgoing multicast interface of the socket to a chosen
|
||||
* interface or back to system interface selection. The `multicastInterface` must
|
||||
* be a valid string representation of an IP from the socket's family.
|
||||
*
|
||||
* For IPv4 sockets, this should be the IP configured for the desired physical
|
||||
* interface. All packets sent to multicast on the socket will be sent on the
|
||||
* interface determined by the most recent successful use of this call.
|
||||
*
|
||||
* For IPv6 sockets, `multicastInterface` should include a scope to indicate the
|
||||
* interface as in the examples that follow. In IPv6, individual `send` calls can
|
||||
* also use explicit scope in addresses, so only packets sent to a multicast
|
||||
* address without specifying an explicit scope are affected by the most recent
|
||||
* successful use of this call.
|
||||
*
|
||||
* This method throws `EBADF` if called on an unbound socket.
|
||||
*
|
||||
* #### Example: IPv6 outgoing multicast interface
|
||||
*
|
||||
* On most systems, where scope format uses the interface name:
|
||||
*
|
||||
* ```js
|
||||
* const socket = dgram.createSocket('udp6');
|
||||
*
|
||||
* socket.bind(1234, () => {
|
||||
* socket.setMulticastInterface('::%eth1');
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* On Windows, where scope format uses an interface number:
|
||||
*
|
||||
* ```js
|
||||
* const socket = dgram.createSocket('udp6');
|
||||
*
|
||||
* socket.bind(1234, () => {
|
||||
* socket.setMulticastInterface('::%2');
|
||||
* });
|
||||
* ```
|
||||
*
|
||||
* #### Example: IPv4 outgoing multicast interface
|
||||
*
|
||||
* All systems use an IP of the host on the desired physical interface:
|
||||
*
|
||||
* ```js
|
||||
* const socket = dgram.createSocket('udp4');
|
||||
*
|
||||
* socket.bind(1234, () => {
|
||||
* socket.setMulticastInterface('10.0.0.2');
|
||||
* });
|
||||
* ```
|
||||
* @since v8.6.0
|
||||
*/
|
||||
setMulticastInterface(multicastInterface: string): void;
|
||||
/**
|
||||
* Sets or clears the `IP_MULTICAST_LOOP` socket option. When set to `true`,
|
||||
* multicast packets will also be received on the local interface.
|
||||
*
|
||||
* This method throws `EBADF` if called on an unbound socket.
|
||||
* @since v0.3.8
|
||||
*/
|
||||
setMulticastLoopback(flag: boolean): boolean;
|
||||
/**
|
||||
* Sets the `IP_MULTICAST_TTL` socket option. While TTL generally stands for
|
||||
* "Time to Live", in this context it specifies the number of IP hops that a
|
||||
* packet is allowed to travel through, specifically for multicast traffic. Each
|
||||
* router or gateway that forwards a packet decrements the TTL. If the TTL is
|
||||
* decremented to 0 by a router, it will not be forwarded.
|
||||
*
|
||||
* The `ttl` argument may be between 0 and 255\. The default on most systems is `1`.
|
||||
*
|
||||
* This method throws `EBADF` if called on an unbound socket.
|
||||
* @since v0.3.8
|
||||
*/
|
||||
setMulticastTTL(ttl: number): number;
|
||||
/**
|
||||
* Sets the `SO_RCVBUF` socket option. Sets the maximum socket receive buffer
|
||||
* in bytes.
|
||||
*
|
||||
* This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
|
||||
* @since v8.7.0
|
||||
*/
|
||||
setRecvBufferSize(size: number): void;
|
||||
/**
|
||||
* Sets the `SO_SNDBUF` socket option. Sets the maximum socket send buffer
|
||||
* in bytes.
|
||||
*
|
||||
* This method throws `ERR_SOCKET_BUFFER_SIZE` if called on an unbound socket.
|
||||
* @since v8.7.0
|
||||
*/
|
||||
setSendBufferSize(size: number): void;
|
||||
/**
|
||||
* Sets the `IP_TTL` socket option. While TTL generally stands for "Time to Live",
|
||||
* in this context it specifies the number of IP hops that a packet is allowed to
|
||||
* travel through. Each router or gateway that forwards a packet decrements the
|
||||
* TTL. If the TTL is decremented to 0 by a router, it will not be forwarded.
|
||||
* Changing TTL values is typically done for network probes or when multicasting.
|
||||
*
|
||||
* The `ttl` argument may be between 1 and 255\. The default on most systems
|
||||
* is 64.
|
||||
*
|
||||
* This method throws `EBADF` if called on an unbound socket.
|
||||
* @since v0.1.101
|
||||
*/
|
||||
setTTL(ttl: number): number;
|
||||
/**
|
||||
* By default, binding a socket will cause it to block the Node.js process from
|
||||
* exiting as long as the socket is open. The `socket.unref()` method can be used
|
||||
* to exclude the socket from the reference counting that keeps the Node.js
|
||||
* process active, allowing the process to exit even if the socket is still
|
||||
* listening.
|
||||
*
|
||||
* Calling `socket.unref()` multiple times will have no additional effect.
|
||||
*
|
||||
* The `socket.unref()` method returns a reference to the socket so calls can be
|
||||
* chained.
|
||||
* @since v0.9.1
|
||||
*/
|
||||
unref(): this;
|
||||
/**
|
||||
* Tells the kernel to join a source-specific multicast channel at the given `sourceAddress` and `groupAddress`, using the `multicastInterface` with the `IP_ADD_SOURCE_MEMBERSHIP` socket
|
||||
* option. If the `multicastInterface` argument
|
||||
* is not specified, the operating system will choose one interface and will add
|
||||
* membership to it. To add membership to every available interface, call `socket.addSourceSpecificMembership()` multiple times, once per interface.
|
||||
*
|
||||
* When called on an unbound socket, this method will implicitly bind to a random
|
||||
* port, listening on all interfaces.
|
||||
* @since v13.1.0, v12.16.0
|
||||
*/
|
||||
addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
|
||||
/**
|
||||
* Instructs the kernel to leave a source-specific multicast channel at the given `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP` socket option. This method is
|
||||
* automatically called by the kernel when the
|
||||
* socket is closed or the process terminates, so most apps will never have
|
||||
* reason to call this.
|
||||
*
|
||||
* If `multicastInterface` is not specified, the operating system will attempt to
|
||||
* drop membership on all valid interfaces.
|
||||
* @since v13.1.0, v12.16.0
|
||||
*/
|
||||
dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
|
||||
/**
|
||||
* events.EventEmitter
|
||||
* 1. close
|
||||
* 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;
|
||||
/**
|
||||
* Calls `socket.close()` and returns a promise that fulfills when the socket has closed.
|
||||
* @since v20.5.0
|
||||
*/
|
||||
[Symbol.asyncDispose](): Promise<void>;
|
||||
}
|
||||
}
|
||||
declare module "node:dgram" {
|
||||
export * from "dgram";
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user