mirror of
https://github.com/joelwmale/webhook-action.git
synced 2026-08-24 21:23:37 +08:00
add ability to call self-signed or invalid certificate clients
This commit is contained in:
-21
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
# Installation
|
||||
> `npm install --save @types/color-name`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for color-name ( https://github.com/colorjs/color-name ).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/color-name
|
||||
|
||||
Additional Details
|
||||
* Last updated: Wed, 13 Feb 2019 16:16:48 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by Junyoung Clare Jang <https://github.com/Ailrun>.
|
||||
-161
@@ -1,161 +0,0 @@
|
||||
// Type definitions for color-name 1.1
|
||||
// Project: https://github.com/colorjs/color-name
|
||||
// Definitions by: Junyoung Clare Jang <https://github.com/Ailrun>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/**
|
||||
* Tuple of Red, Green, and Blue
|
||||
* @example
|
||||
* // Red = 55, Green = 70, Blue = 0
|
||||
* const rgb: RGB = [55, 70, 0];
|
||||
*/
|
||||
export type RGB = [number, number, number];
|
||||
|
||||
export const aliceblue: RGB;
|
||||
export const antiquewhite: RGB;
|
||||
export const aqua: RGB;
|
||||
export const aquamarine: RGB;
|
||||
export const azure: RGB;
|
||||
export const beige: RGB;
|
||||
export const bisque: RGB;
|
||||
export const black: RGB;
|
||||
export const blanchedalmond: RGB;
|
||||
export const blue: RGB;
|
||||
export const blueviolet: RGB;
|
||||
export const brown: RGB;
|
||||
export const burlywood: RGB;
|
||||
export const cadetblue: RGB;
|
||||
export const chartreuse: RGB;
|
||||
export const chocolate: RGB;
|
||||
export const coral: RGB;
|
||||
export const cornflowerblue: RGB;
|
||||
export const cornsilk: RGB;
|
||||
export const crimson: RGB;
|
||||
export const cyan: RGB;
|
||||
export const darkblue: RGB;
|
||||
export const darkcyan: RGB;
|
||||
export const darkgoldenrod: RGB;
|
||||
export const darkgray: RGB;
|
||||
export const darkgreen: RGB;
|
||||
export const darkgrey: RGB;
|
||||
export const darkkhaki: RGB;
|
||||
export const darkmagenta: RGB;
|
||||
export const darkolivegreen: RGB;
|
||||
export const darkorange: RGB;
|
||||
export const darkorchid: RGB;
|
||||
export const darkred: RGB;
|
||||
export const darksalmon: RGB;
|
||||
export const darkseagreen: RGB;
|
||||
export const darkslateblue: RGB;
|
||||
export const darkslategray: RGB;
|
||||
export const darkslategrey: RGB;
|
||||
export const darkturquoise: RGB;
|
||||
export const darkviolet: RGB;
|
||||
export const deeppink: RGB;
|
||||
export const deepskyblue: RGB;
|
||||
export const dimgray: RGB;
|
||||
export const dimgrey: RGB;
|
||||
export const dodgerblue: RGB;
|
||||
export const firebrick: RGB;
|
||||
export const floralwhite: RGB;
|
||||
export const forestgreen: RGB;
|
||||
export const fuchsia: RGB;
|
||||
export const gainsboro: RGB;
|
||||
export const ghostwhite: RGB;
|
||||
export const gold: RGB;
|
||||
export const goldenrod: RGB;
|
||||
export const gray: RGB;
|
||||
export const green: RGB;
|
||||
export const greenyellow: RGB;
|
||||
export const grey: RGB;
|
||||
export const honeydew: RGB;
|
||||
export const hotpink: RGB;
|
||||
export const indianred: RGB;
|
||||
export const indigo: RGB;
|
||||
export const ivory: RGB;
|
||||
export const khaki: RGB;
|
||||
export const lavender: RGB;
|
||||
export const lavenderblush: RGB;
|
||||
export const lawngreen: RGB;
|
||||
export const lemonchiffon: RGB;
|
||||
export const lightblue: RGB;
|
||||
export const lightcoral: RGB;
|
||||
export const lightcyan: RGB;
|
||||
export const lightgoldenrodyellow: RGB;
|
||||
export const lightgray: RGB;
|
||||
export const lightgreen: RGB;
|
||||
export const lightgrey: RGB;
|
||||
export const lightpink: RGB;
|
||||
export const lightsalmon: RGB;
|
||||
export const lightseagreen: RGB;
|
||||
export const lightskyblue: RGB;
|
||||
export const lightslategray: RGB;
|
||||
export const lightslategrey: RGB;
|
||||
export const lightsteelblue: RGB;
|
||||
export const lightyellow: RGB;
|
||||
export const lime: RGB;
|
||||
export const limegreen: RGB;
|
||||
export const linen: RGB;
|
||||
export const magenta: RGB;
|
||||
export const maroon: RGB;
|
||||
export const mediumaquamarine: RGB;
|
||||
export const mediumblue: RGB;
|
||||
export const mediumorchid: RGB;
|
||||
export const mediumpurple: RGB;
|
||||
export const mediumseagreen: RGB;
|
||||
export const mediumslateblue: RGB;
|
||||
export const mediumspringgreen: RGB;
|
||||
export const mediumturquoise: RGB;
|
||||
export const mediumvioletred: RGB;
|
||||
export const midnightblue: RGB;
|
||||
export const mintcream: RGB;
|
||||
export const mistyrose: RGB;
|
||||
export const moccasin: RGB;
|
||||
export const navajowhite: RGB;
|
||||
export const navy: RGB;
|
||||
export const oldlace: RGB;
|
||||
export const olive: RGB;
|
||||
export const olivedrab: RGB;
|
||||
export const orange: RGB;
|
||||
export const orangered: RGB;
|
||||
export const orchid: RGB;
|
||||
export const palegoldenrod: RGB;
|
||||
export const palegreen: RGB;
|
||||
export const paleturquoise: RGB;
|
||||
export const palevioletred: RGB;
|
||||
export const papayawhip: RGB;
|
||||
export const peachpuff: RGB;
|
||||
export const peru: RGB;
|
||||
export const pink: RGB;
|
||||
export const plum: RGB;
|
||||
export const powderblue: RGB;
|
||||
export const purple: RGB;
|
||||
export const rebeccapurple: RGB;
|
||||
export const red: RGB;
|
||||
export const rosybrown: RGB;
|
||||
export const royalblue: RGB;
|
||||
export const saddlebrown: RGB;
|
||||
export const salmon: RGB;
|
||||
export const sandybrown: RGB;
|
||||
export const seagreen: RGB;
|
||||
export const seashell: RGB;
|
||||
export const sienna: RGB;
|
||||
export const silver: RGB;
|
||||
export const skyblue: RGB;
|
||||
export const slateblue: RGB;
|
||||
export const slategray: RGB;
|
||||
export const slategrey: RGB;
|
||||
export const snow: RGB;
|
||||
export const springgreen: RGB;
|
||||
export const steelblue: RGB;
|
||||
export const tan: RGB;
|
||||
export const teal: RGB;
|
||||
export const thistle: RGB;
|
||||
export const tomato: RGB;
|
||||
export const turquoise: RGB;
|
||||
export const violet: RGB;
|
||||
export const wheat: RGB;
|
||||
export const white: RGB;
|
||||
export const whitesmoke: RGB;
|
||||
export const yellow: RGB;
|
||||
export const yellowgreen: RGB;
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
{
|
||||
"name": "@types/color-name",
|
||||
"version": "1.1.1",
|
||||
"description": "TypeScript definitions for color-name",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Junyoung Clare Jang",
|
||||
"url": "https://github.com/Ailrun",
|
||||
"githubUsername": "Ailrun"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "e22c6881e2dcf766e32142cbb82d9acf9c08258bdf0da8e76c8a448d1be44ac7",
|
||||
"typeScriptVersion": "2.0"
|
||||
}
|
||||
-21
@@ -1,21 +0,0 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
# Installation
|
||||
> `npm install --save @types/eslint-visitor-keys`
|
||||
|
||||
# Summary
|
||||
This package contains type definitions for eslint-visitor-keys (https://github.com/eslint/eslint-visitor-keys#readme).
|
||||
|
||||
# Details
|
||||
Files were exported from https://www.github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/eslint-visitor-keys
|
||||
|
||||
Additional Details
|
||||
* Last updated: Sun, 18 Feb 2018 01:53:11 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by Toru Nagashima <https://github.com/mysticatea>.
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
// Type definitions for eslint-visitor-keys 1.0
|
||||
// Project: https://github.com/eslint/eslint-visitor-keys#readme
|
||||
// Definitions by: Toru Nagashima <https://github.com/mysticatea>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.2
|
||||
|
||||
export interface VisitorKeys {
|
||||
readonly [type: string]: ReadonlyArray<string> | undefined;
|
||||
}
|
||||
|
||||
export const KEYS: VisitorKeys;
|
||||
export function getKeys(node: {}): ReadonlyArray<string>;
|
||||
export function unionWith(keys: VisitorKeys): VisitorKeys;
|
||||
-22
@@ -1,22 +0,0 @@
|
||||
{
|
||||
"name": "@types/eslint-visitor-keys",
|
||||
"version": "1.0.0",
|
||||
"description": "TypeScript definitions for eslint-visitor-keys",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Toru Nagashima",
|
||||
"url": "https://github.com/mysticatea",
|
||||
"githubUsername": "mysticatea"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://www.github.com/DefinitelyTyped/DefinitelyTyped.git"
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "439a0b912c49f6aedb6456cd8485eddf2444a36dd4ae5767258b663df3dfb6dc",
|
||||
"typeScriptVersion": "2.2"
|
||||
}
|
||||
+3
-3
@@ -8,9 +8,9 @@ This package contains type definitions for istanbul-reports (https://github.com/
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/istanbul-reports.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Fri, 15 May 2020 04:09:43 GMT
|
||||
* Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report), [@types/istanbul-lib-coverage](https://npmjs.com/package/@types/istanbul-lib-coverage)
|
||||
* Last updated: Mon, 20 Jul 2020 21:55:27 GMT
|
||||
* Dependencies: [@types/istanbul-lib-report](https://npmjs.com/package/@types/istanbul-lib-report)
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Jason Cheatham](https://github.com/jason0x43).
|
||||
These definitions were written by [Jason Cheatham](https://github.com/jason0x43), and [Elena Shcherbakova](https://github.com/not-a-doctor).
|
||||
|
||||
+49
-25
@@ -1,48 +1,72 @@
|
||||
// Type definitions for istanbul-reports 1.1
|
||||
// Type definitions for istanbul-reports 3.0
|
||||
// Project: https://github.com/istanbuljs/istanbuljs, https://istanbul.js.org
|
||||
// Definitions by: Jason Cheatham <https://github.com/jason0x43>
|
||||
// Elena Shcherbakova <https://github.com/not-a-doctor>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.4
|
||||
|
||||
import { Context, Node, FileWriter, Visitor } from 'istanbul-lib-report';
|
||||
import { CoverageSummary } from 'istanbul-lib-coverage';
|
||||
import { Node, Visitor } from 'istanbul-lib-report';
|
||||
|
||||
export function create<T extends keyof ReportOptions>(
|
||||
name: T,
|
||||
options?: Partial<ReportOptions[T]>
|
||||
): Visitor;
|
||||
export function create<T extends keyof ReportOptions>(name: T, options?: Partial<ReportOptions[T]>): Visitor;
|
||||
|
||||
export interface FileOptions {
|
||||
file: string;
|
||||
}
|
||||
|
||||
export interface ProjectOptions {
|
||||
projectRoot: string;
|
||||
}
|
||||
|
||||
export interface ReportOptions {
|
||||
clover: RootedOptions;
|
||||
cobertura: RootedOptions;
|
||||
clover: CloverOptions;
|
||||
cobertura: CoberturaOptions;
|
||||
'html-spa': HtmlSpaOptions;
|
||||
html: HtmlOptions;
|
||||
json: Options;
|
||||
'json-summary': Options;
|
||||
lcov: never;
|
||||
lcovonly: Options;
|
||||
none: RootedOptions;
|
||||
teamcity: Options & { blockName: string };
|
||||
text: Options & { maxCols: number };
|
||||
'text-lcov': Options;
|
||||
'text-summary': Options;
|
||||
json: JsonOptions;
|
||||
'json-summary': JsonSummaryOptions;
|
||||
lcov: LcovOptions;
|
||||
lcovonly: LcovOnlyOptions;
|
||||
none: never;
|
||||
teamcity: TeamcityOptions;
|
||||
text: TextOptions;
|
||||
'text-lcov': TextLcovOptions;
|
||||
'text-summary': TextSummaryOptions;
|
||||
}
|
||||
|
||||
export type ReportType = keyof ReportOptions;
|
||||
|
||||
export interface Options {
|
||||
file: string;
|
||||
}
|
||||
export interface CloverOptions extends FileOptions, ProjectOptions {}
|
||||
|
||||
export interface RootedOptions extends Options {
|
||||
projectRoot: string;
|
||||
}
|
||||
export interface CoberturaOptions extends FileOptions, ProjectOptions {}
|
||||
|
||||
export interface HtmlSpaOptions extends HtmlOptions {
|
||||
metricsToShow: Array<'lines' | 'branches' | 'functions' | 'statements'>;
|
||||
}
|
||||
export interface HtmlOptions {
|
||||
verbose: boolean;
|
||||
linkMapper: LinkMapper;
|
||||
skipEmpty: boolean;
|
||||
subdir: string;
|
||||
linkMapper: LinkMapper;
|
||||
}
|
||||
|
||||
export type JsonOptions = FileOptions;
|
||||
export type JsonSummaryOptions = FileOptions;
|
||||
|
||||
export interface LcovOptions extends FileOptions, ProjectOptions {}
|
||||
export interface LcovOnlyOptions extends FileOptions, ProjectOptions {}
|
||||
|
||||
export interface TeamcityOptions extends FileOptions {
|
||||
blockName: string;
|
||||
}
|
||||
|
||||
export interface TextOptions extends FileOptions {
|
||||
maxCols: number;
|
||||
skipEmpty: boolean;
|
||||
skipFull: boolean;
|
||||
}
|
||||
export type TextLcovOptions = ProjectOptions;
|
||||
export type TextSummaryOptions = FileOptions;
|
||||
|
||||
export interface LinkMapper {
|
||||
getPath(node: string | Node): string;
|
||||
relativePath(source: string | Node, target: string | Node): string;
|
||||
|
||||
+7
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@types/istanbul-reports",
|
||||
"version": "1.1.2",
|
||||
"version": "3.0.0",
|
||||
"description": "TypeScript definitions for istanbul-reports",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
@@ -8,6 +8,11 @@
|
||||
"name": "Jason Cheatham",
|
||||
"url": "https://github.com/jason0x43",
|
||||
"githubUsername": "jason0x43"
|
||||
},
|
||||
{
|
||||
"name": "Elena Shcherbakova",
|
||||
"url": "https://github.com/not-a-doctor",
|
||||
"githubUsername": "not-a-doctor"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
@@ -19,9 +24,8 @@
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"@types/istanbul-lib-coverage": "*",
|
||||
"@types/istanbul-lib-report": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "c13cd090c027208710520a039ec004ef0045ea12516dc4c71d648e4fce9ff9f7",
|
||||
"typesPublisherContentHash": "71342edcc57e7212d17e794fa519955e496dd3b6696e2738904679ef3aa59d70",
|
||||
"typeScriptVersion": "3.0"
|
||||
}
|
||||
+3
-3
@@ -8,10 +8,10 @@ This package contains type definitions for Jest (https://jestjs.io/).
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Fri, 14 Aug 2020 23:42:57 GMT
|
||||
* Dependencies: none
|
||||
* Last updated: Thu, 07 Jan 2021 08:51:23 GMT
|
||||
* Dependencies: [@types/jest-diff](https://npmjs.com/package/@types/jest-diff), [@types/pretty-format](https://npmjs.com/package/@types/pretty-format)
|
||||
* Global values: `afterAll`, `afterEach`, `beforeAll`, `beforeEach`, `describe`, `expect`, `fail`, `fdescribe`, `fit`, `it`, `jasmine`, `jest`, `pending`, `spyOn`, `test`, `xdescribe`, `xit`, `xtest`
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Asana (https://asana.com)
|
||||
// Ivo Stratev](https://github.com/NoHomey), [jwbay](https://github.com/jwbay), [Alexey Svetliakov](https://github.com/asvetliakov), [Alex Jover Morales](https://github.com/alexjoverm), [Allan Lukwago](https://github.com/epicallan), [Ika](https://github.com/ikatyang), [Waseem Dahman](https://github.com/wsmd), [Jamie Mason](https://github.com/JamieMason), [Douglas Duteil](https://github.com/douglasduteil), [Ahn](https://github.com/ahnpnl), [Josh Goldberg](https://github.com/joshuakgoldberg), [Jeff Lau](https://github.com/UselessPickles), [Andrew Makarov](https://github.com/r3nya), [Martin Hochel](https://github.com/hotell), [Sebastian Sebald](https://github.com/sebald), [Andy](https://github.com/andys8), [Antoine Brault](https://github.com/antoinebrault), [Gregor Stamać](https://github.com/gstamac), [ExE Boss](https://github.com/ExE-Boss), [Alex Bolenok](https://github.com/quassnoi), [Mario Beltrán Alarcón](https://github.com/Belco90), [Tony Hallett](https://github.com/tonyhallett), [Jason Yu](https://github.com/ycmjason), [Devansh Jethmalani](https://github.com/devanshj), [Pawel Fajfer](https://github.com/pawfa), and [Regev Brody](https://github.com/regevbr).
|
||||
// Ivo Stratev](https://github.com/NoHomey), [jwbay](https://github.com/jwbay), [Alexey Svetliakov](https://github.com/asvetliakov), [Alex Jover Morales](https://github.com/alexjoverm), [Allan Lukwago](https://github.com/epicallan), [Ika](https://github.com/ikatyang), [Waseem Dahman](https://github.com/wsmd), [Jamie Mason](https://github.com/JamieMason), [Douglas Duteil](https://github.com/douglasduteil), [Ahn](https://github.com/ahnpnl), [Josh Goldberg](https://github.com/joshuakgoldberg), [Jeff Lau](https://github.com/UselessPickles), [Andrew Makarov](https://github.com/r3nya), [Martin Hochel](https://github.com/hotell), [Sebastian Sebald](https://github.com/sebald), [Andy](https://github.com/andys8), [Antoine Brault](https://github.com/antoinebrault), [Gregor Stamać](https://github.com/gstamac), [ExE Boss](https://github.com/ExE-Boss), [Alex Bolenok](https://github.com/quassnoi), [Mario Beltrán Alarcón](https://github.com/Belco90), [Tony Hallett](https://github.com/tonyhallett), [Jason Yu](https://github.com/ycmjason), [Devansh Jethmalani](https://github.com/devanshj), [Pawel Fajfer](https://github.com/pawfa), [Regev Brody](https://github.com/regevbr), and [Alexandre Germain](https://github.com/gerkindev).
|
||||
|
||||
+26
-26
@@ -27,8 +27,9 @@
|
||||
// Devansh Jethmalani <https://github.com/devanshj>
|
||||
// Pawel Fajfer <https://github.com/pawfa>
|
||||
// Regev Brody <https://github.com/regevbr>
|
||||
// Alexandre Germain <https://github.com/gerkindev>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 3.1
|
||||
// Minimum TypeScript Version: 3.8
|
||||
|
||||
declare var beforeAll: jest.Lifecycle;
|
||||
declare var beforeEach: jest.Lifecycle;
|
||||
@@ -709,6 +710,7 @@ declare namespace jest {
|
||||
type AndNot<T> = T & {
|
||||
not: T
|
||||
};
|
||||
|
||||
// should be R extends void|Promise<void> but getting dtslint error
|
||||
interface Matchers<R, T = {}> {
|
||||
/**
|
||||
@@ -723,7 +725,7 @@ declare namespace jest {
|
||||
* Ensure that the last call to a mock function has returned a specified value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
lastReturnedWith<E = any>(value: E): R;
|
||||
@@ -739,7 +741,7 @@ declare namespace jest {
|
||||
* Ensure that the nth call to a mock function has returned a specified value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
nthReturnedWith<E = any>(n: number, value: E): R;
|
||||
@@ -748,7 +750,7 @@ declare namespace jest {
|
||||
* Don't use `toBe` with floating-point numbers.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toBe<E = any>(expected: E): R;
|
||||
@@ -784,30 +786,30 @@ declare namespace jest {
|
||||
*/
|
||||
toBeFalsy(): R;
|
||||
/**
|
||||
* For comparing floating point numbers.
|
||||
* For comparing floating point or big integer numbers.
|
||||
*/
|
||||
toBeGreaterThan(expected: number): R;
|
||||
toBeGreaterThan(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing floating point numbers.
|
||||
* For comparing floating point or big integer numbers.
|
||||
*/
|
||||
toBeGreaterThanOrEqual(expected: number): R;
|
||||
toBeGreaterThanOrEqual(expected: number | bigint): R;
|
||||
/**
|
||||
* Ensure that an object is an instance of a class.
|
||||
* This matcher uses `instanceof` underneath.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toBeInstanceOf<E = any>(expected: E): R;
|
||||
/**
|
||||
* For comparing floating point numbers.
|
||||
* For comparing floating point or big integer numbers.
|
||||
*/
|
||||
toBeLessThan(expected: number): R;
|
||||
toBeLessThan(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing floating point numbers.
|
||||
* For comparing floating point or big integer numbers.
|
||||
*/
|
||||
toBeLessThanOrEqual(expected: number): R;
|
||||
toBeLessThanOrEqual(expected: number | bigint): R;
|
||||
/**
|
||||
* This is the same as `.toBe(null)` but the error messages are a bit nicer.
|
||||
* So use `.toBeNull()` when you want to check that something is null.
|
||||
@@ -833,7 +835,7 @@ declare namespace jest {
|
||||
* It can also check whether a string is a substring of another string.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toContain<E = any>(expected: E): R;
|
||||
@@ -843,7 +845,7 @@ declare namespace jest {
|
||||
* equality of all fields, rather than checking for object identity.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toContainEqual<E = any>(expected: E): R;
|
||||
@@ -852,7 +854,7 @@ declare namespace jest {
|
||||
* This matcher recursively checks the equality of all fields, rather than checking for object identity.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toEqual<E = any>(expected: E): R;
|
||||
@@ -895,7 +897,7 @@ declare namespace jest {
|
||||
* no matter what value you provided as the expected return value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveLastReturnedWith<E = any>(expected: E): R;
|
||||
@@ -910,7 +912,7 @@ declare namespace jest {
|
||||
* no matter what value you provided as the expected return value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveNthReturnedWith<E = any>(nthCall: number, expected: E): R;
|
||||
@@ -942,7 +944,7 @@ declare namespace jest {
|
||||
* Use to ensure that a mock function returned a specific value.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toHaveReturnedWith<E = any>(expected: E): R;
|
||||
@@ -1008,7 +1010,7 @@ declare namespace jest {
|
||||
* Ensure that a mock function has returned a specified value at least once.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toReturnWith<E = any>(value: E): R;
|
||||
@@ -1016,7 +1018,7 @@ declare namespace jest {
|
||||
* Use to test that objects have the same types as well as structure.
|
||||
*
|
||||
* Optionally, you can provide a type for the expected value via a generic.
|
||||
* This is particuarly useful for ensuring expected objects have the right structure.
|
||||
* This is particularly useful for ensuring expected objects have the right structure.
|
||||
*/
|
||||
// tslint:disable-next-line: no-unnecessary-generics
|
||||
toStrictEqual<E = any>(expected: E): R;
|
||||
@@ -1043,8 +1045,6 @@ declare namespace jest {
|
||||
T['length'] extends 0 ? [] :
|
||||
(((...b: T) => void) extends (a: any, ...b: infer I) => void ? I : []);
|
||||
|
||||
type Parameters<T extends (...args: any[]) => any> = T extends (...args: infer P) => any ? P : never;
|
||||
|
||||
interface AsymmetricMatcher {
|
||||
asymmetricMatch(other: unknown): boolean;
|
||||
}
|
||||
@@ -1077,7 +1077,7 @@ declare namespace jest {
|
||||
* Construct a type with the properties of T except for those in type K.
|
||||
*/
|
||||
type Omit<T, K extends keyof any> = Pick<T, Exclude<keyof T, K>>;
|
||||
type NonPromiseMatchers<T extends JestMatchersShape> = Omit<T, 'resolves' | 'rejects' | 'not'>;
|
||||
type NonPromiseMatchers<T extends JestMatchersShape<any>> = Omit<T, 'resolves' | 'rejects' | 'not'>;
|
||||
type PromiseMatchers<T extends JestMatchersShape> = Omit<T['resolves'], 'not'>;
|
||||
|
||||
interface Constructable {
|
||||
@@ -1114,7 +1114,7 @@ declare namespace jest {
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* import { MyClass } from "./libary";
|
||||
* import { MyClass } from "./library";
|
||||
* jest.mock("./library");
|
||||
*
|
||||
* const mockedMyClass = MyClass as jest.MockedClass<typeof MyClass>;
|
||||
@@ -1190,7 +1190,7 @@ declare namespace jest {
|
||||
/**
|
||||
* Returns the function that was set as the implementation of the mock (using mockImplementation).
|
||||
*/
|
||||
getMockImplementation(): (...args: Y) => T | undefined;
|
||||
getMockImplementation(): ((...args: Y) => T) | undefined;
|
||||
/**
|
||||
* Accepts a function that should be used as the implementation of the mock. The mock itself will still record
|
||||
* all calls that go into and instances that come from itself – the only difference is that the implementation
|
||||
|
||||
+10
-12
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@types/jest",
|
||||
"version": "26.0.10",
|
||||
"version": "26.0.20",
|
||||
"description": "TypeScript definitions for Jest",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
@@ -133,17 +133,15 @@
|
||||
"name": "Regev Brody",
|
||||
"url": "https://github.com/regevbr",
|
||||
"githubUsername": "regevbr"
|
||||
},
|
||||
{
|
||||
"name": "Alexandre Germain",
|
||||
"url": "https://github.com/gerkindev",
|
||||
"githubUsername": "gerkindev"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"typesVersions": {
|
||||
">=3.2.0-0": {
|
||||
"*": [
|
||||
"ts3.2/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
|
||||
@@ -151,9 +149,9 @@
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {
|
||||
"jest-diff": "^25.2.1",
|
||||
"pretty-format": "^25.2.1"
|
||||
"jest-diff": "^26.0.0",
|
||||
"pretty-format": "^26.0.0"
|
||||
},
|
||||
"typesPublisherContentHash": "acc1228cac126b3aae5af506b3e028ef5984ca2dc4cb3d847709b4351d35df9a",
|
||||
"typeScriptVersion": "3.1"
|
||||
"typesPublisherContentHash": "fd2f1aeaaf8c9257855794609142e4cf462a09b6ee1a337f1ca0e797c1718ce7",
|
||||
"typeScriptVersion": "3.8"
|
||||
}
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../index.d.ts" />
|
||||
|
||||
declare namespace jest {
|
||||
interface Matchers<R, T = {}> {
|
||||
/**
|
||||
* For comparing numbers or big integer values.
|
||||
*/
|
||||
toBeGreaterThan(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing numbers or big integer values.
|
||||
*/
|
||||
toBeGreaterThanOrEqual(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing numbers or big integer values.
|
||||
*/
|
||||
toBeLessThan(expected: number | bigint): R;
|
||||
/**
|
||||
* For comparing numbers or big integer values.
|
||||
*/
|
||||
toBeLessThanOrEqual(expected: number | bigint): R;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -8,7 +8,7 @@ This package contains type definitions for json-schema 4.0, 6.0 and (https://git
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Tue, 09 Jun 2020 17:03:55 GMT
|
||||
* Last updated: Tue, 19 Jan 2021 23:09:28 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
|
||||
+94
-90
@@ -16,7 +16,7 @@
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
|
||||
*/
|
||||
export type JSONSchema4TypeName =
|
||||
| 'string'
|
||||
| 'string' //
|
||||
| 'number'
|
||||
| 'integer'
|
||||
| 'boolean'
|
||||
@@ -29,7 +29,7 @@ export type JSONSchema4TypeName =
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
|
||||
*/
|
||||
export type JSONSchema4Type =
|
||||
| string
|
||||
| string //
|
||||
| number
|
||||
| boolean
|
||||
| JSONSchema4Object
|
||||
@@ -65,9 +65,9 @@ export type JSONSchema4Version = string;
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04
|
||||
*/
|
||||
export interface JSONSchema4 {
|
||||
id?: string
|
||||
$ref?: string
|
||||
$schema?: JSONSchema4Version
|
||||
id?: string;
|
||||
$ref?: string;
|
||||
$schema?: JSONSchema4Version;
|
||||
|
||||
/**
|
||||
* This attribute is a string that provides a short description of the
|
||||
@@ -75,7 +75,7 @@ export interface JSONSchema4 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
|
||||
*/
|
||||
title?: string
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* This attribute is a string that provides a full description of the of
|
||||
@@ -83,17 +83,17 @@ export interface JSONSchema4 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
|
||||
*/
|
||||
description?: string
|
||||
description?: string;
|
||||
|
||||
default?: JSONSchema4Type
|
||||
multipleOf?: number
|
||||
maximum?: number
|
||||
exclusiveMaximum?: boolean
|
||||
minimum?: number
|
||||
exclusiveMinimum?: boolean
|
||||
maxLength?: number
|
||||
minLength?: number
|
||||
pattern?: string
|
||||
default?: JSONSchema4Type;
|
||||
multipleOf?: number;
|
||||
maximum?: number;
|
||||
exclusiveMaximum?: boolean;
|
||||
minimum?: number;
|
||||
exclusiveMinimum?: boolean;
|
||||
maxLength?: number;
|
||||
minLength?: number;
|
||||
pattern?: string;
|
||||
|
||||
/**
|
||||
* May only be defined when "items" is defined, and is a tuple of JSONSchemas.
|
||||
@@ -105,7 +105,7 @@ export interface JSONSchema4 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
|
||||
*/
|
||||
additionalItems?: boolean | JSONSchema4
|
||||
additionalItems?: boolean | JSONSchema4;
|
||||
|
||||
/**
|
||||
* This attribute defines the allowed items in an instance array, and
|
||||
@@ -126,13 +126,13 @@ export interface JSONSchema4 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
|
||||
*/
|
||||
items?: JSONSchema4 | JSONSchema4[]
|
||||
items?: JSONSchema4 | JSONSchema4[];
|
||||
|
||||
maxItems?: number
|
||||
minItems?: number
|
||||
uniqueItems?: boolean
|
||||
maxProperties?: number
|
||||
minProperties?: number
|
||||
maxItems?: number;
|
||||
minItems?: number;
|
||||
uniqueItems?: boolean;
|
||||
maxProperties?: number;
|
||||
minProperties?: number;
|
||||
|
||||
/**
|
||||
* This attribute indicates if the instance must have a value, and not
|
||||
@@ -141,7 +141,7 @@ export interface JSONSchema4 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
|
||||
*/
|
||||
required?: false | string[]
|
||||
required?: false | string[];
|
||||
|
||||
/**
|
||||
* This attribute defines a schema for all properties that are not
|
||||
@@ -153,11 +153,11 @@ export interface JSONSchema4 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
|
||||
*/
|
||||
additionalProperties?: boolean | JSONSchema4
|
||||
additionalProperties?: boolean | JSONSchema4;
|
||||
|
||||
definitions?: {
|
||||
[k: string]: JSONSchema4
|
||||
}
|
||||
[k: string]: JSONSchema4;
|
||||
};
|
||||
|
||||
/**
|
||||
* This attribute is an object with property definitions that define the
|
||||
@@ -173,8 +173,8 @@ export interface JSONSchema4 {
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
|
||||
*/
|
||||
properties?: {
|
||||
[k: string]: JSONSchema4
|
||||
}
|
||||
[k: string]: JSONSchema4;
|
||||
};
|
||||
|
||||
/**
|
||||
* This attribute is an object that defines the schema for a set of
|
||||
@@ -188,11 +188,11 @@ export interface JSONSchema4 {
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
|
||||
*/
|
||||
patternProperties?: {
|
||||
[k: string]: JSONSchema4
|
||||
}
|
||||
[k: string]: JSONSchema4;
|
||||
};
|
||||
dependencies?: {
|
||||
[k: string]: JSONSchema4 | string[]
|
||||
}
|
||||
[k: string]: JSONSchema4 | string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* This provides an enumeration of all possible values that are valid
|
||||
@@ -203,17 +203,17 @@ export interface JSONSchema4 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
|
||||
*/
|
||||
enum?: JSONSchema4Type[]
|
||||
enum?: JSONSchema4Type[];
|
||||
|
||||
/**
|
||||
* A single type, or a union of simple types
|
||||
*/
|
||||
type?: JSONSchema4TypeName | JSONSchema4TypeName[]
|
||||
type?: JSONSchema4TypeName | JSONSchema4TypeName[];
|
||||
|
||||
allOf?: JSONSchema4[]
|
||||
anyOf?: JSONSchema4[]
|
||||
oneOf?: JSONSchema4[]
|
||||
not?: JSONSchema4
|
||||
allOf?: JSONSchema4[];
|
||||
anyOf?: JSONSchema4[];
|
||||
oneOf?: JSONSchema4[];
|
||||
not?: JSONSchema4;
|
||||
|
||||
/**
|
||||
* The value of this property MUST be another schema which will provide
|
||||
@@ -231,14 +231,14 @@ export interface JSONSchema4 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
|
||||
*/
|
||||
extends?: string | string[]
|
||||
extends?: string | string[];
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
|
||||
*/
|
||||
[k: string]: any
|
||||
[k: string]: any;
|
||||
|
||||
format?: string
|
||||
format?: string;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
@@ -246,7 +246,7 @@ export interface JSONSchema4 {
|
||||
//==================================================================================================
|
||||
|
||||
export type JSONSchema6TypeName =
|
||||
| 'string'
|
||||
| 'string' //
|
||||
| 'number'
|
||||
| 'integer'
|
||||
| 'boolean'
|
||||
@@ -256,7 +256,7 @@ export type JSONSchema6TypeName =
|
||||
| 'any';
|
||||
|
||||
export type JSONSchema6Type =
|
||||
| string
|
||||
| string //
|
||||
| number
|
||||
| boolean
|
||||
| JSONSchema6Object
|
||||
@@ -291,51 +291,51 @@ export type JSONSchema6Version = string;
|
||||
*/
|
||||
export type JSONSchema6Definition = JSONSchema6 | boolean;
|
||||
export interface JSONSchema6 {
|
||||
$id?: string
|
||||
$ref?: string
|
||||
$schema?: JSONSchema6Version
|
||||
$id?: string;
|
||||
$ref?: string;
|
||||
$schema?: JSONSchema6Version;
|
||||
|
||||
/**
|
||||
* Must be strictly greater than 0.
|
||||
* A numeric instance is valid only if division by this keyword's value results in an integer.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1
|
||||
*/
|
||||
multipleOf?: number
|
||||
multipleOf?: number;
|
||||
|
||||
/**
|
||||
* Representing an inclusive upper limit for a numeric instance.
|
||||
* This keyword validates only if the instance is less than or exactly equal to "maximum".
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2
|
||||
*/
|
||||
maximum?: number
|
||||
maximum?: number;
|
||||
|
||||
/**
|
||||
* Representing an exclusive upper limit for a numeric instance.
|
||||
* This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum".
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3
|
||||
*/
|
||||
exclusiveMaximum?: number
|
||||
exclusiveMaximum?: number;
|
||||
|
||||
/**
|
||||
* Representing an inclusive lower limit for a numeric instance.
|
||||
* This keyword validates only if the instance is greater than or exactly equal to "minimum".
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4
|
||||
*/
|
||||
minimum?: number
|
||||
minimum?: number;
|
||||
|
||||
/**
|
||||
* Representing an exclusive lower limit for a numeric instance.
|
||||
* This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum".
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5
|
||||
*/
|
||||
exclusiveMinimum?: number
|
||||
exclusiveMinimum?: number;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
* A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6
|
||||
*/
|
||||
maxLength?: number
|
||||
maxLength?: number;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
@@ -343,20 +343,20 @@ export interface JSONSchema6 {
|
||||
* Omitting this keyword has the same behavior as a value of 0.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7
|
||||
*/
|
||||
minLength?: number
|
||||
minLength?: number;
|
||||
|
||||
/**
|
||||
* Should be a valid regular expression, according to the ECMA 262 regular expression dialect.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8
|
||||
*/
|
||||
pattern?: string
|
||||
pattern?: string;
|
||||
|
||||
/**
|
||||
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
|
||||
* Omitting this keyword has the same behavior as an empty schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9
|
||||
*/
|
||||
items?: JSONSchema6Definition | JSONSchema6Definition[]
|
||||
items?: JSONSchema6Definition | JSONSchema6Definition[];
|
||||
|
||||
/**
|
||||
* This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
|
||||
@@ -367,14 +367,14 @@ export interface JSONSchema6 {
|
||||
* Omitting this keyword has the same behavior as an empty schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10
|
||||
*/
|
||||
additionalItems?: JSONSchema6Definition
|
||||
additionalItems?: JSONSchema6Definition;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
* An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11
|
||||
*/
|
||||
maxItems?: number
|
||||
maxItems?: number;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
@@ -382,7 +382,7 @@ export interface JSONSchema6 {
|
||||
* Omitting this keyword has the same behavior as a value of 0.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12
|
||||
*/
|
||||
minItems?: number
|
||||
minItems?: number;
|
||||
|
||||
/**
|
||||
* If this keyword has boolean value false, the instance validates successfully.
|
||||
@@ -390,20 +390,20 @@ export interface JSONSchema6 {
|
||||
* Omitting this keyword has the same behavior as a value of false.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13
|
||||
*/
|
||||
uniqueItems?: boolean
|
||||
uniqueItems?: boolean;
|
||||
|
||||
/**
|
||||
* An array instance is valid against "contains" if at least one of its elements is valid against the given schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14
|
||||
*/
|
||||
contains?: JSONSchema6Definition
|
||||
contains?: JSONSchema6Definition;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
* An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15
|
||||
*/
|
||||
maxProperties?: number
|
||||
maxProperties?: number;
|
||||
|
||||
/**
|
||||
* Must be a non-negative integer.
|
||||
@@ -412,7 +412,7 @@ export interface JSONSchema6 {
|
||||
* Omitting this keyword has the same behavior as a value of 0.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16
|
||||
*/
|
||||
minProperties?: number
|
||||
minProperties?: number;
|
||||
|
||||
/**
|
||||
* Elements of this array must be unique.
|
||||
@@ -421,7 +421,7 @@ export interface JSONSchema6 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17
|
||||
*/
|
||||
required?: string[]
|
||||
required?: string[];
|
||||
|
||||
/**
|
||||
* This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.
|
||||
@@ -431,8 +431,8 @@ export interface JSONSchema6 {
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18
|
||||
*/
|
||||
properties?: {
|
||||
[k: string]: JSONSchema6Definition
|
||||
}
|
||||
[k: string]: JSONSchema6Definition;
|
||||
};
|
||||
|
||||
/**
|
||||
* This attribute is an object that defines the schema for a set of property names of an object instance.
|
||||
@@ -443,8 +443,8 @@ export interface JSONSchema6 {
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19
|
||||
*/
|
||||
patternProperties?: {
|
||||
[k: string]: JSONSchema6Definition
|
||||
}
|
||||
[k: string]: JSONSchema6Definition;
|
||||
};
|
||||
|
||||
/**
|
||||
* This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
|
||||
@@ -453,7 +453,7 @@ export interface JSONSchema6 {
|
||||
* The default value is an empty schema which allows any value for additional properties.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
|
||||
*/
|
||||
additionalProperties?: JSONSchema6Definition
|
||||
additionalProperties?: JSONSchema6Definition;
|
||||
|
||||
/**
|
||||
* This keyword specifies rules that are evaluated if the instance is an object and contains a certain property.
|
||||
@@ -463,8 +463,8 @@ export interface JSONSchema6 {
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21
|
||||
*/
|
||||
dependencies?: {
|
||||
[k: string]: JSONSchema6Definition | string[]
|
||||
}
|
||||
[k: string]: JSONSchema6Definition | string[];
|
||||
};
|
||||
|
||||
/**
|
||||
* Takes a schema which validates the names of all properties rather than their values.
|
||||
@@ -472,7 +472,7 @@ export interface JSONSchema6 {
|
||||
* Omitting this keyword has the same behavior as an empty schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22
|
||||
*/
|
||||
propertyNames?: JSONSchema6Definition
|
||||
propertyNames?: JSONSchema6Definition;
|
||||
|
||||
/**
|
||||
* This provides an enumeration of all possible values that are valid
|
||||
@@ -483,78 +483,78 @@ export interface JSONSchema6 {
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23
|
||||
*/
|
||||
enum?: JSONSchema6Type[]
|
||||
enum?: JSONSchema6Type[];
|
||||
|
||||
/**
|
||||
* More readible form of a one-element "enum"
|
||||
* More readable form of a one-element "enum"
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24
|
||||
*/
|
||||
const?: JSONSchema6Type
|
||||
const?: JSONSchema6Type;
|
||||
|
||||
/**
|
||||
* A single type, or a union of simple types
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25
|
||||
*/
|
||||
type?: JSONSchema6TypeName | JSONSchema6TypeName[]
|
||||
type?: JSONSchema6TypeName | JSONSchema6TypeName[];
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
|
||||
*/
|
||||
allOf?: JSONSchema6Definition[]
|
||||
allOf?: JSONSchema6Definition[];
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
|
||||
*/
|
||||
anyOf?: JSONSchema6Definition[]
|
||||
anyOf?: JSONSchema6Definition[];
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
|
||||
*/
|
||||
oneOf?: JSONSchema6Definition[]
|
||||
oneOf?: JSONSchema6Definition[];
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29
|
||||
*/
|
||||
not?: JSONSchema6Definition
|
||||
not?: JSONSchema6Definition;
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1
|
||||
*/
|
||||
definitions?: {
|
||||
[k: string]: JSONSchema6Definition
|
||||
}
|
||||
[k: string]: JSONSchema6Definition;
|
||||
};
|
||||
|
||||
/**
|
||||
* This attribute is a string that provides a short description of the instance property.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
|
||||
*/
|
||||
title?: string
|
||||
title?: string;
|
||||
|
||||
/**
|
||||
* This attribute is a string that provides a full description of the of purpose the instance property.
|
||||
*
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
|
||||
*/
|
||||
description?: string
|
||||
description?: string;
|
||||
|
||||
/**
|
||||
* This keyword can be used to supply a default JSON value associated with a particular schema.
|
||||
* It is RECOMMENDED that a default value be valid against the associated schema.
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3
|
||||
*/
|
||||
default?: JSONSchema6Type
|
||||
default?: JSONSchema6Type;
|
||||
|
||||
/**
|
||||
* Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4
|
||||
*/
|
||||
examples?: JSONSchema6Type[]
|
||||
examples?: JSONSchema6Type[];
|
||||
|
||||
/**
|
||||
* @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8
|
||||
*/
|
||||
format?: string
|
||||
format?: string;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
@@ -568,7 +568,7 @@ export interface JSONSchema6 {
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
||||
*/
|
||||
export type JSONSchema7TypeName =
|
||||
| 'string'
|
||||
| 'string' //
|
||||
| 'number'
|
||||
| 'integer'
|
||||
| 'boolean'
|
||||
@@ -581,7 +581,7 @@ export type JSONSchema7TypeName =
|
||||
* @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
|
||||
*/
|
||||
export type JSONSchema7Type =
|
||||
| string
|
||||
| string //
|
||||
| number
|
||||
| boolean
|
||||
| JSONSchema7Object
|
||||
@@ -739,7 +739,11 @@ export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONS
|
||||
* This is slightly different than the validate method in that it will fail if the schema is readonly and it will
|
||||
* not check for self-validation, it is assumed that the passed in value is already internally valid.
|
||||
*/
|
||||
export function checkPropertyChange(value: any, schema: JSONSchema4 | JSONSchema6 | JSONSchema7, property: string): ValidationResult;
|
||||
export function checkPropertyChange(
|
||||
value: any,
|
||||
schema: JSONSchema4 | JSONSchema6 | JSONSchema7,
|
||||
property: string,
|
||||
): ValidationResult;
|
||||
|
||||
/**
|
||||
* This checks to ensure that the result is valid and will throw an appropriate error message if it is not.
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@types/json-schema",
|
||||
"version": "7.0.5",
|
||||
"version": "7.0.7",
|
||||
"description": "TypeScript definitions for json-schema 4.0, 6.0 and",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
@@ -39,6 +39,6 @@
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "13bc0b77525d2b007b8b1b2ca14737cc908edb09aac83ec9a200f7d79ec25973",
|
||||
"typeScriptVersion": "3.0"
|
||||
"typesPublisherContentHash": "ef06c3e504eafcb78cb50a8ec27cdd4d6e863f83efa5622123a703af98c53075",
|
||||
"typeScriptVersion": "3.4"
|
||||
}
|
||||
+3
-3
@@ -8,9 +8,9 @@ This package contains type definitions for Node.js (http://nodejs.org/).
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Thu, 27 Aug 2020 11:19:52 GMT
|
||||
* Last updated: Fri, 19 Feb 2021 17:58:40 GMT
|
||||
* Dependencies: none
|
||||
* Global values: `Buffer`, `Symbol`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
|
||||
* Global values: `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [Alberto Schiabel](https://github.com/jkomyno), [Alexander T.](https://github.com/a-tarasyuk), [Alvis HT Tang](https://github.com/alvis), [Andrew Makarov](https://github.com/r3nya), [Benjamin Toueg](https://github.com/btoueg), [Bruno Scheufler](https://github.com/brunoscheufler), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Flarna](https://github.com/Flarna), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [Samuel Ainsworth](https://github.com/samuela), [Kyle Uehlein](https://github.com/kuehlein), [Jordi Oliveras Rovira](https://github.com/j-oliveras), [Thanik Bhongbhibhat](https://github.com/bhongy), [Marcin Kopacz](https://github.com/chyzwar), [Trivikram Kamat](https://github.com/trivikr), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), and [Jason Kwok](https://github.com/JasonHK).
|
||||
These definitions were written by [Microsoft TypeScript](https://github.com/Microsoft), [DefinitelyTyped](https://github.com/DefinitelyTyped), [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), [Bruno Scheufler](https://github.com/brunoscheufler), [Chigozirim C.](https://github.com/smac89), [David Junger](https://github.com/touffy), [Deividas Bakanas](https://github.com/DeividasBakanas), [Eugene Y. Q. Shen](https://github.com/eyqs), [Hannes Magnusson](https://github.com/Hannes-Magnusson-CK), [Hoàng Văn Khải](https://github.com/KSXGitHub), [Huw](https://github.com/hoo29), [Kelvin Jin](https://github.com/kjin), [Klaus Meinhardt](https://github.com/ajafff), [Lishude](https://github.com/islishude), [Mariusz Wiktorczyk](https://github.com/mwiktorczyk), [Mohsen Azimi](https://github.com/mohsen1), [Nicolas Even](https://github.com/n-e), [Nikita Galkin](https://github.com/galkin), [Parambir Singh](https://github.com/parambirs), [Sebastian Silbermann](https://github.com/eps1lon), [Simon Schick](https://github.com/SimonSchick), [Thomas den Hollander](https://github.com/ThomasdenH), [Wilco Bakker](https://github.com/WilcoBakker), [wwwy3y3](https://github.com/wwwy3y3), [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), [Minh Son Nguyen](https://github.com/nguymin4), [Junxiao Shi](https://github.com/yoursunny), [Ilia Baryshnikov](https://github.com/qwelias), [ExE Boss](https://github.com/ExE-Boss), [Surasak Chaisurin](https://github.com/Ryan-Willpower), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Anna Henningsen](https://github.com/addaleax), [Jason Kwok](https://github.com/JasonHK), [Victor Perin](https://github.com/victorperin), and [Yongsheng Zhang](https://github.com/ZYSzys).
|
||||
|
||||
+94
-22
@@ -1,9 +1,13 @@
|
||||
declare module "assert" {
|
||||
function assert(value: any, message?: string | Error): void;
|
||||
declare module 'node:assert' {
|
||||
import assert = require('assert');
|
||||
export = assert;
|
||||
}
|
||||
|
||||
declare module 'assert' {
|
||||
/** An alias of `assert.ok()`. */
|
||||
function assert(value: any, message?: string | Error): asserts value;
|
||||
namespace assert {
|
||||
class AssertionError implements Error {
|
||||
name: string;
|
||||
message: string;
|
||||
class AssertionError extends Error {
|
||||
actual: any;
|
||||
expected: any;
|
||||
operator: string;
|
||||
@@ -11,46 +15,114 @@ declare module "assert" {
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFn?: Function
|
||||
/** If provided, the error message is set to this value. */
|
||||
message?: string;
|
||||
/** The `actual` property on the error instance. */
|
||||
actual?: any;
|
||||
/** The `expected` property on the error instance. */
|
||||
expected?: any;
|
||||
/** The `operator` property on the error instance. */
|
||||
operator?: string;
|
||||
/** If provided, the generated stack trace omits frames before this function. */
|
||||
// tslint:disable-next-line:ban-types
|
||||
stackStartFn?: Function;
|
||||
});
|
||||
}
|
||||
|
||||
type AssertPredicate = RegExp | (new() => object) | ((thrown: any) => boolean) | object | Error;
|
||||
class CallTracker {
|
||||
calls(exact?: number): () => void;
|
||||
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
|
||||
report(): CallTrackerReportInformation[];
|
||||
verify(): void;
|
||||
}
|
||||
interface CallTrackerReportInformation {
|
||||
message: string;
|
||||
/** The actual number of times the function was called. */
|
||||
actual: number;
|
||||
/** The number of times the function was expected to be called. */
|
||||
expected: number;
|
||||
/** The name of the function that is wrapped. */
|
||||
operator: string;
|
||||
/** A stack trace of the function. */
|
||||
stack: object;
|
||||
}
|
||||
|
||||
type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
|
||||
|
||||
function fail(message?: string | Error): never;
|
||||
/** @deprecated since v10.0.0 - use `fail([message])` or other assert functions instead. */
|
||||
function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
|
||||
function ok(value: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use `strictEqual()` instead. */
|
||||
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
||||
function fail(
|
||||
actual: any,
|
||||
expected: any,
|
||||
message?: string | Error,
|
||||
operator?: string,
|
||||
// tslint:disable-next-line:ban-types
|
||||
stackStartFn?: Function,
|
||||
): never;
|
||||
function ok(value: any, message?: string | Error): asserts value;
|
||||
/** @deprecated since v9.9.0 - use strictEqual() instead. */
|
||||
function equal(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use `notStrictEqual()` instead. */
|
||||
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
|
||||
function notEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use `deepStrictEqual()` instead. */
|
||||
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
|
||||
function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use `notDeepStrictEqual()` instead. */
|
||||
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
|
||||
function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function strictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
|
||||
function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
|
||||
function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
|
||||
function throws(block: () => any, message?: string | Error): void;
|
||||
function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
||||
function doesNotThrow(block: () => any, message?: string | Error): void;
|
||||
function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
|
||||
function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
||||
|
||||
function ifError(value: any): void;
|
||||
function ifError(value: any): asserts value is null | undefined;
|
||||
|
||||
function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
||||
function rejects(block: (() => Promise<any>) | Promise<any>, error: AssertPredicate, message?: string | Error): Promise<void>;
|
||||
function rejects(
|
||||
block: (() => Promise<any>) | Promise<any>,
|
||||
error: AssertPredicate,
|
||||
message?: string | Error,
|
||||
): Promise<void>;
|
||||
function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
||||
function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
|
||||
function doesNotReject(
|
||||
block: (() => Promise<any>) | Promise<any>,
|
||||
error: AssertPredicate,
|
||||
message?: string | Error,
|
||||
): Promise<void>;
|
||||
|
||||
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
||||
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
||||
|
||||
const strict: typeof assert;
|
||||
const strict: Omit<
|
||||
typeof assert,
|
||||
| 'equal'
|
||||
| 'notEqual'
|
||||
| 'deepEqual'
|
||||
| 'notDeepEqual'
|
||||
| 'ok'
|
||||
| 'strictEqual'
|
||||
| 'deepStrictEqual'
|
||||
| 'ifError'
|
||||
| 'strict'
|
||||
> & {
|
||||
(value: any, message?: string | Error): asserts value;
|
||||
equal: typeof strictEqual;
|
||||
notEqual: typeof notStrictEqual;
|
||||
deepEqual: typeof deepStrictEqual;
|
||||
notDeepEqual: typeof notDeepStrictEqual;
|
||||
|
||||
// Mapped types and assertion functions are incompatible?
|
||||
// TS2775: Assertions require every name in the call target
|
||||
// to be declared with an explicit type annotation.
|
||||
ok: typeof ok;
|
||||
strictEqual: typeof strictEqual;
|
||||
deepStrictEqual: typeof deepStrictEqual;
|
||||
ifError: typeof ifError;
|
||||
strict: typeof strict;
|
||||
};
|
||||
}
|
||||
|
||||
export = assert;
|
||||
|
||||
+21
-1
@@ -1,7 +1,14 @@
|
||||
/**
|
||||
* Async Hooks module: https://nodejs.org/api/async_hooks.html
|
||||
*/
|
||||
declare module "async_hooks" {
|
||||
declare module 'node:async_hooks' {
|
||||
export * from 'async_hooks';
|
||||
}
|
||||
|
||||
/**
|
||||
* Async Hooks module: https://nodejs.org/api/async_hooks.html
|
||||
*/
|
||||
declare module 'async_hooks' {
|
||||
/**
|
||||
* Returns the asyncId of the current execution context.
|
||||
*/
|
||||
@@ -115,6 +122,19 @@ declare module "async_hooks" {
|
||||
*/
|
||||
constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
|
||||
|
||||
/**
|
||||
* Binds the given function to the current execution context.
|
||||
* @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 (...args: any[]) => any>(fn: Func, type?: string): Func & { asyncResource: AsyncResource };
|
||||
|
||||
/**
|
||||
* Binds the given function to execute to this `AsyncResource`'s scope.
|
||||
* @param fn The function to bind to the current `AsyncResource`.
|
||||
*/
|
||||
bind<Func extends (...args: any[]) => any>(fn: Func): Func & { asyncResource: AsyncResource };
|
||||
|
||||
/**
|
||||
* Call the provided function with the provided arguments in the
|
||||
* execution context of the async resource. This will establish the
|
||||
|
||||
+19
-41
@@ -1,41 +1,19 @@
|
||||
// base definitions for all NodeJS modules that are not specific to any version of TypeScript
|
||||
/// <reference path="globals.d.ts" />
|
||||
/// <reference path="async_hooks.d.ts" />
|
||||
/// <reference path="buffer.d.ts" />
|
||||
/// <reference path="child_process.d.ts" />
|
||||
/// <reference path="cluster.d.ts" />
|
||||
/// <reference path="console.d.ts" />
|
||||
/// <reference path="constants.d.ts" />
|
||||
/// <reference path="crypto.d.ts" />
|
||||
/// <reference path="dgram.d.ts" />
|
||||
/// <reference path="dns.d.ts" />
|
||||
/// <reference path="domain.d.ts" />
|
||||
/// <reference path="events.d.ts" />
|
||||
/// <reference path="fs.d.ts" />
|
||||
/// <reference path="fs/promises.d.ts" />
|
||||
/// <reference path="http.d.ts" />
|
||||
/// <reference path="http2.d.ts" />
|
||||
/// <reference path="https.d.ts" />
|
||||
/// <reference path="inspector.d.ts" />
|
||||
/// <reference path="module.d.ts" />
|
||||
/// <reference path="net.d.ts" />
|
||||
/// <reference path="os.d.ts" />
|
||||
/// <reference path="path.d.ts" />
|
||||
/// <reference path="perf_hooks.d.ts" />
|
||||
/// <reference path="process.d.ts" />
|
||||
/// <reference path="punycode.d.ts" />
|
||||
/// <reference path="querystring.d.ts" />
|
||||
/// <reference path="readline.d.ts" />
|
||||
/// <reference path="repl.d.ts" />
|
||||
/// <reference path="stream.d.ts" />
|
||||
/// <reference path="string_decoder.d.ts" />
|
||||
/// <reference path="timers.d.ts" />
|
||||
/// <reference path="tls.d.ts" />
|
||||
/// <reference path="trace_events.d.ts" />
|
||||
/// <reference path="tty.d.ts" />
|
||||
/// <reference path="url.d.ts" />
|
||||
/// <reference path="util.d.ts" />
|
||||
/// <reference path="v8.d.ts" />
|
||||
/// <reference path="vm.d.ts" />
|
||||
/// <reference path="worker_threads.d.ts" />
|
||||
/// <reference path="zlib.d.ts" />
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.7.
|
||||
|
||||
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
||||
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
||||
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
|
||||
// - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7
|
||||
// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
|
||||
|
||||
// Reference required types from the default lib:
|
||||
/// <reference lib="es2018" />
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/// <reference lib="esnext.intl" />
|
||||
/// <reference lib="esnext.bigint" />
|
||||
|
||||
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
||||
/// <reference path="ts3.6/base.d.ts" />
|
||||
|
||||
// TypeScript 3.7-specific augmentations:
|
||||
/// <reference path="assert.d.ts" />
|
||||
|
||||
+5
-1
@@ -1,4 +1,8 @@
|
||||
declare module "buffer" {
|
||||
declare module 'node:buffer' {
|
||||
export * from 'buffer';
|
||||
}
|
||||
|
||||
declare module 'buffer' {
|
||||
export const INSPECT_MAX_BYTES: number;
|
||||
export const kMaxLength: number;
|
||||
export const kStringMaxLength: number;
|
||||
|
||||
+26
-18
@@ -1,8 +1,12 @@
|
||||
declare module "child_process" {
|
||||
import { BaseEncodingOptions } from 'fs';
|
||||
import * as events from "events";
|
||||
import * as net from "net";
|
||||
import { Writable, Readable, Stream, Pipe } from "stream";
|
||||
declare module 'node:child_process' {
|
||||
export * from 'child_process';
|
||||
}
|
||||
|
||||
declare module 'child_process' {
|
||||
import { BaseEncodingOptions } from 'node:fs';
|
||||
import * as events from 'node:events';
|
||||
import * as net from 'node:net';
|
||||
import { Writable, Readable, Stream, Pipe } from 'node:stream';
|
||||
|
||||
type Serializable = string | object | number | boolean;
|
||||
type SendHandle = net.Socket | net.Server;
|
||||
@@ -23,7 +27,7 @@ declare module "child_process" {
|
||||
readonly pid: number;
|
||||
readonly connected: boolean;
|
||||
readonly exitCode: number | null;
|
||||
readonly signalCode: number | null;
|
||||
readonly signalCode: NodeJS.Signals | null;
|
||||
readonly spawnargs: string[];
|
||||
readonly spawnfile: string;
|
||||
kill(signal?: NodeJS.Signals | number): boolean;
|
||||
@@ -44,42 +48,42 @@ declare module "child_process" {
|
||||
*/
|
||||
|
||||
addListener(event: string, listener: (...args: any[]) => void): this;
|
||||
addListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
|
||||
addListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
addListener(event: "disconnect", listener: () => void): this;
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
addListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
addListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
||||
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
emit(event: "close", code: number, signal: NodeJS.Signals): boolean;
|
||||
emit(event: "close", code: number | null, signal: NodeJS.Signals | null): boolean;
|
||||
emit(event: "disconnect"): boolean;
|
||||
emit(event: "error", err: Error): boolean;
|
||||
emit(event: "exit", code: number | null, signal: NodeJS.Signals | null): boolean;
|
||||
emit(event: "message", message: Serializable, sendHandle: SendHandle): boolean;
|
||||
|
||||
on(event: string, listener: (...args: any[]) => void): this;
|
||||
on(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
|
||||
on(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
on(event: "disconnect", listener: () => void): this;
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
on(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
||||
|
||||
once(event: string, listener: (...args: any[]) => void): this;
|
||||
once(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
|
||||
once(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
once(event: "disconnect", listener: () => void): this;
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
once(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
once(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
||||
|
||||
prependListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
|
||||
prependListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
prependListener(event: "disconnect", listener: () => void): this;
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
prependListener(event: "message", listener: (message: Serializable, sendHandle: SendHandle) => void): this;
|
||||
|
||||
prependOnceListener(event: string, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: "close", listener: (code: number, signal: NodeJS.Signals) => void): this;
|
||||
prependOnceListener(event: "close", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
prependOnceListener(event: "disconnect", listener: () => void): this;
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "exit", listener: (code: number | null, signal: NodeJS.Signals | null) => void): this;
|
||||
@@ -405,19 +409,23 @@ declare module "child_process" {
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
namespace execFile {
|
||||
function __promisify__(file: string): PromiseWithChild<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null): PromiseWithChild<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
|
||||
function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithBufferEncoding): PromiseWithChild<{ stdout: Buffer, stderr: Buffer }>;
|
||||
function __promisify__(file: string, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptionsWithStringEncoding): PromiseWithChild<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptionsWithOtherEncoding): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
args: ReadonlyArray<string> | undefined | null,
|
||||
options: ExecFileOptionsWithOtherEncoding,
|
||||
): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
function __promisify__(file: string, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, args: string[] | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, args: ReadonlyArray<string> | undefined | null, options: ExecFileOptions): PromiseWithChild<{ stdout: string, stderr: string }>;
|
||||
function __promisify__(file: string, options: (BaseEncodingOptions & ExecFileOptions) | undefined | null): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
function __promisify__(
|
||||
file: string,
|
||||
args: string[] | undefined | null,
|
||||
args: ReadonlyArray<string> | undefined | null,
|
||||
options: (BaseEncodingOptions & ExecFileOptions) | undefined | null,
|
||||
): PromiseWithChild<{ stdout: string | Buffer, stderr: string | Buffer }>;
|
||||
}
|
||||
|
||||
+10
-6
@@ -1,7 +1,11 @@
|
||||
declare module "cluster" {
|
||||
import * as child from "child_process";
|
||||
import * as events from "events";
|
||||
import * as net from "net";
|
||||
declare module 'node:cluster' {
|
||||
export * from 'cluster';
|
||||
}
|
||||
|
||||
declare module 'cluster' {
|
||||
import * as child from 'node:child_process';
|
||||
import EventEmitter = require('node:events');
|
||||
import * as net from 'node:net';
|
||||
|
||||
// interfaces
|
||||
interface ClusterSettings {
|
||||
@@ -21,7 +25,7 @@ declare module "cluster" {
|
||||
addressType: number | "udp4" | "udp6"; // 4, 6, -1, "udp4", "udp6"
|
||||
}
|
||||
|
||||
class Worker extends events.EventEmitter {
|
||||
class Worker extends EventEmitter {
|
||||
id: number;
|
||||
process: child.ChildProcess;
|
||||
send(message: child.Serializable, sendHandle?: child.SendHandle, callback?: (error: Error | null) => void): boolean;
|
||||
@@ -90,7 +94,7 @@ declare module "cluster" {
|
||||
prependOnceListener(event: "online", listener: () => void): this;
|
||||
}
|
||||
|
||||
interface Cluster extends events.EventEmitter {
|
||||
interface Cluster extends EventEmitter {
|
||||
Worker: Worker;
|
||||
disconnect(callback?: () => void): void;
|
||||
fork(env?: any): Worker;
|
||||
|
||||
+7
-3
@@ -1,5 +1,9 @@
|
||||
declare module "console" {
|
||||
import { InspectOptions } from 'util';
|
||||
declare module 'node:console' {
|
||||
export = console;
|
||||
}
|
||||
|
||||
declare module '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
|
||||
@@ -66,7 +70,7 @@ declare module "console" {
|
||||
* This method does not display anything unless used in the inspector.
|
||||
* Prints to `stdout` the array `array` formatted as a table.
|
||||
*/
|
||||
table(tabularData: any, properties?: string[]): void;
|
||||
table(tabularData: any, properties?: ReadonlyArray<string>): void;
|
||||
/**
|
||||
* Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
|
||||
*/
|
||||
|
||||
+16
-5
@@ -1,8 +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 'os';
|
||||
import { constants as cryptoConstants } from 'crypto';
|
||||
import { constants as fsConstants } from 'fs';
|
||||
const exp: typeof osConstants.errno & typeof osConstants.priority & SignalConstants & typeof cryptoConstants & typeof fsConstants;
|
||||
declare module 'node:constants' {
|
||||
import exp = require('constants');
|
||||
export = exp;
|
||||
}
|
||||
|
||||
/** @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;
|
||||
}
|
||||
|
||||
+654
-127
@@ -1,17 +1,40 @@
|
||||
declare module "crypto" {
|
||||
import * as stream from "stream";
|
||||
declare module 'node:crypto' {
|
||||
export * from 'crypto';
|
||||
}
|
||||
|
||||
declare module 'crypto' {
|
||||
import * as stream from 'node:stream';
|
||||
|
||||
interface Certificate {
|
||||
/**
|
||||
* @param spkac
|
||||
* @returns The challenge component of the `spkac` data structure,
|
||||
* which includes a public key and a challenge.
|
||||
*/
|
||||
exportChallenge(spkac: BinaryLike): Buffer;
|
||||
exportPublicKey(spkac: BinaryLike): Buffer;
|
||||
/**
|
||||
* @param spkac
|
||||
* @param encoding The encoding of the spkac string.
|
||||
* @returns The public key component of the `spkac` data structure,
|
||||
* which includes a public key and a challenge.
|
||||
*/
|
||||
exportPublicKey(spkac: BinaryLike, encoding?: string): Buffer;
|
||||
/**
|
||||
* @param spkac
|
||||
* @returns `true` if the given `spkac` data structure is valid,
|
||||
* `false` otherwise.
|
||||
*/
|
||||
verifySpkac(spkac: NodeJS.ArrayBufferView): boolean;
|
||||
}
|
||||
const Certificate: {
|
||||
new(): Certificate;
|
||||
const Certificate: Certificate & {
|
||||
/** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
|
||||
new (): Certificate;
|
||||
/** @deprecated since v14.9.0 - Use static methods of `crypto.Certificate` instead. */
|
||||
(): Certificate;
|
||||
};
|
||||
|
||||
namespace constants { // https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
|
||||
namespace constants {
|
||||
// https://nodejs.org/dist/latest-v10.x/docs/api/crypto.html#crypto_crypto_constants
|
||||
const OPENSSL_VERSION_NUMBER: number;
|
||||
|
||||
/** Applies multiple bug workarounds within OpenSSL. See https://www.openssl.org/docs/man1.0.2/ssl/SSL_CTX_set_options.html for detail. */
|
||||
@@ -120,26 +143,29 @@ declare module "crypto" {
|
||||
function createHash(algorithm: string, options?: HashOptions): Hash;
|
||||
function createHmac(algorithm: string, key: BinaryLike | KeyObject, options?: stream.TransformOptions): Hmac;
|
||||
|
||||
type Utf8AsciiLatin1Encoding = "utf8" | "ascii" | "latin1";
|
||||
type HexBase64Latin1Encoding = "latin1" | "hex" | "base64";
|
||||
type Utf8AsciiBinaryEncoding = "utf8" | "ascii" | "binary";
|
||||
type HexBase64BinaryEncoding = "binary" | "base64" | "hex";
|
||||
type ECDHKeyFormat = "compressed" | "uncompressed" | "hybrid";
|
||||
// https://nodejs.org/api/buffer.html#buffer_buffers_and_character_encodings
|
||||
type BinaryToTextEncoding = 'base64' | 'hex';
|
||||
type CharacterEncoding = 'utf8' | 'utf-8' | 'utf16le' | 'latin1';
|
||||
type LegacyCharacterEncoding = 'ascii' | 'binary' | 'ucs2' | 'ucs-2';
|
||||
|
||||
type Encoding = BinaryToTextEncoding | CharacterEncoding | LegacyCharacterEncoding;
|
||||
|
||||
type ECDHKeyFormat = 'compressed' | 'uncompressed' | 'hybrid';
|
||||
|
||||
class Hash extends stream.Transform {
|
||||
private constructor();
|
||||
copy(): Hash;
|
||||
update(data: BinaryLike): Hash;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hash;
|
||||
update(data: string, input_encoding: Encoding): Hash;
|
||||
digest(): Buffer;
|
||||
digest(encoding: HexBase64Latin1Encoding): string;
|
||||
digest(encoding: BinaryToTextEncoding): string;
|
||||
}
|
||||
class Hmac extends stream.Transform {
|
||||
private constructor();
|
||||
update(data: BinaryLike): Hmac;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Hmac;
|
||||
update(data: string, input_encoding: Encoding): Hmac;
|
||||
digest(): Buffer;
|
||||
digest(encoding: HexBase64Latin1Encoding): string;
|
||||
digest(encoding: BinaryToTextEncoding): string;
|
||||
}
|
||||
|
||||
type KeyObjectType = 'secret' | 'public' | 'private';
|
||||
@@ -189,36 +215,39 @@ declare module "crypto" {
|
||||
algorithm: CipherCCMTypes,
|
||||
key: CipherKey,
|
||||
iv: BinaryLike | null,
|
||||
options: CipherCCMOptions
|
||||
options: CipherCCMOptions,
|
||||
): CipherCCM;
|
||||
function createCipheriv(
|
||||
algorithm: CipherGCMTypes,
|
||||
key: CipherKey,
|
||||
iv: BinaryLike | null,
|
||||
options?: CipherGCMOptions
|
||||
options?: CipherGCMOptions,
|
||||
): CipherGCM;
|
||||
function createCipheriv(
|
||||
algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions
|
||||
algorithm: string,
|
||||
key: CipherKey,
|
||||
iv: BinaryLike | null,
|
||||
options?: stream.TransformOptions,
|
||||
): Cipher;
|
||||
|
||||
class Cipher extends stream.Transform {
|
||||
private constructor();
|
||||
update(data: BinaryLike): Buffer;
|
||||
update(data: string, input_encoding: Utf8AsciiBinaryEncoding): Buffer;
|
||||
update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: HexBase64BinaryEncoding): string;
|
||||
update(data: string, input_encoding: Utf8AsciiBinaryEncoding | undefined, output_encoding: HexBase64BinaryEncoding): string;
|
||||
update(data: string, input_encoding: Encoding): Buffer;
|
||||
update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: BinaryToTextEncoding): string;
|
||||
update(data: string, input_encoding: Encoding | undefined, output_encoding: BinaryToTextEncoding): string;
|
||||
final(): Buffer;
|
||||
final(output_encoding: BufferEncoding): string;
|
||||
setAutoPadding(auto_padding?: boolean): this;
|
||||
// getAuthTag(): Buffer;
|
||||
// setAAD(buffer: Buffer): this; // docs only say buffer
|
||||
// setAAD(buffer: NodeJS.ArrayBufferView): this;
|
||||
}
|
||||
interface CipherCCM extends Cipher {
|
||||
setAAD(buffer: Buffer, options: { plaintextLength: number }): this;
|
||||
setAAD(buffer: NodeJS.ArrayBufferView, options: { plaintextLength: number }): this;
|
||||
getAuthTag(): Buffer;
|
||||
}
|
||||
interface CipherGCM extends Cipher {
|
||||
setAAD(buffer: Buffer, options?: { plaintextLength: number }): this;
|
||||
setAAD(buffer: NodeJS.ArrayBufferView, options?: { plaintextLength: number }): this;
|
||||
getAuthTag(): Buffer;
|
||||
}
|
||||
/** @deprecated since v10.0.0 use `createDecipheriv()` */
|
||||
@@ -240,14 +269,19 @@ declare module "crypto" {
|
||||
iv: BinaryLike | null,
|
||||
options?: CipherGCMOptions,
|
||||
): DecipherGCM;
|
||||
function createDecipheriv(algorithm: string, key: CipherKey, iv: BinaryLike | null, options?: stream.TransformOptions): Decipher;
|
||||
function createDecipheriv(
|
||||
algorithm: string,
|
||||
key: CipherKey,
|
||||
iv: BinaryLike | null,
|
||||
options?: stream.TransformOptions,
|
||||
): Decipher;
|
||||
|
||||
class Decipher extends stream.Transform {
|
||||
private constructor();
|
||||
update(data: NodeJS.ArrayBufferView): Buffer;
|
||||
update(data: string, input_encoding: HexBase64BinaryEncoding): Buffer;
|
||||
update(data: NodeJS.ArrayBufferView, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
|
||||
update(data: string, input_encoding: HexBase64BinaryEncoding | undefined, output_encoding: Utf8AsciiBinaryEncoding): string;
|
||||
update(data: string, input_encoding: BinaryToTextEncoding): Buffer;
|
||||
update(data: NodeJS.ArrayBufferView, input_encoding: undefined, output_encoding: Encoding): string;
|
||||
update(data: string, input_encoding: BinaryToTextEncoding | undefined, output_encoding: Encoding): string;
|
||||
final(): Buffer;
|
||||
final(output_encoding: BufferEncoding): string;
|
||||
setAutoPadding(auto_padding?: boolean): this;
|
||||
@@ -278,19 +312,28 @@ declare module "crypto" {
|
||||
|
||||
function createPrivateKey(key: PrivateKeyInput | string | Buffer): KeyObject;
|
||||
function createPublicKey(key: PublicKeyInput | string | Buffer | KeyObject): KeyObject;
|
||||
function createSecretKey(key: Buffer): KeyObject;
|
||||
function createSecretKey(key: NodeJS.ArrayBufferView): KeyObject;
|
||||
|
||||
function createSign(algorithm: string, options?: stream.WritableOptions): Signer;
|
||||
|
||||
type DSAEncoding = 'der' | 'ieee-p1363';
|
||||
|
||||
interface SigningOptions {
|
||||
/**
|
||||
* @See crypto.constants.RSA_PKCS1_PADDING
|
||||
*/
|
||||
padding?: number;
|
||||
saltLength?: number;
|
||||
dsaEncoding?: DSAEncoding;
|
||||
}
|
||||
|
||||
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {
|
||||
interface SignPrivateKeyInput extends PrivateKeyInput, SigningOptions {}
|
||||
interface SignKeyObjectInput extends SigningOptions {
|
||||
key: KeyObject;
|
||||
}
|
||||
interface VerifyPublicKeyInput extends PublicKeyInput, SigningOptions {}
|
||||
interface VerifyKeyObjectInput extends SigningOptions {
|
||||
key: KeyObject;
|
||||
}
|
||||
|
||||
type KeyLike = string | Buffer | KeyObject;
|
||||
@@ -299,9 +342,12 @@ declare module "crypto" {
|
||||
private constructor();
|
||||
|
||||
update(data: BinaryLike): Signer;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Signer;
|
||||
sign(private_key: SignPrivateKeyInput | KeyLike): Buffer;
|
||||
sign(private_key: SignPrivateKeyInput | KeyLike, output_format: HexBase64Latin1Encoding): string;
|
||||
update(data: string, input_encoding: Encoding): Signer;
|
||||
sign(private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput): Buffer;
|
||||
sign(
|
||||
private_key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
|
||||
output_format: BinaryToTextEncoding,
|
||||
): string;
|
||||
}
|
||||
|
||||
function createVerify(algorithm: string, options?: stream.WritableOptions): Verify;
|
||||
@@ -309,33 +355,53 @@ declare module "crypto" {
|
||||
private constructor();
|
||||
|
||||
update(data: BinaryLike): Verify;
|
||||
update(data: string, input_encoding: Utf8AsciiLatin1Encoding): Verify;
|
||||
verify(object: object | KeyLike, signature: NodeJS.ArrayBufferView): boolean;
|
||||
verify(object: object | KeyLike, signature: string, signature_format?: HexBase64Latin1Encoding): boolean;
|
||||
update(data: string, input_encoding: Encoding): Verify;
|
||||
verify(
|
||||
object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
|
||||
signature: NodeJS.ArrayBufferView,
|
||||
): boolean;
|
||||
verify(
|
||||
object: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
|
||||
signature: string,
|
||||
signature_format?: BinaryToTextEncoding,
|
||||
): boolean;
|
||||
// https://nodejs.org/api/crypto.html#crypto_verifier_verify_object_signature_signature_format
|
||||
// The signature field accepts a TypedArray type, but it is only available starting ES2017
|
||||
}
|
||||
function createDiffieHellman(prime_length: number, generator?: number | NodeJS.ArrayBufferView): DiffieHellman;
|
||||
function createDiffieHellman(prime: NodeJS.ArrayBufferView): DiffieHellman;
|
||||
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
||||
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: number | NodeJS.ArrayBufferView): DiffieHellman;
|
||||
function createDiffieHellman(prime: string, prime_encoding: HexBase64Latin1Encoding, generator: string, generator_encoding: HexBase64Latin1Encoding): DiffieHellman;
|
||||
function createDiffieHellman(prime: string, prime_encoding: BinaryToTextEncoding): DiffieHellman;
|
||||
function createDiffieHellman(
|
||||
prime: string,
|
||||
prime_encoding: BinaryToTextEncoding,
|
||||
generator: number | NodeJS.ArrayBufferView,
|
||||
): DiffieHellman;
|
||||
function createDiffieHellman(
|
||||
prime: string,
|
||||
prime_encoding: BinaryToTextEncoding,
|
||||
generator: string,
|
||||
generator_encoding: BinaryToTextEncoding,
|
||||
): DiffieHellman;
|
||||
class DiffieHellman {
|
||||
private constructor();
|
||||
generateKeys(): Buffer;
|
||||
generateKeys(encoding: HexBase64Latin1Encoding): string;
|
||||
generateKeys(encoding: BinaryToTextEncoding): string;
|
||||
computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
|
||||
computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
|
||||
computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
|
||||
computeSecret(
|
||||
other_public_key: string,
|
||||
input_encoding: BinaryToTextEncoding,
|
||||
output_encoding: BinaryToTextEncoding,
|
||||
): string;
|
||||
getPrime(): Buffer;
|
||||
getPrime(encoding: HexBase64Latin1Encoding): string;
|
||||
getPrime(encoding: BinaryToTextEncoding): string;
|
||||
getGenerator(): Buffer;
|
||||
getGenerator(encoding: HexBase64Latin1Encoding): string;
|
||||
getGenerator(encoding: BinaryToTextEncoding): string;
|
||||
getPublicKey(): Buffer;
|
||||
getPublicKey(encoding: HexBase64Latin1Encoding): string;
|
||||
getPublicKey(encoding: BinaryToTextEncoding): string;
|
||||
getPrivateKey(): Buffer;
|
||||
getPrivateKey(encoding: HexBase64Latin1Encoding): string;
|
||||
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
||||
setPublicKey(public_key: NodeJS.ArrayBufferView): void;
|
||||
setPublicKey(public_key: string, encoding: BufferEncoding): void;
|
||||
setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
|
||||
@@ -351,19 +417,45 @@ declare module "crypto" {
|
||||
digest: string,
|
||||
callback: (err: Error | null, derivedKey: Buffer) => any,
|
||||
): void;
|
||||
function pbkdf2Sync(password: BinaryLike, salt: BinaryLike, iterations: number, keylen: number, digest: string): Buffer;
|
||||
function pbkdf2Sync(
|
||||
password: BinaryLike,
|
||||
salt: BinaryLike,
|
||||
iterations: number,
|
||||
keylen: number,
|
||||
digest: string,
|
||||
): Buffer;
|
||||
|
||||
function randomBytes(size: number): Buffer;
|
||||
function randomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
function pseudoRandomBytes(size: number): Buffer;
|
||||
function pseudoRandomBytes(size: number, callback: (err: Error | null, buf: Buffer) => void): void;
|
||||
|
||||
function randomInt(max: number): number;
|
||||
function randomInt(min: number, max: number): number;
|
||||
function randomInt(max: number, callback: (err: Error | null, value: number) => void): void;
|
||||
function randomInt(min: number, max: number, callback: (err: Error | null, value: number) => void): void;
|
||||
|
||||
function randomFillSync<T extends NodeJS.ArrayBufferView>(buffer: T, offset?: number, size?: number): T;
|
||||
function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, callback: (err: Error | null, buf: T) => void): void;
|
||||
function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, callback: (err: Error | null, buf: T) => void): void;
|
||||
function randomFill<T extends NodeJS.ArrayBufferView>(buffer: T, offset: number, size: number, callback: (err: Error | null, buf: T) => void): void;
|
||||
function randomFill<T extends NodeJS.ArrayBufferView>(
|
||||
buffer: T,
|
||||
callback: (err: Error | null, buf: T) => void,
|
||||
): void;
|
||||
function randomFill<T extends NodeJS.ArrayBufferView>(
|
||||
buffer: T,
|
||||
offset: number,
|
||||
callback: (err: Error | null, buf: T) => void,
|
||||
): void;
|
||||
function randomFill<T extends NodeJS.ArrayBufferView>(
|
||||
buffer: T,
|
||||
offset: number,
|
||||
size: number,
|
||||
callback: (err: Error | null, buf: T) => void,
|
||||
): void;
|
||||
|
||||
interface ScryptOptions {
|
||||
cost?: number;
|
||||
blockSize?: number;
|
||||
parallelization?: number;
|
||||
N?: number;
|
||||
r?: number;
|
||||
p?: number;
|
||||
@@ -372,7 +464,8 @@ declare module "crypto" {
|
||||
function scrypt(
|
||||
password: BinaryLike,
|
||||
salt: BinaryLike,
|
||||
keylen: number, callback: (err: Error | null, derivedKey: Buffer) => void,
|
||||
keylen: number,
|
||||
callback: (err: Error | null, derivedKey: Buffer) => void,
|
||||
): void;
|
||||
function scrypt(
|
||||
password: BinaryLike,
|
||||
@@ -403,35 +496,40 @@ declare module "crypto" {
|
||||
function privateEncrypt(private_key: RsaPrivateKey | KeyLike, buffer: NodeJS.ArrayBufferView): Buffer;
|
||||
function getCiphers(): string[];
|
||||
function getCurves(): string[];
|
||||
function getFips(): 1 | 0;
|
||||
function getHashes(): string[];
|
||||
class ECDH {
|
||||
private constructor();
|
||||
static convertKey(
|
||||
key: BinaryLike,
|
||||
curve: string,
|
||||
inputEncoding?: HexBase64Latin1Encoding,
|
||||
outputEncoding?: "latin1" | "hex" | "base64",
|
||||
format?: "uncompressed" | "compressed" | "hybrid",
|
||||
inputEncoding?: BinaryToTextEncoding,
|
||||
outputEncoding?: 'latin1' | 'hex' | 'base64',
|
||||
format?: 'uncompressed' | 'compressed' | 'hybrid',
|
||||
): Buffer | string;
|
||||
generateKeys(): Buffer;
|
||||
generateKeys(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
|
||||
generateKeys(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
||||
computeSecret(other_public_key: NodeJS.ArrayBufferView): Buffer;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding): Buffer;
|
||||
computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: string, input_encoding: HexBase64Latin1Encoding, output_encoding: HexBase64Latin1Encoding): string;
|
||||
computeSecret(other_public_key: string, input_encoding: BinaryToTextEncoding): Buffer;
|
||||
computeSecret(other_public_key: NodeJS.ArrayBufferView, output_encoding: BinaryToTextEncoding): string;
|
||||
computeSecret(
|
||||
other_public_key: string,
|
||||
input_encoding: BinaryToTextEncoding,
|
||||
output_encoding: BinaryToTextEncoding,
|
||||
): string;
|
||||
getPrivateKey(): Buffer;
|
||||
getPrivateKey(encoding: HexBase64Latin1Encoding): string;
|
||||
getPrivateKey(encoding: BinaryToTextEncoding): string;
|
||||
getPublicKey(): Buffer;
|
||||
getPublicKey(encoding: HexBase64Latin1Encoding, format?: ECDHKeyFormat): string;
|
||||
getPublicKey(encoding: BinaryToTextEncoding, format?: ECDHKeyFormat): string;
|
||||
setPrivateKey(private_key: NodeJS.ArrayBufferView): void;
|
||||
setPrivateKey(private_key: string, encoding: HexBase64Latin1Encoding): void;
|
||||
setPrivateKey(private_key: string, encoding: BinaryToTextEncoding): void;
|
||||
}
|
||||
function createECDH(curve_name: string): ECDH;
|
||||
function timingSafeEqual(a: NodeJS.ArrayBufferView, b: NodeJS.ArrayBufferView): boolean;
|
||||
/** @deprecated since v10.0.0 */
|
||||
const DEFAULT_ENCODING: BufferEncoding;
|
||||
|
||||
type KeyType = 'rsa' | 'dsa' | 'ec' | 'ed25519';
|
||||
type KeyType = 'rsa' | 'dsa' | 'ec' | 'ed25519' | 'ed448' | 'x25519' | 'x448';
|
||||
type KeyFormat = 'pem' | 'der';
|
||||
|
||||
interface BasePrivateKeyEncodingOptions<T extends KeyFormat> {
|
||||
@@ -451,6 +549,24 @@ declare module "crypto" {
|
||||
*/
|
||||
}
|
||||
|
||||
interface ED448KeyPairKeyObjectOptions {
|
||||
/**
|
||||
* No options.
|
||||
*/
|
||||
}
|
||||
|
||||
interface X25519KeyPairKeyObjectOptions {
|
||||
/**
|
||||
* No options.
|
||||
*/
|
||||
}
|
||||
|
||||
interface X448KeyPairKeyObjectOptions {
|
||||
/**
|
||||
* No options.
|
||||
*/
|
||||
}
|
||||
|
||||
interface ECKeyPairKeyObjectOptions {
|
||||
/**
|
||||
* Name of the curve to use.
|
||||
@@ -537,11 +653,41 @@ declare module "crypto" {
|
||||
|
||||
interface ED25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
||||
publicKeyEncoding: {
|
||||
type: 'pkcs1' | 'spki';
|
||||
type: 'spki';
|
||||
format: PubF;
|
||||
};
|
||||
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
||||
type: 'sec1' | 'pkcs8';
|
||||
type: 'pkcs8';
|
||||
};
|
||||
}
|
||||
|
||||
interface ED448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
||||
publicKeyEncoding: {
|
||||
type: 'spki';
|
||||
format: PubF;
|
||||
};
|
||||
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
||||
type: 'pkcs8';
|
||||
};
|
||||
}
|
||||
|
||||
interface X25519KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
||||
publicKeyEncoding: {
|
||||
type: 'spki';
|
||||
format: PubF;
|
||||
};
|
||||
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
||||
type: 'pkcs8';
|
||||
};
|
||||
}
|
||||
|
||||
interface X448KeyPairOptions<PubF extends KeyFormat, PrivF extends KeyFormat> {
|
||||
publicKeyEncoding: {
|
||||
type: 'spki';
|
||||
format: PubF;
|
||||
};
|
||||
privateKeyEncoding: BasePrivateKeyEncodingOptions<PrivF> & {
|
||||
type: 'pkcs8';
|
||||
};
|
||||
}
|
||||
|
||||
@@ -550,78 +696,446 @@ declare module "crypto" {
|
||||
privateKey: T2;
|
||||
}
|
||||
|
||||
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'pem', 'pem'>,
|
||||
): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'pem', 'der'>,
|
||||
): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'der', 'pem'>,
|
||||
): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'der', 'der'>,
|
||||
): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(type: 'rsa', options: RSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
||||
|
||||
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'pem', 'pem'>,
|
||||
): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'pem', 'der'>,
|
||||
): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'der', 'pem'>,
|
||||
): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'der', 'der'>,
|
||||
): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(type: 'dsa', options: DSAKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
||||
|
||||
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(type: 'ec', options: ECKeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'pem', 'pem'>,
|
||||
): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'pem', 'der'>,
|
||||
): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'der', 'pem'>,
|
||||
): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'der', 'der'>,
|
||||
): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(type: 'ec', options: ECKeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
||||
|
||||
function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
||||
function generateKeyPairSync(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'pem', 'pem'>,
|
||||
): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'pem', 'der'>,
|
||||
): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'der', 'pem'>,
|
||||
): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'der', 'der'>,
|
||||
): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(type: 'ed25519', options?: ED25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
||||
|
||||
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'rsa', options: RSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'rsa', options: RSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
|
||||
function generateKeyPairSync(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'pem', 'pem'>,
|
||||
): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'pem', 'der'>,
|
||||
): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'der', 'pem'>,
|
||||
): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'der', 'der'>,
|
||||
): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
||||
|
||||
function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'dsa', options: DSAKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'dsa', options: DSAKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
|
||||
function generateKeyPairSync(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'pem', 'pem'>,
|
||||
): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'pem', 'der'>,
|
||||
): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'der', 'pem'>,
|
||||
): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'der', 'der'>,
|
||||
): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(type: 'x25519', options?: X25519KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
||||
|
||||
function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'ec', options: ECKeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'ec', options: ECKeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
|
||||
function generateKeyPairSync(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'pem', 'pem'>,
|
||||
): KeyPairSyncResult<string, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'pem', 'der'>,
|
||||
): KeyPairSyncResult<string, Buffer>;
|
||||
function generateKeyPairSync(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'der', 'pem'>,
|
||||
): KeyPairSyncResult<Buffer, string>;
|
||||
function generateKeyPairSync(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'der', 'der'>,
|
||||
): KeyPairSyncResult<Buffer, Buffer>;
|
||||
function generateKeyPairSync(type: 'x448', options?: X448KeyPairKeyObjectOptions): KeyPairKeyObjectResult;
|
||||
|
||||
function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'pem'>, callback: (err: Error | null, publicKey: string, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'pem', 'der'>, callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'pem'>, callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void): void;
|
||||
function generateKeyPair(type: 'ed25519', options: ED25519KeyPairOptions<'der', 'der'>, callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void): void;
|
||||
function generateKeyPair(type: 'ed25519', options: ED25519KeyPairKeyObjectOptions, callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void): void;
|
||||
function generateKeyPair(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'pem', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'pem', 'der'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'der', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'der', 'der'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairKeyObjectOptions,
|
||||
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
||||
): void;
|
||||
|
||||
function generateKeyPair(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'pem', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'pem', 'der'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'der', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'der', 'der'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairKeyObjectOptions,
|
||||
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
||||
): void;
|
||||
|
||||
function generateKeyPair(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'pem', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'pem', 'der'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'der', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'der', 'der'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ec',
|
||||
options: ECKeyPairKeyObjectOptions,
|
||||
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
||||
): void;
|
||||
|
||||
function generateKeyPair(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'pem', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'pem', 'der'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'der', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'der', 'der'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairKeyObjectOptions | undefined,
|
||||
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
||||
): void;
|
||||
|
||||
function generateKeyPair(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'pem', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'pem', 'der'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'der', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'der', 'der'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairKeyObjectOptions | undefined,
|
||||
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
||||
): void;
|
||||
|
||||
function generateKeyPair(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'pem', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'pem', 'der'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'der', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'der', 'der'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairKeyObjectOptions | undefined,
|
||||
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
||||
): void;
|
||||
|
||||
function generateKeyPair(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'pem', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'pem', 'der'>,
|
||||
callback: (err: Error | null, publicKey: string, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'der', 'pem'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: string) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'der', 'der'>,
|
||||
callback: (err: Error | null, publicKey: Buffer, privateKey: Buffer) => void,
|
||||
): void;
|
||||
function generateKeyPair(
|
||||
type: 'x448',
|
||||
options: X448KeyPairKeyObjectOptions | undefined,
|
||||
callback: (err: Error | null, publicKey: KeyObject, privateKey: KeyObject) => void,
|
||||
): void;
|
||||
|
||||
namespace generateKeyPair {
|
||||
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
|
||||
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
|
||||
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
|
||||
function __promisify__(type: "rsa", options: RSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
|
||||
function __promisify__(type: "rsa", options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
||||
function __promisify__(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'pem', 'pem'>,
|
||||
): Promise<{ publicKey: string; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'pem', 'der'>,
|
||||
): Promise<{ publicKey: string; privateKey: Buffer }>;
|
||||
function __promisify__(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'der', 'pem'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'rsa',
|
||||
options: RSAKeyPairOptions<'der', 'der'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
|
||||
function __promisify__(type: 'rsa', options: RSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
||||
|
||||
function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
|
||||
function __promisify__(type: "dsa", options: DSAKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
|
||||
function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
|
||||
function __promisify__(type: "dsa", options: DSAKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
|
||||
function __promisify__(type: "dsa", options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
||||
function __promisify__(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'pem', 'pem'>,
|
||||
): Promise<{ publicKey: string; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'pem', 'der'>,
|
||||
): Promise<{ publicKey: string; privateKey: Buffer }>;
|
||||
function __promisify__(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'der', 'pem'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'dsa',
|
||||
options: DSAKeyPairOptions<'der', 'der'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
|
||||
function __promisify__(type: 'dsa', options: DSAKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
||||
|
||||
function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
|
||||
function __promisify__(type: "ec", options: ECKeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
|
||||
function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
|
||||
function __promisify__(type: "ec", options: ECKeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
|
||||
function __promisify__(type: "ec", options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
||||
function __promisify__(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'pem', 'pem'>,
|
||||
): Promise<{ publicKey: string; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'pem', 'der'>,
|
||||
): Promise<{ publicKey: string; privateKey: Buffer }>;
|
||||
function __promisify__(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'der', 'pem'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'ec',
|
||||
options: ECKeyPairOptions<'der', 'der'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
|
||||
function __promisify__(type: 'ec', options: ECKeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
||||
|
||||
function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'pem'>): Promise<{ publicKey: string, privateKey: string }>;
|
||||
function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'pem', 'der'>): Promise<{ publicKey: string, privateKey: Buffer }>;
|
||||
function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'pem'>): Promise<{ publicKey: Buffer, privateKey: string }>;
|
||||
function __promisify__(type: "ed25519", options: ED25519KeyPairOptions<'der', 'der'>): Promise<{ publicKey: Buffer, privateKey: Buffer }>;
|
||||
function __promisify__(type: "ed25519", options: ED25519KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
||||
function __promisify__(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'pem', 'pem'>,
|
||||
): Promise<{ publicKey: string; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'pem', 'der'>,
|
||||
): Promise<{ publicKey: string; privateKey: Buffer }>;
|
||||
function __promisify__(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'der', 'pem'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'ed25519',
|
||||
options: ED25519KeyPairOptions<'der', 'der'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
|
||||
function __promisify__(
|
||||
type: 'ed25519',
|
||||
options?: ED25519KeyPairKeyObjectOptions,
|
||||
): Promise<KeyPairKeyObjectResult>;
|
||||
|
||||
function __promisify__(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'pem', 'pem'>,
|
||||
): Promise<{ publicKey: string; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'pem', 'der'>,
|
||||
): Promise<{ publicKey: string; privateKey: Buffer }>;
|
||||
function __promisify__(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'der', 'pem'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'ed448',
|
||||
options: ED448KeyPairOptions<'der', 'der'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
|
||||
function __promisify__(type: 'ed448', options?: ED448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
||||
|
||||
function __promisify__(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'pem', 'pem'>,
|
||||
): Promise<{ publicKey: string; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'pem', 'der'>,
|
||||
): Promise<{ publicKey: string; privateKey: Buffer }>;
|
||||
function __promisify__(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'der', 'pem'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'x25519',
|
||||
options: X25519KeyPairOptions<'der', 'der'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
|
||||
function __promisify__(
|
||||
type: 'x25519',
|
||||
options?: X25519KeyPairKeyObjectOptions,
|
||||
): Promise<KeyPairKeyObjectResult>;
|
||||
|
||||
function __promisify__(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'pem', 'pem'>,
|
||||
): Promise<{ publicKey: string; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'pem', 'der'>,
|
||||
): Promise<{ publicKey: string; privateKey: Buffer }>;
|
||||
function __promisify__(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'der', 'pem'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: string }>;
|
||||
function __promisify__(
|
||||
type: 'x448',
|
||||
options: X448KeyPairOptions<'der', 'der'>,
|
||||
): Promise<{ publicKey: Buffer; privateKey: Buffer }>;
|
||||
function __promisify__(type: 'x448', options?: X448KeyPairKeyObjectOptions): Promise<KeyPairKeyObjectResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -632,10 +1146,11 @@ declare module "crypto" {
|
||||
* If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
|
||||
* passed to [`crypto.createPrivateKey()`][].
|
||||
*/
|
||||
function sign(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | SignPrivateKeyInput): Buffer;
|
||||
|
||||
interface VerifyKeyWithOptions extends KeyObject, SigningOptions {
|
||||
}
|
||||
function sign(
|
||||
algorithm: string | null | undefined,
|
||||
data: NodeJS.ArrayBufferView,
|
||||
key: KeyLike | SignKeyObjectInput | SignPrivateKeyInput,
|
||||
): Buffer;
|
||||
|
||||
/**
|
||||
* Calculates and returns the signature for `data` using the given private key and
|
||||
@@ -645,5 +1160,17 @@ declare module "crypto" {
|
||||
* If `key` is not a [`KeyObject`][], this function behaves as if `key` had been
|
||||
* passed to [`crypto.createPublicKey()`][].
|
||||
*/
|
||||
function verify(algorithm: string | null | undefined, data: NodeJS.ArrayBufferView, key: KeyLike | VerifyKeyWithOptions, signature: NodeJS.ArrayBufferView): boolean;
|
||||
function verify(
|
||||
algorithm: string | null | undefined,
|
||||
data: NodeJS.ArrayBufferView,
|
||||
key: KeyLike | VerifyKeyObjectInput | VerifyPublicKeyInput,
|
||||
signature: NodeJS.ArrayBufferView,
|
||||
): boolean;
|
||||
|
||||
/**
|
||||
* Computes the Diffie-Hellman secret based on a privateKey and a publicKey.
|
||||
* Both keys must have the same asymmetricKeyType, which must be one of
|
||||
* 'dh' (for Diffie-Hellman), 'ec' (for ECDH), 'x448', or 'x25519' (for ECDH-ES).
|
||||
*/
|
||||
function diffieHellman(options: { privateKey: KeyObject; publicKey: KeyObject }): Buffer;
|
||||
}
|
||||
|
||||
+12
-8
@@ -1,7 +1,11 @@
|
||||
declare module "dgram" {
|
||||
import { AddressInfo } from "net";
|
||||
import * as dns from "dns";
|
||||
import * as events from "events";
|
||||
declare module 'node:dgram' {
|
||||
export * from 'dgram';
|
||||
}
|
||||
|
||||
declare module 'dgram' {
|
||||
import { AddressInfo } from 'node:net';
|
||||
import * as dns from 'node:dns';
|
||||
import EventEmitter = require('node:events');
|
||||
|
||||
interface RemoteInfo {
|
||||
address: string;
|
||||
@@ -34,7 +38,7 @@ declare module "dgram" {
|
||||
function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
|
||||
|
||||
class Socket extends events.EventEmitter {
|
||||
class Socket extends EventEmitter {
|
||||
addMembership(multicastAddress: string, multicastInterface?: string): void;
|
||||
address(): AddressInfo;
|
||||
bind(port?: number, address?: string, callback?: () => void): void;
|
||||
@@ -50,9 +54,9 @@ declare module "dgram" {
|
||||
getSendBufferSize(): number;
|
||||
ref(): this;
|
||||
remoteAddress(): AddressInfo;
|
||||
send(msg: string | Uint8Array | any[], port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
||||
send(msg: string | Uint8Array | any[], port?: number, callback?: (error: Error | null, bytes: number) => void): void;
|
||||
send(msg: string | Uint8Array | any[], callback?: (error: Error | null, bytes: number) => void): void;
|
||||
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
|
||||
send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
|
||||
send(msg: string | Uint8Array | ReadonlyArray<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;
|
||||
|
||||
+16
-3
@@ -1,4 +1,8 @@
|
||||
declare module "dns" {
|
||||
declare module 'node:dns' {
|
||||
export * from 'dns';
|
||||
}
|
||||
|
||||
declare module 'dns' {
|
||||
// Supported getaddrinfo flags.
|
||||
const ADDRCONFIG: number;
|
||||
const V4MAPPED: number;
|
||||
@@ -276,9 +280,14 @@ declare module "dns" {
|
||||
const ADDRGETNETWORKPARAMS: string;
|
||||
const CANCELLED: string;
|
||||
|
||||
interface ResolverOptions {
|
||||
timeout?: number;
|
||||
}
|
||||
|
||||
class Resolver {
|
||||
constructor(options?: ResolverOptions);
|
||||
cancel(): void;
|
||||
getServers: typeof getServers;
|
||||
setServers: typeof setServers;
|
||||
resolve: typeof resolve;
|
||||
resolve4: typeof resolve4;
|
||||
resolve6: typeof resolve6;
|
||||
@@ -292,7 +301,8 @@ declare module "dns" {
|
||||
resolveSrv: typeof resolveSrv;
|
||||
resolveTxt: typeof resolveTxt;
|
||||
reverse: typeof reverse;
|
||||
cancel(): void;
|
||||
setLocalAddress(ipv4?: string, ipv6?: string): void;
|
||||
setServers: typeof setServers;
|
||||
}
|
||||
|
||||
namespace promises {
|
||||
@@ -351,6 +361,8 @@ declare module "dns" {
|
||||
function setServers(servers: ReadonlyArray<string>): void;
|
||||
|
||||
class Resolver {
|
||||
constructor(options?: ResolverOptions);
|
||||
cancel(): void;
|
||||
getServers: typeof getServers;
|
||||
resolve: typeof resolve;
|
||||
resolve4: typeof resolve4;
|
||||
@@ -365,6 +377,7 @@ declare module "dns" {
|
||||
resolveSrv: typeof resolveSrv;
|
||||
resolveTxt: typeof resolveTxt;
|
||||
reverse: typeof reverse;
|
||||
setLocalAddress(ipv4?: string, ipv6?: string): void;
|
||||
setServers: typeof setServers;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -1,5 +1,9 @@
|
||||
declare module "domain" {
|
||||
import { EventEmitter } from "events";
|
||||
declare module 'node:domain' {
|
||||
export * from 'domain';
|
||||
}
|
||||
|
||||
declare module 'domain' {
|
||||
import EventEmitter = require('node:events');
|
||||
|
||||
global {
|
||||
namespace NodeJS {
|
||||
|
||||
+28
-28
@@ -1,4 +1,9 @@
|
||||
declare module "events" {
|
||||
declare module 'node:events' {
|
||||
import EventEmitter = require('events');
|
||||
export = EventEmitter;
|
||||
}
|
||||
|
||||
declare module 'events' {
|
||||
interface EventEmitterOptions {
|
||||
/**
|
||||
* Enables automatic capturing of promise rejection.
|
||||
@@ -14,11 +19,16 @@ declare module "events" {
|
||||
addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any;
|
||||
}
|
||||
|
||||
namespace EventEmitter {
|
||||
function once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
|
||||
function once(emitter: DOMEventTarget, event: string): Promise<any[]>;
|
||||
function on(emitter: EventEmitter, event: string): AsyncIterableIterator<any>;
|
||||
const captureRejectionSymbol: unique symbol;
|
||||
interface EventEmitter extends NodeJS.EventEmitter {}
|
||||
class EventEmitter {
|
||||
constructor(options?: EventEmitterOptions);
|
||||
|
||||
static once(emitter: NodeEventTarget, event: string | symbol): Promise<any[]>;
|
||||
static once(emitter: DOMEventTarget, event: string): Promise<any[]>;
|
||||
static on(emitter: NodeJS.EventEmitter, event: string): AsyncIterableIterator<any>;
|
||||
|
||||
/** @deprecated since v4.0.0 */
|
||||
static listenerCount(emitter: NodeJS.EventEmitter, event: string | symbol): number;
|
||||
|
||||
/**
|
||||
* This symbol shall be used to install a listener for only monitoring `'error'`
|
||||
@@ -29,31 +39,21 @@ declare module "events" {
|
||||
* `'error'` event is emitted, therefore the process will still crash if no
|
||||
* regular `'error'` listener is installed.
|
||||
*/
|
||||
const errorMonitor: unique symbol;
|
||||
static readonly errorMonitor: unique symbol;
|
||||
static readonly captureRejectionSymbol: unique symbol;
|
||||
|
||||
/**
|
||||
* Sets or gets the default captureRejection value for all emitters.
|
||||
*/
|
||||
let captureRejections: boolean;
|
||||
// TODO: These should be described using static getter/setter pairs:
|
||||
static captureRejections: boolean;
|
||||
static defaultMaxListeners: number;
|
||||
}
|
||||
|
||||
interface EventEmitter extends NodeJS.EventEmitter {
|
||||
}
|
||||
|
||||
class EventEmitter {
|
||||
constructor(options?: EventEmitterOptions);
|
||||
/** @deprecated since v4.0.0 */
|
||||
static listenerCount(emitter: EventEmitter, event: string | symbol): number;
|
||||
static defaultMaxListeners: number;
|
||||
/**
|
||||
* This symbol shall be used to install a listener for only monitoring `'error'`
|
||||
* events. Listeners installed using this symbol are called before the regular
|
||||
* `'error'` listeners are called.
|
||||
*
|
||||
* Installing a listener using this symbol does not change the behavior once an
|
||||
* `'error'` event is emitted, therefore the process will still crash if no
|
||||
* regular `'error'` listener is installed.
|
||||
*/
|
||||
static readonly errorMonitor: unique symbol;
|
||||
}
|
||||
import internal = require('events');
|
||||
namespace EventEmitter {
|
||||
// Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
|
||||
export { internal as EventEmitter };
|
||||
}
|
||||
|
||||
global {
|
||||
@@ -70,7 +70,7 @@ declare module "events" {
|
||||
listeners(event: string | symbol): Function[];
|
||||
rawListeners(event: string | symbol): Function[];
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
listenerCount(type: string | symbol): number;
|
||||
listenerCount(event: string | symbol): number;
|
||||
// Added in Node 6...
|
||||
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
+174
-44
@@ -1,8 +1,12 @@
|
||||
declare module "fs" {
|
||||
import * as stream from "stream";
|
||||
import * as events from "events";
|
||||
import { URL } from "url";
|
||||
import * as promises from 'fs/promises';
|
||||
declare module 'node:fs' {
|
||||
export * from 'fs';
|
||||
}
|
||||
|
||||
declare module 'fs' {
|
||||
import * as stream from 'node:stream';
|
||||
import EventEmitter = require('node:events');
|
||||
import { URL } from 'node:url';
|
||||
import * as promises from 'node:fs/promises';
|
||||
|
||||
export { promises };
|
||||
/**
|
||||
@@ -105,10 +109,10 @@ declare module "fs" {
|
||||
* If there are no more directory entries to read, null will be returned.
|
||||
* Directory entries returned by this function are in no particular order as provided by the operating system's underlying directory mechanisms.
|
||||
*/
|
||||
readSync(): Dirent;
|
||||
readSync(): Dirent | null;
|
||||
}
|
||||
|
||||
export interface FSWatcher extends events.EventEmitter {
|
||||
export interface FSWatcher extends EventEmitter {
|
||||
close(): void;
|
||||
|
||||
/**
|
||||
@@ -427,6 +431,39 @@ declare module "fs" {
|
||||
*/
|
||||
export function lchownSync(path: PathLike, uid: number, gid: number): void;
|
||||
|
||||
/**
|
||||
* Changes the access and modification times of a file in the same way as `fs.utimes()`,
|
||||
* with the difference that if the path refers to a symbolic link, then the link is not
|
||||
* dereferenced: instead, the timestamps of the symbolic link itself are changed.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param atime The last access time. If a string is provided, it will be coerced to number.
|
||||
* @param mtime The last modified time. If a string is provided, it will be coerced to number.
|
||||
*/
|
||||
export function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date, callback: NoParamCallback): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
export namespace lutimes {
|
||||
/**
|
||||
* Changes the access and modification times of a file in the same way as `fsPromises.utimes()`,
|
||||
* with the difference that if the path refers to a symbolic link, then the link is not
|
||||
* dereferenced: instead, the timestamps of the symbolic link itself are changed.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param atime The last access time. If a string is provided, it will be coerced to number.
|
||||
* @param mtime The last modified time. If a string is provided, it will be coerced to number.
|
||||
*/
|
||||
function __promisify__(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the file system timestamps of the symbolic link referenced by `path`. Returns `undefined`,
|
||||
* or throws an exception when parameters are incorrect or the operation fails.
|
||||
* This is the synchronous version of `fs.lutimes()`.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param atime The last access time. If a string is provided, it will be coerced to number.
|
||||
* @param mtime The last modified time. If a string is provided, it will be coerced to number.
|
||||
*/
|
||||
export function lutimesSync(path: PathLike, atime: string | number | Date, mtime: string | number | Date): void;
|
||||
|
||||
/**
|
||||
* Asynchronous chmod(2) - Change permissions of a file.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
@@ -504,6 +541,9 @@ declare module "fs" {
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
export function stat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
||||
export function stat(path: PathLike, options: StatOptions & { bigint?: false } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
||||
export function stat(path: PathLike, options: StatOptions & { bigint: true }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
|
||||
export function stat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
export namespace stat {
|
||||
@@ -511,20 +551,27 @@ declare module "fs" {
|
||||
* Asynchronous stat(2) - Get file status.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
function __promisify__(path: PathLike): Promise<Stats>;
|
||||
function __promisify__(path: PathLike, options?: StatOptions & { bigint?: false }): Promise<Stats>;
|
||||
function __promisify__(path: PathLike, options: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
||||
function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronous stat(2) - Get file status.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
export function statSync(path: PathLike): Stats;
|
||||
export function statSync(path: PathLike, options?: StatOptions & { bigint?: false }): Stats;
|
||||
export function statSync(path: PathLike, options: StatOptions & { bigint: true }): BigIntStats;
|
||||
export function statSync(path: PathLike, options?: StatOptions): Stats | BigIntStats;
|
||||
|
||||
/**
|
||||
* Asynchronous fstat(2) - Get file status.
|
||||
* @param fd A file descriptor.
|
||||
*/
|
||||
export function fstat(fd: number, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
||||
export function fstat(fd: number, options: StatOptions & { bigint?: false } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
||||
export function fstat(fd: number, options: StatOptions & { bigint: true }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
|
||||
export function fstat(fd: number, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
export namespace fstat {
|
||||
@@ -532,20 +579,27 @@ declare module "fs" {
|
||||
* Asynchronous fstat(2) - Get file status.
|
||||
* @param fd A file descriptor.
|
||||
*/
|
||||
function __promisify__(fd: number): Promise<Stats>;
|
||||
function __promisify__(fd: number, options?: StatOptions & { bigint?: false }): Promise<Stats>;
|
||||
function __promisify__(fd: number, options: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
||||
function __promisify__(fd: number, options?: StatOptions): Promise<Stats | BigIntStats>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronous fstat(2) - Get file status.
|
||||
* @param fd A file descriptor.
|
||||
*/
|
||||
export function fstatSync(fd: number): Stats;
|
||||
export function fstatSync(fd: number, options?: StatOptions & { bigint?: false }): Stats;
|
||||
export function fstatSync(fd: number, options: StatOptions & { bigint: true }): BigIntStats;
|
||||
export function fstatSync(fd: number, options?: StatOptions): Stats | BigIntStats;
|
||||
|
||||
/**
|
||||
* Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
export function lstat(path: PathLike, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
||||
export function lstat(path: PathLike, options: StatOptions & { bigint?: false } | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats) => void): void;
|
||||
export function lstat(path: PathLike, options: StatOptions & { bigint: true }, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
|
||||
export function lstat(path: PathLike, options: StatOptions | undefined, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
export namespace lstat {
|
||||
@@ -553,14 +607,18 @@ declare module "fs" {
|
||||
* Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
function __promisify__(path: PathLike): Promise<Stats>;
|
||||
function __promisify__(path: PathLike, options?: StatOptions & { bigint?: false }): Promise<Stats>;
|
||||
function __promisify__(path: PathLike, options: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
||||
function __promisify__(path: PathLike, options?: StatOptions): Promise<Stats | BigIntStats>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronous lstat(2) - Get file status. Does not dereference symbolic links.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
export function lstatSync(path: PathLike): Stats;
|
||||
export function lstatSync(path: PathLike, options?: StatOptions & { bigint?: false }): Stats;
|
||||
export function lstatSync(path: PathLike, options: StatOptions & { bigint: true }): BigIntStats;
|
||||
export function lstatSync(path: PathLike, options?: StatOptions): Stats | BigIntStats;
|
||||
|
||||
/**
|
||||
* Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
|
||||
@@ -815,22 +873,62 @@ declare module "fs" {
|
||||
|
||||
export interface RmDirOptions {
|
||||
/**
|
||||
* If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
|
||||
* `EPERM` error is encountered, Node.js will retry the operation with a linear
|
||||
* backoff wait of `retryDelay` ms longer on each try. This option represents the
|
||||
* number of retries. This option is ignored if the `recursive` option is not
|
||||
* `true`.
|
||||
* @default 0
|
||||
*/
|
||||
maxRetries?: number;
|
||||
/**
|
||||
* @deprecated since v14.14.0 In future versions of Node.js,
|
||||
* `fs.rmdir(path, { recursive: true })` will throw on nonexistent
|
||||
* paths, or when given a file as a target.
|
||||
* Use `fs.rm(path, { recursive: true, force: true })` instead.
|
||||
*
|
||||
* If `true`, perform a recursive directory removal. In
|
||||
* recursive mode, errors are not reported if `path` does not exist, and
|
||||
* operations are retried on failure.
|
||||
* @experimental
|
||||
* @default false
|
||||
*/
|
||||
recursive?: boolean;
|
||||
}
|
||||
|
||||
export interface RmDirAsyncOptions extends RmDirOptions {
|
||||
/**
|
||||
* The amount of time in milliseconds to wait between retries.
|
||||
* This option is ignored if the `recursive` option is not `true`.
|
||||
* @default 100
|
||||
*/
|
||||
retryDelay?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asynchronous rmdir(2) - delete a directory.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
export function rmdir(path: PathLike, callback: NoParamCallback): void;
|
||||
export function rmdir(path: PathLike, options: RmDirOptions, callback: NoParamCallback): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
export namespace rmdir {
|
||||
/**
|
||||
* Asynchronous rmdir(2) - delete a directory.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
function __promisify__(path: PathLike, options?: RmDirOptions): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronous rmdir(2) - delete a directory.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
export function rmdirSync(path: PathLike, options?: RmDirOptions): void;
|
||||
|
||||
export interface RmOptions {
|
||||
/**
|
||||
* When `true`, exceptions will be ignored if `path` does not exist.
|
||||
* @default false
|
||||
*/
|
||||
force?: boolean;
|
||||
/**
|
||||
* If an `EBUSY`, `EMFILE`, `ENFILE`, `ENOTEMPTY`, or
|
||||
* `EPERM` error is encountered, Node.js will retry the operation with a linear
|
||||
@@ -840,29 +938,39 @@ declare module "fs" {
|
||||
* @default 0
|
||||
*/
|
||||
maxRetries?: number;
|
||||
/**
|
||||
* If `true`, perform a recursive directory removal. In
|
||||
* recursive mode, errors are not reported if `path` does not exist, and
|
||||
* operations are retried on failure.
|
||||
* @default false
|
||||
*/
|
||||
recursive?: boolean;
|
||||
/**
|
||||
* The amount of time in milliseconds to wait between retries.
|
||||
* This option is ignored if the `recursive` option is not `true`.
|
||||
* @default 100
|
||||
*/
|
||||
retryDelay?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Asynchronous rmdir(2) - delete a directory.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
|
||||
*/
|
||||
export function rmdir(path: PathLike, callback: NoParamCallback): void;
|
||||
export function rmdir(path: PathLike, options: RmDirAsyncOptions, callback: NoParamCallback): void;
|
||||
export function rm(path: PathLike, callback: NoParamCallback): void;
|
||||
export function rm(path: PathLike, options: RmOptions, callback: NoParamCallback): void;
|
||||
|
||||
// NOTE: This namespace provides design-time support for util.promisify. Exported members do not exist at runtime.
|
||||
export namespace rmdir {
|
||||
export namespace rm {
|
||||
/**
|
||||
* Asynchronous rmdir(2) - delete a directory.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
|
||||
*/
|
||||
function __promisify__(path: PathLike, options?: RmDirAsyncOptions): Promise<void>;
|
||||
function __promisify__(path: PathLike, options?: RmOptions): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
* Synchronous rmdir(2) - delete a directory.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* Synchronously removes files and directories (modeled on the standard POSIX `rm` utility).
|
||||
*/
|
||||
export function rmdirSync(path: PathLike, options?: RmDirOptions): void;
|
||||
export function rmSync(path: PathLike, options?: RmOptions): void;
|
||||
|
||||
export interface MakeDirectoryOptions {
|
||||
/**
|
||||
@@ -884,7 +992,7 @@ declare module "fs" {
|
||||
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
||||
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
||||
*/
|
||||
export function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path: string) => void): void;
|
||||
export function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true }, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
|
||||
|
||||
/**
|
||||
* Asynchronous mkdir(2) - create a directory.
|
||||
@@ -900,7 +1008,7 @@ declare module "fs" {
|
||||
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
||||
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
||||
*/
|
||||
export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path: string | undefined) => void): void;
|
||||
export function mkdir(path: PathLike, options: Mode | MakeDirectoryOptions | null | undefined, callback: (err: NodeJS.ErrnoException | null, path?: string) => void): void;
|
||||
|
||||
/**
|
||||
* Asynchronous mkdir(2) - create a directory with a mode of `0o777`.
|
||||
@@ -916,7 +1024,7 @@ declare module "fs" {
|
||||
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
||||
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
||||
*/
|
||||
function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
|
||||
function __promisify__(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string | undefined>;
|
||||
|
||||
/**
|
||||
* Asynchronous mkdir(2) - create a directory.
|
||||
@@ -941,7 +1049,7 @@ declare module "fs" {
|
||||
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
||||
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
||||
*/
|
||||
export function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string;
|
||||
export function mkdirSync(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): string | undefined;
|
||||
|
||||
/**
|
||||
* Synchronous mkdir(2) - create a directory.
|
||||
@@ -1689,7 +1797,7 @@ declare module "fs" {
|
||||
export function watch(
|
||||
filename: PathLike,
|
||||
options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | BufferEncoding | undefined | null,
|
||||
listener?: (event: string, filename: string) => void,
|
||||
listener?: (event: "rename" | "change", filename: string) => void,
|
||||
): FSWatcher;
|
||||
|
||||
/**
|
||||
@@ -1701,7 +1809,11 @@ declare module "fs" {
|
||||
* If `persistent` is not supplied, the default of `true` is used.
|
||||
* If `recursive` is not supplied, the default of `false` is used.
|
||||
*/
|
||||
export function watch(filename: PathLike, options: { encoding: "buffer", persistent?: boolean, recursive?: boolean } | "buffer", listener?: (event: string, filename: Buffer) => void): FSWatcher;
|
||||
export function watch(
|
||||
filename: PathLike,
|
||||
options: { encoding: "buffer", persistent?: boolean, recursive?: boolean; } | "buffer",
|
||||
listener?: (event: "rename" | "change", filename: Buffer) => void
|
||||
): FSWatcher;
|
||||
|
||||
/**
|
||||
* Watch for changes on `filename`, where `filename` is either a file or a directory, returning an `FSWatcher`.
|
||||
@@ -1715,7 +1827,7 @@ declare module "fs" {
|
||||
export function watch(
|
||||
filename: PathLike,
|
||||
options: { encoding?: BufferEncoding | null, persistent?: boolean, recursive?: boolean } | string | null,
|
||||
listener?: (event: string, filename: string | Buffer) => void,
|
||||
listener?: (event: "rename" | "change", filename: string | Buffer) => void,
|
||||
): FSWatcher;
|
||||
|
||||
/**
|
||||
@@ -1723,7 +1835,7 @@ declare module "fs" {
|
||||
* @param filename A path to a file or directory. If a URL is provided, it must use the `file:` protocol.
|
||||
* URL support is _experimental_.
|
||||
*/
|
||||
export function watch(filename: PathLike, listener?: (event: string, filename: string) => any): FSWatcher;
|
||||
export function watch(filename: PathLike, listener?: (event: "rename" | "change", filename: string) => any): FSWatcher;
|
||||
|
||||
/**
|
||||
* Asynchronously tests whether or not the given path exists by checking with the file system.
|
||||
@@ -2060,12 +2172,12 @@ declare module "fs" {
|
||||
*/
|
||||
export function writev(
|
||||
fd: number,
|
||||
buffers: NodeJS.ArrayBufferView[],
|
||||
buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
|
||||
cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void
|
||||
): void;
|
||||
export function writev(
|
||||
fd: number,
|
||||
buffers: NodeJS.ArrayBufferView[],
|
||||
buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
|
||||
position: number,
|
||||
cb: (err: NodeJS.ErrnoException | null, bytesWritten: number, buffers: NodeJS.ArrayBufferView[]) => void
|
||||
): void;
|
||||
@@ -2076,22 +2188,22 @@ declare module "fs" {
|
||||
}
|
||||
|
||||
export namespace writev {
|
||||
function __promisify__(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): Promise<WriteVResult>;
|
||||
function __promisify__(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* See `writev`.
|
||||
*/
|
||||
export function writevSync(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): number;
|
||||
export function writevSync(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): number;
|
||||
|
||||
export function readv(
|
||||
fd: number,
|
||||
buffers: NodeJS.ArrayBufferView[],
|
||||
buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
|
||||
cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void
|
||||
): void;
|
||||
export function readv(
|
||||
fd: number,
|
||||
buffers: NodeJS.ArrayBufferView[],
|
||||
buffers: ReadonlyArray<NodeJS.ArrayBufferView>,
|
||||
position: number,
|
||||
cb: (err: NodeJS.ErrnoException | null, bytesRead: number, buffers: NodeJS.ArrayBufferView[]) => void
|
||||
): void;
|
||||
@@ -2102,13 +2214,13 @@ declare module "fs" {
|
||||
}
|
||||
|
||||
export namespace readv {
|
||||
function __promisify__(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): Promise<ReadVResult>;
|
||||
function __promisify__(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
|
||||
}
|
||||
|
||||
/**
|
||||
* See `readv`.
|
||||
*/
|
||||
export function readvSync(fd: number, buffers: NodeJS.ArrayBufferView[], position?: number): number;
|
||||
export function readvSync(fd: number, buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): number;
|
||||
|
||||
export interface OpenDirOptions {
|
||||
encoding?: BufferEncoding;
|
||||
@@ -2129,4 +2241,22 @@ declare module "fs" {
|
||||
export namespace opendir {
|
||||
function __promisify__(path: string, options?: OpenDirOptions): Promise<Dir>;
|
||||
}
|
||||
|
||||
export interface BigIntStats extends StatsBase<bigint> {
|
||||
}
|
||||
|
||||
export class BigIntStats {
|
||||
atimeNs: bigint;
|
||||
mtimeNs: bigint;
|
||||
ctimeNs: bigint;
|
||||
birthtimeNs: bigint;
|
||||
}
|
||||
|
||||
export interface BigIntOptions {
|
||||
bigint: true;
|
||||
}
|
||||
|
||||
export interface StatOptions {
|
||||
bigint?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
+37
-15
@@ -1,10 +1,17 @@
|
||||
declare module 'fs/promises' {
|
||||
export * from 'node:fs/promises';
|
||||
}
|
||||
|
||||
declare module 'node:fs/promises' {
|
||||
import {
|
||||
Stats,
|
||||
BigIntStats,
|
||||
StatOptions,
|
||||
WriteVResult,
|
||||
ReadVResult,
|
||||
PathLike,
|
||||
RmDirAsyncOptions,
|
||||
RmDirOptions,
|
||||
RmOptions,
|
||||
MakeDirectoryOptions,
|
||||
Dirent,
|
||||
OpenDirOptions,
|
||||
@@ -13,7 +20,7 @@ declare module 'fs/promises' {
|
||||
BufferEncodingOption,
|
||||
OpenMode,
|
||||
Mode,
|
||||
} from 'fs';
|
||||
} from 'node:fs';
|
||||
|
||||
interface FileHandle {
|
||||
/**
|
||||
@@ -91,7 +98,9 @@ declare module 'fs/promises' {
|
||||
/**
|
||||
* Asynchronous fstat(2) - Get file status.
|
||||
*/
|
||||
stat(): Promise<Stats>;
|
||||
stat(opts?: StatOptions & { bigint?: false }): Promise<Stats>;
|
||||
stat(opts: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
||||
stat(opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||
|
||||
/**
|
||||
* Asynchronous ftruncate(2) - Truncate a file to a specified length.
|
||||
@@ -143,12 +152,12 @@ declare module 'fs/promises' {
|
||||
/**
|
||||
* See `fs.writev` promisified version.
|
||||
*/
|
||||
writev(buffers: NodeJS.ArrayBufferView[], position?: number): Promise<WriteVResult>;
|
||||
writev(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<WriteVResult>;
|
||||
|
||||
/**
|
||||
* See `fs.readv` promisified version.
|
||||
*/
|
||||
readv(buffers: NodeJS.ArrayBufferView[], position?: number): Promise<ReadVResult>;
|
||||
readv(buffers: ReadonlyArray<NodeJS.ArrayBufferView>, position?: number): Promise<ReadVResult>;
|
||||
|
||||
/**
|
||||
* Asynchronous close(2) - close a `FileHandle`.
|
||||
@@ -255,7 +264,12 @@ declare module 'fs/promises' {
|
||||
* Asynchronous rmdir(2) - delete a directory.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
function rmdir(path: PathLike, options?: RmDirAsyncOptions): Promise<void>;
|
||||
function rmdir(path: PathLike, options?: RmDirOptions): Promise<void>;
|
||||
|
||||
/**
|
||||
* Asynchronously removes files and directories (modeled on the standard POSIX `rm` utility).
|
||||
*/
|
||||
function rm(path: PathLike, options?: RmOptions): Promise<void>;
|
||||
|
||||
/**
|
||||
* Asynchronous fdatasync(2) - synchronize a file's in-core state with storage device.
|
||||
@@ -275,7 +289,7 @@ declare module 'fs/promises' {
|
||||
* @param options Either the file mode, or an object optionally specifying the file mode and whether parent folders
|
||||
* should be created. If a string is passed, it is parsed as an octal integer. If not specified, defaults to `0o777`.
|
||||
*/
|
||||
function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string>;
|
||||
function mkdir(path: PathLike, options: MakeDirectoryOptions & { recursive: true; }): Promise<string | undefined>;
|
||||
|
||||
/**
|
||||
* Asynchronous mkdir(2) - create a directory.
|
||||
@@ -351,23 +365,21 @@ declare module 'fs/promises' {
|
||||
*/
|
||||
function symlink(target: PathLike, path: PathLike, type?: string | null): Promise<void>;
|
||||
|
||||
/**
|
||||
* Asynchronous fstat(2) - Get file status.
|
||||
* @param handle A `FileHandle`.
|
||||
*/
|
||||
function fstat(handle: FileHandle): Promise<Stats>;
|
||||
|
||||
/**
|
||||
* Asynchronous lstat(2) - Get file status. Does not dereference symbolic links.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
function lstat(path: PathLike): Promise<Stats>;
|
||||
function lstat(path: PathLike, opts?: StatOptions & { bigint?: false }): Promise<Stats>;
|
||||
function lstat(path: PathLike, opts: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
||||
function lstat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||
|
||||
/**
|
||||
* Asynchronous stat(2) - Get file status.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
*/
|
||||
function stat(path: PathLike): Promise<Stats>;
|
||||
function stat(path: PathLike, opts?: StatOptions & { bigint?: false }): Promise<Stats>;
|
||||
function stat(path: PathLike, opts: StatOptions & { bigint: true }): Promise<BigIntStats>;
|
||||
function stat(path: PathLike, opts?: StatOptions): Promise<Stats | BigIntStats>;
|
||||
|
||||
/**
|
||||
* Asynchronous link(2) - Create a new link (also known as a hard link) to an existing file.
|
||||
@@ -409,6 +421,16 @@ declare module 'fs/promises' {
|
||||
*/
|
||||
function lchown(path: PathLike, uid: number, gid: number): Promise<void>;
|
||||
|
||||
/**
|
||||
* Changes the access and modification times of a file in the same way as `fsPromises.utimes()`,
|
||||
* with the difference that if the path refers to a symbolic link, then the link is not
|
||||
* dereferenced: instead, the timestamps of the symbolic link itself are changed.
|
||||
* @param path A path to a file. If a URL is provided, it must use the `file:` protocol.
|
||||
* @param atime The last access time. If a string is provided, it will be coerced to number.
|
||||
* @param mtime The last modified time. If a string is provided, it will be coerced to number.
|
||||
*/
|
||||
function lutimes(path: PathLike, atime: string | number | Date, mtime: string | number | Date): Promise<void>;
|
||||
|
||||
/**
|
||||
* Asynchronous fchown(2) - Change ownership of a file.
|
||||
* @param handle A `FileHandle`.
|
||||
|
||||
+41
-19
@@ -19,6 +19,11 @@ interface String {
|
||||
trimLeft(): string;
|
||||
/** Removes whitespace from the right end of a string. */
|
||||
trimRight(): string;
|
||||
|
||||
/** Returns a copy with leading whitespace removed. */
|
||||
trimStart(): string;
|
||||
/** Returns a copy with trailing whitespace removed. */
|
||||
trimEnd(): string;
|
||||
}
|
||||
|
||||
interface ImportMeta {
|
||||
@@ -42,13 +47,13 @@ declare var console: Console;
|
||||
declare var __filename: string;
|
||||
declare var __dirname: string;
|
||||
|
||||
declare function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
|
||||
declare function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
|
||||
declare namespace setTimeout {
|
||||
function __promisify__(ms: number): Promise<void>;
|
||||
function __promisify__<T>(ms: number, value: T): Promise<T>;
|
||||
}
|
||||
declare function clearTimeout(timeoutId: NodeJS.Timeout): void;
|
||||
declare function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
|
||||
declare function setInterval(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
|
||||
declare function clearInterval(intervalId: NodeJS.Timeout): void;
|
||||
declare function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
|
||||
declare namespace setImmediate {
|
||||
@@ -68,6 +73,8 @@ declare var exports: any;
|
||||
// Buffer class
|
||||
type BufferEncoding = "ascii" | "utf8" | "utf-8" | "utf16le" | "ucs2" | "ucs-2" | "base64" | "latin1" | "binary" | "hex";
|
||||
|
||||
type WithImplicitCoercion<T> = T | { valueOf(): T };
|
||||
|
||||
/**
|
||||
* Raw data is stored in instances of the Buffer class.
|
||||
* A Buffer is similar to an array of integers but corresponds to a raw memory allocation outside the V8 heap. A Buffer cannot be resized.
|
||||
@@ -111,7 +118,7 @@ declare class Buffer extends Uint8Array {
|
||||
* @param array The octets to store.
|
||||
* @deprecated since v10.0.0 - Use `Buffer.from(array)` instead.
|
||||
*/
|
||||
constructor(array: any[]);
|
||||
constructor(array: ReadonlyArray<any>);
|
||||
/**
|
||||
* Copies the passed {buffer} data onto a new {Buffer} instance.
|
||||
*
|
||||
@@ -127,25 +134,19 @@ declare class Buffer extends Uint8Array {
|
||||
*
|
||||
* @param arrayBuffer The .buffer property of any TypedArray or a new ArrayBuffer()
|
||||
*/
|
||||
static from(arrayBuffer: ArrayBuffer | SharedArrayBuffer, byteOffset?: number, length?: number): Buffer;
|
||||
static from(arrayBuffer: WithImplicitCoercion<ArrayBuffer | SharedArrayBuffer>, byteOffset?: number, length?: number): Buffer;
|
||||
/**
|
||||
* Creates a new Buffer using the passed {data}
|
||||
* @param data data to create a new Buffer
|
||||
*/
|
||||
static from(data: number[]): Buffer;
|
||||
static from(data: Uint8Array): Buffer;
|
||||
/**
|
||||
* Creates a new buffer containing the coerced value of an object
|
||||
* A `TypeError` will be thrown if {obj} has not mentioned methods or is not of other type appropriate for `Buffer.from()` variants.
|
||||
* @param obj An object supporting `Symbol.toPrimitive` or `valueOf()`.
|
||||
*/
|
||||
static from(obj: { valueOf(): string | object } | { [Symbol.toPrimitive](hint: 'string'): string }, byteOffset?: number, length?: number): Buffer;
|
||||
static from(data: Uint8Array | ReadonlyArray<number>): Buffer;
|
||||
static from(data: WithImplicitCoercion<Uint8Array | ReadonlyArray<number> | string>): Buffer;
|
||||
/**
|
||||
* 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'.
|
||||
*/
|
||||
static from(str: string, encoding?: BufferEncoding): Buffer;
|
||||
static from(str: WithImplicitCoercion<string> | { [Symbol.toPrimitive](hint: 'string'): string }, encoding?: BufferEncoding): Buffer;
|
||||
/**
|
||||
* Creates a new Buffer using the passed {data}
|
||||
* @param values to create a new Buffer
|
||||
@@ -186,7 +187,7 @@ declare class Buffer extends Uint8Array {
|
||||
* @param totalLength Total length of the buffers when concatenated.
|
||||
* If totalLength is not provided, it is read from the buffers in the list. However, this adds an additional loop to the function, so it is faster to provide the length explicitly.
|
||||
*/
|
||||
static concat(list: Uint8Array[], totalLength?: number): Buffer;
|
||||
static concat(list: ReadonlyArray<Uint8Array>, totalLength?: number): Buffer;
|
||||
/**
|
||||
* The same as buf1.compare(buf2).
|
||||
*/
|
||||
@@ -251,10 +252,18 @@ declare class Buffer extends Uint8Array {
|
||||
* @param end Where the new `Buffer` will end (not inclusive). Default: `buf.length`.
|
||||
*/
|
||||
subarray(begin?: number, end?: number): Buffer;
|
||||
writeBigInt64BE(value: bigint, offset?: number): number;
|
||||
writeBigInt64LE(value: bigint, offset?: number): number;
|
||||
writeBigUInt64BE(value: bigint, offset?: number): number;
|
||||
writeBigUInt64LE(value: bigint, offset?: number): number;
|
||||
writeUIntLE(value: number, offset: number, byteLength: number): number;
|
||||
writeUIntBE(value: number, offset: number, byteLength: number): number;
|
||||
writeIntLE(value: number, offset: number, byteLength: number): number;
|
||||
writeIntBE(value: number, offset: number, byteLength: number): number;
|
||||
readBigUInt64BE(offset?: number): bigint;
|
||||
readBigUInt64LE(offset?: number): bigint;
|
||||
readBigInt64BE(offset?: number): bigint;
|
||||
readBigInt64LE(offset?: number): bigint;
|
||||
readUIntLE(offset: number, byteLength: number): number;
|
||||
readUIntBE(offset: number, byteLength: number): number;
|
||||
readIntLE(offset: number, byteLength: number): number;
|
||||
@@ -510,8 +519,8 @@ declare namespace NodeJS {
|
||||
parseFloat: typeof parseFloat;
|
||||
parseInt: typeof parseInt;
|
||||
setImmediate: (callback: (...args: any[]) => void, ...args: any[]) => Immediate;
|
||||
setInterval: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
|
||||
setTimeout: (callback: (...args: any[]) => void, ms: number, ...args: any[]) => Timeout;
|
||||
setInterval: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => Timeout;
|
||||
setTimeout: (callback: (...args: any[]) => void, ms?: number, ...args: any[]) => Timeout;
|
||||
queueMicrotask: typeof queueMicrotask;
|
||||
undefined: typeof undefined;
|
||||
unescape: (str: string) => string;
|
||||
@@ -528,6 +537,7 @@ declare namespace NodeJS {
|
||||
interface Timer extends RefCounted {
|
||||
hasRef(): boolean;
|
||||
refresh(): this;
|
||||
[Symbol.toPrimitive](): number;
|
||||
}
|
||||
|
||||
interface Immediate extends RefCounted {
|
||||
@@ -538,13 +548,24 @@ declare namespace NodeJS {
|
||||
interface Timeout extends Timer {
|
||||
hasRef(): boolean;
|
||||
refresh(): this;
|
||||
[Symbol.toPrimitive](): number;
|
||||
}
|
||||
|
||||
type TypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
|
||||
type TypedArray =
|
||||
| Uint8Array
|
||||
| Uint8ClampedArray
|
||||
| Uint16Array
|
||||
| Uint32Array
|
||||
| Int8Array
|
||||
| Int16Array
|
||||
| Int32Array
|
||||
| BigUint64Array
|
||||
| BigInt64Array
|
||||
| Float32Array
|
||||
| Float64Array;
|
||||
type ArrayBufferView = TypedArray | DataView;
|
||||
|
||||
interface Require {
|
||||
/* tslint:disable-next-line:callable-types */
|
||||
(id: string): any;
|
||||
resolve: RequireResolve;
|
||||
cache: Dict<NodeModule>;
|
||||
@@ -571,7 +592,8 @@ declare namespace NodeJS {
|
||||
id: string;
|
||||
filename: string;
|
||||
loaded: boolean;
|
||||
parent: Module | null;
|
||||
/** @deprecated since 14.6.0 Please use `require.main` and `module.children` instead. */
|
||||
parent: Module | null | undefined;
|
||||
children: Module[];
|
||||
/**
|
||||
* @since 11.14.0
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
declare var global: NodeJS.Global;
|
||||
declare var global: NodeJS.Global & typeof globalThis;
|
||||
|
||||
+42
-15
@@ -1,7 +1,11 @@
|
||||
declare module "http" {
|
||||
import * as stream from "stream";
|
||||
import { URL } from "url";
|
||||
import { Socket, Server as NetServer } from "net";
|
||||
declare module 'node:http' {
|
||||
export * from 'http';
|
||||
}
|
||||
|
||||
declare module 'http' {
|
||||
import * as stream from 'node:stream';
|
||||
import { URL } from 'node:url';
|
||||
import { Socket, Server as NetServer } from 'node:net';
|
||||
|
||||
// incoming headers will never contain number
|
||||
interface IncomingHttpHeaders extends NodeJS.Dict<string | string[]> {
|
||||
@@ -51,6 +55,11 @@ declare module "http" {
|
||||
'range'?: string;
|
||||
'referer'?: string;
|
||||
'retry-after'?: string;
|
||||
'sec-websocket-accept'?: string;
|
||||
'sec-websocket-extensions'?: string;
|
||||
'sec-websocket-key'?: string;
|
||||
'sec-websocket-protocol'?: string;
|
||||
'sec-websocket-version'?: string;
|
||||
'set-cookie'?: string[];
|
||||
'strict-transport-security'?: string;
|
||||
'tk'?: string;
|
||||
@@ -65,7 +74,9 @@ declare module "http" {
|
||||
}
|
||||
|
||||
// outgoing headers allows numbers (as they are converted internally to strings)
|
||||
interface OutgoingHttpHeaders extends NodeJS.Dict<number | string | string[]> {
|
||||
type OutgoingHttpHeader = number | string | string[];
|
||||
|
||||
interface OutgoingHttpHeaders extends NodeJS.Dict<OutgoingHttpHeader> {
|
||||
}
|
||||
|
||||
interface ClientRequestArgs {
|
||||
@@ -131,6 +142,12 @@ declare module "http" {
|
||||
*/
|
||||
headersTimeout: number;
|
||||
keepAliveTimeout: number;
|
||||
/**
|
||||
* Sets the timeout value in milliseconds for receiving the entire request from the client.
|
||||
* @default 0
|
||||
* {@link https://nodejs.org/api/http.html#http_server_requesttimeout}
|
||||
*/
|
||||
requestTimeout: number;
|
||||
}
|
||||
|
||||
interface Server extends HttpBase {}
|
||||
@@ -154,19 +171,19 @@ declare module "http" {
|
||||
/**
|
||||
* @deprecate Use `socket` instead.
|
||||
*/
|
||||
connection: Socket;
|
||||
socket: Socket;
|
||||
connection: Socket | null;
|
||||
socket: Socket | null;
|
||||
|
||||
constructor();
|
||||
|
||||
setTimeout(msecs: number, callback?: () => void): this;
|
||||
setHeader(name: string, value: number | string | string[]): void;
|
||||
setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
|
||||
getHeader(name: string): number | string | string[] | undefined;
|
||||
getHeaders(): OutgoingHttpHeaders;
|
||||
getHeaderNames(): string[];
|
||||
hasHeader(name: string): boolean;
|
||||
removeHeader(name: string): void;
|
||||
addTrailers(headers: OutgoingHttpHeaders | Array<[string, string]>): void;
|
||||
addTrailers(headers: OutgoingHttpHeaders | ReadonlyArray<[string, string]>): void;
|
||||
flushHeaders(): void;
|
||||
}
|
||||
|
||||
@@ -182,8 +199,8 @@ declare module "http" {
|
||||
// https://github.com/nodejs/node/blob/master/test/parallel/test-http-write-callbacks.js#L53
|
||||
// no args in writeContinue callback
|
||||
writeContinue(callback?: () => void): void;
|
||||
writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders): this;
|
||||
writeHead(statusCode: number, headers?: OutgoingHttpHeaders): this;
|
||||
writeHead(statusCode: number, reasonPhrase?: string, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
|
||||
writeHead(statusCode: number, headers?: OutgoingHttpHeaders | OutgoingHttpHeader[]): this;
|
||||
writeProcessing(): void;
|
||||
}
|
||||
|
||||
@@ -199,14 +216,15 @@ declare module "http" {
|
||||
|
||||
// https://github.com/nodejs/node/blob/master/lib/_http_client.js#L77
|
||||
class ClientRequest extends OutgoingMessage {
|
||||
connection: Socket;
|
||||
socket: Socket;
|
||||
aborted: number;
|
||||
aborted: boolean;
|
||||
host: string;
|
||||
protocol: string;
|
||||
|
||||
constructor(url: string | URL | ClientRequestArgs, cb?: (res: IncomingMessage) => void);
|
||||
|
||||
method: string;
|
||||
path: string;
|
||||
/** @deprecated since v14.1.0 Use `request.destroy()` instead. */
|
||||
abort(): void;
|
||||
onSocket(socket: Socket): void;
|
||||
setTimeout(timeout: number, callback?: () => void): this;
|
||||
@@ -303,7 +321,7 @@ declare module "http" {
|
||||
httpVersionMinor: number;
|
||||
complete: boolean;
|
||||
/**
|
||||
* @deprecate Use `socket` instead.
|
||||
* @deprecated since v13.0.0 - Use `socket` instead.
|
||||
*/
|
||||
connection: Socket;
|
||||
socket: Socket;
|
||||
@@ -345,6 +363,10 @@ declare module "http" {
|
||||
* Maximum number of sockets to allow per host. Default for Node 0.10 is 5, default for Node 0.12 is Infinity
|
||||
*/
|
||||
maxSockets?: number;
|
||||
/**
|
||||
* Maximum number of sockets allowed for all hosts in total. Each request will use a new socket until the maximum is reached. Default: Infinity.
|
||||
*/
|
||||
maxTotalSockets?: number;
|
||||
/**
|
||||
* Maximum number of sockets to leave open in a free state. Only relevant if keepAlive is set to true. Default = 256.
|
||||
*/
|
||||
@@ -353,11 +375,16 @@ declare module "http" {
|
||||
* Socket timeout in milliseconds. This will set the timeout after the socket is connected.
|
||||
*/
|
||||
timeout?: number;
|
||||
/**
|
||||
* Scheduling strategy to apply when picking the next free socket to use. Default: 'fifo'.
|
||||
*/
|
||||
scheduling?: 'fifo' | 'lifo';
|
||||
}
|
||||
|
||||
class Agent {
|
||||
maxFreeSockets: number;
|
||||
maxSockets: number;
|
||||
maxTotalSockets: number;
|
||||
readonly freeSockets: NodeJS.ReadOnlyDict<Socket[]>;
|
||||
readonly sockets: NodeJS.ReadOnlyDict<Socket[]>;
|
||||
readonly requests: NodeJS.ReadOnlyDict<IncomingMessage[]>;
|
||||
|
||||
+23
-13
@@ -1,13 +1,22 @@
|
||||
declare module "http2" {
|
||||
import * as events from "events";
|
||||
import * as fs from "fs";
|
||||
import * as net from "net";
|
||||
import * as stream from "stream";
|
||||
import * as tls from "tls";
|
||||
import * as url from "url";
|
||||
declare module 'node:http2' {
|
||||
export * from 'http2';
|
||||
}
|
||||
|
||||
import { IncomingHttpHeaders as Http1IncomingHttpHeaders, OutgoingHttpHeaders, IncomingMessage, ServerResponse } from "http";
|
||||
export { OutgoingHttpHeaders } from "http";
|
||||
declare module 'http2' {
|
||||
import EventEmitter = require('node:events');
|
||||
import * as fs from 'node:fs';
|
||||
import * as net from 'node:net';
|
||||
import * as stream from 'node:stream';
|
||||
import * as tls from 'node:tls';
|
||||
import * as url from 'node:url';
|
||||
|
||||
import {
|
||||
IncomingHttpHeaders as Http1IncomingHttpHeaders,
|
||||
OutgoingHttpHeaders,
|
||||
IncomingMessage,
|
||||
ServerResponse,
|
||||
} from 'node:http';
|
||||
export { OutgoingHttpHeaders } from 'node:http';
|
||||
|
||||
export interface IncomingHttpStatusHeader {
|
||||
":status"?: number;
|
||||
@@ -261,7 +270,7 @@ declare module "http2" {
|
||||
inflateDynamicTableSize?: number;
|
||||
}
|
||||
|
||||
export interface Http2Session extends events.EventEmitter {
|
||||
export interface Http2Session extends EventEmitter {
|
||||
readonly alpnProtocol?: string;
|
||||
readonly closed: boolean;
|
||||
readonly connecting: boolean;
|
||||
@@ -281,6 +290,7 @@ declare module "http2" {
|
||||
ping(callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
|
||||
ping(payload: NodeJS.ArrayBufferView, callback: (err: Error | null, duration: number, payload: Buffer) => void): boolean;
|
||||
ref(): void;
|
||||
setLocalWindowSize(windowSize: number): void;
|
||||
setTimeout(msecs: number, callback?: () => void): void;
|
||||
settings(settings: Settings): void;
|
||||
unref(): void;
|
||||
@@ -356,7 +366,7 @@ declare module "http2" {
|
||||
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
emit(event: "altsvc", alt: string, origin: string, stream: number): boolean;
|
||||
emit(event: "origin", origins: string[]): boolean;
|
||||
emit(event: "origin", origins: ReadonlyArray<string>): boolean;
|
||||
emit(event: "connect", session: ClientHttp2Session, socket: net.Socket | tls.TLSSocket): boolean;
|
||||
emit(event: "stream", stream: ClientHttp2Stream, headers: IncomingHttpHeaders & IncomingHttpStatusHeader, flags: number): boolean;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
@@ -571,7 +581,7 @@ declare module "http2" {
|
||||
}
|
||||
|
||||
export class Http2ServerRequest extends stream.Readable {
|
||||
constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: string[]);
|
||||
constructor(stream: ServerHttp2Stream, headers: IncomingHttpHeaders, options: stream.ReadableOptions, rawHeaders: ReadonlyArray<string>);
|
||||
|
||||
readonly aborted: boolean;
|
||||
readonly authority: string;
|
||||
@@ -662,7 +672,7 @@ declare module "http2" {
|
||||
getHeaders(): OutgoingHttpHeaders;
|
||||
hasHeader(name: string): boolean;
|
||||
removeHeader(name: string): void;
|
||||
setHeader(name: string, value: number | string | string[]): void;
|
||||
setHeader(name: string, value: number | string | ReadonlyArray<string>): void;
|
||||
setTimeout(msecs: number, callback?: () => void): void;
|
||||
write(chunk: string | Uint8Array, callback?: (err: Error) => void): boolean;
|
||||
write(chunk: string | Uint8Array, encoding: BufferEncoding, callback?: (err: Error) => void): boolean;
|
||||
|
||||
+8
-5
@@ -1,8 +1,11 @@
|
||||
declare module "https" {
|
||||
import * as tls from "tls";
|
||||
import * as events from "events";
|
||||
import * as http from "http";
|
||||
import { URL } from "url";
|
||||
declare module 'node:https' {
|
||||
export * from 'https';
|
||||
}
|
||||
|
||||
declare module 'https' {
|
||||
import * as tls from 'node:tls';
|
||||
import * as http from 'node:http';
|
||||
import { URL } from 'node:url';
|
||||
|
||||
type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
|
||||
|
||||
|
||||
+7
-39
@@ -1,9 +1,8 @@
|
||||
// Type definitions for non-npm package Node.js 14.6
|
||||
// Type definitions for non-npm package Node.js 14.14
|
||||
// Project: http://nodejs.org/
|
||||
// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
|
||||
// DefinitelyTyped <https://github.com/DefinitelyTyped>
|
||||
// Alberto Schiabel <https://github.com/jkomyno>
|
||||
// Alexander T. <https://github.com/a-tarasyuk>
|
||||
// Alvis HT Tang <https://github.com/alvis>
|
||||
// Andrew Makarov <https://github.com/r3nya>
|
||||
// Benjamin Toueg <https://github.com/btoueg>
|
||||
@@ -12,7 +11,6 @@
|
||||
// David Junger <https://github.com/touffy>
|
||||
// Deividas Bakanas <https://github.com/DeividasBakanas>
|
||||
// Eugene Y. Q. Shen <https://github.com/eyqs>
|
||||
// Flarna <https://github.com/Flarna>
|
||||
// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
|
||||
// Hoàng Văn Khải <https://github.com/KSXGitHub>
|
||||
// Huw <https://github.com/hoo29>
|
||||
@@ -31,7 +29,6 @@
|
||||
// wwwy3y3 <https://github.com/wwwy3y3>
|
||||
// Samuel Ainsworth <https://github.com/samuela>
|
||||
// Kyle Uehlein <https://github.com/kuehlein>
|
||||
// Jordi Oliveras Rovira <https://github.com/j-oliveras>
|
||||
// Thanik Bhongbhibhat <https://github.com/bhongy>
|
||||
// Marcin Kopacz <https://github.com/chyzwar>
|
||||
// Trivikram Kamat <https://github.com/trivikr>
|
||||
@@ -43,9 +40,14 @@
|
||||
// Piotr Błażejewicz <https://github.com/peterblazejewicz>
|
||||
// Anna Henningsen <https://github.com/addaleax>
|
||||
// Jason Kwok <https://github.com/JasonHK>
|
||||
// Victor Perin <https://github.com/victorperin>
|
||||
// Yongsheng Zhang <https://github.com/ZYSzys>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.5.
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.7.
|
||||
// Typically type modifications should be made in base.d.ts instead of here
|
||||
|
||||
/// <reference path="base.d.ts" />
|
||||
|
||||
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
||||
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
||||
@@ -55,37 +57,3 @@
|
||||
// NOTE: Augmentations for TypeScript 3.5 and later should use individual files for overrides
|
||||
// within the respective ~/ts3.5 (or later) folder. However, this is disallowed for versions
|
||||
// prior to TypeScript 3.5, so the older definitions will be found here.
|
||||
|
||||
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
||||
/// <reference path="base.d.ts" />
|
||||
|
||||
// We can't include globals.global.d.ts in globals.d.ts, as it'll cause duplication errors in TypeScript 3.5+
|
||||
/// <reference path="globals.global.d.ts" />
|
||||
|
||||
// We can't include assert.d.ts in base.d.ts, as it'll cause duplication errors in TypeScript 3.7+
|
||||
/// <reference path="assert.d.ts" />
|
||||
|
||||
// Forward-declarations for needed types from es2015 and later (in case users are using `--lib es5`)
|
||||
// Empty interfaces are used here which merge fine with the real declarations in the lib XXX files
|
||||
// just to ensure the names are known and node typings can be used without importing these libs.
|
||||
// if someone really needs these types the libs need to be added via --lib or in tsconfig.json
|
||||
interface AsyncIterable<T> { }
|
||||
interface IterableIterator<T> { }
|
||||
interface AsyncIterableIterator<T> {}
|
||||
interface SymbolConstructor {
|
||||
readonly asyncIterator: symbol;
|
||||
}
|
||||
declare var Symbol: SymbolConstructor;
|
||||
// even this is just a forward declaration some properties are added otherwise
|
||||
// it would be allowed to pass anything to e.g. Buffer.from()
|
||||
interface SharedArrayBuffer {
|
||||
readonly byteLength: number;
|
||||
slice(begin?: number, end?: number): SharedArrayBuffer;
|
||||
}
|
||||
|
||||
declare module "util" {
|
||||
namespace types {
|
||||
function isBigInt64Array(value: any): boolean;
|
||||
function isBigUint64Array(value: any): boolean;
|
||||
}
|
||||
}
|
||||
|
||||
+9
-2
@@ -10,8 +10,15 @@
|
||||
/**
|
||||
* The inspector module provides an API for interacting with the V8 inspector.
|
||||
*/
|
||||
declare module "inspector" {
|
||||
import { EventEmitter } from 'events';
|
||||
declare module 'node:inspector' {
|
||||
export * from 'inspector';
|
||||
}
|
||||
|
||||
/**
|
||||
* The inspector module provides an API for interacting with the V8 inspector.
|
||||
*/
|
||||
declare module 'inspector' {
|
||||
import EventEmitter = require('node:events');
|
||||
|
||||
interface InspectorNotification<T> {
|
||||
method: string;
|
||||
|
||||
+7
-2
@@ -1,5 +1,10 @@
|
||||
declare module "module" {
|
||||
import { URL } from "url";
|
||||
declare module 'node:module' {
|
||||
import Module = require('module');
|
||||
export = Module;
|
||||
}
|
||||
|
||||
declare module 'module' {
|
||||
import { URL } from 'node:url';
|
||||
namespace Module {
|
||||
/**
|
||||
* Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports.
|
||||
|
||||
+30
-9
@@ -1,9 +1,17 @@
|
||||
declare module "net" {
|
||||
import * as stream from "stream";
|
||||
import * as events from "events";
|
||||
import * as dns from "dns";
|
||||
declare module 'node:net' {
|
||||
export * from 'net';
|
||||
}
|
||||
|
||||
type LookupFunction = (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
|
||||
declare module 'net' {
|
||||
import * as stream from 'node:stream';
|
||||
import EventEmitter = require('node:events');
|
||||
import * as dns from 'node:dns';
|
||||
|
||||
type LookupFunction = (
|
||||
hostname: string,
|
||||
options: dns.LookupOneOptions,
|
||||
callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void,
|
||||
) => void;
|
||||
|
||||
interface AddressInfo {
|
||||
address: string;
|
||||
@@ -71,10 +79,11 @@ declare module "net" {
|
||||
setTimeout(timeout: number, callback?: () => void): this;
|
||||
setNoDelay(noDelay?: boolean): this;
|
||||
setKeepAlive(enable?: boolean, initialDelay?: number): this;
|
||||
address(): AddressInfo | string;
|
||||
address(): AddressInfo | {};
|
||||
unref(): this;
|
||||
ref(): this;
|
||||
|
||||
/** @deprecated since v14.6.0 - Use `writableLength` instead. */
|
||||
readonly bufferSize: number;
|
||||
readonly bytesRead: number;
|
||||
readonly bytesWritten: number;
|
||||
@@ -177,10 +186,22 @@ declare module "net" {
|
||||
ipv6Only?: boolean;
|
||||
}
|
||||
|
||||
interface ServerOpts {
|
||||
/**
|
||||
* Indicates whether half-opened TCP connections are allowed. __Default:__ `false`.
|
||||
*/
|
||||
allowHalfOpen?: boolean;
|
||||
|
||||
/**
|
||||
* Indicates whether the socket should be paused on incoming connections. __Default:__ `false`.
|
||||
*/
|
||||
pauseOnConnect?: boolean;
|
||||
}
|
||||
|
||||
// https://github.com/nodejs/node/blob/master/lib/net.js
|
||||
class Server extends events.EventEmitter {
|
||||
class Server extends EventEmitter {
|
||||
constructor(connectionListener?: (socket: Socket) => void);
|
||||
constructor(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void);
|
||||
constructor(options?: ServerOpts, connectionListener?: (socket: Socket) => void);
|
||||
|
||||
listen(port?: number, hostname?: string, backlog?: number, listeningListener?: () => void): this;
|
||||
listen(port?: number, hostname?: string, listeningListener?: () => void): this;
|
||||
@@ -255,7 +276,7 @@ declare module "net" {
|
||||
type NetConnectOpts = TcpNetConnectOpts | IpcNetConnectOpts;
|
||||
|
||||
function createServer(connectionListener?: (socket: Socket) => void): Server;
|
||||
function createServer(options?: { allowHalfOpen?: boolean, pauseOnConnect?: boolean }, connectionListener?: (socket: Socket) => void): Server;
|
||||
function createServer(options?: ServerOpts, connectionListener?: (socket: Socket) => void): Server;
|
||||
function connect(options: NetConnectOpts, connectionListener?: () => void): Socket;
|
||||
function connect(port: number, host?: string, connectionListener?: () => void): Socket;
|
||||
function connect(path: string, connectionListener?: () => void): Socket;
|
||||
|
||||
+5
-1
@@ -1,4 +1,8 @@
|
||||
declare module "os" {
|
||||
declare module 'node:os' {
|
||||
export * from 'os';
|
||||
}
|
||||
|
||||
declare module 'os' {
|
||||
interface CpuInfo {
|
||||
model: string;
|
||||
speed: number;
|
||||
|
||||
+17
-27
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@types/node",
|
||||
"version": "14.6.1",
|
||||
"version": "14.14.31",
|
||||
"description": "TypeScript definitions for Node.js",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
@@ -19,11 +19,6 @@
|
||||
"url": "https://github.com/jkomyno",
|
||||
"githubUsername": "jkomyno"
|
||||
},
|
||||
{
|
||||
"name": "Alexander T.",
|
||||
"url": "https://github.com/a-tarasyuk",
|
||||
"githubUsername": "a-tarasyuk"
|
||||
},
|
||||
{
|
||||
"name": "Alvis HT Tang",
|
||||
"url": "https://github.com/alvis",
|
||||
@@ -64,11 +59,6 @@
|
||||
"url": "https://github.com/eyqs",
|
||||
"githubUsername": "eyqs"
|
||||
},
|
||||
{
|
||||
"name": "Flarna",
|
||||
"url": "https://github.com/Flarna",
|
||||
"githubUsername": "Flarna"
|
||||
},
|
||||
{
|
||||
"name": "Hannes Magnusson",
|
||||
"url": "https://github.com/Hannes-Magnusson-CK",
|
||||
@@ -159,11 +149,6 @@
|
||||
"url": "https://github.com/kuehlein",
|
||||
"githubUsername": "kuehlein"
|
||||
},
|
||||
{
|
||||
"name": "Jordi Oliveras Rovira",
|
||||
"url": "https://github.com/j-oliveras",
|
||||
"githubUsername": "j-oliveras"
|
||||
},
|
||||
{
|
||||
"name": "Thanik Bhongbhibhat",
|
||||
"url": "https://github.com/bhongy",
|
||||
@@ -218,24 +203,29 @@
|
||||
"name": "Jason Kwok",
|
||||
"url": "https://github.com/JasonHK",
|
||||
"githubUsername": "JasonHK"
|
||||
},
|
||||
{
|
||||
"name": "Victor Perin",
|
||||
"url": "https://github.com/victorperin",
|
||||
"githubUsername": "victorperin"
|
||||
},
|
||||
{
|
||||
"name": "Yongsheng Zhang",
|
||||
"url": "https://github.com/ZYSzys",
|
||||
"githubUsername": "ZYSzys"
|
||||
}
|
||||
],
|
||||
"main": "",
|
||||
"types": "index.d.ts",
|
||||
"typesVersions": {
|
||||
">=3.7.0-0": {
|
||||
"<=3.4": {
|
||||
"*": [
|
||||
"ts3.7/*"
|
||||
"ts3.4/*"
|
||||
]
|
||||
},
|
||||
">=3.5.0-0": {
|
||||
"<=3.6": {
|
||||
"*": [
|
||||
"ts3.5/*"
|
||||
]
|
||||
},
|
||||
">=3.2.0-0": {
|
||||
"*": [
|
||||
"ts3.2/*"
|
||||
"ts3.6/*"
|
||||
]
|
||||
}
|
||||
},
|
||||
@@ -246,6 +236,6 @@
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "fe5126c321b3e11256e7d89d506db0a8f78bc70c6d89968a6084e20c9be0acc5",
|
||||
"typeScriptVersion": "3.1"
|
||||
"typesPublisherContentHash": "e35e9f1e1be2150998638a2f9485b5e421a39bcfa3f02c37f4c39c69eeffef7b",
|
||||
"typeScriptVersion": "3.4"
|
||||
}
|
||||
+6
-1
@@ -1,4 +1,9 @@
|
||||
declare module "path" {
|
||||
declare module 'node:path' {
|
||||
import path = require('path');
|
||||
export = path;
|
||||
}
|
||||
|
||||
declare module 'path' {
|
||||
namespace path {
|
||||
/**
|
||||
* A parsed path object generated by path.parse() or consumed by path.format().
|
||||
|
||||
+32
-78
@@ -1,5 +1,9 @@
|
||||
declare module 'node:perf_hooks' {
|
||||
export * from 'perf_hooks';
|
||||
}
|
||||
|
||||
declare module 'perf_hooks' {
|
||||
import { AsyncResource } from 'async_hooks';
|
||||
import { AsyncResource } from 'node:async_hooks';
|
||||
|
||||
type EntryType = 'node' | 'mark' | 'measure' | 'gc' | 'function' | 'http2' | 'http';
|
||||
|
||||
@@ -48,74 +52,43 @@ declare module 'perf_hooks' {
|
||||
readonly bootstrapComplete: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which cluster processing ended.
|
||||
* The high resolution millisecond timestamp at which the Node.js process completed bootstrapping.
|
||||
* If bootstrapping has not yet finished, the property has the value of -1.
|
||||
*/
|
||||
readonly clusterSetupEnd: number;
|
||||
readonly environment: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which cluster processing started.
|
||||
* The high resolution millisecond timestamp at which the Node.js environment was initialized.
|
||||
*/
|
||||
readonly clusterSetupStart: number;
|
||||
readonly idleTime: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which the Node.js event loop exited.
|
||||
* The high resolution millisecond timestamp of the amount of time the event loop has been idle
|
||||
* within the event loop's event provider (e.g. `epoll_wait`). This does not take CPU usage
|
||||
* into consideration. If the event loop has not yet started (e.g., in the first tick of the main script),
|
||||
* the property has the value of 0.
|
||||
*/
|
||||
readonly loopExit: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which the Node.js event loop started.
|
||||
* If the event loop has not yet started (e.g., in the first tick of the main script), the property has the value of -1.
|
||||
*/
|
||||
readonly loopStart: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which main module load ended.
|
||||
*/
|
||||
readonly moduleLoadEnd: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which main module load started.
|
||||
*/
|
||||
readonly moduleLoadStart: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which the Node.js process was initialized.
|
||||
*/
|
||||
readonly nodeStart: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which preload module load ended.
|
||||
*/
|
||||
readonly preloadModuleLoadEnd: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which preload module load started.
|
||||
*/
|
||||
readonly preloadModuleLoadStart: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which third_party_main processing ended.
|
||||
*/
|
||||
readonly thirdPartyMainEnd: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which third_party_main processing started.
|
||||
*/
|
||||
readonly thirdPartyMainStart: number;
|
||||
|
||||
/**
|
||||
* The high resolution millisecond timestamp at which the V8 platform was initialized.
|
||||
*/
|
||||
readonly v8Start: number;
|
||||
}
|
||||
|
||||
interface Performance {
|
||||
/**
|
||||
* If name is not provided, removes all PerformanceFunction objects from the Performance Timeline.
|
||||
* If name is provided, removes entries with name.
|
||||
* @param name
|
||||
*/
|
||||
clearFunctions(name?: string): void;
|
||||
interface EventLoopUtilization {
|
||||
idle: number;
|
||||
active: number;
|
||||
utilization: number;
|
||||
}
|
||||
|
||||
interface Performance {
|
||||
/**
|
||||
* If name is not provided, removes all PerformanceMark objects from the Performance Timeline.
|
||||
* If name is provided, removes only the named mark.
|
||||
@@ -123,35 +96,6 @@ declare module 'perf_hooks' {
|
||||
*/
|
||||
clearMarks(name?: string): void;
|
||||
|
||||
/**
|
||||
* If name is not provided, removes all PerformanceMeasure objects from the Performance Timeline.
|
||||
* If name is provided, removes only objects whose performanceEntry.name matches name.
|
||||
*/
|
||||
clearMeasures(name?: string): void;
|
||||
|
||||
/**
|
||||
* Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime.
|
||||
* @return list of all PerformanceEntry objects
|
||||
*/
|
||||
getEntries(): PerformanceEntry[];
|
||||
|
||||
/**
|
||||
* Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
|
||||
* whose performanceEntry.name is equal to name, and optionally, whose performanceEntry.entryType is equal to type.
|
||||
* @param name
|
||||
* @param type
|
||||
* @return list of all PerformanceEntry objects
|
||||
*/
|
||||
getEntriesByName(name: string, type?: EntryType): PerformanceEntry[];
|
||||
|
||||
/**
|
||||
* Returns a list of all PerformanceEntry objects in chronological order with respect to performanceEntry.startTime
|
||||
* whose performanceEntry.entryType is equal to type.
|
||||
* @param type
|
||||
* @return list of all PerformanceEntry objects
|
||||
*/
|
||||
getEntriesByType(type: EntryType): PerformanceEntry[];
|
||||
|
||||
/**
|
||||
* Creates a new PerformanceMark entry in the Performance Timeline.
|
||||
* A PerformanceMark is a subclass of PerformanceEntry whose performanceEntry.entryType is always 'mark',
|
||||
@@ -199,6 +143,16 @@ declare module 'perf_hooks' {
|
||||
* @param fn
|
||||
*/
|
||||
timerify<T extends (...optionalParams: any[]) => any>(fn: T): T;
|
||||
|
||||
/**
|
||||
* eventLoopUtilization is similar to CPU utilization except that it is calculated using high precision wall-clock time.
|
||||
* It represents the percentage of time the event loop has spent outside the event loop's event provider (e.g. epoll_wait).
|
||||
* No other CPU idle time is taken into consideration.
|
||||
*
|
||||
* @param util1 The result of a previous call to eventLoopUtilization()
|
||||
* @param util2 The result of a previous call to eventLoopUtilization() prior to util1
|
||||
*/
|
||||
eventLoopUtilization(util1?: EventLoopUtilization, util2?: EventLoopUtilization): EventLoopUtilization;
|
||||
}
|
||||
|
||||
interface PerformanceObserverEntryList {
|
||||
@@ -236,7 +190,7 @@ declare module 'perf_hooks' {
|
||||
* Property buffered defaults to false.
|
||||
* @param options
|
||||
*/
|
||||
observe(options: { entryTypes: EntryType[]; buffered?: boolean }): void;
|
||||
observe(options: { entryTypes: ReadonlyArray<EntryType>; buffered?: boolean }): void;
|
||||
}
|
||||
|
||||
namespace constants {
|
||||
|
||||
+21
-6
@@ -1,5 +1,9 @@
|
||||
declare module "process" {
|
||||
import * as tty from "tty";
|
||||
declare module 'node:process' {
|
||||
export = process;
|
||||
}
|
||||
|
||||
declare module 'process' {
|
||||
import * as tty from 'node:tty';
|
||||
|
||||
global {
|
||||
var process: NodeJS.Process;
|
||||
@@ -32,7 +36,7 @@ declare module "process" {
|
||||
lts?: string;
|
||||
}
|
||||
|
||||
interface ProcessVersions {
|
||||
interface ProcessVersions extends Dict<string> {
|
||||
http_parser: string;
|
||||
node: string;
|
||||
v8: string;
|
||||
@@ -84,6 +88,7 @@ declare module "process" {
|
||||
|
||||
interface HRTime {
|
||||
(time?: [number, number]): [number, number];
|
||||
bigint(): bigint;
|
||||
}
|
||||
|
||||
interface ProcessReport {
|
||||
@@ -191,7 +196,7 @@ declare module "process" {
|
||||
argv0: string;
|
||||
execArgv: string[];
|
||||
execPath: string;
|
||||
abort(): void;
|
||||
abort(): never;
|
||||
chdir(directory: string): void;
|
||||
cwd(): string;
|
||||
debugPort: number;
|
||||
@@ -208,7 +213,7 @@ declare module "process" {
|
||||
getegid(): number;
|
||||
setegid(id: number | string): void;
|
||||
getgroups(): number[];
|
||||
setgroups(groups: Array<string | number>): void;
|
||||
setgroups(groups: ReadonlyArray<string | number>): void;
|
||||
setUncaughtExceptionCaptureCallback(cb: ((err: Error) => void) | null): void;
|
||||
hasUncaughtExceptionCaptureCallback(): boolean;
|
||||
version: string;
|
||||
@@ -245,6 +250,8 @@ declare module "process" {
|
||||
title: string;
|
||||
arch: string;
|
||||
platform: Platform;
|
||||
/** @deprecated since v14.0.0 - use `require.main` instead. */
|
||||
mainModule?: Module;
|
||||
memoryUsage(): MemoryUsage;
|
||||
cpuUsage(previousValue?: CpuUsage): CpuUsage;
|
||||
nextTick(callback: Function, ...args: any[]): void;
|
||||
@@ -259,10 +266,16 @@ declare module "process" {
|
||||
tls_ocsp: boolean;
|
||||
tls: boolean;
|
||||
};
|
||||
/**
|
||||
* @deprecated since v14.0.0 - Calling process.umask() with no argument causes
|
||||
* the process-wide umask to be written twice. This introduces a race condition between threads,
|
||||
* and is a potential security vulnerability. There is no safe, cross-platform alternative API.
|
||||
*/
|
||||
umask(): number;
|
||||
/**
|
||||
* Can only be set if not in worker thread.
|
||||
*/
|
||||
umask(mask: number): number;
|
||||
umask(mask: string | number): number;
|
||||
uptime(): number;
|
||||
hrtime: HRTime;
|
||||
domain: Domain;
|
||||
@@ -286,6 +299,8 @@ declare module "process" {
|
||||
|
||||
resourceUsage(): ResourceUsage;
|
||||
|
||||
traceDeprecation: boolean;
|
||||
|
||||
/* EventEmitter */
|
||||
addListener(event: "beforeExit", listener: BeforeExitListener): this;
|
||||
addListener(event: "disconnect", listener: DisconnectListener): this;
|
||||
|
||||
+76
-2
@@ -1,12 +1,86 @@
|
||||
declare module "punycode" {
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
declare module 'node:punycode' {
|
||||
export * from 'punycode';
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
declare module 'punycode' {
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
function decode(string: string): string;
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
function encode(string: string): string;
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
function toUnicode(domain: string): string;
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
function toASCII(domain: string): string;
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
const ucs2: ucs2;
|
||||
interface ucs2 {
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
decode(string: string): number[];
|
||||
encode(codePoints: number[]): string;
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
encode(codePoints: ReadonlyArray<number>): string;
|
||||
}
|
||||
/**
|
||||
* @deprecated since v7.0.0
|
||||
* The version of the punycode module bundled in Node.js is being deprecated.
|
||||
* In a future major version of Node.js this module will be removed.
|
||||
* Users currently depending on the punycode module should switch to using
|
||||
* the userland-provided Punycode.js module instead.
|
||||
*/
|
||||
const version: string;
|
||||
}
|
||||
|
||||
+5
-1
@@ -1,4 +1,8 @@
|
||||
declare module "querystring" {
|
||||
declare module 'node:querystring' {
|
||||
export * from 'querystring';
|
||||
}
|
||||
|
||||
declare module 'querystring' {
|
||||
interface StringifyOptions {
|
||||
encodeURIComponent?: (str: string) => string;
|
||||
}
|
||||
|
||||
+8
-5
@@ -1,6 +1,9 @@
|
||||
declare module "readline" {
|
||||
import * as events from "events";
|
||||
import * as stream from "stream";
|
||||
declare module 'node:readline' {
|
||||
export * from 'readline';
|
||||
}
|
||||
|
||||
declare module 'readline' {
|
||||
import EventEmitter = require('node:events');
|
||||
|
||||
interface Key {
|
||||
sequence?: string;
|
||||
@@ -10,7 +13,7 @@ declare module "readline" {
|
||||
shift?: boolean;
|
||||
}
|
||||
|
||||
class Interface extends events.EventEmitter {
|
||||
class Interface extends EventEmitter {
|
||||
readonly terminal: boolean;
|
||||
|
||||
// Need direct access to line/cursor data, for use in external processes
|
||||
@@ -121,7 +124,7 @@ declare module "readline" {
|
||||
[Symbol.asyncIterator](): AsyncIterableIterator<string>;
|
||||
}
|
||||
|
||||
type ReadLine = Interface; // type forwarded for backwards compatiblity
|
||||
type ReadLine = Interface; // type forwarded for backwards compatibility
|
||||
|
||||
type Completer = (line: string) => CompleterResult;
|
||||
type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any;
|
||||
|
||||
+18
-6
@@ -1,7 +1,11 @@
|
||||
declare module "repl" {
|
||||
import { Interface, Completer, AsyncCompleter } from "readline";
|
||||
import { Context } from "vm";
|
||||
import { InspectOptions } from "util";
|
||||
declare module 'node:repl' {
|
||||
export * from 'repl';
|
||||
}
|
||||
|
||||
declare module 'repl' {
|
||||
import { Interface, Completer, AsyncCompleter } from 'node:readline';
|
||||
import { Context } from 'node:vm';
|
||||
import { InspectOptions } from 'node:util';
|
||||
|
||||
interface ReplOptions {
|
||||
/**
|
||||
@@ -136,13 +140,21 @@ declare module "repl" {
|
||||
*/
|
||||
readonly context: Context;
|
||||
/**
|
||||
* The `Readable` stream from which REPL input will be read.
|
||||
* @deprecated since v14.3.0 - Use `input` instead.
|
||||
*/
|
||||
readonly inputStream: NodeJS.ReadableStream;
|
||||
/**
|
||||
* The `Writable` stream to which REPL output will be written.
|
||||
* @deprecated since v14.3.0 - Use `output` instead.
|
||||
*/
|
||||
readonly outputStream: NodeJS.WritableStream;
|
||||
/**
|
||||
* The `Readable` stream from which REPL input will be read.
|
||||
*/
|
||||
readonly input: NodeJS.ReadableStream;
|
||||
/**
|
||||
* The `Writable` stream to which REPL output will be written.
|
||||
*/
|
||||
readonly output: NodeJS.WritableStream;
|
||||
/**
|
||||
* The commands registered via `replServer.defineCommand()`.
|
||||
*/
|
||||
|
||||
+13
-5
@@ -1,7 +1,12 @@
|
||||
declare module "stream" {
|
||||
import * as events from "events";
|
||||
declare module 'node:stream' {
|
||||
import Stream = require('stream');
|
||||
export = Stream;
|
||||
}
|
||||
|
||||
class internal extends events.EventEmitter {
|
||||
declare module 'stream' {
|
||||
import EventEmitter = require('node:events');
|
||||
|
||||
class internal extends EventEmitter {
|
||||
pipe<T extends NodeJS.WritableStream>(destination: T, options?: { end?: boolean; }): T;
|
||||
}
|
||||
|
||||
@@ -314,7 +319,10 @@ declare module "stream" {
|
||||
stream5: T,
|
||||
callback?: (err: NodeJS.ErrnoException | null) => void,
|
||||
): T;
|
||||
function pipeline(streams: Array<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>, callback?: (err: NodeJS.ErrnoException | null) => void): NodeJS.WritableStream;
|
||||
function pipeline(
|
||||
streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
|
||||
callback?: (err: NodeJS.ErrnoException | null) => void,
|
||||
): NodeJS.WritableStream;
|
||||
function pipeline(
|
||||
stream1: NodeJS.ReadableStream,
|
||||
stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
|
||||
@@ -331,7 +339,7 @@ declare module "stream" {
|
||||
stream4: NodeJS.ReadWriteStream,
|
||||
stream5: NodeJS.WritableStream,
|
||||
): Promise<void>;
|
||||
function __promisify__(streams: Array<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>): Promise<void>;
|
||||
function __promisify__(streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>): Promise<void>;
|
||||
function __promisify__(
|
||||
stream1: NodeJS.ReadableStream,
|
||||
stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
|
||||
|
||||
+5
-1
@@ -1,4 +1,8 @@
|
||||
declare module "string_decoder" {
|
||||
declare module 'node:string_decoder' {
|
||||
export * from 'string_decoder';
|
||||
}
|
||||
|
||||
declare module 'string_decoder' {
|
||||
class StringDecoder {
|
||||
constructor(encoding?: BufferEncoding);
|
||||
write(buffer: Buffer): string;
|
||||
|
||||
+7
-3
@@ -1,11 +1,15 @@
|
||||
declare module "timers" {
|
||||
function setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
|
||||
declare module 'node:timers' {
|
||||
export * from 'timers';
|
||||
}
|
||||
|
||||
declare module 'timers' {
|
||||
function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
|
||||
namespace setTimeout {
|
||||
function __promisify__(ms: number): Promise<void>;
|
||||
function __promisify__<T>(ms: number, value: T): Promise<T>;
|
||||
}
|
||||
function clearTimeout(timeoutId: NodeJS.Timeout): void;
|
||||
function setInterval(callback: (...args: any[]) => void, ms: number, ...args: any[]): NodeJS.Timeout;
|
||||
function setInterval(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
|
||||
function clearInterval(intervalId: NodeJS.Timeout): void;
|
||||
function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
|
||||
namespace setImmediate {
|
||||
|
||||
+17
-11
@@ -1,8 +1,9 @@
|
||||
declare module "tls" {
|
||||
import * as crypto from "crypto";
|
||||
import * as dns from "dns";
|
||||
import * as net from "net";
|
||||
import * as stream from "stream";
|
||||
declare module 'node:tls' {
|
||||
export * from 'tls';
|
||||
}
|
||||
|
||||
declare module 'tls' {
|
||||
import * as net from 'node:net';
|
||||
|
||||
const CLIENT_RENEG_LIMIT: number;
|
||||
const CLIENT_RENEG_WINDOW: number;
|
||||
@@ -385,7 +386,7 @@ declare module "tls" {
|
||||
rejectUnauthorized?: boolean;
|
||||
}
|
||||
|
||||
interface TlsOptions extends SecureContextOptions, CommonConnectionOptions {
|
||||
interface TlsOptions extends SecureContextOptions, CommonConnectionOptions, net.ServerOpts {
|
||||
/**
|
||||
* Abort the connection if the SSL/TLS handshake does not finish in the
|
||||
* specified number of milliseconds. A 'tlsClientError' is emitted on
|
||||
@@ -436,7 +437,7 @@ declare module "tls" {
|
||||
|
||||
interface PSKCallbackNegotation {
|
||||
psk: DataView | NodeJS.TypedArray;
|
||||
identitty: string;
|
||||
identity: string;
|
||||
}
|
||||
|
||||
interface ConnectionOptions extends SecureContextOptions, CommonConnectionOptions {
|
||||
@@ -471,6 +472,9 @@ declare module "tls" {
|
||||
}
|
||||
|
||||
class Server extends net.Server {
|
||||
constructor(secureConnectionListener?: (socket: TLSSocket) => void);
|
||||
constructor(options: TlsOptions, secureConnectionListener?: (socket: TLSSocket) => void);
|
||||
|
||||
/**
|
||||
* The server.addContext() method adds a secure context that will be
|
||||
* used if the client request's SNI name matches the supplied hostname
|
||||
@@ -707,12 +711,14 @@ declare module "tls" {
|
||||
*/
|
||||
sessionIdContext?: string;
|
||||
/**
|
||||
* 48 bytes of cryptographically strong pseudo-random data.
|
||||
* 48-bytes of cryptographically strong pseudo-random data.
|
||||
* See Session Resumption for more information.
|
||||
*/
|
||||
ticketKeys?: Buffer;
|
||||
/**
|
||||
* The number of seconds after which a TLS session created by the server
|
||||
* will no longer be resumable.
|
||||
* The number of seconds after which a TLS session created by the
|
||||
* server will no longer be resumable. See Session Resumption for more
|
||||
* information. Default: 300.
|
||||
*/
|
||||
sessionTimeout?: number;
|
||||
}
|
||||
@@ -738,7 +744,7 @@ declare module "tls" {
|
||||
* @deprecated since v0.11.3 Use `tls.TLSSocket` instead.
|
||||
*/
|
||||
function createSecurePair(credentials?: SecureContext, isServer?: boolean, requestCert?: boolean, rejectUnauthorized?: boolean): SecurePair;
|
||||
function createSecureContext(details: SecureContextOptions): SecureContext;
|
||||
function createSecureContext(options?: SecureContextOptions): SecureContext;
|
||||
function getCiphers(): string[];
|
||||
|
||||
/**
|
||||
|
||||
+5
-1
@@ -1,4 +1,8 @@
|
||||
declare module "trace_events" {
|
||||
declare module 'node:trace_events' {
|
||||
export * from 'trace_events';
|
||||
}
|
||||
|
||||
declare module 'trace_events' {
|
||||
/**
|
||||
* The `Tracing` object is used to enable or disable tracing for sets of
|
||||
* categories. Instances are created using the
|
||||
|
||||
-23
@@ -1,23 +0,0 @@
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.2.
|
||||
|
||||
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
||||
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
||||
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
|
||||
// - ~/ts3.2/base.d.ts - Definitions specific to TypeScript 3.2
|
||||
// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2 with global and assert pulled in
|
||||
|
||||
// Reference required types from the default lib:
|
||||
/// <reference lib="es2018" />
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/// <reference lib="esnext.intl" />
|
||||
/// <reference lib="esnext.bigint" />
|
||||
|
||||
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../base.d.ts" />
|
||||
|
||||
// TypeScript 3.2-specific augmentations:
|
||||
/// <reference path="fs.d.ts" />
|
||||
/// <reference path="process.d.ts" />
|
||||
/// <reference path="util.d.ts" />
|
||||
/// <reference path="globals.d.ts" />
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../fs.d.ts" />
|
||||
|
||||
declare module 'fs' {
|
||||
interface BigIntStats extends StatsBase<bigint> {
|
||||
}
|
||||
|
||||
class BigIntStats {
|
||||
atimeNs: bigint;
|
||||
mtimeNs: bigint;
|
||||
ctimeNs: bigint;
|
||||
birthtimeNs: bigint;
|
||||
}
|
||||
|
||||
interface BigIntOptions {
|
||||
bigint: true;
|
||||
}
|
||||
|
||||
interface StatOptions {
|
||||
bigint: boolean;
|
||||
}
|
||||
|
||||
function stat(path: PathLike, options: BigIntOptions, callback: (err: NodeJS.ErrnoException | null, stats: BigIntStats) => void): void;
|
||||
function stat(path: PathLike, options: StatOptions, callback: (err: NodeJS.ErrnoException | null, stats: Stats | BigIntStats) => void): void;
|
||||
|
||||
namespace stat {
|
||||
function __promisify__(path: PathLike, options: BigIntOptions): Promise<BigIntStats>;
|
||||
function __promisify__(path: PathLike, options: StatOptions): Promise<Stats | BigIntStats>;
|
||||
}
|
||||
|
||||
function statSync(path: PathLike, options: BigIntOptions): BigIntStats;
|
||||
function statSync(path: PathLike, options: StatOptions): Stats | BigIntStats;
|
||||
}
|
||||
-13
@@ -1,13 +0,0 @@
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../globals.d.ts" />
|
||||
|
||||
interface Buffer extends Uint8Array {
|
||||
readBigUInt64BE(offset?: number): bigint;
|
||||
readBigUInt64LE(offset?: number): bigint;
|
||||
readBigInt64BE(offset?: number): bigint;
|
||||
readBigInt64LE(offset?: number): bigint;
|
||||
writeBigInt64BE(value: bigint, offset?: number): number;
|
||||
writeBigInt64LE(value: bigint, offset?: number): number;
|
||||
writeBigUInt64BE(value: bigint, offset?: number): number;
|
||||
writeBigUInt64LE(value: bigint, offset?: number): number;
|
||||
}
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.2.
|
||||
// This is requried to enable globalThis support for global in ts3.5 without causing errors
|
||||
// This is requried to enable typing assert in ts3.7 without causing errors
|
||||
// Typically type modifiations should be made in base.d.ts instead of here
|
||||
|
||||
/// <reference path="base.d.ts" />
|
||||
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../assert.d.ts" />
|
||||
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../globals.global.d.ts" />
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../process.d.ts" />
|
||||
|
||||
declare module 'process' {
|
||||
global {
|
||||
namespace NodeJS {
|
||||
interface HRTime {
|
||||
bigint(): bigint;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../util.d.ts" />
|
||||
|
||||
declare module "util" {
|
||||
namespace types {
|
||||
function isBigInt64Array(value: any): value is BigInt64Array;
|
||||
function isBigUint64Array(value: any): value is BigUint64Array;
|
||||
}
|
||||
}
|
||||
+103
@@ -0,0 +1,103 @@
|
||||
declare module 'node:assert' {
|
||||
import assert = require('assert');
|
||||
export = assert;
|
||||
}
|
||||
|
||||
declare module 'assert' {
|
||||
/** An alias of `assert.ok()`. */
|
||||
function assert(value: any, message?: string | Error): void;
|
||||
namespace assert {
|
||||
class AssertionError extends Error {
|
||||
actual: any;
|
||||
expected: any;
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
/** If provided, the error message is set to this value. */
|
||||
message?: string;
|
||||
/** The `actual` property on the error instance. */
|
||||
actual?: any;
|
||||
/** The `expected` property on the error instance. */
|
||||
expected?: any;
|
||||
/** The `operator` property on the error instance. */
|
||||
operator?: string;
|
||||
/** If provided, the generated stack trace omits frames before this function. */
|
||||
// tslint:disable-next-line:ban-types
|
||||
stackStartFn?: Function;
|
||||
});
|
||||
}
|
||||
|
||||
class CallTracker {
|
||||
calls(exact?: number): () => void;
|
||||
calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
|
||||
report(): CallTrackerReportInformation[];
|
||||
verify(): void;
|
||||
}
|
||||
interface CallTrackerReportInformation {
|
||||
message: string;
|
||||
/** The actual number of times the function was called. */
|
||||
actual: number;
|
||||
/** The number of times the function was expected to be called. */
|
||||
expected: number;
|
||||
/** The name of the function that is wrapped. */
|
||||
operator: string;
|
||||
/** A stack trace of the function. */
|
||||
stack: object;
|
||||
}
|
||||
|
||||
type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
|
||||
|
||||
function fail(message?: string | Error): never;
|
||||
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
||||
function fail(
|
||||
actual: any,
|
||||
expected: any,
|
||||
message?: string | Error,
|
||||
operator?: string,
|
||||
// tslint:disable-next-line:ban-types
|
||||
stackStartFn?: Function,
|
||||
): never;
|
||||
function ok(value: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use strictEqual() instead. */
|
||||
function equal(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
|
||||
function notEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
|
||||
function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
|
||||
function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function strictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
|
||||
function throws(block: () => any, message?: string | Error): void;
|
||||
function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
||||
function doesNotThrow(block: () => any, message?: string | Error): void;
|
||||
function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
||||
|
||||
function ifError(value: any): void;
|
||||
|
||||
function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
||||
function rejects(
|
||||
block: (() => Promise<any>) | Promise<any>,
|
||||
error: AssertPredicate,
|
||||
message?: string | Error,
|
||||
): Promise<void>;
|
||||
function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
||||
function doesNotReject(
|
||||
block: (() => Promise<any>) | Promise<any>,
|
||||
error: AssertPredicate,
|
||||
message?: string | Error,
|
||||
): Promise<void>;
|
||||
|
||||
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
||||
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
||||
|
||||
const strict: typeof assert;
|
||||
}
|
||||
|
||||
export = assert;
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.2 - 3.4.
|
||||
|
||||
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
||||
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
||||
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
|
||||
// - ~/ts3.2/base.d.ts - Definitions specific to TypeScript 3.2
|
||||
// - ~/ts3.2/index.d.ts - Definitions specific to TypeScript 3.2 with global and assert pulled in
|
||||
|
||||
// Reference required types from the default lib:
|
||||
/// <reference lib="es2018" />
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/// <reference lib="esnext.intl" />
|
||||
/// <reference lib="esnext.bigint" />
|
||||
|
||||
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
||||
|
||||
/// <reference path="../globals.d.ts" />
|
||||
/// <reference path="../async_hooks.d.ts" />
|
||||
/// <reference path="../buffer.d.ts" />
|
||||
/// <reference path="../child_process.d.ts" />
|
||||
/// <reference path="../cluster.d.ts" />
|
||||
/// <reference path="../console.d.ts" />
|
||||
/// <reference path="../constants.d.ts" />
|
||||
/// <reference path="../crypto.d.ts" />
|
||||
/// <reference path="../dgram.d.ts" />
|
||||
/// <reference path="../dns.d.ts" />
|
||||
/// <reference path="../domain.d.ts" />
|
||||
/// <reference path="../events.d.ts" />
|
||||
/// <reference path="../fs.d.ts" />
|
||||
/// <reference path="../fs/promises.d.ts" />
|
||||
/// <reference path="../http.d.ts" />
|
||||
/// <reference path="../http2.d.ts" />
|
||||
/// <reference path="../https.d.ts" />
|
||||
/// <reference path="../inspector.d.ts" />
|
||||
/// <reference path="../module.d.ts" />
|
||||
/// <reference path="../net.d.ts" />
|
||||
/// <reference path="../os.d.ts" />
|
||||
/// <reference path="../path.d.ts" />
|
||||
/// <reference path="../perf_hooks.d.ts" />
|
||||
/// <reference path="../process.d.ts" />
|
||||
/// <reference path="../punycode.d.ts" />
|
||||
/// <reference path="../querystring.d.ts" />
|
||||
/// <reference path="../readline.d.ts" />
|
||||
/// <reference path="../repl.d.ts" />
|
||||
/// <reference path="../stream.d.ts" />
|
||||
/// <reference path="../string_decoder.d.ts" />
|
||||
/// <reference path="../timers.d.ts" />
|
||||
/// <reference path="../tls.d.ts" />
|
||||
/// <reference path="../trace_events.d.ts" />
|
||||
/// <reference path="../tty.d.ts" />
|
||||
/// <reference path="../url.d.ts" />
|
||||
/// <reference path="../util.d.ts" />
|
||||
/// <reference path="../v8.d.ts" />
|
||||
/// <reference path="../vm.d.ts" />
|
||||
/// <reference path="../worker_threads.d.ts" />
|
||||
/// <reference path="../zlib.d.ts" />
|
||||
+1
@@ -0,0 +1 @@
|
||||
declare var global: NodeJS.Global;
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.2 - 3.4.
|
||||
// This is required to enable globalThis support for global in ts3.5 without causing errors
|
||||
// This is required to enable typing assert in ts3.7 without causing errors
|
||||
// Typically type modifiations should be made in base.d.ts instead of here
|
||||
|
||||
/// <reference path="base.d.ts" />
|
||||
/// <reference path="assert.d.ts" />
|
||||
/// <reference path="globals.global.d.ts" />
|
||||
-1
@@ -1 +0,0 @@
|
||||
declare var global: NodeJS.Global & typeof globalThis;
|
||||
-8
@@ -1,8 +0,0 @@
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.5.
|
||||
// This is requried to enable typing assert in ts3.7 without causing errors
|
||||
// Typically type modifiations should be made in base.d.ts instead of here
|
||||
|
||||
/// <reference path="base.d.ts" />
|
||||
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../assert.d.ts" />
|
||||
Generated
Vendored
+3
-4
@@ -13,11 +13,10 @@
|
||||
/// <reference lib="esnext.bigint" />
|
||||
|
||||
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../ts3.2/base.d.ts" />
|
||||
/// <reference path="../ts3.4/base.d.ts" />
|
||||
|
||||
// TypeScript 3.5-specific augmentations:
|
||||
/// <reference path="globals.global.d.ts" />
|
||||
/// <reference path="../globals.global.d.ts" />
|
||||
|
||||
// TypeScript 3.5-specific augmentations:
|
||||
/// <reference path="wasi.d.ts" />
|
||||
/// <reference path="../wasi.d.ts" />
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.5 - 3.6.
|
||||
// This is required to enable typing assert in ts3.7 without causing errors
|
||||
// Typically type modifications should be made in base.d.ts instead of here
|
||||
|
||||
/// <reference path="base.d.ts" />
|
||||
|
||||
/// <reference path="../ts3.4/assert.d.ts" />
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
declare module "assert" {
|
||||
function assert(value: any, message?: string | Error): asserts value;
|
||||
namespace assert {
|
||||
class AssertionError implements Error {
|
||||
name: string;
|
||||
message: string;
|
||||
actual: any;
|
||||
expected: any;
|
||||
operator: string;
|
||||
generatedMessage: boolean;
|
||||
code: 'ERR_ASSERTION';
|
||||
|
||||
constructor(options?: {
|
||||
message?: string; actual?: any; expected?: any;
|
||||
operator?: string; stackStartFn?: Function
|
||||
});
|
||||
}
|
||||
|
||||
type AssertPredicate = RegExp | (new() => object) | ((thrown: any) => boolean) | object | Error;
|
||||
|
||||
function fail(message?: string | Error): never;
|
||||
/** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
|
||||
function fail(actual: any, expected: any, message?: string | Error, operator?: string, stackStartFn?: Function): never;
|
||||
function ok(value: any, message?: string | Error): asserts value;
|
||||
/** @deprecated since v9.9.0 - use strictEqual() instead. */
|
||||
function equal(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notStrictEqual() instead. */
|
||||
function notEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
|
||||
function deepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
/** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
|
||||
function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
|
||||
function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
|
||||
function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
|
||||
|
||||
function throws(block: () => any, message?: string | Error): void;
|
||||
function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
|
||||
function doesNotThrow(block: () => any, message?: string | Error): void;
|
||||
function doesNotThrow(block: () => any, error: RegExp | Function, message?: string | Error): void;
|
||||
|
||||
function ifError(value: any): asserts value is null | undefined;
|
||||
|
||||
function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
||||
function rejects(block: (() => Promise<any>) | Promise<any>, error: AssertPredicate, message?: string | Error): Promise<void>;
|
||||
function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
|
||||
function doesNotReject(block: (() => Promise<any>) | Promise<any>, error: RegExp | Function, message?: string | Error): Promise<void>;
|
||||
|
||||
function match(value: string, regExp: RegExp, message?: string | Error): void;
|
||||
function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
|
||||
|
||||
const strict: typeof assert;
|
||||
}
|
||||
|
||||
export = assert;
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.7.
|
||||
|
||||
// NOTE: TypeScript version-specific augmentations can be found in the following paths:
|
||||
// - ~/base.d.ts - Shared definitions common to all TypeScript versions
|
||||
// - ~/index.d.ts - Definitions specific to TypeScript 2.1
|
||||
// - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7
|
||||
// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
|
||||
|
||||
// Reference required types from the default lib:
|
||||
/// <reference lib="es2018" />
|
||||
/// <reference lib="esnext.asynciterable" />
|
||||
/// <reference lib="esnext.intl" />
|
||||
/// <reference lib="esnext.bigint" />
|
||||
|
||||
// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
|
||||
// tslint:disable-next-line:no-bad-reference
|
||||
/// <reference path="../ts3.5/base.d.ts" />
|
||||
|
||||
// TypeScript 3.7-specific augmentations:
|
||||
/// <reference path="assert.d.ts" />
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
// NOTE: These definitions support NodeJS and TypeScript 3.7.
|
||||
// This isn't strictly needed since 3.7 has the assert module, but this way we're consistent.
|
||||
// Typically type modificatons should be made in base.d.ts instead of here
|
||||
|
||||
/// <reference path="base.d.ts" />
|
||||
+6
-2
@@ -1,5 +1,9 @@
|
||||
declare module "tty" {
|
||||
import * as net from "net";
|
||||
declare module 'node:tty' {
|
||||
export * from 'tty';
|
||||
}
|
||||
|
||||
declare module 'tty' {
|
||||
import * as net from 'node:net';
|
||||
|
||||
function isatty(fd: number): boolean;
|
||||
class ReadStream extends net.Socket {
|
||||
|
||||
+13
-3
@@ -1,5 +1,9 @@
|
||||
declare module "url" {
|
||||
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
|
||||
declare module 'node:url' {
|
||||
export * from 'url';
|
||||
}
|
||||
|
||||
declare module 'url' {
|
||||
import { ParsedUrlQuery, ParsedUrlQueryInput } from 'node:querystring';
|
||||
|
||||
// Input to `url.format`
|
||||
interface UrlObject {
|
||||
@@ -40,13 +44,19 @@ declare module "url" {
|
||||
query: string | null;
|
||||
}
|
||||
|
||||
/** @deprecated since v11.0.0 - Use the WHATWG URL API. */
|
||||
function parse(urlStr: string): UrlWithStringQuery;
|
||||
/** @deprecated since v11.0.0 - Use the WHATWG URL API. */
|
||||
function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
|
||||
/** @deprecated since v11.0.0 - Use the WHATWG URL API. */
|
||||
function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
|
||||
/** @deprecated since v11.0.0 - Use the WHATWG URL API. */
|
||||
function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
|
||||
|
||||
function format(URL: URL, options?: URLFormatOptions): string;
|
||||
/** @deprecated since v11.0.0 - Use the WHATWG URL API. */
|
||||
function format(urlObject: UrlObject | string): string;
|
||||
/** @deprecated since v11.0.0 - Use the WHATWG URL API. */
|
||||
function resolve(from: string, to: string): string;
|
||||
|
||||
function domainToASCII(domain: string): string;
|
||||
@@ -92,7 +102,7 @@ declare module "url" {
|
||||
}
|
||||
|
||||
class URLSearchParams implements Iterable<[string, string]> {
|
||||
constructor(init?: URLSearchParams | string | NodeJS.Dict<string | string[]> | Iterable<[string, string]> | Array<[string, string]>);
|
||||
constructor(init?: URLSearchParams | string | NodeJS.Dict<string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
|
||||
append(name: string, value: string): void;
|
||||
delete(name: string): void;
|
||||
entries(): IterableIterator<[string, string]>;
|
||||
|
||||
+34
-17
@@ -1,12 +1,16 @@
|
||||
declare module "util" {
|
||||
declare module 'node:util' {
|
||||
export * from 'util';
|
||||
}
|
||||
|
||||
declare module 'util' {
|
||||
interface InspectOptions extends NodeJS.InspectOptions { }
|
||||
type Style = 'special' | 'number' | 'bigint' | 'boolean' | 'undefined' | 'null' | 'string' | 'symbol' | 'date' | 'regexp' | 'module';
|
||||
type CustomInspectFunction = (depth: number, options: InspectOptionsStylized) => string;
|
||||
interface InspectOptionsStylized extends InspectOptions {
|
||||
stylize(text: string, styleType: Style): string;
|
||||
}
|
||||
function format(format: any, ...param: any[]): string;
|
||||
function formatWithOptions(inspectOptions: InspectOptions, format: string, ...param: any[]): string;
|
||||
function format(format?: any, ...param: any[]): string;
|
||||
function formatWithOptions(inspectOptions: InspectOptions, format?: any, ...param: any[]): string;
|
||||
/** @deprecated since v0.11.3 - use a third party module instead. */
|
||||
function log(string: string): void;
|
||||
function inspect(object: any, showHidden?: boolean, depth?: number | null, color?: boolean): string;
|
||||
@@ -120,44 +124,57 @@ declare module "util" {
|
||||
}
|
||||
|
||||
namespace types {
|
||||
function isAnyArrayBuffer(object: any): boolean;
|
||||
function isAnyArrayBuffer(object: any): object is ArrayBufferLike;
|
||||
function isArgumentsObject(object: any): object is IArguments;
|
||||
function isArrayBuffer(object: any): object is ArrayBuffer;
|
||||
function isArrayBufferView(object: any): object is ArrayBufferView;
|
||||
function isArrayBufferView(object: any): object is NodeJS.ArrayBufferView;
|
||||
function isAsyncFunction(object: any): boolean;
|
||||
function isBigInt64Array(value: any): value is BigInt64Array;
|
||||
function isBigUint64Array(value: any): value is BigUint64Array;
|
||||
function isBooleanObject(object: any): object is Boolean;
|
||||
function isBoxedPrimitive(object: any): object is (Number | Boolean | String | Symbol /* | Object(BigInt) | Object(Symbol) */);
|
||||
function isBoxedPrimitive(object: any): object is String | Number | BigInt | Boolean | Symbol;
|
||||
function isDataView(object: any): object is DataView;
|
||||
function isDate(object: any): object is Date;
|
||||
function isExternal(object: any): boolean;
|
||||
function isFloat32Array(object: any): object is Float32Array;
|
||||
function isFloat64Array(object: any): object is Float64Array;
|
||||
function isGeneratorFunction(object: any): boolean;
|
||||
function isGeneratorObject(object: any): boolean;
|
||||
function isGeneratorFunction(object: any): object is GeneratorFunction;
|
||||
function isGeneratorObject(object: any): object is Generator;
|
||||
function isInt8Array(object: any): object is Int8Array;
|
||||
function isInt16Array(object: any): object is Int16Array;
|
||||
function isInt32Array(object: any): object is Int32Array;
|
||||
function isMap(object: any): boolean;
|
||||
function isMap<T>(
|
||||
object: T | {},
|
||||
): object is T extends ReadonlyMap<any, any>
|
||||
? unknown extends T
|
||||
? never
|
||||
: ReadonlyMap<any, any>
|
||||
: Map<any, any>;
|
||||
function isMapIterator(object: any): boolean;
|
||||
function isModuleNamespaceObject(value: any): boolean;
|
||||
function isNativeError(object: any): object is Error;
|
||||
function isNumberObject(object: any): object is Number;
|
||||
function isPromise(object: any): boolean;
|
||||
function isPromise(object: any): object is Promise<any>;
|
||||
function isProxy(object: any): boolean;
|
||||
function isRegExp(object: any): object is RegExp;
|
||||
function isSet(object: any): boolean;
|
||||
function isSet<T>(
|
||||
object: T | {},
|
||||
): object is T extends ReadonlySet<any>
|
||||
? unknown extends T
|
||||
? never
|
||||
: ReadonlySet<any>
|
||||
: Set<any>;
|
||||
function isSetIterator(object: any): boolean;
|
||||
function isSharedArrayBuffer(object: any): boolean;
|
||||
function isStringObject(object: any): boolean;
|
||||
function isSymbolObject(object: any): boolean;
|
||||
function isSharedArrayBuffer(object: any): object is SharedArrayBuffer;
|
||||
function isStringObject(object: any): object is String;
|
||||
function isSymbolObject(object: any): object is Symbol;
|
||||
function isTypedArray(object: any): object is NodeJS.TypedArray;
|
||||
function isUint8Array(object: any): object is Uint8Array;
|
||||
function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
|
||||
function isUint16Array(object: any): object is Uint16Array;
|
||||
function isUint32Array(object: any): object is Uint32Array;
|
||||
function isWeakMap(object: any): boolean;
|
||||
function isWeakSet(object: any): boolean;
|
||||
function isWebAssemblyCompiledModule(object: any): boolean;
|
||||
function isWeakMap(object: any): object is WeakMap<any, any>;
|
||||
function isWeakSet(object: any): object is WeakSet<any>;
|
||||
}
|
||||
|
||||
class TextDecoder {
|
||||
|
||||
+6
-2
@@ -1,5 +1,9 @@
|
||||
declare module "v8" {
|
||||
import { Readable } from "stream";
|
||||
declare module 'node:v8' {
|
||||
export * from 'v8';
|
||||
}
|
||||
|
||||
declare module 'v8' {
|
||||
import { Readable } from 'node:stream';
|
||||
|
||||
interface HeapSpaceInfo {
|
||||
space_name: string;
|
||||
|
||||
+8
-2
@@ -1,4 +1,8 @@
|
||||
declare module "vm" {
|
||||
declare module 'node:vm' {
|
||||
export * from 'vm';
|
||||
}
|
||||
|
||||
declare module 'vm' {
|
||||
interface Context extends NodeJS.Dict<any> { }
|
||||
interface BaseOptions {
|
||||
/**
|
||||
@@ -21,6 +25,7 @@ declare module "vm" {
|
||||
displayErrors?: boolean;
|
||||
timeout?: number;
|
||||
cachedData?: Buffer;
|
||||
/** @deprecated in favor of `script.createCachedData()` */
|
||||
produceCachedData?: boolean;
|
||||
}
|
||||
interface RunningScriptOptions extends BaseOptions {
|
||||
@@ -119,13 +124,14 @@ declare module "vm" {
|
||||
runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
|
||||
runInThisContext(options?: RunningScriptOptions): any;
|
||||
createCachedData(): Buffer;
|
||||
cachedDataRejected?: boolean;
|
||||
}
|
||||
function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
|
||||
function isContext(sandbox: Context): boolean;
|
||||
function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
|
||||
function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
|
||||
function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
|
||||
function compileFunction(code: string, params?: string[], options?: CompileFunctionOptions): Function;
|
||||
function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function;
|
||||
|
||||
/**
|
||||
* Measure the memory known to V8 and used by the current execution context or a specified context.
|
||||
|
||||
+39
-1
@@ -1,3 +1,7 @@
|
||||
declare module 'node:wasi' {
|
||||
export * from 'wasi';
|
||||
}
|
||||
|
||||
declare module 'wasi' {
|
||||
interface WASIOptions {
|
||||
/**
|
||||
@@ -6,11 +10,13 @@ declare module 'wasi' {
|
||||
* WASI command itself.
|
||||
*/
|
||||
args?: string[];
|
||||
|
||||
/**
|
||||
* An object similar to `process.env` that the WebAssembly
|
||||
* application will see as its environment.
|
||||
*/
|
||||
env?: object;
|
||||
|
||||
/**
|
||||
* This object represents the WebAssembly application's
|
||||
* sandbox directory structure. The string keys of `preopens` are treated as
|
||||
@@ -27,6 +33,24 @@ declare module 'wasi' {
|
||||
* @default false
|
||||
*/
|
||||
returnOnExit?: boolean;
|
||||
|
||||
/**
|
||||
* The file descriptor used as standard input in the WebAssembly application.
|
||||
* @default 0
|
||||
*/
|
||||
stdin?: number;
|
||||
|
||||
/**
|
||||
* The file descriptor used as standard output in the WebAssembly application.
|
||||
* @default 1
|
||||
*/
|
||||
stdout?: number;
|
||||
|
||||
/**
|
||||
* The file descriptor used as standard error in the WebAssembly application.
|
||||
* @default 2
|
||||
*/
|
||||
stderr?: number;
|
||||
}
|
||||
|
||||
class WASI {
|
||||
@@ -40,11 +64,25 @@ declare module 'wasi' {
|
||||
*
|
||||
* `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
|
||||
* `memory`. If `instance` does not have a `memory` export an exception is thrown.
|
||||
*
|
||||
* If `start()` is called more than once, an exception is thrown.
|
||||
*/
|
||||
start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
|
||||
|
||||
/**
|
||||
* Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present.
|
||||
* If `instance` contains a `_start()` export, then an exception is thrown.
|
||||
*
|
||||
* `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
|
||||
* `memory`. If `instance` does not have a `memory` export an exception is thrown.
|
||||
*
|
||||
* If `initialize()` is called more than once, an exception is thrown.
|
||||
*/
|
||||
initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
|
||||
|
||||
/**
|
||||
* Is an object that implements the WASI system call API. This object
|
||||
* should be passed as the `wasi_unstable` import during the instantiation of a
|
||||
* should be passed as the `wasi_snapshot_preview1` import during the instantiation of a
|
||||
* [`WebAssembly.Instance`][].
|
||||
*/
|
||||
readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
|
||||
+58
-8
@@ -1,11 +1,17 @@
|
||||
declare module "worker_threads" {
|
||||
import { Context } from "vm";
|
||||
import { EventEmitter } from "events";
|
||||
import { Readable, Writable } from "stream";
|
||||
import { URL } from "url";
|
||||
declare module 'node:worker_threads' {
|
||||
export * from 'worker_threads';
|
||||
}
|
||||
|
||||
declare module 'worker_threads' {
|
||||
import { Context } from 'node:vm';
|
||||
import EventEmitter = require('node:events');
|
||||
import { Readable, Writable } from 'node:stream';
|
||||
import { URL } from 'node:url';
|
||||
import { FileHandle } from 'node:fs/promises';
|
||||
|
||||
const isMainThread: boolean;
|
||||
const parentPort: null | MessagePort;
|
||||
const resourceLimits: ResourceLimits;
|
||||
const SHARE_ENV: unique symbol;
|
||||
const threadId: number;
|
||||
const workerData: any;
|
||||
@@ -15,43 +21,53 @@ declare module "worker_threads" {
|
||||
readonly port2: MessagePort;
|
||||
}
|
||||
|
||||
type TransferListItem = ArrayBuffer | MessagePort | FileHandle;
|
||||
|
||||
class MessagePort extends EventEmitter {
|
||||
close(): void;
|
||||
postMessage(value: any, transferList?: Array<ArrayBuffer | MessagePort>): void;
|
||||
postMessage(value: any, transferList?: ReadonlyArray<TransferListItem>): void;
|
||||
ref(): void;
|
||||
unref(): void;
|
||||
start(): void;
|
||||
|
||||
addListener(event: "close", listener: () => void): this;
|
||||
addListener(event: "message", listener: (value: any) => void): this;
|
||||
addListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
emit(event: "close"): boolean;
|
||||
emit(event: "message", value: any): boolean;
|
||||
emit(event: "messageerror", error: Error): boolean;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
|
||||
on(event: "close", listener: () => void): this;
|
||||
on(event: "message", listener: (value: any) => void): this;
|
||||
on(event: "messageerror", listener: (error: Error) => void): this;
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
once(event: "close", listener: () => void): this;
|
||||
once(event: "message", listener: (value: any) => void): this;
|
||||
once(event: "messageerror", listener: (error: Error) => void): this;
|
||||
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
prependListener(event: "close", listener: () => void): this;
|
||||
prependListener(event: "message", listener: (value: any) => void): this;
|
||||
prependListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
prependOnceListener(event: "close", listener: () => void): this;
|
||||
prependOnceListener(event: "message", listener: (value: any) => void): this;
|
||||
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
removeListener(event: "close", listener: () => void): this;
|
||||
removeListener(event: "message", listener: (value: any) => void): this;
|
||||
removeListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
off(event: "close", listener: () => void): this;
|
||||
off(event: "message", listener: (value: any) => void): this;
|
||||
off(event: "messageerror", listener: (error: Error) => void): this;
|
||||
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
}
|
||||
|
||||
@@ -74,14 +90,28 @@ declare module "worker_threads" {
|
||||
/**
|
||||
* Additional data to send in the first worker message.
|
||||
*/
|
||||
transferList?: Array<ArrayBuffer | MessagePort>;
|
||||
transferList?: TransferListItem[];
|
||||
trackUnmanagedFds?: boolean;
|
||||
}
|
||||
|
||||
interface ResourceLimits {
|
||||
/**
|
||||
* The maximum size of a heap space for recently created objects.
|
||||
*/
|
||||
maxYoungGenerationSizeMb?: number;
|
||||
/**
|
||||
* The maximum size of the main heap in MB.
|
||||
*/
|
||||
maxOldGenerationSizeMb?: number;
|
||||
/**
|
||||
* The size of a pre-allocated memory range used for generated code.
|
||||
*/
|
||||
codeRangeSizeMb?: number;
|
||||
/**
|
||||
* The default maximum stack size for the thread. Small values may lead to unusable Worker instances.
|
||||
* @default 4
|
||||
*/
|
||||
stackSizeMb?: number;
|
||||
}
|
||||
|
||||
class Worker extends EventEmitter {
|
||||
@@ -98,7 +128,7 @@ declare module "worker_threads" {
|
||||
*/
|
||||
constructor(filename: string | URL, options?: WorkerOptions);
|
||||
|
||||
postMessage(value: any, transferList?: Array<ArrayBuffer | MessagePort>): void;
|
||||
postMessage(value: any, transferList?: ReadonlyArray<TransferListItem>): void;
|
||||
ref(): void;
|
||||
unref(): void;
|
||||
/**
|
||||
@@ -120,52 +150,72 @@ declare module "worker_threads" {
|
||||
addListener(event: "error", listener: (err: Error) => void): this;
|
||||
addListener(event: "exit", listener: (exitCode: number) => void): this;
|
||||
addListener(event: "message", listener: (value: any) => void): this;
|
||||
addListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
addListener(event: "online", listener: () => void): this;
|
||||
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
emit(event: "error", err: Error): boolean;
|
||||
emit(event: "exit", exitCode: number): boolean;
|
||||
emit(event: "message", value: any): boolean;
|
||||
emit(event: "messageerror", error: Error): boolean;
|
||||
emit(event: "online"): boolean;
|
||||
emit(event: string | symbol, ...args: any[]): boolean;
|
||||
|
||||
on(event: "error", listener: (err: Error) => void): this;
|
||||
on(event: "exit", listener: (exitCode: number) => void): this;
|
||||
on(event: "message", listener: (value: any) => void): this;
|
||||
on(event: "messageerror", listener: (error: Error) => void): this;
|
||||
on(event: "online", listener: () => void): this;
|
||||
on(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
once(event: "error", listener: (err: Error) => void): this;
|
||||
once(event: "exit", listener: (exitCode: number) => void): this;
|
||||
once(event: "message", listener: (value: any) => void): this;
|
||||
once(event: "messageerror", listener: (error: Error) => void): this;
|
||||
once(event: "online", listener: () => void): this;
|
||||
once(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
prependListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependListener(event: "exit", listener: (exitCode: number) => void): this;
|
||||
prependListener(event: "message", listener: (value: any) => void): this;
|
||||
prependListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
prependListener(event: "online", listener: () => void): this;
|
||||
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
prependOnceListener(event: "error", listener: (err: Error) => void): this;
|
||||
prependOnceListener(event: "exit", listener: (exitCode: number) => void): this;
|
||||
prependOnceListener(event: "message", listener: (value: any) => void): this;
|
||||
prependOnceListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
prependOnceListener(event: "online", listener: () => void): this;
|
||||
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
removeListener(event: "error", listener: (err: Error) => void): this;
|
||||
removeListener(event: "exit", listener: (exitCode: number) => void): this;
|
||||
removeListener(event: "message", listener: (value: any) => void): this;
|
||||
removeListener(event: "messageerror", listener: (error: Error) => void): this;
|
||||
removeListener(event: "online", listener: () => void): this;
|
||||
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
|
||||
off(event: "error", listener: (err: Error) => void): this;
|
||||
off(event: "exit", listener: (exitCode: number) => void): this;
|
||||
off(event: "message", listener: (value: any) => void): this;
|
||||
off(event: "messageerror", listener: (error: Error) => void): this;
|
||||
off(event: "online", listener: () => void): this;
|
||||
off(event: string | symbol, listener: (...args: any[]) => void): this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mark an object as not transferable.
|
||||
* If `object` occurs in the transfer list of a `port.postMessage()` call, it will be ignored.
|
||||
*
|
||||
* In particular, this makes sense for objects that can be cloned, rather than transferred,
|
||||
* and which are used by other objects on the sending side. For example, Node.js marks
|
||||
* the `ArrayBuffer`s it uses for its Buffer pool with this.
|
||||
*
|
||||
* This operation cannot be undone.
|
||||
*/
|
||||
function markAsUntransferable(object: object): void;
|
||||
|
||||
/**
|
||||
* Transfer a `MessagePort` to a different `vm` Context. The original `port`
|
||||
* object will be rendered unusable, and the returned `MessagePort` instance will
|
||||
|
||||
+140
-127
@@ -1,5 +1,9 @@
|
||||
declare module "zlib" {
|
||||
import * as stream from "stream";
|
||||
declare module 'node:zlib' {
|
||||
export * from 'zlib';
|
||||
}
|
||||
|
||||
declare module 'zlib' {
|
||||
import * as stream from 'node:stream';
|
||||
|
||||
interface ZlibOptions {
|
||||
/**
|
||||
@@ -19,6 +23,8 @@ declare module "zlib" {
|
||||
memLevel?: number; // compression only
|
||||
strategy?: number; // compression only
|
||||
dictionary?: NodeJS.ArrayBufferView | ArrayBuffer; // deflate/inflate only, empty dictionary by default
|
||||
info?: boolean;
|
||||
maxOutputLength?: number;
|
||||
}
|
||||
|
||||
interface BrotliOptions {
|
||||
@@ -40,6 +46,7 @@ declare module "zlib" {
|
||||
*/
|
||||
[key: number]: boolean | number;
|
||||
};
|
||||
maxOutputLength?: number;
|
||||
}
|
||||
|
||||
interface Zlib {
|
||||
@@ -48,7 +55,8 @@ declare module "zlib" {
|
||||
readonly bytesWritten: number;
|
||||
shell?: boolean | string;
|
||||
close(callback?: () => void): void;
|
||||
flush(kind?: number | (() => void), callback?: () => void): void;
|
||||
flush(kind?: number, callback?: () => void): void;
|
||||
flush(callback?: () => void): void;
|
||||
}
|
||||
|
||||
interface ZlibParams {
|
||||
@@ -85,30 +93,74 @@ declare module "zlib" {
|
||||
|
||||
function brotliCompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
|
||||
function brotliCompress(buf: InputType, callback: CompressCallback): void;
|
||||
namespace brotliCompress {
|
||||
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
|
||||
}
|
||||
|
||||
function brotliCompressSync(buf: InputType, options?: BrotliOptions): Buffer;
|
||||
|
||||
function brotliDecompress(buf: InputType, options: BrotliOptions, callback: CompressCallback): void;
|
||||
function brotliDecompress(buf: InputType, callback: CompressCallback): void;
|
||||
namespace brotliDecompress {
|
||||
function __promisify__(buffer: InputType, options?: BrotliOptions): Promise<Buffer>;
|
||||
}
|
||||
|
||||
function brotliDecompressSync(buf: InputType, options?: BrotliOptions): Buffer;
|
||||
|
||||
function deflate(buf: InputType, callback: CompressCallback): void;
|
||||
function deflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace deflate {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
}
|
||||
|
||||
function deflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
|
||||
function deflateRaw(buf: InputType, callback: CompressCallback): void;
|
||||
function deflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace deflateRaw {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
}
|
||||
|
||||
function deflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
|
||||
function gzip(buf: InputType, callback: CompressCallback): void;
|
||||
function gzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace gzip {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
}
|
||||
|
||||
function gzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
|
||||
function gunzip(buf: InputType, callback: CompressCallback): void;
|
||||
function gunzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace gunzip {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
}
|
||||
|
||||
function gunzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
|
||||
function inflate(buf: InputType, callback: CompressCallback): void;
|
||||
function inflate(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace inflate {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
}
|
||||
|
||||
function inflateSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
|
||||
function inflateRaw(buf: InputType, callback: CompressCallback): void;
|
||||
function inflateRaw(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace inflateRaw {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
}
|
||||
|
||||
function inflateRawSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
|
||||
function unzip(buf: InputType, callback: CompressCallback): void;
|
||||
function unzip(buf: InputType, options: ZlibOptions, callback: CompressCallback): void;
|
||||
namespace unzip {
|
||||
function __promisify__(buffer: InputType, options?: ZlibOptions): Promise<Buffer>;
|
||||
}
|
||||
|
||||
function unzipSync(buf: InputType, options?: ZlibOptions): Buffer;
|
||||
|
||||
namespace constants {
|
||||
@@ -188,165 +240,126 @@ declare module "zlib" {
|
||||
const INFLATERAW: number;
|
||||
const UNZIP: number;
|
||||
|
||||
const Z_BEST_COMPRESSION: number;
|
||||
const Z_BEST_SPEED: number;
|
||||
const Z_BLOCK: number;
|
||||
const Z_BUF_ERROR: number;
|
||||
const Z_DATA_ERROR: number;
|
||||
|
||||
const Z_DEFAULT_CHUNK: number;
|
||||
const Z_DEFAULT_COMPRESSION: number;
|
||||
const Z_DEFAULT_LEVEL: number;
|
||||
const Z_DEFAULT_MEMLEVEL: number;
|
||||
const Z_DEFAULT_STRATEGY: number;
|
||||
const Z_DEFAULT_WINDOWBITS: number;
|
||||
|
||||
const Z_ERRNO: number;
|
||||
const Z_FILTERED: number;
|
||||
const Z_FINISH: number;
|
||||
const Z_FIXED: number;
|
||||
const Z_FULL_FLUSH: number;
|
||||
const Z_HUFFMAN_ONLY: number;
|
||||
const Z_MAX_CHUNK: number;
|
||||
const Z_MAX_LEVEL: number;
|
||||
const Z_MAX_MEMLEVEL: number;
|
||||
const Z_MAX_WINDOWBITS: number;
|
||||
const Z_MEM_ERROR: number;
|
||||
const Z_MIN_CHUNK: number;
|
||||
const Z_MIN_LEVEL: number;
|
||||
const Z_MIN_MEMLEVEL: number;
|
||||
const Z_MIN_WINDOWBITS: number;
|
||||
const Z_NEED_DICT: number;
|
||||
const Z_NO_COMPRESSION: number;
|
||||
// Allowed flush values.
|
||||
const Z_NO_FLUSH: number;
|
||||
const Z_OK: number;
|
||||
const Z_PARTIAL_FLUSH: number;
|
||||
const Z_RLE: number;
|
||||
const Z_STREAM_END: number;
|
||||
const Z_STREAM_ERROR: number;
|
||||
const Z_SYNC_FLUSH: number;
|
||||
const Z_FULL_FLUSH: number;
|
||||
const Z_FINISH: number;
|
||||
const Z_BLOCK: number;
|
||||
const Z_TREES: number;
|
||||
|
||||
// Return codes for the compression/decompression functions.
|
||||
// Negative values are errors, positive values are used for special but normal events.
|
||||
const Z_OK: number;
|
||||
const Z_STREAM_END: number;
|
||||
const Z_NEED_DICT: number;
|
||||
const Z_ERRNO: number;
|
||||
const Z_STREAM_ERROR: number;
|
||||
const Z_DATA_ERROR: number;
|
||||
const Z_MEM_ERROR: number;
|
||||
const Z_BUF_ERROR: number;
|
||||
const Z_VERSION_ERROR: number;
|
||||
|
||||
// Compression levels.
|
||||
const Z_NO_COMPRESSION: number;
|
||||
const Z_BEST_SPEED: number;
|
||||
const Z_BEST_COMPRESSION: number;
|
||||
const Z_DEFAULT_COMPRESSION: number;
|
||||
|
||||
// Compression strategy.
|
||||
const Z_FILTERED: number;
|
||||
const Z_HUFFMAN_ONLY: number;
|
||||
const Z_RLE: number;
|
||||
const Z_FIXED: number;
|
||||
const Z_DEFAULT_STRATEGY: number;
|
||||
|
||||
const Z_DEFAULT_WINDOWBITS: number;
|
||||
const Z_MIN_WINDOWBITS: number;
|
||||
const Z_MAX_WINDOWBITS: number;
|
||||
|
||||
const Z_MIN_CHUNK: number;
|
||||
const Z_MAX_CHUNK: number;
|
||||
const Z_DEFAULT_CHUNK: number;
|
||||
|
||||
const Z_MIN_MEMLEVEL: number;
|
||||
const Z_MAX_MEMLEVEL: number;
|
||||
const Z_DEFAULT_MEMLEVEL: number;
|
||||
|
||||
const Z_MIN_LEVEL: number;
|
||||
const Z_MAX_LEVEL: number;
|
||||
const Z_DEFAULT_LEVEL: number;
|
||||
|
||||
const ZLIB_VERNUM: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
// Allowed flush values.
|
||||
/** @deprecated Use `constants.Z_NO_FLUSH` */
|
||||
const Z_NO_FLUSH: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_PARTIAL_FLUSH` */
|
||||
const Z_PARTIAL_FLUSH: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_SYNC_FLUSH` */
|
||||
const Z_SYNC_FLUSH: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_FULL_FLUSH` */
|
||||
const Z_FULL_FLUSH: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_FINISH` */
|
||||
const Z_FINISH: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_BLOCK` */
|
||||
const Z_BLOCK: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_TREES` */
|
||||
const Z_TREES: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
// Return codes for the compression/decompression functions.
|
||||
// Negative values are errors, positive values are used for special but normal events.
|
||||
/** @deprecated Use `constants.Z_OK` */
|
||||
const Z_OK: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_STREAM_END` */
|
||||
const Z_STREAM_END: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_NEED_DICT` */
|
||||
const Z_NEED_DICT: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_ERRNO` */
|
||||
const Z_ERRNO: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_STREAM_ERROR` */
|
||||
const Z_STREAM_ERROR: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_DATA_ERROR` */
|
||||
const Z_DATA_ERROR: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_MEM_ERROR` */
|
||||
const Z_MEM_ERROR: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_BUF_ERROR` */
|
||||
const Z_BUF_ERROR: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_VERSION_ERROR` */
|
||||
const Z_VERSION_ERROR: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
// Compression levels.
|
||||
/** @deprecated Use `constants.Z_NO_COMPRESSION` */
|
||||
const Z_NO_COMPRESSION: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_BEST_SPEED` */
|
||||
const Z_BEST_SPEED: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_BEST_COMPRESSION` */
|
||||
const Z_BEST_COMPRESSION: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_DEFAULT_COMPRESSION` */
|
||||
const Z_DEFAULT_COMPRESSION: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
// Compression strategy.
|
||||
/** @deprecated Use `constants.Z_FILTERED` */
|
||||
const Z_FILTERED: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_HUFFMAN_ONLY` */
|
||||
const Z_HUFFMAN_ONLY: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_RLE` */
|
||||
const Z_RLE: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_FIXED` */
|
||||
const Z_FIXED: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated Use `constants.Z_DEFAULT_STRATEGY` */
|
||||
const Z_DEFAULT_STRATEGY: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
|
||||
/** @deprecated */
|
||||
const Z_BINARY: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated */
|
||||
const Z_TEXT: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated */
|
||||
const Z_ASCII: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated */
|
||||
const Z_UNKNOWN: number;
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
/** @deprecated */
|
||||
const Z_DEFLATED: number;
|
||||
}
|
||||
|
||||
+21
-21
@@ -1,21 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
MIT License
|
||||
|
||||
Copyright (c) Microsoft Corporation.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE
|
||||
|
||||
+2
-2
@@ -8,9 +8,9 @@ This package contains type definitions for yargs-parser (https://github.com/yarg
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs-parser.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Mon, 13 Jan 2020 21:01:19 GMT
|
||||
* Last updated: Wed, 23 Dec 2020 19:06:45 GMT
|
||||
* Dependencies: none
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by Miles Johnson (https://github.com/milesj).
|
||||
These definitions were written by [Miles Johnson](https://github.com/milesj).
|
||||
|
||||
+7
-1
@@ -1,4 +1,4 @@
|
||||
// Type definitions for yargs-parser 15.0
|
||||
// Type definitions for yargs-parser 20.2
|
||||
// Project: https://github.com/yargs/yargs-parser#readme
|
||||
// Definitions by: Miles Johnson <https://github.com/milesj>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -40,12 +40,18 @@ declare namespace yargsParser {
|
||||
'duplicate-arguments-array': boolean;
|
||||
/** Should array arguments be coerced into a single array when duplicated. Default is `true` */
|
||||
'flatten-duplicate-arrays': boolean;
|
||||
/** Should arrays consume more than one positional argument following their flag. Default is `true` */
|
||||
'greedy-arrays': boolean;
|
||||
/** Should nargs consume dash options as well as positional arguments. Default is `false` */
|
||||
'nargs-eats-options': boolean;
|
||||
/** Should parsing stop at the first text argument? This is similar to how e.g. ssh parses its command line. Default is `false` */
|
||||
'halt-at-non-option': boolean;
|
||||
/** The prefix to use for negated boolean variables. Default is `'no-'` */
|
||||
'negation-prefix': string;
|
||||
/** Should keys that look like numbers be treated as such? Default is `true` */
|
||||
'parse-numbers': boolean;
|
||||
/** Should positional keys that look like numbers be treated as such? Default is `true` */
|
||||
'parse-positional-numbers': boolean;
|
||||
/** Should unparsed flags be stored in -- or _. Default is `false` */
|
||||
'populate--': boolean;
|
||||
/** Should a placeholder be added for keys not set via the corresponding CLI argument? Default is `false` */
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@types/yargs-parser",
|
||||
"version": "15.0.0",
|
||||
"version": "20.2.0",
|
||||
"description": "TypeScript definitions for yargs-parser",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
@@ -19,6 +19,6 @@
|
||||
},
|
||||
"scripts": {},
|
||||
"dependencies": {},
|
||||
"typesPublisherContentHash": "dfb678a3324e6b48900f50da7ca18c044ba7c18cf0bfecb96c1c1a6998d736d6",
|
||||
"typeScriptVersion": "2.8"
|
||||
"typesPublisherContentHash": "8910a9d6eab5721fa5cb05ff2f01d5042c4ecba6967efd4739f53c5f0e6b3c33",
|
||||
"typeScriptVersion": "3.3"
|
||||
}
|
||||
+3
-3
@@ -5,12 +5,12 @@
|
||||
This package contains type definitions for yargs (https://github.com/chevex/yargs).
|
||||
|
||||
# Details
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs.
|
||||
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/yargs/v15.
|
||||
|
||||
### Additional Details
|
||||
* Last updated: Wed, 13 May 2020 21:48:11 GMT
|
||||
* Last updated: Fri, 29 Jan 2021 01:21:39 GMT
|
||||
* Dependencies: [@types/yargs-parser](https://npmjs.com/package/@types/yargs-parser)
|
||||
* Global values: none
|
||||
|
||||
# Credits
|
||||
These definitions were written by [Martin Poelstra](https://github.com/poelstra), [Mizunashi Mana](https://github.com/mizunashi-mana), [Jeffery Grajkowski](https://github.com/pushplay), [Jeff Kenney](https://github.com/jeffkenney), [Jimi (Dimitris) Charalampidis](https://github.com/JimiC), [Steffen Viken Valvåg](https://github.com/steffenvv), [Emily Marigold Klassen](https://github.com/forivall), [ExE Boss](https://github.com/ExE-Boss), and [Aankhen](https://github.com/Aankhen).
|
||||
These definitions were written by [Martin Poelstra](https://github.com/poelstra), [Mizunashi Mana](https://github.com/mizunashi-mana), [Jeffery Grajkowski](https://github.com/pushplay), [Jimi (Dimitris) Charalampidis](https://github.com/JimiC), [Steffen Viken Valvåg](https://github.com/steffenvv), [Emily Marigold Klassen](https://github.com/forivall), [ExE Boss](https://github.com/ExE-Boss), and [Aankhen](https://github.com/Aankhen).
|
||||
|
||||
+52
-6
@@ -3,7 +3,6 @@
|
||||
// Definitions by: Martin Poelstra <https://github.com/poelstra>
|
||||
// Mizunashi Mana <https://github.com/mizunashi-mana>
|
||||
// Jeffery Grajkowski <https://github.com/pushplay>
|
||||
// Jeff Kenney <https://github.com/jeffkenney>
|
||||
// Jimi (Dimitris) Charalampidis <https://github.com/JimiC>
|
||||
// Steffen Viken Valvåg <https://github.com/steffenvv>
|
||||
// Emily Marigold Klassen <https://github.com/forivall>
|
||||
@@ -145,11 +144,37 @@ declare namespace yargs {
|
||||
* Note that when `void` is returned, the handler `argv` object type will not include command-specific arguments.
|
||||
* @param [handler] Function, which will be executed with the parsed `argv` object.
|
||||
*/
|
||||
command<U = T>(command: string | ReadonlyArray<string>, description: string, builder?: BuilderCallback<T, U>, handler?: (args: Arguments<U>) => void): Argv<U>;
|
||||
command<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, description: string, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
command<U = T>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
description: string,
|
||||
builder?: BuilderCallback<T, U>,
|
||||
handler?: (args: Arguments<U>) => void,
|
||||
middlewares?: MiddlewareFunction[],
|
||||
deprecated?: boolean | string,
|
||||
): Argv<U>;
|
||||
command<O extends { [key: string]: Options }>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
description: string,
|
||||
builder?: O,
|
||||
handler?: (args: Arguments<InferredOptionTypes<O>>) => void,
|
||||
middlewares?: MiddlewareFunction[],
|
||||
deprecated?: boolean | string,
|
||||
): Argv<T>;
|
||||
command<U>(command: string | ReadonlyArray<string>, description: string, module: CommandModule<T, U>): Argv<U>;
|
||||
command<U = T>(command: string | ReadonlyArray<string>, showInHelp: false, builder?: BuilderCallback<T, U>, handler?: (args: Arguments<U>) => void): Argv<T>;
|
||||
command<O extends { [key: string]: Options }>(command: string | ReadonlyArray<string>, showInHelp: false, builder?: O, handler?: (args: Arguments<InferredOptionTypes<O>>) => void): Argv<T>;
|
||||
command<U = T>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
showInHelp: false,
|
||||
builder?: BuilderCallback<T, U>,
|
||||
handler?: (args: Arguments<U>) => void,
|
||||
middlewares?: MiddlewareFunction[],
|
||||
deprecated?: boolean | string,
|
||||
): Argv<T>;
|
||||
command<O extends { [key: string]: Options }>(
|
||||
command: string | ReadonlyArray<string>,
|
||||
showInHelp: false,
|
||||
builder?: O,
|
||||
handler?: (args: Arguments<InferredOptionTypes<O>>) => void,
|
||||
): Argv<T>;
|
||||
command<U>(command: string | ReadonlyArray<string>, showInHelp: false, module: CommandModule<T, U>): Argv<U>;
|
||||
command<U>(module: CommandModule<T, U>): Argv<U>;
|
||||
|
||||
@@ -246,6 +271,11 @@ declare namespace yargs {
|
||||
demandCommand(min: number, minMsg?: string): Argv<T>;
|
||||
demandCommand(min: number, max?: number, minMsg?: string, maxMsg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Shows a [deprecated] notice in front of the option
|
||||
*/
|
||||
deprecateOption(option: string, msg?: string): Argv<T>;
|
||||
|
||||
/**
|
||||
* Describe a `key` for the generated usage information.
|
||||
*
|
||||
@@ -287,6 +317,7 @@ declare namespace yargs {
|
||||
* Examples will be printed out as part of the help message.
|
||||
*/
|
||||
example(command: string, description: string): Argv<T>;
|
||||
example(command: ReadonlyArray<[string, string?]>): Argv<T>;
|
||||
|
||||
/** Manually indicate that the program should exit, and provide context about why we wanted to exit. Follows the behavior set by `.exitProcess().` */
|
||||
exit(code: number, err: Error): void;
|
||||
@@ -532,6 +563,14 @@ declare namespace yargs {
|
||||
strict(): Argv<T>;
|
||||
strict(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Similar to .strict(), except that it only applies to unrecognized commands.
|
||||
* A user can still provide arbitrary options, but unknown positional commands
|
||||
* will raise an error.
|
||||
*/
|
||||
strictCommands(): Argv<T>;
|
||||
strictCommands(enabled: boolean): Argv<T>;
|
||||
|
||||
/**
|
||||
* Tell the parser logic not to interpret `key` as a number or boolean. This can be useful if you need to preserve leading zeros in an input.
|
||||
*
|
||||
@@ -593,7 +632,7 @@ declare namespace yargs {
|
||||
|
||||
type Arguments<T = {}> = T & {
|
||||
/** Non-option arguments */
|
||||
_: string[];
|
||||
_: Array<string | number>;
|
||||
/** The script name or node command */
|
||||
$0: string;
|
||||
/** All remaining options */
|
||||
@@ -645,6 +684,10 @@ declare namespace yargs {
|
||||
* Use 'demandOption' instead
|
||||
*/
|
||||
demand?: boolean | string;
|
||||
/** boolean or string, mark the argument as deprecated, see `deprecateOption()` */
|
||||
deprecate?: boolean | string;
|
||||
/** boolean or string, mark the argument as deprecated, see `deprecateOption()` */
|
||||
deprecated?: boolean | string;
|
||||
/** boolean or string, demand the option be given, with optional error message, see `demandOption()` */
|
||||
demandOption?: boolean | string;
|
||||
/** string, the option description for help content, see `describe()` */
|
||||
@@ -730,6 +773,7 @@ declare namespace yargs {
|
||||
type ToNumber<T> = (Exclude<T, undefined> extends any[] ? number[] : number) | Extract<T, undefined>;
|
||||
|
||||
type InferredOptionType<O extends Options | PositionalOptions> =
|
||||
O extends { default: any, coerce: (arg: any) => infer T } ? T :
|
||||
O extends { default: infer D } ? D :
|
||||
O extends { type: "count" } ? number :
|
||||
O extends { count: true } ? number :
|
||||
@@ -770,6 +814,8 @@ declare namespace yargs {
|
||||
builder?: CommandBuilder<T, U>;
|
||||
/** string (or array of strings) that executes this command when given on the command line, first string may contain positional args */
|
||||
command?: ReadonlyArray<string> | string;
|
||||
/** boolean (or string) to show deprecation notice */
|
||||
deprecated?: boolean | string;
|
||||
/** string used as the description for the command in help text, use `false` for a hidden command */
|
||||
describe?: string | false;
|
||||
/** a function which will be passed the parsed argv. */
|
||||
|
||||
+3
-8
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@types/yargs",
|
||||
"version": "15.0.5",
|
||||
"version": "15.0.13",
|
||||
"description": "TypeScript definitions for yargs",
|
||||
"license": "MIT",
|
||||
"contributors": [
|
||||
@@ -19,11 +19,6 @@
|
||||
"url": "https://github.com/pushplay",
|
||||
"githubUsername": "pushplay"
|
||||
},
|
||||
{
|
||||
"name": "Jeff Kenney",
|
||||
"url": "https://github.com/jeffkenney",
|
||||
"githubUsername": "jeffkenney"
|
||||
},
|
||||
{
|
||||
"name": "Jimi (Dimitris) Charalampidis",
|
||||
"url": "https://github.com/JimiC",
|
||||
@@ -61,6 +56,6 @@
|
||||
"dependencies": {
|
||||
"@types/yargs-parser": "*"
|
||||
},
|
||||
"typesPublisherContentHash": "2bb8b330a882b24ea5ce38de8f9057b7e686daeead308722b6c2e7b262fe34fb",
|
||||
"typeScriptVersion": "3.0"
|
||||
"typesPublisherContentHash": "9dc5dfe6f64e907144ccb7cbdc31a59a4f0d5408c4fe0c0b1975f64ac7d3b312",
|
||||
"typeScriptVersion": "3.4"
|
||||
}
|
||||
Reference in New Issue
Block a user