박민정

[feat] monggoDB connected

Showing 718 changed files with 4856 additions and 5 deletions
...@@ -4,10 +4,16 @@ const express = require('express') ...@@ -4,10 +4,16 @@ const express = require('express')
4 const app = express() 4 const app = express()
5 const port = 5000 5 const port = 5000
6 6
7 -app.get('/', (req, res) => { 7 +const mongoose = require('mongoose')
8 - res.send('Hello World!') 8 +mongoose.connect('mongodb+srv://mindyeoi:20241004qw@boilerplate.djq4a.mongodb.net/myFirstDatabase?retryWrites=true&w=majority',
9 -}) 9 +{
10 + useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, useFindAndModify: false
11 +}).then(() => console.log('MongoDB connected...'))
12 +.catch(err => console.log(err))
10 13
11 -app.listen(port, () => { 14 +app.get('/', (req, res) => res.send('Hello World!'))
15 +
16 +app.listen(port, () =>
12 console.log(`Example app listening at http://localhost:${port}`) 17 console.log(`Example app listening at http://localhost:${port}`)
13 -})
...\ No newline at end of file ...\ No newline at end of file
18 +)
19 +
......
1 + MIT License
2 +
3 + Copyright (c) Microsoft Corporation.
4 +
5 + Permission is hereby granted, free of charge, to any person obtaining a copy
6 + of this software and associated documentation files (the "Software"), to deal
7 + in the Software without restriction, including without limitation the rights
8 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 + copies of the Software, and to permit persons to whom the Software is
10 + furnished to do so, subject to the following conditions:
11 +
12 + The above copyright notice and this permission notice shall be included in all
13 + copies or substantial portions of the Software.
14 +
15 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 + SOFTWARE
1 +# Installation
2 +> `npm install --save @types/bson`
3 +
4 +# Summary
5 +This package contains type definitions for bson (https://github.com/mongodb/js-bson).
6 +
7 +# Details
8 +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/bson.
9 +
10 +### Additional Details
11 + * Last updated: Tue, 20 Oct 2020 02:03:19 GMT
12 + * Dependencies: [@types/node](https://npmjs.com/package/@types/node)
13 + * Global values: none
14 +
15 +# Credits
16 +These definitions were written by [Hiroki Horiuchi](https://github.com/horiuchi), [Federico Caselli](https://github.com/CaselIT), [Justin Grant](https://github.com/justingrant), and [Mikael Lirbank](https://github.com/lirbank).
This diff is collapsed. Click to expand it.
1 +{
2 + "_from": "@types/bson@*",
3 + "_id": "@types/bson@4.0.3",
4 + "_inBundle": false,
5 + "_integrity": "sha512-mVRvYnTOZJz3ccpxhr3wgxVmSeiYinW+zlzQz3SXWaJmD1DuL05Jeq7nKw3SnbKmbleW5qrLG5vdyWe/A9sXhw==",
6 + "_location": "/@types/bson",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "@types/bson@*",
12 + "name": "@types/bson",
13 + "escapedName": "@types%2fbson",
14 + "scope": "@types",
15 + "rawSpec": "*",
16 + "saveSpec": null,
17 + "fetchSpec": "*"
18 + },
19 + "_requiredBy": [
20 + "/@types/mongodb"
21 + ],
22 + "_resolved": "https://registry.npmjs.org/@types/bson/-/bson-4.0.3.tgz",
23 + "_shasum": "30889d2ffde6262abbe38659364c631454999fbf",
24 + "_spec": "@types/bson@*",
25 + "_where": "/Users/mindyeoi/Desktop/We-Shop/boiler-plate/node_modules/@types/mongodb",
26 + "bugs": {
27 + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
28 + },
29 + "bundleDependencies": false,
30 + "contributors": [
31 + {
32 + "name": "Hiroki Horiuchi",
33 + "url": "https://github.com/horiuchi"
34 + },
35 + {
36 + "name": "Federico Caselli",
37 + "url": "https://github.com/CaselIT"
38 + },
39 + {
40 + "name": "Justin Grant",
41 + "url": "https://github.com/justingrant"
42 + },
43 + {
44 + "name": "Mikael Lirbank",
45 + "url": "https://github.com/lirbank"
46 + }
47 + ],
48 + "dependencies": {
49 + "@types/node": "*"
50 + },
51 + "deprecated": false,
52 + "description": "TypeScript definitions for bson",
53 + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
54 + "license": "MIT",
55 + "main": "",
56 + "name": "@types/bson",
57 + "repository": {
58 + "type": "git",
59 + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
60 + "directory": "types/bson"
61 + },
62 + "scripts": {},
63 + "typeScriptVersion": "3.2",
64 + "types": "index.d.ts",
65 + "typesPublisherContentHash": "de339c6ae3194d7c34d771d4580048f1007707bafc646731b539c3a79638ebe9",
66 + "version": "4.0.3"
67 +}
1 + MIT License
2 +
3 + Copyright (c) Microsoft Corporation.
4 +
5 + Permission is hereby granted, free of charge, to any person obtaining a copy
6 + of this software and associated documentation files (the "Software"), to deal
7 + in the Software without restriction, including without limitation the rights
8 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 + copies of the Software, and to permit persons to whom the Software is
10 + furnished to do so, subject to the following conditions:
11 +
12 + The above copyright notice and this permission notice shall be included in all
13 + copies or substantial portions of the Software.
14 +
15 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 + SOFTWARE
1 +# Installation
2 +> `npm install --save @types/mongodb`
3 +
4 +# Summary
5 +This package contains type definitions for MongoDB (https://github.com/mongodb/node-mongodb-native).
6 +
7 +# Details
8 +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mongodb.
9 +
10 +### Additional Details
11 + * Last updated: Fri, 21 May 2021 16:31:21 GMT
12 + * Dependencies: [@types/bson](https://npmjs.com/package/@types/bson), [@types/node](https://npmjs.com/package/@types/node)
13 + * Global values: none
14 +
15 +# Credits
16 +These definitions were written by [Federico Caselli](https://github.com/CaselIT), [Alan Marcell](https://github.com/alanmarcell), [Gaurav Lahoti](https://github.com/dante-101), [Mariano Cortesi](https://github.com/mcortesi), [Enrico Picci](https://github.com/EnricoPicci), [Alexander Christie](https://github.com/AJCStriker), [Julien Chaumond](https://github.com/julien-c), [Dan Aprahamian](https://github.com/daprahamian), [Denys Bushulyak](https://github.com/denys-bushulyak), [Bastien Arata](https://github.com/b4nst), [Wan Bachtiar](https://github.com/sindbach), [Geraldine Lemeur](https://github.com/geraldinelemeur), [Dominik Heigl](https://github.com/various89), [Angela-1](https://github.com/angela-1), [Hector Ribes](https://github.com/hector7), [Florian Richter](https://github.com/floric), [Erik Christensen](https://github.com/erikc5000), [Nick Zahn](https://github.com/Manc), [Jarom Loveridge](https://github.com/jloveridge), [Luis Pais](https://github.com/ranguna), [Hossein Saniei](https://github.com/HosseinAgha), [Alberto Silva](https://github.com/albertossilva), [Piotr Błażejewicz](https://github.com/peterblazejewicz), [Linus Unnebäck](https://github.com/LinusU), [Richard Bateman](https://github.com/taxilian), [Igor Strebezhev](https://github.com/xamgore), [Valentin Agachi](https://github.com/avaly), [HitkoDev](https://github.com/HitkoDev), [TJT](https://github.com/Celend), [Julien TASSIN](https://github.com/jtassin), [Anna Henningsen](https://github.com/addaleax), [Emmanuel Gautier](https://github.com/emmanuelgautier), and [Wyatt Johnson](https://github.com/wyattjoh).
This diff could not be displayed because it is too large.
1 +{
2 + "_from": "@types/mongodb@^3.5.27",
3 + "_id": "@types/mongodb@3.6.16",
4 + "_inBundle": false,
5 + "_integrity": "sha512-D3tM0iRUet3TiIMAdvovxAIRG9gYqFd4j7visGwmPNdQj8Fq/uFFfRxyGCgEwVXAs0NnJPMI/QGVTADxDwhmSQ==",
6 + "_location": "/@types/mongodb",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "@types/mongodb@^3.5.27",
12 + "name": "@types/mongodb",
13 + "escapedName": "@types%2fmongodb",
14 + "scope": "@types",
15 + "rawSpec": "^3.5.27",
16 + "saveSpec": null,
17 + "fetchSpec": "^3.5.27"
18 + },
19 + "_requiredBy": [
20 + "/mongoose"
21 + ],
22 + "_resolved": "https://registry.npmjs.org/@types/mongodb/-/mongodb-3.6.16.tgz",
23 + "_shasum": "7a48aaeb777f57e4655515ce18acbc68600dfeb9",
24 + "_spec": "@types/mongodb@^3.5.27",
25 + "_where": "/Users/mindyeoi/Desktop/We-Shop/boiler-plate/node_modules/mongoose",
26 + "bugs": {
27 + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
28 + },
29 + "bundleDependencies": false,
30 + "contributors": [
31 + {
32 + "name": "Federico Caselli",
33 + "url": "https://github.com/CaselIT"
34 + },
35 + {
36 + "name": "Alan Marcell",
37 + "url": "https://github.com/alanmarcell"
38 + },
39 + {
40 + "name": "Gaurav Lahoti",
41 + "url": "https://github.com/dante-101"
42 + },
43 + {
44 + "name": "Mariano Cortesi",
45 + "url": "https://github.com/mcortesi"
46 + },
47 + {
48 + "name": "Enrico Picci",
49 + "url": "https://github.com/EnricoPicci"
50 + },
51 + {
52 + "name": "Alexander Christie",
53 + "url": "https://github.com/AJCStriker"
54 + },
55 + {
56 + "name": "Julien Chaumond",
57 + "url": "https://github.com/julien-c"
58 + },
59 + {
60 + "name": "Dan Aprahamian",
61 + "url": "https://github.com/daprahamian"
62 + },
63 + {
64 + "name": "Denys Bushulyak",
65 + "url": "https://github.com/denys-bushulyak"
66 + },
67 + {
68 + "name": "Bastien Arata",
69 + "url": "https://github.com/b4nst"
70 + },
71 + {
72 + "name": "Wan Bachtiar",
73 + "url": "https://github.com/sindbach"
74 + },
75 + {
76 + "name": "Geraldine Lemeur",
77 + "url": "https://github.com/geraldinelemeur"
78 + },
79 + {
80 + "name": "Dominik Heigl",
81 + "url": "https://github.com/various89"
82 + },
83 + {
84 + "name": "Angela-1",
85 + "url": "https://github.com/angela-1"
86 + },
87 + {
88 + "name": "Hector Ribes",
89 + "url": "https://github.com/hector7"
90 + },
91 + {
92 + "name": "Florian Richter",
93 + "url": "https://github.com/floric"
94 + },
95 + {
96 + "name": "Erik Christensen",
97 + "url": "https://github.com/erikc5000"
98 + },
99 + {
100 + "name": "Nick Zahn",
101 + "url": "https://github.com/Manc"
102 + },
103 + {
104 + "name": "Jarom Loveridge",
105 + "url": "https://github.com/jloveridge"
106 + },
107 + {
108 + "name": "Luis Pais",
109 + "url": "https://github.com/ranguna"
110 + },
111 + {
112 + "name": "Hossein Saniei",
113 + "url": "https://github.com/HosseinAgha"
114 + },
115 + {
116 + "name": "Alberto Silva",
117 + "url": "https://github.com/albertossilva"
118 + },
119 + {
120 + "name": "Piotr Błażejewicz",
121 + "url": "https://github.com/peterblazejewicz"
122 + },
123 + {
124 + "name": "Linus Unnebäck",
125 + "url": "https://github.com/LinusU"
126 + },
127 + {
128 + "name": "Richard Bateman",
129 + "url": "https://github.com/taxilian"
130 + },
131 + {
132 + "name": "Igor Strebezhev",
133 + "url": "https://github.com/xamgore"
134 + },
135 + {
136 + "name": "Valentin Agachi",
137 + "url": "https://github.com/avaly"
138 + },
139 + {
140 + "name": "HitkoDev",
141 + "url": "https://github.com/HitkoDev"
142 + },
143 + {
144 + "name": "TJT",
145 + "url": "https://github.com/Celend"
146 + },
147 + {
148 + "name": "Julien TASSIN",
149 + "url": "https://github.com/jtassin"
150 + },
151 + {
152 + "name": "Anna Henningsen",
153 + "url": "https://github.com/addaleax"
154 + },
155 + {
156 + "name": "Emmanuel Gautier",
157 + "url": "https://github.com/emmanuelgautier"
158 + },
159 + {
160 + "name": "Wyatt Johnson",
161 + "url": "https://github.com/wyattjoh"
162 + }
163 + ],
164 + "dependencies": {
165 + "@types/bson": "*",
166 + "@types/node": "*"
167 + },
168 + "deprecated": false,
169 + "description": "TypeScript definitions for MongoDB",
170 + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
171 + "license": "MIT",
172 + "main": "",
173 + "name": "@types/mongodb",
174 + "repository": {
175 + "type": "git",
176 + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
177 + "directory": "types/mongodb"
178 + },
179 + "scripts": {},
180 + "typeScriptVersion": "3.5",
181 + "types": "index.d.ts",
182 + "typesPublisherContentHash": "987beaa8db7bae4ff936d766be502eabfd25c0af4567efb6e87ed8c49c9789d0",
183 + "version": "3.6.16"
184 +}
1 + MIT License
2 +
3 + Copyright (c) Microsoft Corporation.
4 +
5 + Permission is hereby granted, free of charge, to any person obtaining a copy
6 + of this software and associated documentation files (the "Software"), to deal
7 + in the Software without restriction, including without limitation the rights
8 + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 + copies of the Software, and to permit persons to whom the Software is
10 + furnished to do so, subject to the following conditions:
11 +
12 + The above copyright notice and this permission notice shall be included in all
13 + copies or substantial portions of the Software.
14 +
15 + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 + SOFTWARE
1 +# Installation
2 +> `npm install --save @types/node`
3 +
4 +# Summary
5 +This package contains type definitions for Node.js (http://nodejs.org/).
6 +
7 +# Details
8 +Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node.
9 +
10 +### Additional Details
11 + * Last updated: Tue, 25 May 2021 00:01:37 GMT
12 + * Dependencies: none
13 + * Global values: `AbortController`, `AbortSignal`, `Buffer`, `__dirname`, `__filename`, `clearImmediate`, `clearInterval`, `clearTimeout`, `console`, `exports`, `global`, `module`, `process`, `queueMicrotask`, `require`, `setImmediate`, `setInterval`, `setTimeout`
14 +
15 +# Credits
16 +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), [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).
1 +declare module 'assert' {
2 + /** An alias of `assert.ok()`. */
3 + function assert(value: any, message?: string | Error): asserts value;
4 + namespace assert {
5 + class AssertionError extends Error {
6 + actual: any;
7 + expected: any;
8 + operator: string;
9 + generatedMessage: boolean;
10 + code: 'ERR_ASSERTION';
11 +
12 + constructor(options?: {
13 + /** If provided, the error message is set to this value. */
14 + message?: string;
15 + /** The `actual` property on the error instance. */
16 + actual?: any;
17 + /** The `expected` property on the error instance. */
18 + expected?: any;
19 + /** The `operator` property on the error instance. */
20 + operator?: string;
21 + /** If provided, the generated stack trace omits frames before this function. */
22 + // tslint:disable-next-line:ban-types
23 + stackStartFn?: Function;
24 + });
25 + }
26 +
27 + class CallTracker {
28 + calls(exact?: number): () => void;
29 + calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
30 + report(): CallTrackerReportInformation[];
31 + verify(): void;
32 + }
33 + interface CallTrackerReportInformation {
34 + message: string;
35 + /** The actual number of times the function was called. */
36 + actual: number;
37 + /** The number of times the function was expected to be called. */
38 + expected: number;
39 + /** The name of the function that is wrapped. */
40 + operator: string;
41 + /** A stack trace of the function. */
42 + stack: object;
43 + }
44 +
45 + type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
46 +
47 + function fail(message?: string | Error): never;
48 + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
49 + function fail(
50 + actual: any,
51 + expected: any,
52 + message?: string | Error,
53 + operator?: string,
54 + // tslint:disable-next-line:ban-types
55 + stackStartFn?: Function,
56 + ): never;
57 + function ok(value: any, message?: string | Error): asserts value;
58 + /** @deprecated since v9.9.0 - use strictEqual() instead. */
59 + function equal(actual: any, expected: any, message?: string | Error): void;
60 + /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
61 + function notEqual(actual: any, expected: any, message?: string | Error): void;
62 + /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
63 + function deepEqual(actual: any, expected: any, message?: string | Error): void;
64 + /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
65 + function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
66 + function strictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
67 + function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
68 + function deepStrictEqual<T>(actual: any, expected: T, message?: string | Error): asserts actual is T;
69 + function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
70 +
71 + function throws(block: () => any, message?: string | Error): void;
72 + function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73 + function doesNotThrow(block: () => any, message?: string | Error): void;
74 + function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75 +
76 + function ifError(value: any): asserts value is null | undefined;
77 +
78 + function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
79 + function rejects(
80 + block: (() => Promise<any>) | Promise<any>,
81 + error: AssertPredicate,
82 + message?: string | Error,
83 + ): Promise<void>;
84 + function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85 + function doesNotReject(
86 + block: (() => Promise<any>) | Promise<any>,
87 + error: AssertPredicate,
88 + message?: string | Error,
89 + ): Promise<void>;
90 +
91 + function match(value: string, regExp: RegExp, message?: string | Error): void;
92 + function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
93 +
94 + const strict: Omit<
95 + typeof assert,
96 + | 'equal'
97 + | 'notEqual'
98 + | 'deepEqual'
99 + | 'notDeepEqual'
100 + | 'ok'
101 + | 'strictEqual'
102 + | 'deepStrictEqual'
103 + | 'ifError'
104 + | 'strict'
105 + > & {
106 + (value: any, message?: string | Error): asserts value;
107 + equal: typeof strictEqual;
108 + notEqual: typeof notStrictEqual;
109 + deepEqual: typeof deepStrictEqual;
110 + notDeepEqual: typeof notDeepStrictEqual;
111 +
112 + // Mapped types and assertion functions are incompatible?
113 + // TS2775: Assertions require every name in the call target
114 + // to be declared with an explicit type annotation.
115 + ok: typeof ok;
116 + strictEqual: typeof strictEqual;
117 + deepStrictEqual: typeof deepStrictEqual;
118 + ifError: typeof ifError;
119 + strict: typeof strict;
120 + };
121 + }
122 +
123 + export = assert;
124 +}
1 +declare module 'assert/strict' {
2 + import { strict } from 'assert';
3 + export = strict;
4 +}
1 +/**
2 + * Async Hooks module: https://nodejs.org/api/async_hooks.html
3 + */
4 +declare module 'async_hooks' {
5 + /**
6 + * Returns the asyncId of the current execution context.
7 + */
8 + function executionAsyncId(): number;
9 +
10 + /**
11 + * The resource representing the current execution.
12 + * Useful to store data within the resource.
13 + *
14 + * Resource objects returned by `executionAsyncResource()` are most often internal
15 + * Node.js handle objects with undocumented APIs. Using any functions or properties
16 + * on the object is likely to crash your application and should be avoided.
17 + *
18 + * Using `executionAsyncResource()` in the top-level execution context will
19 + * return an empty object as there is no handle or request object to use,
20 + * but having an object representing the top-level can be helpful.
21 + */
22 + function executionAsyncResource(): object;
23 +
24 + /**
25 + * Returns the ID of the resource responsible for calling the callback that is currently being executed.
26 + */
27 + function triggerAsyncId(): number;
28 +
29 + interface HookCallbacks {
30 + /**
31 + * Called when a class is constructed that has the possibility to emit an asynchronous event.
32 + * @param asyncId a unique ID for the async resource
33 + * @param type the type of the async resource
34 + * @param triggerAsyncId the unique ID of the async resource in whose execution context this async resource was created
35 + * @param resource reference to the resource representing the async operation, needs to be released during destroy
36 + */
37 + init?(asyncId: number, type: string, triggerAsyncId: number, resource: object): void;
38 +
39 + /**
40 + * When an asynchronous operation is initiated or completes a callback is called to notify the user.
41 + * The before callback is called just before said callback is executed.
42 + * @param asyncId the unique identifier assigned to the resource about to execute the callback.
43 + */
44 + before?(asyncId: number): void;
45 +
46 + /**
47 + * Called immediately after the callback specified in before is completed.
48 + * @param asyncId the unique identifier assigned to the resource which has executed the callback.
49 + */
50 + after?(asyncId: number): void;
51 +
52 + /**
53 + * Called when a promise has resolve() called. This may not be in the same execution id
54 + * as the promise itself.
55 + * @param asyncId the unique id for the promise that was resolve()d.
56 + */
57 + promiseResolve?(asyncId: number): void;
58 +
59 + /**
60 + * Called after the resource corresponding to asyncId is destroyed
61 + * @param asyncId a unique ID for the async resource
62 + */
63 + destroy?(asyncId: number): void;
64 + }
65 +
66 + interface AsyncHook {
67 + /**
68 + * Enable the callbacks for a given AsyncHook instance. If no callbacks are provided enabling is a noop.
69 + */
70 + enable(): this;
71 +
72 + /**
73 + * Disable the callbacks for a given AsyncHook instance from the global pool of AsyncHook callbacks to be executed. Once a hook has been disabled it will not be called again until enabled.
74 + */
75 + disable(): this;
76 + }
77 +
78 + /**
79 + * Registers functions to be called for different lifetime events of each async operation.
80 + * @param options the callbacks to register
81 + * @return an AsyncHooks instance used for disabling and enabling hooks
82 + */
83 + function createHook(options: HookCallbacks): AsyncHook;
84 +
85 + interface AsyncResourceOptions {
86 + /**
87 + * The ID of the execution context that created this async event.
88 + * @default executionAsyncId()
89 + */
90 + triggerAsyncId?: number;
91 +
92 + /**
93 + * Disables automatic `emitDestroy` when the object is garbage collected.
94 + * This usually does not need to be set (even if `emitDestroy` is called
95 + * manually), unless the resource's `asyncId` is retrieved and the
96 + * sensitive API's `emitDestroy` is called with it.
97 + * @default false
98 + */
99 + requireManualDestroy?: boolean;
100 + }
101 +
102 + /**
103 + * The class AsyncResource was designed to be extended by the embedder's async resources.
104 + * Using this users can easily trigger the lifetime events of their own resources.
105 + */
106 + class AsyncResource {
107 + /**
108 + * AsyncResource() is meant to be extended. Instantiating a
109 + * new AsyncResource() also triggers init. If triggerAsyncId is omitted then
110 + * async_hook.executionAsyncId() is used.
111 + * @param type The type of async event.
112 + * @param triggerAsyncId The ID of the execution context that created
113 + * this async event (default: `executionAsyncId()`), or an
114 + * AsyncResourceOptions object (since 9.3)
115 + */
116 + constructor(type: string, triggerAsyncId?: number|AsyncResourceOptions);
117 +
118 + /**
119 + * Binds the given function to the current execution context.
120 + * @param fn The function to bind to the current execution context.
121 + * @param type An optional name to associate with the underlying `AsyncResource`.
122 + */
123 + static bind<Func extends (...args: any[]) => any>(fn: Func, type?: string): Func & { asyncResource: AsyncResource };
124 +
125 + /**
126 + * Binds the given function to execute to this `AsyncResource`'s scope.
127 + * @param fn The function to bind to the current `AsyncResource`.
128 + */
129 + bind<Func extends (...args: any[]) => any>(fn: Func): Func & { asyncResource: AsyncResource };
130 +
131 + /**
132 + * Call the provided function with the provided arguments in the
133 + * execution context of the async resource. This will establish the
134 + * context, trigger the AsyncHooks before callbacks, call the function,
135 + * trigger the AsyncHooks after callbacks, and then restore the original
136 + * execution context.
137 + * @param fn The function to call in the execution context of this
138 + * async resource.
139 + * @param thisArg The receiver to be used for the function call.
140 + * @param args Optional arguments to pass to the function.
141 + */
142 + runInAsyncScope<This, Result>(fn: (this: This, ...args: any[]) => Result, thisArg?: This, ...args: any[]): Result;
143 +
144 + /**
145 + * Call AsyncHooks destroy callbacks.
146 + */
147 + emitDestroy(): this;
148 +
149 + /**
150 + * @return the unique ID assigned to this AsyncResource instance.
151 + */
152 + asyncId(): number;
153 +
154 + /**
155 + * @return the trigger ID for this AsyncResource instance.
156 + */
157 + triggerAsyncId(): number;
158 + }
159 +
160 + /**
161 + * When having multiple instances of `AsyncLocalStorage`, they are independent
162 + * from each other. It is safe to instantiate this class multiple times.
163 + */
164 + class AsyncLocalStorage<T> {
165 + /**
166 + * This method disables the instance of `AsyncLocalStorage`. All subsequent calls
167 + * to `asyncLocalStorage.getStore()` will return `undefined` until
168 + * `asyncLocalStorage.run()` is called again.
169 + *
170 + * When calling `asyncLocalStorage.disable()`, all current contexts linked to the
171 + * instance will be exited.
172 + *
173 + * Calling `asyncLocalStorage.disable()` is required before the
174 + * `asyncLocalStorage` can be garbage collected. This does not apply to stores
175 + * provided by the `asyncLocalStorage`, as those objects are garbage collected
176 + * along with the corresponding async resources.
177 + *
178 + * This method is to be used when the `asyncLocalStorage` is not in use anymore
179 + * in the current process.
180 + */
181 + disable(): void;
182 +
183 + /**
184 + * This method returns the current store. If this method is called outside of an
185 + * asynchronous context initialized by calling `asyncLocalStorage.run`, it will
186 + * return `undefined`.
187 + */
188 + getStore(): T | undefined;
189 +
190 + /**
191 + * This methods runs a function synchronously within a context and return its
192 + * return value. The store is not accessible outside of the callback function or
193 + * the asynchronous operations created within the callback.
194 + *
195 + * Optionally, arguments can be passed to the function. They will be passed to the
196 + * callback function.
197 + *
198 + * I the callback function throws an error, it will be thrown by `run` too. The
199 + * stacktrace will not be impacted by this call and the context will be exited.
200 + */
201 + // TODO: Apply generic vararg once available
202 + run<R>(store: T, callback: (...args: any[]) => R, ...args: any[]): R;
203 +
204 + /**
205 + * This methods runs a function synchronously outside of a context and return its
206 + * return value. The store is not accessible within the callback function or the
207 + * asynchronous operations created within the callback.
208 + *
209 + * Optionally, arguments can be passed to the function. They will be passed to the
210 + * callback function.
211 + *
212 + * If the callback function throws an error, it will be thrown by `exit` too. The
213 + * stacktrace will not be impacted by this call and the context will be
214 + * re-entered.
215 + */
216 + // TODO: Apply generic vararg once available
217 + exit<R>(callback: (...args: any[]) => R, ...args: any[]): R;
218 +
219 + /**
220 + * Calling `asyncLocalStorage.enterWith(store)` will transition into the context
221 + * for the remainder of the current synchronous execution and will persist
222 + * through any following asynchronous calls.
223 + */
224 + enterWith(store: T): void;
225 + }
226 +}
1 +// NOTE: These definitions support NodeJS and TypeScript 3.7.
2 +
3 +// NOTE: TypeScript version-specific augmentations can be found in the following paths:
4 +// - ~/base.d.ts - Shared definitions common to all TypeScript versions
5 +// - ~/index.d.ts - Definitions specific to TypeScript 2.1
6 +// - ~/ts3.7/base.d.ts - Definitions specific to TypeScript 3.7
7 +// - ~/ts3.7/index.d.ts - Definitions specific to TypeScript 3.7 with assert pulled in
8 +
9 +// Reference required types from the default lib:
10 +/// <reference lib="es2018" />
11 +/// <reference lib="esnext.asynciterable" />
12 +/// <reference lib="esnext.intl" />
13 +/// <reference lib="esnext.bigint" />
14 +
15 +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16 +/// <reference path="ts3.6/base.d.ts" />
17 +
18 +// TypeScript 3.7-specific augmentations:
19 +/// <reference path="assert.d.ts" />
1 +declare module 'buffer' {
2 + export const INSPECT_MAX_BYTES: number;
3 + export const kMaxLength: number;
4 + export const kStringMaxLength: number;
5 + export const constants: {
6 + MAX_LENGTH: number;
7 + MAX_STRING_LENGTH: number;
8 + };
9 + const BuffType: typeof Buffer;
10 +
11 + export type TranscodeEncoding = "ascii" | "utf8" | "utf16le" | "ucs2" | "latin1" | "binary";
12 +
13 + export function transcode(source: Uint8Array, fromEnc: TranscodeEncoding, toEnc: TranscodeEncoding): Buffer;
14 +
15 + export const SlowBuffer: {
16 + /** @deprecated since v6.0.0, use `Buffer.allocUnsafeSlow()` */
17 + new(size: number): Buffer;
18 + prototype: Buffer;
19 + };
20 +
21 + export { BuffType as Buffer };
22 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +declare module 'console' {
2 + import { InspectOptions } from 'util';
3 +
4 + global {
5 + // This needs to be global to avoid TS2403 in case lib.dom.d.ts is present in the same build
6 + interface Console {
7 + Console: NodeJS.ConsoleConstructor;
8 + /**
9 + * A simple assertion test that verifies whether `value` is truthy.
10 + * If it is not, an `AssertionError` is thrown.
11 + * If provided, the error `message` is formatted using `util.format()` and used as the error message.
12 + */
13 + assert(value: any, message?: string, ...optionalParams: any[]): void;
14 + /**
15 + * When `stdout` is a TTY, calling `console.clear()` will attempt to clear the TTY.
16 + * When `stdout` is not a TTY, this method does nothing.
17 + */
18 + clear(): void;
19 + /**
20 + * Maintains an internal counter specific to `label` and outputs to `stdout` the number of times `console.count()` has been called with the given `label`.
21 + */
22 + count(label?: string): void;
23 + /**
24 + * Resets the internal counter specific to `label`.
25 + */
26 + countReset(label?: string): void;
27 + /**
28 + * The `console.debug()` function is an alias for {@link console.log()}.
29 + */
30 + debug(message?: any, ...optionalParams: any[]): void;
31 + /**
32 + * Uses {@link util.inspect()} on `obj` and prints the resulting string to `stdout`.
33 + * This function bypasses any custom `inspect()` function defined on `obj`.
34 + */
35 + dir(obj: any, options?: InspectOptions): void;
36 + /**
37 + * This method calls {@link console.log()} passing it the arguments received. Please note that this method does not produce any XML formatting
38 + */
39 + dirxml(...data: any[]): void;
40 + /**
41 + * Prints to `stderr` with newline.
42 + */
43 + error(message?: any, ...optionalParams: any[]): void;
44 + /**
45 + * Increases indentation of subsequent lines by two spaces.
46 + * If one or more `label`s are provided, those are printed first without the additional indentation.
47 + */
48 + group(...label: any[]): void;
49 + /**
50 + * The `console.groupCollapsed()` function is an alias for {@link console.group()}.
51 + */
52 + groupCollapsed(...label: any[]): void;
53 + /**
54 + * Decreases indentation of subsequent lines by two spaces.
55 + */
56 + groupEnd(): void;
57 + /**
58 + * The {@link console.info()} function is an alias for {@link console.log()}.
59 + */
60 + info(message?: any, ...optionalParams: any[]): void;
61 + /**
62 + * Prints to `stdout` with newline.
63 + */
64 + log(message?: any, ...optionalParams: any[]): void;
65 + /**
66 + * This method does not display anything unless used in the inspector.
67 + * Prints to `stdout` the array `array` formatted as a table.
68 + */
69 + table(tabularData: any, properties?: ReadonlyArray<string>): void;
70 + /**
71 + * Starts a timer that can be used to compute the duration of an operation. Timers are identified by a unique `label`.
72 + */
73 + time(label?: string): void;
74 + /**
75 + * Stops a timer that was previously started by calling {@link console.time()} and prints the result to `stdout`.
76 + */
77 + timeEnd(label?: string): void;
78 + /**
79 + * For a timer that was previously started by calling {@link console.time()}, prints the elapsed time and other `data` arguments to `stdout`.
80 + */
81 + timeLog(label?: string, ...data: any[]): void;
82 + /**
83 + * Prints to `stderr` the string 'Trace :', followed by the {@link util.format()} formatted message and stack trace to the current position in the code.
84 + */
85 + trace(message?: any, ...optionalParams: any[]): void;
86 + /**
87 + * The {@link console.warn()} function is an alias for {@link console.error()}.
88 + */
89 + warn(message?: any, ...optionalParams: any[]): void;
90 +
91 + // --- Inspector mode only ---
92 + /**
93 + * This method does not display anything unless used in the inspector.
94 + * Starts a JavaScript CPU profile with an optional label.
95 + */
96 + profile(label?: string): void;
97 + /**
98 + * This method does not display anything unless used in the inspector.
99 + * Stops the current JavaScript CPU profiling session if one has been started and prints the report to the Profiles panel of the inspector.
100 + */
101 + profileEnd(label?: string): void;
102 + /**
103 + * This method does not display anything unless used in the inspector.
104 + * Adds an event with the label `label` to the Timeline panel of the inspector.
105 + */
106 + timeStamp(label?: string): void;
107 + }
108 +
109 + var console: Console;
110 +
111 + namespace NodeJS {
112 + interface ConsoleConstructorOptions {
113 + stdout: WritableStream;
114 + stderr?: WritableStream;
115 + ignoreErrors?: boolean;
116 + colorMode?: boolean | 'auto';
117 + inspectOptions?: InspectOptions;
118 + }
119 +
120 + interface ConsoleConstructor {
121 + prototype: Console;
122 + new(stdout: WritableStream, stderr?: WritableStream, ignoreErrors?: boolean): Console;
123 + new(options: ConsoleConstructorOptions): Console;
124 + }
125 +
126 + interface Global {
127 + console: typeof console;
128 + }
129 + }
130 + }
131 +
132 + export = console;
133 +}
1 +/** @deprecated since v6.3.0 - use constants property exposed by the relevant module instead. */
2 +declare module 'constants' {
3 + import { constants as osConstants, SignalConstants } from 'os';
4 + import { constants as cryptoConstants } from 'crypto';
5 + import { constants as fsConstants } from 'fs';
6 +
7 + const exp: typeof osConstants.errno &
8 + typeof osConstants.priority &
9 + SignalConstants &
10 + typeof cryptoConstants &
11 + typeof fsConstants;
12 + export = exp;
13 +}
This diff is collapsed. Click to expand it.
1 +declare module 'dgram' {
2 + import { AddressInfo } from 'net';
3 + import * as dns from 'dns';
4 + import EventEmitter = require('events');
5 +
6 + interface RemoteInfo {
7 + address: string;
8 + family: 'IPv4' | 'IPv6';
9 + port: number;
10 + size: number;
11 + }
12 +
13 + interface BindOptions {
14 + port?: number;
15 + address?: string;
16 + exclusive?: boolean;
17 + fd?: number;
18 + }
19 +
20 + type SocketType = "udp4" | "udp6";
21 +
22 + interface SocketOptions {
23 + type: SocketType;
24 + reuseAddr?: boolean;
25 + /**
26 + * @default false
27 + */
28 + ipv6Only?: boolean;
29 + recvBufferSize?: number;
30 + sendBufferSize?: number;
31 + lookup?: (hostname: string, options: dns.LookupOneOptions, callback: (err: NodeJS.ErrnoException | null, address: string, family: number) => void) => void;
32 + }
33 +
34 + function createSocket(type: SocketType, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
35 + function createSocket(options: SocketOptions, callback?: (msg: Buffer, rinfo: RemoteInfo) => void): Socket;
36 +
37 + class Socket extends EventEmitter {
38 + addMembership(multicastAddress: string, multicastInterface?: string): void;
39 + address(): AddressInfo;
40 + bind(port?: number, address?: string, callback?: () => void): void;
41 + bind(port?: number, callback?: () => void): void;
42 + bind(callback?: () => void): void;
43 + bind(options: BindOptions, callback?: () => void): void;
44 + close(callback?: () => void): void;
45 + connect(port: number, address?: string, callback?: () => void): void;
46 + connect(port: number, callback: () => void): void;
47 + disconnect(): void;
48 + dropMembership(multicastAddress: string, multicastInterface?: string): void;
49 + getRecvBufferSize(): number;
50 + getSendBufferSize(): number;
51 + ref(): this;
52 + remoteAddress(): AddressInfo;
53 + send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
54 + send(msg: string | Uint8Array | ReadonlyArray<any>, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
55 + send(msg: string | Uint8Array | ReadonlyArray<any>, callback?: (error: Error | null, bytes: number) => void): void;
56 + send(msg: string | Uint8Array, offset: number, length: number, port?: number, address?: string, callback?: (error: Error | null, bytes: number) => void): void;
57 + send(msg: string | Uint8Array, offset: number, length: number, port?: number, callback?: (error: Error | null, bytes: number) => void): void;
58 + send(msg: string | Uint8Array, offset: number, length: number, callback?: (error: Error | null, bytes: number) => void): void;
59 + setBroadcast(flag: boolean): void;
60 + setMulticastInterface(multicastInterface: string): void;
61 + setMulticastLoopback(flag: boolean): void;
62 + setMulticastTTL(ttl: number): void;
63 + setRecvBufferSize(size: number): void;
64 + setSendBufferSize(size: number): void;
65 + setTTL(ttl: number): void;
66 + unref(): this;
67 + /**
68 + * Tells the kernel to join a source-specific multicast channel at the given
69 + * `sourceAddress` and `groupAddress`, using the `multicastInterface` with the
70 + * `IP_ADD_SOURCE_MEMBERSHIP` socket option.
71 + * If the `multicastInterface` argument
72 + * is not specified, the operating system will choose one interface and will add
73 + * membership to it.
74 + * To add membership to every available interface, call
75 + * `socket.addSourceSpecificMembership()` multiple times, once per interface.
76 + */
77 + addSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
78 +
79 + /**
80 + * Instructs the kernel to leave a source-specific multicast channel at the given
81 + * `sourceAddress` and `groupAddress` using the `IP_DROP_SOURCE_MEMBERSHIP`
82 + * socket option. This method is automatically called by the kernel when the
83 + * socket is closed or the process terminates, so most apps will never have
84 + * reason to call this.
85 + *
86 + * If `multicastInterface` is not specified, the operating system will attempt to
87 + * drop membership on all valid interfaces.
88 + */
89 + dropSourceSpecificMembership(sourceAddress: string, groupAddress: string, multicastInterface?: string): void;
90 +
91 + /**
92 + * events.EventEmitter
93 + * 1. close
94 + * 2. connect
95 + * 3. error
96 + * 4. listening
97 + * 5. message
98 + */
99 + addListener(event: string, listener: (...args: any[]) => void): this;
100 + addListener(event: "close", listener: () => void): this;
101 + addListener(event: "connect", listener: () => void): this;
102 + addListener(event: "error", listener: (err: Error) => void): this;
103 + addListener(event: "listening", listener: () => void): this;
104 + addListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
105 +
106 + emit(event: string | symbol, ...args: any[]): boolean;
107 + emit(event: "close"): boolean;
108 + emit(event: "connect"): boolean;
109 + emit(event: "error", err: Error): boolean;
110 + emit(event: "listening"): boolean;
111 + emit(event: "message", msg: Buffer, rinfo: RemoteInfo): boolean;
112 +
113 + on(event: string, listener: (...args: any[]) => void): this;
114 + on(event: "close", listener: () => void): this;
115 + on(event: "connect", listener: () => void): this;
116 + on(event: "error", listener: (err: Error) => void): this;
117 + on(event: "listening", listener: () => void): this;
118 + on(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
119 +
120 + once(event: string, listener: (...args: any[]) => void): this;
121 + once(event: "close", listener: () => void): this;
122 + once(event: "connect", listener: () => void): this;
123 + once(event: "error", listener: (err: Error) => void): this;
124 + once(event: "listening", listener: () => void): this;
125 + once(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
126 +
127 + prependListener(event: string, listener: (...args: any[]) => void): this;
128 + prependListener(event: "close", listener: () => void): this;
129 + prependListener(event: "connect", listener: () => void): this;
130 + prependListener(event: "error", listener: (err: Error) => void): this;
131 + prependListener(event: "listening", listener: () => void): this;
132 + prependListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
133 +
134 + prependOnceListener(event: string, listener: (...args: any[]) => void): this;
135 + prependOnceListener(event: "close", listener: () => void): this;
136 + prependOnceListener(event: "connect", listener: () => void): this;
137 + prependOnceListener(event: "error", listener: (err: Error) => void): this;
138 + prependOnceListener(event: "listening", listener: () => void): this;
139 + prependOnceListener(event: "message", listener: (msg: Buffer, rinfo: RemoteInfo) => void): this;
140 + }
141 +}
1 +/**
2 + * @experimental
3 + */
4 +declare module 'diagnostic_channel' {
5 + /**
6 + * Returns wether a named channel has subscribers or not.
7 + */
8 + function hasSubscribers(name: string): boolean;
9 +
10 + /**
11 + * Gets or create a diagnostic channel by name.
12 + */
13 + function channel(name: string): Channel;
14 +
15 + type ChannelListener = (name: string, message: unknown) => void;
16 +
17 + /**
18 + * Simple diagnostic channel that allows
19 + */
20 + class Channel {
21 + readonly name: string;
22 + readonly hashSubscribers: boolean;
23 + private constructor(name: string);
24 +
25 + /**
26 + * Add a listener to the message channel.
27 + */
28 + subscribe(listener: ChannelListener): void;
29 + /**
30 + * Removes a previously registered listener.
31 + */
32 + unsubscribe(listener: ChannelListener): void;
33 + }
34 +}
This diff is collapsed. Click to expand it.
1 +declare module "dns/promises" {
2 + import {
3 + LookupAddress,
4 + LookupOneOptions,
5 + LookupAllOptions,
6 + LookupOptions,
7 + AnyRecord,
8 + CaaRecord,
9 + MxRecord,
10 + NaptrRecord,
11 + SoaRecord,
12 + SrvRecord,
13 + ResolveWithTtlOptions,
14 + RecordWithTtl,
15 + ResolveOptions,
16 + ResolverOptions,
17 + } from "dns";
18 +
19 + function getServers(): string[];
20 +
21 + function lookup(hostname: string, family: number): Promise<LookupAddress>;
22 + function lookup(hostname: string, options: LookupOneOptions): Promise<LookupAddress>;
23 + function lookup(hostname: string, options: LookupAllOptions): Promise<LookupAddress[]>;
24 + function lookup(hostname: string, options: LookupOptions): Promise<LookupAddress | LookupAddress[]>;
25 + function lookup(hostname: string): Promise<LookupAddress>;
26 +
27 + function lookupService(address: string, port: number): Promise<{ hostname: string, service: string }>;
28 +
29 + function resolve(hostname: string): Promise<string[]>;
30 + function resolve(hostname: string, rrtype: "A"): Promise<string[]>;
31 + function resolve(hostname: string, rrtype: "AAAA"): Promise<string[]>;
32 + function resolve(hostname: string, rrtype: "ANY"): Promise<AnyRecord[]>;
33 + function resolve(hostname: string, rrtype: "CAA"): Promise<CaaRecord[]>;
34 + function resolve(hostname: string, rrtype: "CNAME"): Promise<string[]>;
35 + function resolve(hostname: string, rrtype: "MX"): Promise<MxRecord[]>;
36 + function resolve(hostname: string, rrtype: "NAPTR"): Promise<NaptrRecord[]>;
37 + function resolve(hostname: string, rrtype: "NS"): Promise<string[]>;
38 + function resolve(hostname: string, rrtype: "PTR"): Promise<string[]>;
39 + function resolve(hostname: string, rrtype: "SOA"): Promise<SoaRecord>;
40 + function resolve(hostname: string, rrtype: "SRV"): Promise<SrvRecord[]>;
41 + function resolve(hostname: string, rrtype: "TXT"): Promise<string[][]>;
42 + function resolve(hostname: string, rrtype: string): Promise<string[] | MxRecord[] | NaptrRecord[] | SoaRecord | SrvRecord[] | string[][] | AnyRecord[]>;
43 +
44 + function resolve4(hostname: string): Promise<string[]>;
45 + function resolve4(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
46 + function resolve4(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
47 +
48 + function resolve6(hostname: string): Promise<string[]>;
49 + function resolve6(hostname: string, options: ResolveWithTtlOptions): Promise<RecordWithTtl[]>;
50 + function resolve6(hostname: string, options: ResolveOptions): Promise<string[] | RecordWithTtl[]>;
51 +
52 + function resolveAny(hostname: string): Promise<AnyRecord[]>;
53 +
54 + function resolveCaa(hostname: string): Promise<CaaRecord[]>;
55 +
56 + function resolveCname(hostname: string): Promise<string[]>;
57 +
58 + function resolveMx(hostname: string): Promise<MxRecord[]>;
59 +
60 + function resolveNaptr(hostname: string): Promise<NaptrRecord[]>;
61 +
62 + function resolveNs(hostname: string): Promise<string[]>;
63 +
64 + function resolvePtr(hostname: string): Promise<string[]>;
65 +
66 + function resolveSoa(hostname: string): Promise<SoaRecord>;
67 +
68 + function resolveSrv(hostname: string): Promise<SrvRecord[]>;
69 +
70 + function resolveTxt(hostname: string): Promise<string[][]>;
71 +
72 + function reverse(ip: string): Promise<string[]>;
73 +
74 + function setServers(servers: ReadonlyArray<string>): void;
75 +
76 + class Resolver {
77 + constructor(options?: ResolverOptions);
78 +
79 + cancel(): void;
80 + getServers: typeof getServers;
81 + resolve: typeof resolve;
82 + resolve4: typeof resolve4;
83 + resolve6: typeof resolve6;
84 + resolveAny: typeof resolveAny;
85 + resolveCname: typeof resolveCname;
86 + resolveMx: typeof resolveMx;
87 + resolveNaptr: typeof resolveNaptr;
88 + resolveNs: typeof resolveNs;
89 + resolvePtr: typeof resolvePtr;
90 + resolveSoa: typeof resolveSoa;
91 + resolveSrv: typeof resolveSrv;
92 + resolveTxt: typeof resolveTxt;
93 + reverse: typeof reverse;
94 + setLocalAddress(ipv4?: string, ipv6?: string): void;
95 + setServers: typeof setServers;
96 + }
97 +}
1 +declare module 'domain' {
2 + import EventEmitter = require('events');
3 +
4 + global {
5 + namespace NodeJS {
6 + interface Domain extends EventEmitter {
7 + run<T>(fn: (...args: any[]) => T, ...args: any[]): T;
8 + add(emitter: EventEmitter | Timer): void;
9 + remove(emitter: EventEmitter | Timer): void;
10 + bind<T extends Function>(cb: T): T;
11 + intercept<T extends Function>(cb: T): T;
12 + }
13 + }
14 + }
15 +
16 + interface Domain extends NodeJS.Domain {}
17 + class Domain extends EventEmitter {
18 + members: Array<EventEmitter | NodeJS.Timer>;
19 + enter(): void;
20 + exit(): void;
21 + }
22 +
23 + function create(): Domain;
24 +}
1 +declare module 'events' {
2 + interface EventEmitterOptions {
3 + /**
4 + * Enables automatic capturing of promise rejection.
5 + */
6 + captureRejections?: boolean;
7 + }
8 +
9 + interface NodeEventTarget {
10 + once(event: string | symbol, listener: (...args: any[]) => void): this;
11 + }
12 +
13 + interface DOMEventTarget {
14 + addEventListener(event: string, listener: (...args: any[]) => void, opts?: { once: boolean }): any;
15 + }
16 +
17 + interface StaticEventEmitterOptions {
18 + signal?: AbortSignal;
19 + }
20 +
21 + interface EventEmitter extends NodeJS.EventEmitter {}
22 + class EventEmitter {
23 + constructor(options?: EventEmitterOptions);
24 +
25 + static once(emitter: NodeEventTarget, event: string | symbol, options?: StaticEventEmitterOptions): Promise<any[]>;
26 + static once(emitter: DOMEventTarget, event: string, options?: StaticEventEmitterOptions): Promise<any[]>;
27 + static on(emitter: NodeJS.EventEmitter, event: string, options?: StaticEventEmitterOptions): AsyncIterableIterator<any>;
28 +
29 + /** @deprecated since v4.0.0 */
30 + static listenerCount(emitter: NodeJS.EventEmitter, event: string | symbol): number;
31 + /**
32 + * Returns a list listener for a specific emitter event name.
33 + */
34 + static getEventListener(emitter: DOMEventTarget | NodeJS.EventEmitter, name: string | symbol): Function[];
35 +
36 + /**
37 + * This symbol shall be used to install a listener for only monitoring `'error'`
38 + * events. Listeners installed using this symbol are called before the regular
39 + * `'error'` listeners are called.
40 + *
41 + * Installing a listener using this symbol does not change the behavior once an
42 + * `'error'` event is emitted, therefore the process will still crash if no
43 + * regular `'error'` listener is installed.
44 + */
45 + static readonly errorMonitor: unique symbol;
46 + static readonly captureRejectionSymbol: unique symbol;
47 +
48 + /**
49 + * Sets or gets the default captureRejection value for all emitters.
50 + */
51 + // TODO: These should be described using static getter/setter pairs:
52 + static captureRejections: boolean;
53 + static defaultMaxListeners: number;
54 + }
55 +
56 + import internal = require('events');
57 + namespace EventEmitter {
58 + // Should just be `export { EventEmitter }`, but that doesn't work in TypeScript 3.4
59 + export { internal as EventEmitter };
60 +
61 + export interface Abortable {
62 + /**
63 + * When provided the corresponding `AbortController` can be used to cancel an asynchronous action.
64 + */
65 + signal?: AbortSignal;
66 + }
67 + }
68 +
69 + global {
70 + namespace NodeJS {
71 + interface EventEmitter {
72 + addListener(event: string | symbol, listener: (...args: any[]) => void): this;
73 + on(event: string | symbol, listener: (...args: any[]) => void): this;
74 + once(event: string | symbol, listener: (...args: any[]) => void): this;
75 + removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
76 + off(event: string | symbol, listener: (...args: any[]) => void): this;
77 + removeAllListeners(event?: string | symbol): this;
78 + setMaxListeners(n: number): this;
79 + getMaxListeners(): number;
80 + listeners(event: string | symbol): Function[];
81 + rawListeners(event: string | symbol): Function[];
82 + emit(event: string | symbol, ...args: any[]): boolean;
83 + listenerCount(event: string | symbol): number;
84 + // Added in Node 6...
85 + prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
86 + prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
87 + eventNames(): Array<string | symbol>;
88 + }
89 + }
90 + }
91 +
92 + export = EventEmitter;
93 +}
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +declare var global: NodeJS.Global & typeof globalThis;
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +declare module 'https' {
2 + import * as tls from 'tls';
3 + import * as http from 'http';
4 + import { URL } from 'url';
5 +
6 + type ServerOptions = tls.SecureContextOptions & tls.TlsOptions & http.ServerOptions;
7 +
8 + type RequestOptions = http.RequestOptions & tls.SecureContextOptions & {
9 + rejectUnauthorized?: boolean; // Defaults to true
10 + servername?: string; // SNI TLS Extension
11 + };
12 +
13 + interface AgentOptions extends http.AgentOptions, tls.ConnectionOptions {
14 + rejectUnauthorized?: boolean;
15 + maxCachedSessions?: number;
16 + }
17 +
18 + class Agent extends http.Agent {
19 + constructor(options?: AgentOptions);
20 + options: AgentOptions;
21 + }
22 +
23 + interface Server extends http.HttpBase {}
24 + class Server extends tls.Server {
25 + constructor(requestListener?: http.RequestListener);
26 + constructor(options: ServerOptions, requestListener?: http.RequestListener);
27 + }
28 +
29 + function createServer(requestListener?: http.RequestListener): Server;
30 + function createServer(options: ServerOptions, requestListener?: http.RequestListener): Server;
31 + function request(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
32 + function request(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
33 + function get(options: RequestOptions | string | URL, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
34 + function get(url: string | URL, options: RequestOptions, callback?: (res: http.IncomingMessage) => void): http.ClientRequest;
35 + let globalAgent: Agent;
36 +}
1 +// Type definitions for non-npm package Node.js 15.6
2 +// Project: http://nodejs.org/
3 +// Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4 +// DefinitelyTyped <https://github.com/DefinitelyTyped>
5 +// Alberto Schiabel <https://github.com/jkomyno>
6 +// Alvis HT Tang <https://github.com/alvis>
7 +// Andrew Makarov <https://github.com/r3nya>
8 +// Benjamin Toueg <https://github.com/btoueg>
9 +// Chigozirim C. <https://github.com/smac89>
10 +// David Junger <https://github.com/touffy>
11 +// Deividas Bakanas <https://github.com/DeividasBakanas>
12 +// Eugene Y. Q. Shen <https://github.com/eyqs>
13 +// Hannes Magnusson <https://github.com/Hannes-Magnusson-CK>
14 +// Hoàng Văn Khải <https://github.com/KSXGitHub>
15 +// Huw <https://github.com/hoo29>
16 +// Kelvin Jin <https://github.com/kjin>
17 +// Klaus Meinhardt <https://github.com/ajafff>
18 +// Lishude <https://github.com/islishude>
19 +// Mariusz Wiktorczyk <https://github.com/mwiktorczyk>
20 +// Mohsen Azimi <https://github.com/mohsen1>
21 +// Nicolas Even <https://github.com/n-e>
22 +// Nikita Galkin <https://github.com/galkin>
23 +// Parambir Singh <https://github.com/parambirs>
24 +// Sebastian Silbermann <https://github.com/eps1lon>
25 +// Simon Schick <https://github.com/SimonSchick>
26 +// Thomas den Hollander <https://github.com/ThomasdenH>
27 +// Wilco Bakker <https://github.com/WilcoBakker>
28 +// wwwy3y3 <https://github.com/wwwy3y3>
29 +// Samuel Ainsworth <https://github.com/samuela>
30 +// Kyle Uehlein <https://github.com/kuehlein>
31 +// Thanik Bhongbhibhat <https://github.com/bhongy>
32 +// Marcin Kopacz <https://github.com/chyzwar>
33 +// Trivikram Kamat <https://github.com/trivikr>
34 +// Minh Son Nguyen <https://github.com/nguymin4>
35 +// Junxiao Shi <https://github.com/yoursunny>
36 +// Ilia Baryshnikov <https://github.com/qwelias>
37 +// ExE Boss <https://github.com/ExE-Boss>
38 +// Surasak Chaisurin <https://github.com/Ryan-Willpower>
39 +// Piotr Błażejewicz <https://github.com/peterblazejewicz>
40 +// Anna Henningsen <https://github.com/addaleax>
41 +// Jason Kwok <https://github.com/JasonHK>
42 +// Victor Perin <https://github.com/victorperin>
43 +// Yongsheng Zhang <https://github.com/ZYSzys>
44 +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
45 +
46 +// NOTE: These definitions support NodeJS and TypeScript 3.7.
47 +// Typically type modifications should be made in base.d.ts instead of here
48 +
49 +/// <reference path="base.d.ts" />
50 +
51 +// NOTE: TypeScript version-specific augmentations can be found in the following paths:
52 +// - ~/base.d.ts - Shared definitions common to all TypeScript versions
53 +// - ~/index.d.ts - Definitions specific to TypeScript 2.8
54 +// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.5
55 +
56 +// NOTE: Augmentations for TypeScript 3.5 and later should use individual files for overrides
57 +// within the respective ~/ts3.5 (or later) folder. However, this is disallowed for versions
58 +// prior to TypeScript 3.5, so the older definitions will be found here.
This diff could not be displayed because it is too large.
1 +declare module 'module' {
2 + import { URL } from 'url';
3 + namespace Module {
4 + /**
5 + * Updates all the live bindings for builtin ES Modules to match the properties of the CommonJS exports.
6 + * It does not add or remove exported names from the ES Modules.
7 + */
8 + function syncBuiltinESMExports(): void;
9 +
10 + function findSourceMap(path: string, error?: Error): SourceMap;
11 + interface SourceMapPayload {
12 + file: string;
13 + version: number;
14 + sources: string[];
15 + sourcesContent: string[];
16 + names: string[];
17 + mappings: string;
18 + sourceRoot: string;
19 + }
20 +
21 + interface SourceMapping {
22 + generatedLine: number;
23 + generatedColumn: number;
24 + originalSource: string;
25 + originalLine: number;
26 + originalColumn: number;
27 + }
28 +
29 + class SourceMap {
30 + readonly payload: SourceMapPayload;
31 + constructor(payload: SourceMapPayload);
32 + findEntry(line: number, column: number): SourceMapping;
33 + }
34 + }
35 + interface Module extends NodeModule {}
36 + class Module {
37 + static runMain(): void;
38 + static wrap(code: string): string;
39 +
40 + /**
41 + * @deprecated Deprecated since: v12.2.0. Please use createRequire() instead.
42 + */
43 + static createRequireFromPath(path: string): NodeRequire;
44 + static createRequire(path: string | URL): NodeRequire;
45 + static builtinModules: string[];
46 +
47 + static Module: typeof Module;
48 +
49 + constructor(id: string, parent?: Module);
50 + }
51 + export = Module;
52 +}
This diff is collapsed. Click to expand it.
1 +declare module 'os' {
2 + interface CpuInfo {
3 + model: string;
4 + speed: number;
5 + times: {
6 + user: number;
7 + nice: number;
8 + sys: number;
9 + idle: number;
10 + irq: number;
11 + };
12 + }
13 +
14 + interface NetworkInterfaceBase {
15 + address: string;
16 + netmask: string;
17 + mac: string;
18 + internal: boolean;
19 + cidr: string | null;
20 + }
21 +
22 + interface NetworkInterfaceInfoIPv4 extends NetworkInterfaceBase {
23 + family: "IPv4";
24 + }
25 +
26 + interface NetworkInterfaceInfoIPv6 extends NetworkInterfaceBase {
27 + family: "IPv6";
28 + scopeid: number;
29 + }
30 +
31 + interface UserInfo<T> {
32 + username: T;
33 + uid: number;
34 + gid: number;
35 + shell: T;
36 + homedir: T;
37 + }
38 +
39 + type NetworkInterfaceInfo = NetworkInterfaceInfoIPv4 | NetworkInterfaceInfoIPv6;
40 +
41 + function hostname(): string;
42 + function loadavg(): number[];
43 + function uptime(): number;
44 + function freemem(): number;
45 + function totalmem(): number;
46 + function cpus(): CpuInfo[];
47 + function type(): string;
48 + function release(): string;
49 + function networkInterfaces(): NodeJS.Dict<NetworkInterfaceInfo[]>;
50 + function homedir(): string;
51 + function userInfo(options: { encoding: 'buffer' }): UserInfo<Buffer>;
52 + function userInfo(options?: { encoding: BufferEncoding }): UserInfo<string>;
53 +
54 + type SignalConstants = {
55 + [key in NodeJS.Signals]: number;
56 + };
57 +
58 + namespace constants {
59 + const UV_UDP_REUSEADDR: number;
60 + namespace signals {}
61 + const signals: SignalConstants;
62 + namespace errno {
63 + const E2BIG: number;
64 + const EACCES: number;
65 + const EADDRINUSE: number;
66 + const EADDRNOTAVAIL: number;
67 + const EAFNOSUPPORT: number;
68 + const EAGAIN: number;
69 + const EALREADY: number;
70 + const EBADF: number;
71 + const EBADMSG: number;
72 + const EBUSY: number;
73 + const ECANCELED: number;
74 + const ECHILD: number;
75 + const ECONNABORTED: number;
76 + const ECONNREFUSED: number;
77 + const ECONNRESET: number;
78 + const EDEADLK: number;
79 + const EDESTADDRREQ: number;
80 + const EDOM: number;
81 + const EDQUOT: number;
82 + const EEXIST: number;
83 + const EFAULT: number;
84 + const EFBIG: number;
85 + const EHOSTUNREACH: number;
86 + const EIDRM: number;
87 + const EILSEQ: number;
88 + const EINPROGRESS: number;
89 + const EINTR: number;
90 + const EINVAL: number;
91 + const EIO: number;
92 + const EISCONN: number;
93 + const EISDIR: number;
94 + const ELOOP: number;
95 + const EMFILE: number;
96 + const EMLINK: number;
97 + const EMSGSIZE: number;
98 + const EMULTIHOP: number;
99 + const ENAMETOOLONG: number;
100 + const ENETDOWN: number;
101 + const ENETRESET: number;
102 + const ENETUNREACH: number;
103 + const ENFILE: number;
104 + const ENOBUFS: number;
105 + const ENODATA: number;
106 + const ENODEV: number;
107 + const ENOENT: number;
108 + const ENOEXEC: number;
109 + const ENOLCK: number;
110 + const ENOLINK: number;
111 + const ENOMEM: number;
112 + const ENOMSG: number;
113 + const ENOPROTOOPT: number;
114 + const ENOSPC: number;
115 + const ENOSR: number;
116 + const ENOSTR: number;
117 + const ENOSYS: number;
118 + const ENOTCONN: number;
119 + const ENOTDIR: number;
120 + const ENOTEMPTY: number;
121 + const ENOTSOCK: number;
122 + const ENOTSUP: number;
123 + const ENOTTY: number;
124 + const ENXIO: number;
125 + const EOPNOTSUPP: number;
126 + const EOVERFLOW: number;
127 + const EPERM: number;
128 + const EPIPE: number;
129 + const EPROTO: number;
130 + const EPROTONOSUPPORT: number;
131 + const EPROTOTYPE: number;
132 + const ERANGE: number;
133 + const EROFS: number;
134 + const ESPIPE: number;
135 + const ESRCH: number;
136 + const ESTALE: number;
137 + const ETIME: number;
138 + const ETIMEDOUT: number;
139 + const ETXTBSY: number;
140 + const EWOULDBLOCK: number;
141 + const EXDEV: number;
142 + const WSAEINTR: number;
143 + const WSAEBADF: number;
144 + const WSAEACCES: number;
145 + const WSAEFAULT: number;
146 + const WSAEINVAL: number;
147 + const WSAEMFILE: number;
148 + const WSAEWOULDBLOCK: number;
149 + const WSAEINPROGRESS: number;
150 + const WSAEALREADY: number;
151 + const WSAENOTSOCK: number;
152 + const WSAEDESTADDRREQ: number;
153 + const WSAEMSGSIZE: number;
154 + const WSAEPROTOTYPE: number;
155 + const WSAENOPROTOOPT: number;
156 + const WSAEPROTONOSUPPORT: number;
157 + const WSAESOCKTNOSUPPORT: number;
158 + const WSAEOPNOTSUPP: number;
159 + const WSAEPFNOSUPPORT: number;
160 + const WSAEAFNOSUPPORT: number;
161 + const WSAEADDRINUSE: number;
162 + const WSAEADDRNOTAVAIL: number;
163 + const WSAENETDOWN: number;
164 + const WSAENETUNREACH: number;
165 + const WSAENETRESET: number;
166 + const WSAECONNABORTED: number;
167 + const WSAECONNRESET: number;
168 + const WSAENOBUFS: number;
169 + const WSAEISCONN: number;
170 + const WSAENOTCONN: number;
171 + const WSAESHUTDOWN: number;
172 + const WSAETOOMANYREFS: number;
173 + const WSAETIMEDOUT: number;
174 + const WSAECONNREFUSED: number;
175 + const WSAELOOP: number;
176 + const WSAENAMETOOLONG: number;
177 + const WSAEHOSTDOWN: number;
178 + const WSAEHOSTUNREACH: number;
179 + const WSAENOTEMPTY: number;
180 + const WSAEPROCLIM: number;
181 + const WSAEUSERS: number;
182 + const WSAEDQUOT: number;
183 + const WSAESTALE: number;
184 + const WSAEREMOTE: number;
185 + const WSASYSNOTREADY: number;
186 + const WSAVERNOTSUPPORTED: number;
187 + const WSANOTINITIALISED: number;
188 + const WSAEDISCON: number;
189 + const WSAENOMORE: number;
190 + const WSAECANCELLED: number;
191 + const WSAEINVALIDPROCTABLE: number;
192 + const WSAEINVALIDPROVIDER: number;
193 + const WSAEPROVIDERFAILEDINIT: number;
194 + const WSASYSCALLFAILURE: number;
195 + const WSASERVICE_NOT_FOUND: number;
196 + const WSATYPE_NOT_FOUND: number;
197 + const WSA_E_NO_MORE: number;
198 + const WSA_E_CANCELLED: number;
199 + const WSAEREFUSED: number;
200 + }
201 + namespace priority {
202 + const PRIORITY_LOW: number;
203 + const PRIORITY_BELOW_NORMAL: number;
204 + const PRIORITY_NORMAL: number;
205 + const PRIORITY_ABOVE_NORMAL: number;
206 + const PRIORITY_HIGH: number;
207 + const PRIORITY_HIGHEST: number;
208 + }
209 + }
210 +
211 + function arch(): string;
212 + /**
213 + * Returns a string identifying the kernel version.
214 + * On POSIX systems, the operating system release is determined by calling
215 + * [uname(3)][]. On Windows, `pRtlGetVersion` is used, and if it is not available,
216 + * `GetVersionExW()` will be used. See
217 + * https://en.wikipedia.org/wiki/Uname#Examples for more information.
218 + */
219 + function version(): string;
220 + function platform(): NodeJS.Platform;
221 + function tmpdir(): string;
222 + const EOL: string;
223 + function endianness(): "BE" | "LE";
224 + /**
225 + * Gets the priority of a process.
226 + * Defaults to current process.
227 + */
228 + function getPriority(pid?: number): number;
229 + /**
230 + * Sets the priority of the current process.
231 + * @param priority Must be in range of -20 to 19
232 + */
233 + function setPriority(priority: number): void;
234 + /**
235 + * Sets the priority of the process specified process.
236 + * @param priority Must be in range of -20 to 19
237 + */
238 + function setPriority(pid: number, priority: number): void;
239 +}
1 +{
2 + "_from": "@types/node@*",
3 + "_id": "@types/node@15.6.1",
4 + "_inBundle": false,
5 + "_integrity": "sha512-7EIraBEyRHEe7CH+Fm1XvgqU6uwZN8Q7jppJGcqjROMT29qhAuuOxYB1uEY5UMYQKEmA5D+5tBnhdaPXSsLONA==",
6 + "_location": "/@types/node",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "@types/node@*",
12 + "name": "@types/node",
13 + "escapedName": "@types%2fnode",
14 + "scope": "@types",
15 + "rawSpec": "*",
16 + "saveSpec": null,
17 + "fetchSpec": "*"
18 + },
19 + "_requiredBy": [
20 + "/@types/bson",
21 + "/@types/mongodb"
22 + ],
23 + "_resolved": "https://registry.npmjs.org/@types/node/-/node-15.6.1.tgz",
24 + "_shasum": "32d43390d5c62c5b6ec486a9bc9c59544de39a08",
25 + "_spec": "@types/node@*",
26 + "_where": "/Users/mindyeoi/Desktop/We-Shop/boiler-plate/node_modules/@types/mongodb",
27 + "bugs": {
28 + "url": "https://github.com/DefinitelyTyped/DefinitelyTyped/issues"
29 + },
30 + "bundleDependencies": false,
31 + "contributors": [
32 + {
33 + "name": "Microsoft TypeScript",
34 + "url": "https://github.com/Microsoft"
35 + },
36 + {
37 + "name": "DefinitelyTyped",
38 + "url": "https://github.com/DefinitelyTyped"
39 + },
40 + {
41 + "name": "Alberto Schiabel",
42 + "url": "https://github.com/jkomyno"
43 + },
44 + {
45 + "name": "Alvis HT Tang",
46 + "url": "https://github.com/alvis"
47 + },
48 + {
49 + "name": "Andrew Makarov",
50 + "url": "https://github.com/r3nya"
51 + },
52 + {
53 + "name": "Benjamin Toueg",
54 + "url": "https://github.com/btoueg"
55 + },
56 + {
57 + "name": "Chigozirim C.",
58 + "url": "https://github.com/smac89"
59 + },
60 + {
61 + "name": "David Junger",
62 + "url": "https://github.com/touffy"
63 + },
64 + {
65 + "name": "Deividas Bakanas",
66 + "url": "https://github.com/DeividasBakanas"
67 + },
68 + {
69 + "name": "Eugene Y. Q. Shen",
70 + "url": "https://github.com/eyqs"
71 + },
72 + {
73 + "name": "Hannes Magnusson",
74 + "url": "https://github.com/Hannes-Magnusson-CK"
75 + },
76 + {
77 + "name": "Hoàng Văn Khải",
78 + "url": "https://github.com/KSXGitHub"
79 + },
80 + {
81 + "name": "Huw",
82 + "url": "https://github.com/hoo29"
83 + },
84 + {
85 + "name": "Kelvin Jin",
86 + "url": "https://github.com/kjin"
87 + },
88 + {
89 + "name": "Klaus Meinhardt",
90 + "url": "https://github.com/ajafff"
91 + },
92 + {
93 + "name": "Lishude",
94 + "url": "https://github.com/islishude"
95 + },
96 + {
97 + "name": "Mariusz Wiktorczyk",
98 + "url": "https://github.com/mwiktorczyk"
99 + },
100 + {
101 + "name": "Mohsen Azimi",
102 + "url": "https://github.com/mohsen1"
103 + },
104 + {
105 + "name": "Nicolas Even",
106 + "url": "https://github.com/n-e"
107 + },
108 + {
109 + "name": "Nikita Galkin",
110 + "url": "https://github.com/galkin"
111 + },
112 + {
113 + "name": "Parambir Singh",
114 + "url": "https://github.com/parambirs"
115 + },
116 + {
117 + "name": "Sebastian Silbermann",
118 + "url": "https://github.com/eps1lon"
119 + },
120 + {
121 + "name": "Simon Schick",
122 + "url": "https://github.com/SimonSchick"
123 + },
124 + {
125 + "name": "Thomas den Hollander",
126 + "url": "https://github.com/ThomasdenH"
127 + },
128 + {
129 + "name": "Wilco Bakker",
130 + "url": "https://github.com/WilcoBakker"
131 + },
132 + {
133 + "name": "wwwy3y3",
134 + "url": "https://github.com/wwwy3y3"
135 + },
136 + {
137 + "name": "Samuel Ainsworth",
138 + "url": "https://github.com/samuela"
139 + },
140 + {
141 + "name": "Kyle Uehlein",
142 + "url": "https://github.com/kuehlein"
143 + },
144 + {
145 + "name": "Thanik Bhongbhibhat",
146 + "url": "https://github.com/bhongy"
147 + },
148 + {
149 + "name": "Marcin Kopacz",
150 + "url": "https://github.com/chyzwar"
151 + },
152 + {
153 + "name": "Trivikram Kamat",
154 + "url": "https://github.com/trivikr"
155 + },
156 + {
157 + "name": "Minh Son Nguyen",
158 + "url": "https://github.com/nguymin4"
159 + },
160 + {
161 + "name": "Junxiao Shi",
162 + "url": "https://github.com/yoursunny"
163 + },
164 + {
165 + "name": "Ilia Baryshnikov",
166 + "url": "https://github.com/qwelias"
167 + },
168 + {
169 + "name": "ExE Boss",
170 + "url": "https://github.com/ExE-Boss"
171 + },
172 + {
173 + "name": "Surasak Chaisurin",
174 + "url": "https://github.com/Ryan-Willpower"
175 + },
176 + {
177 + "name": "Piotr Błażejewicz",
178 + "url": "https://github.com/peterblazejewicz"
179 + },
180 + {
181 + "name": "Anna Henningsen",
182 + "url": "https://github.com/addaleax"
183 + },
184 + {
185 + "name": "Jason Kwok",
186 + "url": "https://github.com/JasonHK"
187 + },
188 + {
189 + "name": "Victor Perin",
190 + "url": "https://github.com/victorperin"
191 + },
192 + {
193 + "name": "Yongsheng Zhang",
194 + "url": "https://github.com/ZYSzys"
195 + }
196 + ],
197 + "dependencies": {},
198 + "deprecated": false,
199 + "description": "TypeScript definitions for Node.js",
200 + "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped#readme",
201 + "license": "MIT",
202 + "main": "",
203 + "name": "@types/node",
204 + "repository": {
205 + "type": "git",
206 + "url": "git+https://github.com/DefinitelyTyped/DefinitelyTyped.git",
207 + "directory": "types/node"
208 + },
209 + "scripts": {},
210 + "typeScriptVersion": "3.5",
211 + "types": "index.d.ts",
212 + "typesPublisherContentHash": "f8f8a539a80cc272f918927a96e6cef5cc69df79ec257791f25651eb317ea354",
213 + "typesVersions": {
214 + "<=3.6": {
215 + "*": [
216 + "ts3.6/*"
217 + ]
218 + }
219 + },
220 + "version": "15.6.1"
221 +}
1 +declare module 'path/posix' {
2 + import path = require('path');
3 + export = path;
4 +}
5 +
6 +declare module 'path/win32' {
7 + import path = require('path');
8 + export = path;
9 +}
10 +
11 +declare module 'path' {
12 + namespace path {
13 + /**
14 + * A parsed path object generated by path.parse() or consumed by path.format().
15 + */
16 + interface ParsedPath {
17 + /**
18 + * The root of the path such as '/' or 'c:\'
19 + */
20 + root: string;
21 + /**
22 + * The full directory path such as '/home/user/dir' or 'c:\path\dir'
23 + */
24 + dir: string;
25 + /**
26 + * The file name including extension (if any) such as 'index.html'
27 + */
28 + base: string;
29 + /**
30 + * The file extension (if any) such as '.html'
31 + */
32 + ext: string;
33 + /**
34 + * The file name without extension (if any) such as 'index'
35 + */
36 + name: string;
37 + }
38 +
39 + interface FormatInputPathObject {
40 + /**
41 + * The root of the path such as '/' or 'c:\'
42 + */
43 + root?: string;
44 + /**
45 + * The full directory path such as '/home/user/dir' or 'c:\path\dir'
46 + */
47 + dir?: string;
48 + /**
49 + * The file name including extension (if any) such as 'index.html'
50 + */
51 + base?: string;
52 + /**
53 + * The file extension (if any) such as '.html'
54 + */
55 + ext?: string;
56 + /**
57 + * The file name without extension (if any) such as 'index'
58 + */
59 + name?: string;
60 + }
61 +
62 + interface PlatformPath {
63 + /**
64 + * Normalize a string path, reducing '..' and '.' parts.
65 + * When multiple slashes are found, they're replaced by a single one; when the path contains a trailing slash, it is preserved. On Windows backslashes are used.
66 + *
67 + * @param p string path to normalize.
68 + */
69 + normalize(p: string): string;
70 + /**
71 + * Join all arguments together and normalize the resulting path.
72 + * Arguments must be strings. In v0.8, non-string arguments were silently ignored. In v0.10 and up, an exception is thrown.
73 + *
74 + * @param paths paths to join.
75 + */
76 + join(...paths: string[]): string;
77 + /**
78 + * The right-most parameter is considered {to}. Other parameters are considered an array of {from}.
79 + *
80 + * Starting from leftmost {from} parameter, resolves {to} to an absolute path.
81 + *
82 + * If {to} isn't already absolute, {from} arguments are prepended in right to left order,
83 + * until an absolute path is found. If after using all {from} paths still no absolute path is found,
84 + * the current working directory is used as well. The resulting path is normalized,
85 + * and trailing slashes are removed unless the path gets resolved to the root directory.
86 + *
87 + * @param pathSegments string paths to join. Non-string arguments are ignored.
88 + */
89 + resolve(...pathSegments: string[]): string;
90 + /**
91 + * Determines whether {path} is an absolute path. An absolute path will always resolve to the same location, regardless of the working directory.
92 + *
93 + * @param path path to test.
94 + */
95 + isAbsolute(p: string): boolean;
96 + /**
97 + * Solve the relative path from {from} to {to}.
98 + * At times we have two absolute paths, and we need to derive the relative path from one to the other. This is actually the reverse transform of path.resolve.
99 + */
100 + relative(from: string, to: string): string;
101 + /**
102 + * Return the directory name of a path. Similar to the Unix dirname command.
103 + *
104 + * @param p the path to evaluate.
105 + */
106 + dirname(p: string): string;
107 + /**
108 + * Return the last portion of a path. Similar to the Unix basename command.
109 + * Often used to extract the file name from a fully qualified path.
110 + *
111 + * @param p the path to evaluate.
112 + * @param ext optionally, an extension to remove from the result.
113 + */
114 + basename(p: string, ext?: string): string;
115 + /**
116 + * Return the extension of the path, from the last '.' to end of string in the last portion of the path.
117 + * If there is no '.' in the last portion of the path or the first character of it is '.', then it returns an empty string
118 + *
119 + * @param p the path to evaluate.
120 + */
121 + extname(p: string): string;
122 + /**
123 + * The platform-specific file separator. '\\' or '/'.
124 + */
125 + readonly sep: string;
126 + /**
127 + * The platform-specific file delimiter. ';' or ':'.
128 + */
129 + readonly delimiter: string;
130 + /**
131 + * Returns an object from a path string - the opposite of format().
132 + *
133 + * @param pathString path to evaluate.
134 + */
135 + parse(p: string): ParsedPath;
136 + /**
137 + * Returns a path string from an object - the opposite of parse().
138 + *
139 + * @param pathString path to evaluate.
140 + */
141 + format(pP: FormatInputPathObject): string;
142 + /**
143 + * On Windows systems only, returns an equivalent namespace-prefixed path for the given path.
144 + * If path is not a string, path will be returned without modifications.
145 + * This method is meaningful only on Windows system.
146 + * On POSIX systems, the method is non-operational and always returns path without modifications.
147 + */
148 + toNamespacedPath(path: string): string;
149 + /**
150 + * Posix specific pathing.
151 + * Same as parent object on posix.
152 + */
153 + readonly posix: PlatformPath;
154 + /**
155 + * Windows specific pathing.
156 + * Same as parent object on windows
157 + */
158 + readonly win32: PlatformPath;
159 + }
160 + }
161 + const path: path.PlatformPath;
162 + export = path;
163 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +/**
2 + * @deprecated since v7.0.0
3 + * The version of the punycode module bundled in Node.js is being deprecated.
4 + * In a future major version of Node.js this module will be removed.
5 + * Users currently depending on the punycode module should switch to using
6 + * the userland-provided Punycode.js module instead.
7 + */
8 +declare module 'punycode' {
9 + /**
10 + * @deprecated since v7.0.0
11 + * The version of the punycode module bundled in Node.js is being deprecated.
12 + * In a future major version of Node.js this module will be removed.
13 + * Users currently depending on the punycode module should switch to using
14 + * the userland-provided Punycode.js module instead.
15 + */
16 + function decode(string: string): string;
17 + /**
18 + * @deprecated since v7.0.0
19 + * The version of the punycode module bundled in Node.js is being deprecated.
20 + * In a future major version of Node.js this module will be removed.
21 + * Users currently depending on the punycode module should switch to using
22 + * the userland-provided Punycode.js module instead.
23 + */
24 + function encode(string: string): string;
25 + /**
26 + * @deprecated since v7.0.0
27 + * The version of the punycode module bundled in Node.js is being deprecated.
28 + * In a future major version of Node.js this module will be removed.
29 + * Users currently depending on the punycode module should switch to using
30 + * the userland-provided Punycode.js module instead.
31 + */
32 + function toUnicode(domain: string): string;
33 + /**
34 + * @deprecated since v7.0.0
35 + * The version of the punycode module bundled in Node.js is being deprecated.
36 + * In a future major version of Node.js this module will be removed.
37 + * Users currently depending on the punycode module should switch to using
38 + * the userland-provided Punycode.js module instead.
39 + */
40 + function toASCII(domain: string): string;
41 + /**
42 + * @deprecated since v7.0.0
43 + * The version of the punycode module bundled in Node.js is being deprecated.
44 + * In a future major version of Node.js this module will be removed.
45 + * Users currently depending on the punycode module should switch to using
46 + * the userland-provided Punycode.js module instead.
47 + */
48 + const ucs2: ucs2;
49 + interface ucs2 {
50 + /**
51 + * @deprecated since v7.0.0
52 + * The version of the punycode module bundled in Node.js is being deprecated.
53 + * In a future major version of Node.js this module will be removed.
54 + * Users currently depending on the punycode module should switch to using
55 + * the userland-provided Punycode.js module instead.
56 + */
57 + decode(string: string): number[];
58 + /**
59 + * @deprecated since v7.0.0
60 + * The version of the punycode module bundled in Node.js is being deprecated.
61 + * In a future major version of Node.js this module will be removed.
62 + * Users currently depending on the punycode module should switch to using
63 + * the userland-provided Punycode.js module instead.
64 + */
65 + encode(codePoints: ReadonlyArray<number>): string;
66 + }
67 + /**
68 + * @deprecated since v7.0.0
69 + * The version of the punycode module bundled in Node.js is being deprecated.
70 + * In a future major version of Node.js this module will be removed.
71 + * Users currently depending on the punycode module should switch to using
72 + * the userland-provided Punycode.js module instead.
73 + */
74 + const version: string;
75 +}
1 +declare module 'querystring' {
2 + interface StringifyOptions {
3 + encodeURIComponent?: (str: string) => string;
4 + }
5 +
6 + interface ParseOptions {
7 + maxKeys?: number;
8 + decodeURIComponent?: (str: string) => string;
9 + }
10 +
11 + interface ParsedUrlQuery extends NodeJS.Dict<string | string[]> { }
12 +
13 + interface ParsedUrlQueryInput extends NodeJS.Dict<string | number | boolean | ReadonlyArray<string> | ReadonlyArray<number> | ReadonlyArray<boolean> | null> {
14 + }
15 +
16 + function stringify(obj?: ParsedUrlQueryInput, sep?: string, eq?: string, options?: StringifyOptions): string;
17 + function parse(str: string, sep?: string, eq?: string, options?: ParseOptions): ParsedUrlQuery;
18 + /**
19 + * The querystring.encode() function is an alias for querystring.stringify().
20 + */
21 + const encode: typeof stringify;
22 + /**
23 + * The querystring.decode() function is an alias for querystring.parse().
24 + */
25 + const decode: typeof parse;
26 + function escape(str: string): string;
27 + function unescape(str: string): string;
28 +}
1 +declare module 'readline' {
2 + import EventEmitter = require('events');
3 +
4 + interface Key {
5 + sequence?: string;
6 + name?: string;
7 + ctrl?: boolean;
8 + meta?: boolean;
9 + shift?: boolean;
10 + }
11 +
12 + class Interface extends EventEmitter {
13 + readonly terminal: boolean;
14 +
15 + // Need direct access to line/cursor data, for use in external processes
16 + // see: https://github.com/nodejs/node/issues/30347
17 + /** The current input data */
18 + readonly line: string;
19 + /** The current cursor position in the input line */
20 + readonly cursor: number;
21 +
22 + /**
23 + * NOTE: According to the documentation:
24 + *
25 + * > Instances of the `readline.Interface` class are constructed using the
26 + * > `readline.createInterface()` method.
27 + *
28 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
29 + */
30 + protected constructor(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean);
31 + /**
32 + * NOTE: According to the documentation:
33 + *
34 + * > Instances of the `readline.Interface` class are constructed using the
35 + * > `readline.createInterface()` method.
36 + *
37 + * @see https://nodejs.org/dist/latest-v10.x/docs/api/readline.html#readline_class_interface
38 + */
39 + protected constructor(options: ReadLineOptions);
40 +
41 + getPrompt(): string;
42 + setPrompt(prompt: string): void;
43 + prompt(preserveCursor?: boolean): void;
44 + question(query: string, callback: (answer: string) => void): void;
45 + pause(): this;
46 + resume(): this;
47 + close(): void;
48 + write(data: string | Buffer, key?: Key): void;
49 +
50 + /**
51 + * Returns the real position of the cursor in relation to the input
52 + * prompt + string. Long input (wrapping) strings, as well as multiple
53 + * line prompts are included in the calculations.
54 + */
55 + getCursorPos(): CursorPos;
56 +
57 + /**
58 + * events.EventEmitter
59 + * 1. close
60 + * 2. line
61 + * 3. pause
62 + * 4. resume
63 + * 5. SIGCONT
64 + * 6. SIGINT
65 + * 7. SIGTSTP
66 + */
67 +
68 + addListener(event: string, listener: (...args: any[]) => void): this;
69 + addListener(event: "close", listener: () => void): this;
70 + addListener(event: "line", listener: (input: string) => void): this;
71 + addListener(event: "pause", listener: () => void): this;
72 + addListener(event: "resume", listener: () => void): this;
73 + addListener(event: "SIGCONT", listener: () => void): this;
74 + addListener(event: "SIGINT", listener: () => void): this;
75 + addListener(event: "SIGTSTP", listener: () => void): this;
76 +
77 + emit(event: string | symbol, ...args: any[]): boolean;
78 + emit(event: "close"): boolean;
79 + emit(event: "line", input: string): boolean;
80 + emit(event: "pause"): boolean;
81 + emit(event: "resume"): boolean;
82 + emit(event: "SIGCONT"): boolean;
83 + emit(event: "SIGINT"): boolean;
84 + emit(event: "SIGTSTP"): boolean;
85 +
86 + on(event: string, listener: (...args: any[]) => void): this;
87 + on(event: "close", listener: () => void): this;
88 + on(event: "line", listener: (input: string) => void): this;
89 + on(event: "pause", listener: () => void): this;
90 + on(event: "resume", listener: () => void): this;
91 + on(event: "SIGCONT", listener: () => void): this;
92 + on(event: "SIGINT", listener: () => void): this;
93 + on(event: "SIGTSTP", listener: () => void): this;
94 +
95 + once(event: string, listener: (...args: any[]) => void): this;
96 + once(event: "close", listener: () => void): this;
97 + once(event: "line", listener: (input: string) => void): this;
98 + once(event: "pause", listener: () => void): this;
99 + once(event: "resume", listener: () => void): this;
100 + once(event: "SIGCONT", listener: () => void): this;
101 + once(event: "SIGINT", listener: () => void): this;
102 + once(event: "SIGTSTP", listener: () => void): this;
103 +
104 + prependListener(event: string, listener: (...args: any[]) => void): this;
105 + prependListener(event: "close", listener: () => void): this;
106 + prependListener(event: "line", listener: (input: string) => void): this;
107 + prependListener(event: "pause", listener: () => void): this;
108 + prependListener(event: "resume", listener: () => void): this;
109 + prependListener(event: "SIGCONT", listener: () => void): this;
110 + prependListener(event: "SIGINT", listener: () => void): this;
111 + prependListener(event: "SIGTSTP", listener: () => void): this;
112 +
113 + prependOnceListener(event: string, listener: (...args: any[]) => void): this;
114 + prependOnceListener(event: "close", listener: () => void): this;
115 + prependOnceListener(event: "line", listener: (input: string) => void): this;
116 + prependOnceListener(event: "pause", listener: () => void): this;
117 + prependOnceListener(event: "resume", listener: () => void): this;
118 + prependOnceListener(event: "SIGCONT", listener: () => void): this;
119 + prependOnceListener(event: "SIGINT", listener: () => void): this;
120 + prependOnceListener(event: "SIGTSTP", listener: () => void): this;
121 + [Symbol.asyncIterator](): AsyncIterableIterator<string>;
122 + }
123 +
124 + type ReadLine = Interface; // type forwarded for backwards compatibility
125 +
126 + type Completer = (line: string) => CompleterResult;
127 + type AsyncCompleter = (line: string, callback: (err?: null | Error, result?: CompleterResult) => void) => any;
128 +
129 + type CompleterResult = [string[], string];
130 +
131 + interface ReadLineOptions {
132 + input: NodeJS.ReadableStream;
133 + output?: NodeJS.WritableStream;
134 + completer?: Completer | AsyncCompleter;
135 + terminal?: boolean;
136 + historySize?: number;
137 + prompt?: string;
138 + crlfDelay?: number;
139 + removeHistoryDuplicates?: boolean;
140 + escapeCodeTimeout?: number;
141 + tabSize?: number;
142 + }
143 +
144 + function createInterface(input: NodeJS.ReadableStream, output?: NodeJS.WritableStream, completer?: Completer | AsyncCompleter, terminal?: boolean): Interface;
145 + function createInterface(options: ReadLineOptions): Interface;
146 + function emitKeypressEvents(stream: NodeJS.ReadableStream, readlineInterface?: Interface): void;
147 +
148 + type Direction = -1 | 0 | 1;
149 +
150 + interface CursorPos {
151 + rows: number;
152 + cols: number;
153 + }
154 +
155 + /**
156 + * Clears the current line of this WriteStream in a direction identified by `dir`.
157 + */
158 + function clearLine(stream: NodeJS.WritableStream, dir: Direction, callback?: () => void): boolean;
159 + /**
160 + * Clears this `WriteStream` from the current cursor down.
161 + */
162 + function clearScreenDown(stream: NodeJS.WritableStream, callback?: () => void): boolean;
163 + /**
164 + * Moves this WriteStream's cursor to the specified position.
165 + */
166 + function cursorTo(stream: NodeJS.WritableStream, x: number, y?: number, callback?: () => void): boolean;
167 + /**
168 + * Moves this WriteStream's cursor relative to its current position.
169 + */
170 + function moveCursor(stream: NodeJS.WritableStream, dx: number, dy: number, callback?: () => void): boolean;
171 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +declare module "stream/promises" {
2 + import { FinishedOptions, PipelineSource, PipelineTransform,
3 + PipelineDestination, PipelinePromise, PipelineOptions } from "stream";
4 +
5 + function finished(stream: NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream, options?: FinishedOptions): Promise<void>;
6 +
7 + function pipeline<A extends PipelineSource<any>,
8 + B extends PipelineDestination<A, any>>(
9 + source: A,
10 + destination: B,
11 + options?: PipelineOptions
12 + ): PipelinePromise<B>;
13 + function pipeline<A extends PipelineSource<any>,
14 + T1 extends PipelineTransform<A, any>,
15 + B extends PipelineDestination<T1, any>>(
16 + source: A,
17 + transform1: T1,
18 + destination: B,
19 + options?: PipelineOptions
20 + ): PipelinePromise<B>;
21 + function pipeline<A extends PipelineSource<any>,
22 + T1 extends PipelineTransform<A, any>,
23 + T2 extends PipelineTransform<T1, any>,
24 + B extends PipelineDestination<T2, any>>(
25 + source: A,
26 + transform1: T1,
27 + transform2: T2,
28 + destination: B,
29 + options?: PipelineOptions
30 + ): PipelinePromise<B>;
31 + function pipeline<A extends PipelineSource<any>,
32 + T1 extends PipelineTransform<A, any>,
33 + T2 extends PipelineTransform<T1, any>,
34 + T3 extends PipelineTransform<T2, any>,
35 + B extends PipelineDestination<T3, any>>(
36 + source: A,
37 + transform1: T1,
38 + transform2: T2,
39 + transform3: T3,
40 + destination: B,
41 + options?: PipelineOptions
42 + ): PipelinePromise<B>;
43 + function pipeline<A extends PipelineSource<any>,
44 + T1 extends PipelineTransform<A, any>,
45 + T2 extends PipelineTransform<T1, any>,
46 + T3 extends PipelineTransform<T2, any>,
47 + T4 extends PipelineTransform<T3, any>,
48 + B extends PipelineDestination<T4, any>>(
49 + source: A,
50 + transform1: T1,
51 + transform2: T2,
52 + transform3: T3,
53 + transform4: T4,
54 + destination: B,
55 + options?: PipelineOptions
56 + ): PipelinePromise<B>;
57 +
58 + function pipeline(
59 + streams: ReadonlyArray<NodeJS.ReadableStream | NodeJS.WritableStream | NodeJS.ReadWriteStream>,
60 + options?: PipelineOptions
61 + ): Promise<void>;
62 + function pipeline(
63 + stream1: NodeJS.ReadableStream,
64 + stream2: NodeJS.ReadWriteStream | NodeJS.WritableStream,
65 + ...streams: Array<NodeJS.ReadWriteStream | NodeJS.WritableStream | PipelineOptions>,
66 + ): Promise<void>;
67 +}
1 +declare module 'string_decoder' {
2 + class StringDecoder {
3 + constructor(encoding?: BufferEncoding);
4 + write(buffer: Buffer): string;
5 + end(buffer?: Buffer): string;
6 + }
7 +}
1 +declare module 'timers' {
2 + interface TimerOptions {
3 + /**
4 + * Set to `false` to indicate that the scheduled `Timeout`
5 + * should not require the Node.js event loop to remain active.
6 + * @default true
7 + */
8 + ref?: boolean;
9 +
10 + /**
11 + * An optional `AbortSignal` that can be used to cancel the scheduled `Timeout`.
12 + */
13 + signal?: AbortSignal;
14 + }
15 +
16 + function setTimeout(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
17 + namespace setTimeout {
18 + function __promisify__(ms: number): Promise<void>;
19 + function __promisify__<T>(ms: number, value: T, options?: TimerOptions): Promise<T>;
20 + }
21 + function clearTimeout(timeoutId: NodeJS.Timeout): void;
22 + function setInterval(callback: (...args: any[]) => void, ms?: number, ...args: any[]): NodeJS.Timeout;
23 + function clearInterval(intervalId: NodeJS.Timeout): void;
24 + function setImmediate(callback: (...args: any[]) => void, ...args: any[]): NodeJS.Immediate;
25 + namespace setImmediate {
26 + function __promisify__(): Promise<void>;
27 + function __promisify__<T>(value: T, options?: TimerOptions): Promise<T>;
28 + }
29 + function clearImmediate(immediateId: NodeJS.Immediate): void;
30 +}
1 +declare module 'timers/promises' {
2 + import { TimerOptions } from 'timers';
3 +
4 + /**
5 + * Returns a promise that resolves after the specified delay in milliseconds.
6 + */
7 + function setTimeout<T>(delay: number, value?: T, options?: TimerOptions): Promise<T>;
8 +
9 + /**
10 + * Returns a promise that resolves in the next tick.
11 + */
12 + function setImmediate<T>(value: T, options?: TimerOptions): Promise<T>;
13 +}
This diff is collapsed. Click to expand it.
1 +declare module 'trace_events' {
2 + /**
3 + * The `Tracing` object is used to enable or disable tracing for sets of
4 + * categories. Instances are created using the
5 + * `trace_events.createTracing()` method.
6 + *
7 + * When created, the `Tracing` object is disabled. Calling the
8 + * `tracing.enable()` method adds the categories to the set of enabled trace
9 + * event categories. Calling `tracing.disable()` will remove the categories
10 + * from the set of enabled trace event categories.
11 + */
12 + interface Tracing {
13 + /**
14 + * A comma-separated list of the trace event categories covered by this
15 + * `Tracing` object.
16 + */
17 + readonly categories: string;
18 +
19 + /**
20 + * Disables this `Tracing` object.
21 + *
22 + * Only trace event categories _not_ covered by other enabled `Tracing`
23 + * objects and _not_ specified by the `--trace-event-categories` flag
24 + * will be disabled.
25 + */
26 + disable(): void;
27 +
28 + /**
29 + * Enables this `Tracing` object for the set of categories covered by
30 + * the `Tracing` object.
31 + */
32 + enable(): void;
33 +
34 + /**
35 + * `true` only if the `Tracing` object has been enabled.
36 + */
37 + readonly enabled: boolean;
38 + }
39 +
40 + interface CreateTracingOptions {
41 + /**
42 + * An array of trace category names. Values included in the array are
43 + * coerced to a string when possible. An error will be thrown if the
44 + * value cannot be coerced.
45 + */
46 + categories: string[];
47 + }
48 +
49 + /**
50 + * Creates and returns a Tracing object for the given set of categories.
51 + */
52 + function createTracing(options: CreateTracingOptions): Tracing;
53 +
54 + /**
55 + * Returns a comma-separated list of all currently-enabled trace event
56 + * categories. The current set of enabled trace event categories is
57 + * determined by the union of all currently-enabled `Tracing` objects and
58 + * any categories enabled using the `--trace-event-categories` flag.
59 + */
60 + function getEnabledCategories(): string | undefined;
61 +}
1 +declare module 'assert' {
2 + /** An alias of `assert.ok()`. */
3 + function assert(value: any, message?: string | Error): void;
4 + namespace assert {
5 + class AssertionError extends Error {
6 + actual: any;
7 + expected: any;
8 + operator: string;
9 + generatedMessage: boolean;
10 + code: 'ERR_ASSERTION';
11 +
12 + constructor(options?: {
13 + /** If provided, the error message is set to this value. */
14 + message?: string;
15 + /** The `actual` property on the error instance. */
16 + actual?: any;
17 + /** The `expected` property on the error instance. */
18 + expected?: any;
19 + /** The `operator` property on the error instance. */
20 + operator?: string;
21 + /** If provided, the generated stack trace omits frames before this function. */
22 + // tslint:disable-next-line:ban-types
23 + stackStartFn?: Function;
24 + });
25 + }
26 +
27 + class CallTracker {
28 + calls(exact?: number): () => void;
29 + calls<Func extends (...args: any[]) => any>(fn?: Func, exact?: number): Func;
30 + report(): CallTrackerReportInformation[];
31 + verify(): void;
32 + }
33 + interface CallTrackerReportInformation {
34 + message: string;
35 + /** The actual number of times the function was called. */
36 + actual: number;
37 + /** The number of times the function was expected to be called. */
38 + expected: number;
39 + /** The name of the function that is wrapped. */
40 + operator: string;
41 + /** A stack trace of the function. */
42 + stack: object;
43 + }
44 +
45 + type AssertPredicate = RegExp | (new () => object) | ((thrown: any) => boolean) | object | Error;
46 +
47 + function fail(message?: string | Error): never;
48 + /** @deprecated since v10.0.0 - use fail([message]) or other assert functions instead. */
49 + function fail(
50 + actual: any,
51 + expected: any,
52 + message?: string | Error,
53 + operator?: string,
54 + // tslint:disable-next-line:ban-types
55 + stackStartFn?: Function,
56 + ): never;
57 + function ok(value: any, message?: string | Error): void;
58 + /** @deprecated since v9.9.0 - use strictEqual() instead. */
59 + function equal(actual: any, expected: any, message?: string | Error): void;
60 + /** @deprecated since v9.9.0 - use notStrictEqual() instead. */
61 + function notEqual(actual: any, expected: any, message?: string | Error): void;
62 + /** @deprecated since v9.9.0 - use deepStrictEqual() instead. */
63 + function deepEqual(actual: any, expected: any, message?: string | Error): void;
64 + /** @deprecated since v9.9.0 - use notDeepStrictEqual() instead. */
65 + function notDeepEqual(actual: any, expected: any, message?: string | Error): void;
66 + function strictEqual(actual: any, expected: any, message?: string | Error): void;
67 + function notStrictEqual(actual: any, expected: any, message?: string | Error): void;
68 + function deepStrictEqual(actual: any, expected: any, message?: string | Error): void;
69 + function notDeepStrictEqual(actual: any, expected: any, message?: string | Error): void;
70 +
71 + function throws(block: () => any, message?: string | Error): void;
72 + function throws(block: () => any, error: AssertPredicate, message?: string | Error): void;
73 + function doesNotThrow(block: () => any, message?: string | Error): void;
74 + function doesNotThrow(block: () => any, error: AssertPredicate, message?: string | Error): void;
75 +
76 + function ifError(value: any): void;
77 +
78 + function rejects(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
79 + function rejects(
80 + block: (() => Promise<any>) | Promise<any>,
81 + error: AssertPredicate,
82 + message?: string | Error,
83 + ): Promise<void>;
84 + function doesNotReject(block: (() => Promise<any>) | Promise<any>, message?: string | Error): Promise<void>;
85 + function doesNotReject(
86 + block: (() => Promise<any>) | Promise<any>,
87 + error: AssertPredicate,
88 + message?: string | Error,
89 + ): Promise<void>;
90 +
91 + function match(value: string, regExp: RegExp, message?: string | Error): void;
92 + function doesNotMatch(value: string, regExp: RegExp, message?: string | Error): void;
93 +
94 + const strict: typeof assert;
95 + }
96 +
97 + export = assert;
98 +}
1 +// NOTE: These definitions support NodeJS and TypeScript 3.6 and earlier.
2 +
3 +// NOTE: TypeScript version-specific augmentations can be found in the following paths:
4 +// - ~/base.d.ts - Shared definitions common to all TypeScript versions
5 +// - ~/index.d.ts - Definitions specific to TypeScript 3.7 and above
6 +// - ~/ts3.5/base.d.ts - Definitions specific to TypeScript 3.6 and earlier
7 +// - ~/ts3.5/index.d.ts - Definitions specific to TypeScript 3.6 and earlier with assert pulled in
8 +
9 +// Reference required types from the default lib:
10 +/// <reference lib="es2018" />
11 +/// <reference lib="esnext.asynciterable" />
12 +/// <reference lib="esnext.intl" />
13 +/// <reference lib="esnext.bigint" />
14 +
15 +// Base definitions for all NodeJS modules that are not specific to any version of TypeScript:
16 +/// <reference path="../assert/strict.d.ts" />
17 +/// <reference path="../globals.d.ts" />
18 +/// <reference path="../async_hooks.d.ts" />
19 +/// <reference path="../buffer.d.ts" />
20 +/// <reference path="../child_process.d.ts" />
21 +/// <reference path="../cluster.d.ts" />
22 +/// <reference path="../console.d.ts" />
23 +/// <reference path="../constants.d.ts" />
24 +/// <reference path="../crypto.d.ts" />
25 +/// <reference path="../dgram.d.ts" />
26 +/// <reference path="../diagnostic_channel.d.ts" />
27 +/// <reference path="../dns.d.ts" />
28 +/// <reference path="../dns/promises.d.ts" />
29 +/// <reference path="../dns/promises.d.ts" />
30 +/// <reference path="../domain.d.ts" />
31 +/// <reference path="../events.d.ts" />
32 +/// <reference path="../fs.d.ts" />
33 +/// <reference path="../fs/promises.d.ts" />
34 +/// <reference path="../http.d.ts" />
35 +/// <reference path="../http2.d.ts" />
36 +/// <reference path="../https.d.ts" />
37 +/// <reference path="../inspector.d.ts" />
38 +/// <reference path="../module.d.ts" />
39 +/// <reference path="../net.d.ts" />
40 +/// <reference path="../os.d.ts" />
41 +/// <reference path="../path.d.ts" />
42 +/// <reference path="../perf_hooks.d.ts" />
43 +/// <reference path="../process.d.ts" />
44 +/// <reference path="../punycode.d.ts" />
45 +/// <reference path="../querystring.d.ts" />
46 +/// <reference path="../readline.d.ts" />
47 +/// <reference path="../repl.d.ts" />
48 +/// <reference path="../stream.d.ts" />
49 +/// <reference path="../stream/promises.d.ts" />
50 +/// <reference path="../string_decoder.d.ts" />
51 +/// <reference path="../timers.d.ts" />
52 +/// <reference path="../timers/promises.d.ts" />
53 +/// <reference path="../tls.d.ts" />
54 +/// <reference path="../trace_events.d.ts" />
55 +/// <reference path="../tty.d.ts" />
56 +/// <reference path="../url.d.ts" />
57 +/// <reference path="../util.d.ts" />
58 +/// <reference path="../util/types.d.ts" />
59 +/// <reference path="../v8.d.ts" />
60 +/// <reference path="../vm.d.ts" />
61 +/// <reference path="../worker_threads.d.ts" />
62 +/// <reference path="../zlib.d.ts" />
63 +
64 +// TypeScript 3.5-specific augmentations:
65 +/// <reference path="../globals.global.d.ts" />
66 +
67 +// TypeScript 3.5-specific augmentations:
68 +/// <reference path="../wasi.d.ts" />
1 +// NOTE: These definitions support NodeJS and TypeScript 3.5 - 3.6.
2 +// This is required to enable typing assert in ts3.7 without causing errors
3 +// Typically type modifications should be made in base.d.ts instead of here
4 +
5 +/// <reference path="base.d.ts" />
6 +
7 +/// <reference path="assert.d.ts" />
1 +declare module 'tty' {
2 + import * as net from 'net';
3 +
4 + function isatty(fd: number): boolean;
5 + class ReadStream extends net.Socket {
6 + constructor(fd: number, options?: net.SocketConstructorOpts);
7 + isRaw: boolean;
8 + setRawMode(mode: boolean): this;
9 + isTTY: boolean;
10 + }
11 + /**
12 + * -1 - to the left from cursor
13 + * 0 - the entire line
14 + * 1 - to the right from cursor
15 + */
16 + type Direction = -1 | 0 | 1;
17 + class WriteStream extends net.Socket {
18 + constructor(fd: number);
19 + addListener(event: string, listener: (...args: any[]) => void): this;
20 + addListener(event: "resize", listener: () => void): this;
21 +
22 + emit(event: string | symbol, ...args: any[]): boolean;
23 + emit(event: "resize"): boolean;
24 +
25 + on(event: string, listener: (...args: any[]) => void): this;
26 + on(event: "resize", listener: () => void): this;
27 +
28 + once(event: string, listener: (...args: any[]) => void): this;
29 + once(event: "resize", listener: () => void): this;
30 +
31 + prependListener(event: string, listener: (...args: any[]) => void): this;
32 + prependListener(event: "resize", listener: () => void): this;
33 +
34 + prependOnceListener(event: string, listener: (...args: any[]) => void): this;
35 + prependOnceListener(event: "resize", listener: () => void): this;
36 +
37 + /**
38 + * Clears the current line of this WriteStream in a direction identified by `dir`.
39 + */
40 + clearLine(dir: Direction, callback?: () => void): boolean;
41 + /**
42 + * Clears this `WriteStream` from the current cursor down.
43 + */
44 + clearScreenDown(callback?: () => void): boolean;
45 + /**
46 + * Moves this WriteStream's cursor to the specified position.
47 + */
48 + cursorTo(x: number, y?: number, callback?: () => void): boolean;
49 + cursorTo(x: number, callback: () => void): boolean;
50 + /**
51 + * Moves this WriteStream's cursor relative to its current position.
52 + */
53 + moveCursor(dx: number, dy: number, callback?: () => void): boolean;
54 + /**
55 + * @default `process.env`
56 + */
57 + getColorDepth(env?: {}): number;
58 + hasColors(depth?: number): boolean;
59 + hasColors(env?: {}): boolean;
60 + hasColors(depth: number, env?: {}): boolean;
61 + getWindowSize(): [number, number];
62 + columns: number;
63 + rows: number;
64 + isTTY: boolean;
65 + }
66 +}
1 +declare module 'url' {
2 + import { ParsedUrlQuery, ParsedUrlQueryInput } from 'querystring';
3 +
4 + // Input to `url.format`
5 + interface UrlObject {
6 + auth?: string | null;
7 + hash?: string | null;
8 + host?: string | null;
9 + hostname?: string | null;
10 + href?: string | null;
11 + pathname?: string | null;
12 + protocol?: string | null;
13 + search?: string | null;
14 + slashes?: boolean | null;
15 + port?: string | number | null;
16 + query?: string | null | ParsedUrlQueryInput;
17 + }
18 +
19 + // Output of `url.parse`
20 + interface Url {
21 + auth: string | null;
22 + hash: string | null;
23 + host: string | null;
24 + hostname: string | null;
25 + href: string;
26 + path: string | null;
27 + pathname: string | null;
28 + protocol: string | null;
29 + search: string | null;
30 + slashes: boolean | null;
31 + port: string | null;
32 + query: string | null | ParsedUrlQuery;
33 + }
34 +
35 + interface UrlWithParsedQuery extends Url {
36 + query: ParsedUrlQuery;
37 + }
38 +
39 + interface UrlWithStringQuery extends Url {
40 + query: string | null;
41 + }
42 +
43 + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
44 + function parse(urlStr: string): UrlWithStringQuery;
45 + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
46 + function parse(urlStr: string, parseQueryString: false | undefined, slashesDenoteHost?: boolean): UrlWithStringQuery;
47 + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
48 + function parse(urlStr: string, parseQueryString: true, slashesDenoteHost?: boolean): UrlWithParsedQuery;
49 + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
50 + function parse(urlStr: string, parseQueryString: boolean, slashesDenoteHost?: boolean): Url;
51 +
52 + function format(URL: URL, options?: URLFormatOptions): string;
53 + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
54 + function format(urlObject: UrlObject | string): string;
55 + /** @deprecated since v11.0.0 - Use the WHATWG URL API. */
56 + function resolve(from: string, to: string): string;
57 +
58 + function domainToASCII(domain: string): string;
59 + function domainToUnicode(domain: string): string;
60 +
61 + /**
62 + * This function ensures the correct decodings of percent-encoded characters as
63 + * well as ensuring a cross-platform valid absolute path string.
64 + * @param url The file URL string or URL object to convert to a path.
65 + */
66 + function fileURLToPath(url: string | URL): string;
67 +
68 + /**
69 + * This function ensures that path is resolved absolutely, and that the URL
70 + * control characters are correctly encoded when converting into a File URL.
71 + * @param url The path to convert to a File URL.
72 + */
73 + function pathToFileURL(url: string): URL;
74 +
75 + interface URLFormatOptions {
76 + auth?: boolean;
77 + fragment?: boolean;
78 + search?: boolean;
79 + unicode?: boolean;
80 + }
81 +
82 + class URL {
83 + constructor(input: string, base?: string | URL);
84 + hash: string;
85 + host: string;
86 + hostname: string;
87 + href: string;
88 + readonly origin: string;
89 + password: string;
90 + pathname: string;
91 + port: string;
92 + protocol: string;
93 + search: string;
94 + readonly searchParams: URLSearchParams;
95 + username: string;
96 + toString(): string;
97 + toJSON(): string;
98 + }
99 +
100 + class URLSearchParams implements Iterable<[string, string]> {
101 + constructor(init?: URLSearchParams | string | NodeJS.Dict<string | ReadonlyArray<string>> | Iterable<[string, string]> | ReadonlyArray<[string, string]>);
102 + append(name: string, value: string): void;
103 + delete(name: string): void;
104 + entries(): IterableIterator<[string, string]>;
105 + forEach(callback: (value: string, name: string, searchParams: this) => void): void;
106 + get(name: string): string | null;
107 + getAll(name: string): string[];
108 + has(name: string): boolean;
109 + keys(): IterableIterator<string>;
110 + set(name: string, value: string): void;
111 + sort(): void;
112 + toString(): string;
113 + values(): IterableIterator<string>;
114 + [Symbol.iterator](): IterableIterator<[string, string]>;
115 + }
116 +}
This diff is collapsed. Click to expand it.
1 +declare module 'util/types' {
2 + function isAnyArrayBuffer(object: any): object is ArrayBufferLike;
3 + function isArgumentsObject(object: any): object is IArguments;
4 + function isArrayBuffer(object: any): object is ArrayBuffer;
5 + function isArrayBufferView(object: any): object is NodeJS.ArrayBufferView;
6 + function isAsyncFunction(object: any): boolean;
7 + function isBigInt64Array(value: any): value is BigInt64Array;
8 + function isBigUint64Array(value: any): value is BigUint64Array;
9 + function isBooleanObject(object: any): object is Boolean;
10 + function isBoxedPrimitive(object: any): object is String | Number | BigInt | Boolean | Symbol;
11 + function isDataView(object: any): object is DataView;
12 + function isDate(object: any): object is Date;
13 + function isExternal(object: any): boolean;
14 + function isFloat32Array(object: any): object is Float32Array;
15 + function isFloat64Array(object: any): object is Float64Array;
16 + function isGeneratorFunction(object: any): object is GeneratorFunction;
17 + function isGeneratorObject(object: any): object is Generator;
18 + function isInt8Array(object: any): object is Int8Array;
19 + function isInt16Array(object: any): object is Int16Array;
20 + function isInt32Array(object: any): object is Int32Array;
21 + function isMap<T>(
22 + object: T | {},
23 + ): object is T extends ReadonlyMap<any, any>
24 + ? unknown extends T
25 + ? never
26 + : ReadonlyMap<any, any>
27 + : Map<any, any>;
28 + function isMapIterator(object: any): boolean;
29 + function isModuleNamespaceObject(value: any): boolean;
30 + function isNativeError(object: any): object is Error;
31 + function isNumberObject(object: any): object is Number;
32 + function isPromise(object: any): object is Promise<any>;
33 + function isProxy(object: any): boolean;
34 + function isRegExp(object: any): object is RegExp;
35 + function isSet<T>(
36 + object: T | {},
37 + ): object is T extends ReadonlySet<any>
38 + ? unknown extends T
39 + ? never
40 + : ReadonlySet<any>
41 + : Set<any>;
42 + function isSetIterator(object: any): boolean;
43 + function isSharedArrayBuffer(object: any): object is SharedArrayBuffer;
44 + function isStringObject(object: any): object is String;
45 + function isSymbolObject(object: any): object is Symbol;
46 + function isTypedArray(object: any): object is NodeJS.TypedArray;
47 + function isUint8Array(object: any): object is Uint8Array;
48 + function isUint8ClampedArray(object: any): object is Uint8ClampedArray;
49 + function isUint16Array(object: any): object is Uint16Array;
50 + function isUint32Array(object: any): object is Uint32Array;
51 + function isWeakMap(object: any): object is WeakMap<any, any>;
52 + function isWeakSet(object: any): object is WeakSet<any>;
53 +}
1 +declare module 'v8' {
2 + import { Readable } from 'stream';
3 +
4 + interface HeapSpaceInfo {
5 + space_name: string;
6 + space_size: number;
7 + space_used_size: number;
8 + space_available_size: number;
9 + physical_space_size: number;
10 + }
11 +
12 + // ** Signifies if the --zap_code_space option is enabled or not. 1 == enabled, 0 == disabled. */
13 + type DoesZapCodeSpaceFlag = 0 | 1;
14 +
15 + interface HeapInfo {
16 + total_heap_size: number;
17 + total_heap_size_executable: number;
18 + total_physical_size: number;
19 + total_available_size: number;
20 + used_heap_size: number;
21 + heap_size_limit: number;
22 + malloced_memory: number;
23 + peak_malloced_memory: number;
24 + does_zap_garbage: DoesZapCodeSpaceFlag;
25 + number_of_native_contexts: number;
26 + number_of_detached_contexts: number;
27 + }
28 +
29 + interface HeapCodeStatistics {
30 + code_and_metadata_size: number;
31 + bytecode_and_metadata_size: number;
32 + external_script_source_size: number;
33 + }
34 +
35 + /**
36 + * Returns an integer representing a "version tag" derived from the V8 version, command line flags and detected CPU features.
37 + * This is useful for determining whether a vm.Script cachedData buffer is compatible with this instance of V8.
38 + */
39 + function cachedDataVersionTag(): number;
40 +
41 + function getHeapStatistics(): HeapInfo;
42 + function getHeapSpaceStatistics(): HeapSpaceInfo[];
43 + function setFlagsFromString(flags: string): void;
44 + /**
45 + * Generates a snapshot of the current V8 heap and returns a Readable
46 + * Stream that may be used to read the JSON serialized representation.
47 + * This conversation was marked as resolved by joyeecheung
48 + * This JSON stream format is intended to be used with tools such as
49 + * Chrome DevTools. The JSON schema is undocumented and specific to the
50 + * V8 engine, and may change from one version of V8 to the next.
51 + */
52 + function getHeapSnapshot(): Readable;
53 +
54 + /**
55 + *
56 + * @param fileName The file path where the V8 heap snapshot is to be
57 + * saved. If not specified, a file name with the pattern
58 + * `'Heap-${yyyymmdd}-${hhmmss}-${pid}-${thread_id}.heapsnapshot'` will be
59 + * generated, where `{pid}` will be the PID of the Node.js process,
60 + * `{thread_id}` will be `0` when `writeHeapSnapshot()` is called from
61 + * the main Node.js thread or the id of a worker thread.
62 + */
63 + function writeHeapSnapshot(fileName?: string): string;
64 +
65 + function getHeapCodeStatistics(): HeapCodeStatistics;
66 +
67 + class Serializer {
68 + /**
69 + * Writes out a header, which includes the serialization format version.
70 + */
71 + writeHeader(): void;
72 +
73 + /**
74 + * Serializes a JavaScript value and adds the serialized representation to the internal buffer.
75 + * This throws an error if value cannot be serialized.
76 + */
77 + writeValue(val: any): boolean;
78 +
79 + /**
80 + * Returns the stored internal buffer.
81 + * This serializer should not be used once the buffer is released.
82 + * Calling this method results in undefined behavior if a previous write has failed.
83 + */
84 + releaseBuffer(): Buffer;
85 +
86 + /**
87 + * Marks an ArrayBuffer as having its contents transferred out of band.\
88 + * Pass the corresponding ArrayBuffer in the deserializing context to deserializer.transferArrayBuffer().
89 + */
90 + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
91 +
92 + /**
93 + * Write a raw 32-bit unsigned integer.
94 + */
95 + writeUint32(value: number): void;
96 +
97 + /**
98 + * Write a raw 64-bit unsigned integer, split into high and low 32-bit parts.
99 + */
100 + writeUint64(hi: number, lo: number): void;
101 +
102 + /**
103 + * Write a JS number value.
104 + */
105 + writeDouble(value: number): void;
106 +
107 + /**
108 + * Write raw bytes into the serializer’s internal buffer.
109 + * The deserializer will require a way to compute the length of the buffer.
110 + */
111 + writeRawBytes(buffer: NodeJS.TypedArray): void;
112 + }
113 +
114 + /**
115 + * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
116 + * and only stores the part of their underlying `ArrayBuffers` that they are referring to.
117 + */
118 + class DefaultSerializer extends Serializer {
119 + }
120 +
121 + class Deserializer {
122 + constructor(data: NodeJS.TypedArray);
123 + /**
124 + * Reads and validates a header (including the format version).
125 + * May, for example, reject an invalid or unsupported wire format.
126 + * In that case, an Error is thrown.
127 + */
128 + readHeader(): boolean;
129 +
130 + /**
131 + * Deserializes a JavaScript value from the buffer and returns it.
132 + */
133 + readValue(): any;
134 +
135 + /**
136 + * Marks an ArrayBuffer as having its contents transferred out of band.
137 + * Pass the corresponding `ArrayBuffer` in the serializing context to serializer.transferArrayBuffer()
138 + * (or return the id from serializer._getSharedArrayBufferId() in the case of SharedArrayBuffers).
139 + */
140 + transferArrayBuffer(id: number, arrayBuffer: ArrayBuffer): void;
141 +
142 + /**
143 + * Reads the underlying wire format version.
144 + * Likely mostly to be useful to legacy code reading old wire format versions.
145 + * May not be called before .readHeader().
146 + */
147 + getWireFormatVersion(): number;
148 +
149 + /**
150 + * Read a raw 32-bit unsigned integer and return it.
151 + */
152 + readUint32(): number;
153 +
154 + /**
155 + * Read a raw 64-bit unsigned integer and return it as an array [hi, lo] with two 32-bit unsigned integer entries.
156 + */
157 + readUint64(): [number, number];
158 +
159 + /**
160 + * Read a JS number value.
161 + */
162 + readDouble(): number;
163 +
164 + /**
165 + * Read raw bytes from the deserializer’s internal buffer.
166 + * The length parameter must correspond to the length of the buffer that was passed to serializer.writeRawBytes().
167 + */
168 + readRawBytes(length: number): Buffer;
169 + }
170 +
171 + /**
172 + * A subclass of `Serializer` that serializes `TypedArray` (in particular `Buffer`) and `DataView` objects as host objects,
173 + * and only stores the part of their underlying `ArrayBuffers` that they are referring to.
174 + */
175 + class DefaultDeserializer extends Deserializer {
176 + }
177 +
178 + /**
179 + * Uses a `DefaultSerializer` to serialize value into a buffer.
180 + */
181 + function serialize(value: any): Buffer;
182 +
183 + /**
184 + * Uses a `DefaultDeserializer` with default options to read a JS value from a buffer.
185 + */
186 + function deserialize(data: NodeJS.TypedArray): any;
187 +
188 + /**
189 + * Begins writing coverage report based on the `NODE_V8_COVERAGE` env var.
190 + * Noop is the env var is not set.
191 + */
192 + function takeCoverage(): void;
193 +
194 + /**
195 + * Stops writing coverage report.
196 + */
197 + function stopCoverage(): void;
198 +}
1 +declare module 'vm' {
2 + interface Context extends NodeJS.Dict<any> { }
3 + interface BaseOptions {
4 + /**
5 + * Specifies the filename used in stack traces produced by this script.
6 + * Default: `''`.
7 + */
8 + filename?: string;
9 + /**
10 + * Specifies the line number offset that is displayed in stack traces produced by this script.
11 + * Default: `0`.
12 + */
13 + lineOffset?: number;
14 + /**
15 + * Specifies the column number offset that is displayed in stack traces produced by this script.
16 + * @default 0
17 + */
18 + columnOffset?: number;
19 + }
20 + interface ScriptOptions extends BaseOptions {
21 + displayErrors?: boolean;
22 + timeout?: number;
23 + cachedData?: Buffer;
24 + /** @deprecated in favor of `script.createCachedData()` */
25 + produceCachedData?: boolean;
26 + }
27 + interface RunningScriptOptions extends BaseOptions {
28 + /**
29 + * When `true`, if an `Error` occurs while compiling the `code`, the line of code causing the error is attached to the stack trace.
30 + * Default: `true`.
31 + */
32 + displayErrors?: boolean;
33 + /**
34 + * Specifies the number of milliseconds to execute code before terminating execution.
35 + * If execution is terminated, an `Error` will be thrown. This value must be a strictly positive integer.
36 + */
37 + timeout?: number;
38 + /**
39 + * If `true`, the execution will be terminated when `SIGINT` (Ctrl+C) is received.
40 + * Existing handlers for the event that have been attached via `process.on('SIGINT')` will be disabled during script execution, but will continue to work after that.
41 + * If execution is terminated, an `Error` will be thrown.
42 + * Default: `false`.
43 + */
44 + breakOnSigint?: boolean;
45 + /**
46 + * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
47 + */
48 + microtaskMode?: 'afterEvaluate';
49 + }
50 + interface CompileFunctionOptions extends BaseOptions {
51 + /**
52 + * Provides an optional data with V8's code cache data for the supplied source.
53 + */
54 + cachedData?: Buffer;
55 + /**
56 + * Specifies whether to produce new cache data.
57 + * Default: `false`,
58 + */
59 + produceCachedData?: boolean;
60 + /**
61 + * The sandbox/context in which the said function should be compiled in.
62 + */
63 + parsingContext?: Context;
64 +
65 + /**
66 + * An array containing a collection of context extensions (objects wrapping the current scope) to be applied while compiling
67 + */
68 + contextExtensions?: Object[];
69 + }
70 +
71 + interface CreateContextOptions {
72 + /**
73 + * Human-readable name of the newly created context.
74 + * @default 'VM Context i' Where i is an ascending numerical index of the created context.
75 + */
76 + name?: string;
77 + /**
78 + * Corresponds to the newly created context for display purposes.
79 + * The origin should be formatted like a `URL`, but with only the scheme, host, and port (if necessary),
80 + * like the value of the `url.origin` property of a URL object.
81 + * Most notably, this string should omit the trailing slash, as that denotes a path.
82 + * @default ''
83 + */
84 + origin?: string;
85 + codeGeneration?: {
86 + /**
87 + * If set to false any calls to eval or function constructors (Function, GeneratorFunction, etc)
88 + * will throw an EvalError.
89 + * @default true
90 + */
91 + strings?: boolean;
92 + /**
93 + * If set to false any attempt to compile a WebAssembly module will throw a WebAssembly.CompileError.
94 + * @default true
95 + */
96 + wasm?: boolean;
97 + };
98 + /**
99 + * If set to `afterEvaluate`, microtasks will be run immediately after the script has run.
100 + */
101 + microtaskMode?: 'afterEvaluate';
102 + }
103 +
104 + type MeasureMemoryMode = 'summary' | 'detailed';
105 +
106 + interface MeasureMemoryOptions {
107 + /**
108 + * @default 'summary'
109 + */
110 + mode?: MeasureMemoryMode;
111 + context?: Context;
112 + }
113 +
114 + interface MemoryMeasurement {
115 + total: {
116 + jsMemoryEstimate: number;
117 + jsMemoryRange: [number, number];
118 + };
119 + }
120 +
121 + class Script {
122 + constructor(code: string, options?: ScriptOptions);
123 + runInContext(contextifiedSandbox: Context, options?: RunningScriptOptions): any;
124 + runInNewContext(sandbox?: Context, options?: RunningScriptOptions): any;
125 + runInThisContext(options?: RunningScriptOptions): any;
126 + createCachedData(): Buffer;
127 + cachedDataRejected?: boolean;
128 + }
129 + function createContext(sandbox?: Context, options?: CreateContextOptions): Context;
130 + function isContext(sandbox: Context): boolean;
131 + function runInContext(code: string, contextifiedSandbox: Context, options?: RunningScriptOptions | string): any;
132 + function runInNewContext(code: string, sandbox?: Context, options?: RunningScriptOptions | string): any;
133 + function runInThisContext(code: string, options?: RunningScriptOptions | string): any;
134 + function compileFunction(code: string, params?: ReadonlyArray<string>, options?: CompileFunctionOptions): Function;
135 +
136 + /**
137 + * Measure the memory known to V8 and used by the current execution context or a specified context.
138 + *
139 + * The format of the object that the returned Promise may resolve with is
140 + * specific to the V8 engine and may change from one version of V8 to the next.
141 + *
142 + * The returned result is different from the statistics returned by
143 + * `v8.getHeapSpaceStatistics()` in that `vm.measureMemory()` measures
144 + * the memory reachable by V8 from a specific context, while
145 + * `v8.getHeapSpaceStatistics()` measures the memory used by an instance
146 + * of V8 engine, which can switch among multiple contexts that reference
147 + * objects in the heap of one engine.
148 + *
149 + * @experimental
150 + */
151 + function measureMemory(options?: MeasureMemoryOptions): Promise<MemoryMeasurement>;
152 +}
1 +declare module 'wasi' {
2 + interface WASIOptions {
3 + /**
4 + * An array of strings that the WebAssembly application will
5 + * see as command line arguments. The first argument is the virtual path to the
6 + * WASI command itself.
7 + */
8 + args?: string[];
9 +
10 + /**
11 + * An object similar to `process.env` that the WebAssembly
12 + * application will see as its environment.
13 + */
14 + env?: object;
15 +
16 + /**
17 + * This object represents the WebAssembly application's
18 + * sandbox directory structure. The string keys of `preopens` are treated as
19 + * directories within the sandbox. The corresponding values in `preopens` are
20 + * the real paths to those directories on the host machine.
21 + */
22 + preopens?: NodeJS.Dict<string>;
23 +
24 + /**
25 + * By default, WASI applications terminate the Node.js
26 + * process via the `__wasi_proc_exit()` function. Setting this option to `true`
27 + * causes `wasi.start()` to return the exit code rather than terminate the
28 + * process.
29 + * @default false
30 + */
31 + returnOnExit?: boolean;
32 +
33 + /**
34 + * The file descriptor used as standard input in the WebAssembly application.
35 + * @default 0
36 + */
37 + stdin?: number;
38 +
39 + /**
40 + * The file descriptor used as standard output in the WebAssembly application.
41 + * @default 1
42 + */
43 + stdout?: number;
44 +
45 + /**
46 + * The file descriptor used as standard error in the WebAssembly application.
47 + * @default 2
48 + */
49 + stderr?: number;
50 + }
51 +
52 + class WASI {
53 + constructor(options?: WASIOptions);
54 + /**
55 + *
56 + * Attempt to begin execution of `instance` by invoking its `_start()` export.
57 + * If `instance` does not contain a `_start()` export, then `start()` attempts to
58 + * invoke the `__wasi_unstable_reactor_start()` export. If neither of those exports
59 + * is present on `instance`, then `start()` does nothing.
60 + *
61 + * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
62 + * `memory`. If `instance` does not have a `memory` export an exception is thrown.
63 + *
64 + * If `start()` is called more than once, an exception is thrown.
65 + */
66 + start(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
67 +
68 + /**
69 + * Attempt to initialize `instance` as a WASI reactor by invoking its `_initialize()` export, if it is present.
70 + * If `instance` contains a `_start()` export, then an exception is thrown.
71 + *
72 + * `start()` requires that `instance` exports a [`WebAssembly.Memory`][] named
73 + * `memory`. If `instance` does not have a `memory` export an exception is thrown.
74 + *
75 + * If `initialize()` is called more than once, an exception is thrown.
76 + */
77 + initialize(instance: object): void; // TODO: avoid DOM dependency until WASM moved to own lib.
78 +
79 + /**
80 + * Is an object that implements the WASI system call API. This object
81 + * should be passed as the `wasi_snapshot_preview1` import during the instantiation of a
82 + * [`WebAssembly.Instance`][].
83 + */
84 + readonly wasiImport: NodeJS.Dict<any>; // TODO: Narrow to DOM types
85 + }
86 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +{
2 + "predef": [ ]
3 + , "bitwise": false
4 + , "camelcase": false
5 + , "curly": false
6 + , "eqeqeq": false
7 + , "forin": false
8 + , "immed": false
9 + , "latedef": false
10 + , "noarg": true
11 + , "noempty": true
12 + , "nonew": true
13 + , "plusplus": false
14 + , "quotmark": true
15 + , "regexp": false
16 + , "undef": true
17 + , "unused": true
18 + , "strict": false
19 + , "trailing": true
20 + , "maxlen": 120
21 + , "asi": true
22 + , "boss": true
23 + , "debug": true
24 + , "eqnull": true
25 + , "esnext": false
26 + , "evil": true
27 + , "expr": true
28 + , "funcscope": false
29 + , "globalstrict": false
30 + , "iterator": false
31 + , "lastsemic": true
32 + , "laxbreak": true
33 + , "laxcomma": true
34 + , "loopfunc": true
35 + , "multistr": false
36 + , "onecase": false
37 + , "proto": false
38 + , "regexdash": false
39 + , "scripturl": true
40 + , "smarttabs": false
41 + , "shadow": false
42 + , "sub": true
43 + , "supernew": false
44 + , "validthis": true
45 + , "browser": true
46 + , "couch": false
47 + , "devel": false
48 + , "dojo": false
49 + , "mootools": false
50 + , "node": true
51 + , "nonstandard": true
52 + , "prototypejs": false
53 + , "rhino": false
54 + , "worker": true
55 + , "wsh": false
56 + , "nomen": false
57 + , "onevar": false
58 + , "passfail": false
59 + , "esversion": 3
60 +}
...\ No newline at end of file ...\ No newline at end of file
1 +sudo: false
2 +language: node_js
3 +node_js:
4 + - '4'
5 + - '6'
6 + - '8'
7 + - '9'
8 + - '10'
9 +branches:
10 + only:
11 + - master
12 +notifications:
13 + email:
14 + - rod@vagg.org
15 + - matteo.collina@gmail.com
1 +The MIT License (MIT)
2 +=====================
3 +
4 +Copyright (c) 2013-2018 bl contributors
5 +----------------------------------
6 +
7 +*bl contributors listed at <https://github.com/rvagg/bl#contributors>*
8 +
9 +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:
10 +
11 +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12 +
13 +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.
This diff is collapsed. Click to expand it.
1 +'use strict'
2 +var DuplexStream = require('readable-stream').Duplex
3 + , util = require('util')
4 + , Buffer = require('safe-buffer').Buffer
5 +
6 +function BufferList (callback) {
7 + if (!(this instanceof BufferList))
8 + return new BufferList(callback)
9 +
10 + this._bufs = []
11 + this.length = 0
12 +
13 + if (typeof callback == 'function') {
14 + this._callback = callback
15 +
16 + var piper = function piper (err) {
17 + if (this._callback) {
18 + this._callback(err)
19 + this._callback = null
20 + }
21 + }.bind(this)
22 +
23 + this.on('pipe', function onPipe (src) {
24 + src.on('error', piper)
25 + })
26 + this.on('unpipe', function onUnpipe (src) {
27 + src.removeListener('error', piper)
28 + })
29 + } else {
30 + this.append(callback)
31 + }
32 +
33 + DuplexStream.call(this)
34 +}
35 +
36 +
37 +util.inherits(BufferList, DuplexStream)
38 +
39 +
40 +BufferList.prototype._offset = function _offset (offset) {
41 + var tot = 0, i = 0, _t
42 + if (offset === 0) return [ 0, 0 ]
43 + for (; i < this._bufs.length; i++) {
44 + _t = tot + this._bufs[i].length
45 + if (offset < _t || i == this._bufs.length - 1) {
46 + return [ i, offset - tot ]
47 + }
48 + tot = _t
49 + }
50 +}
51 +
52 +BufferList.prototype._reverseOffset = function (blOffset) {
53 + var bufferId = blOffset[0]
54 + var offset = blOffset[1]
55 + for (var i = 0; i < bufferId; i++) {
56 + offset += this._bufs[i].length
57 + }
58 + return offset
59 +}
60 +
61 +BufferList.prototype.append = function append (buf) {
62 + var i = 0
63 +
64 + if (Buffer.isBuffer(buf)) {
65 + this._appendBuffer(buf)
66 + } else if (Array.isArray(buf)) {
67 + for (; i < buf.length; i++)
68 + this.append(buf[i])
69 + } else if (buf instanceof BufferList) {
70 + // unwrap argument into individual BufferLists
71 + for (; i < buf._bufs.length; i++)
72 + this.append(buf._bufs[i])
73 + } else if (buf != null) {
74 + // coerce number arguments to strings, since Buffer(number) does
75 + // uninitialized memory allocation
76 + if (typeof buf == 'number')
77 + buf = buf.toString()
78 +
79 + this._appendBuffer(Buffer.from(buf))
80 + }
81 +
82 + return this
83 +}
84 +
85 +
86 +BufferList.prototype._appendBuffer = function appendBuffer (buf) {
87 + this._bufs.push(buf)
88 + this.length += buf.length
89 +}
90 +
91 +
92 +BufferList.prototype._write = function _write (buf, encoding, callback) {
93 + this._appendBuffer(buf)
94 +
95 + if (typeof callback == 'function')
96 + callback()
97 +}
98 +
99 +
100 +BufferList.prototype._read = function _read (size) {
101 + if (!this.length)
102 + return this.push(null)
103 +
104 + size = Math.min(size, this.length)
105 + this.push(this.slice(0, size))
106 + this.consume(size)
107 +}
108 +
109 +
110 +BufferList.prototype.end = function end (chunk) {
111 + DuplexStream.prototype.end.call(this, chunk)
112 +
113 + if (this._callback) {
114 + this._callback(null, this.slice())
115 + this._callback = null
116 + }
117 +}
118 +
119 +
120 +BufferList.prototype.get = function get (index) {
121 + if (index > this.length || index < 0) {
122 + return undefined
123 + }
124 + var offset = this._offset(index)
125 + return this._bufs[offset[0]][offset[1]]
126 +}
127 +
128 +
129 +BufferList.prototype.slice = function slice (start, end) {
130 + if (typeof start == 'number' && start < 0)
131 + start += this.length
132 + if (typeof end == 'number' && end < 0)
133 + end += this.length
134 + return this.copy(null, 0, start, end)
135 +}
136 +
137 +
138 +BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
139 + if (typeof srcStart != 'number' || srcStart < 0)
140 + srcStart = 0
141 + if (typeof srcEnd != 'number' || srcEnd > this.length)
142 + srcEnd = this.length
143 + if (srcStart >= this.length)
144 + return dst || Buffer.alloc(0)
145 + if (srcEnd <= 0)
146 + return dst || Buffer.alloc(0)
147 +
148 + var copy = !!dst
149 + , off = this._offset(srcStart)
150 + , len = srcEnd - srcStart
151 + , bytes = len
152 + , bufoff = (copy && dstStart) || 0
153 + , start = off[1]
154 + , l
155 + , i
156 +
157 + // copy/slice everything
158 + if (srcStart === 0 && srcEnd == this.length) {
159 + if (!copy) { // slice, but full concat if multiple buffers
160 + return this._bufs.length === 1
161 + ? this._bufs[0]
162 + : Buffer.concat(this._bufs, this.length)
163 + }
164 +
165 + // copy, need to copy individual buffers
166 + for (i = 0; i < this._bufs.length; i++) {
167 + this._bufs[i].copy(dst, bufoff)
168 + bufoff += this._bufs[i].length
169 + }
170 +
171 + return dst
172 + }
173 +
174 + // easy, cheap case where it's a subset of one of the buffers
175 + if (bytes <= this._bufs[off[0]].length - start) {
176 + return copy
177 + ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
178 + : this._bufs[off[0]].slice(start, start + bytes)
179 + }
180 +
181 + if (!copy) // a slice, we need something to copy in to
182 + dst = Buffer.allocUnsafe(len)
183 +
184 + for (i = off[0]; i < this._bufs.length; i++) {
185 + l = this._bufs[i].length - start
186 +
187 + if (bytes > l) {
188 + this._bufs[i].copy(dst, bufoff, start)
189 + bufoff += l
190 + } else {
191 + this._bufs[i].copy(dst, bufoff, start, start + bytes)
192 + bufoff += l
193 + break
194 + }
195 +
196 + bytes -= l
197 +
198 + if (start)
199 + start = 0
200 + }
201 +
202 + // safeguard so that we don't return uninitialized memory
203 + if (dst.length > bufoff) return dst.slice(0, bufoff)
204 +
205 + return dst
206 +}
207 +
208 +BufferList.prototype.shallowSlice = function shallowSlice (start, end) {
209 + start = start || 0
210 + end = typeof end !== 'number' ? this.length : end
211 +
212 + if (start < 0)
213 + start += this.length
214 + if (end < 0)
215 + end += this.length
216 +
217 + if (start === end) {
218 + return new BufferList()
219 + }
220 + var startOffset = this._offset(start)
221 + , endOffset = this._offset(end)
222 + , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)
223 +
224 + if (endOffset[1] == 0)
225 + buffers.pop()
226 + else
227 + buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1])
228 +
229 + if (startOffset[1] != 0)
230 + buffers[0] = buffers[0].slice(startOffset[1])
231 +
232 + return new BufferList(buffers)
233 +}
234 +
235 +BufferList.prototype.toString = function toString (encoding, start, end) {
236 + return this.slice(start, end).toString(encoding)
237 +}
238 +
239 +BufferList.prototype.consume = function consume (bytes) {
240 + // first, normalize the argument, in accordance with how Buffer does it
241 + bytes = Math.trunc(bytes)
242 + // do nothing if not a positive number
243 + if (Number.isNaN(bytes) || bytes <= 0) return this
244 +
245 + while (this._bufs.length) {
246 + if (bytes >= this._bufs[0].length) {
247 + bytes -= this._bufs[0].length
248 + this.length -= this._bufs[0].length
249 + this._bufs.shift()
250 + } else {
251 + this._bufs[0] = this._bufs[0].slice(bytes)
252 + this.length -= bytes
253 + break
254 + }
255 + }
256 + return this
257 +}
258 +
259 +
260 +BufferList.prototype.duplicate = function duplicate () {
261 + var i = 0
262 + , copy = new BufferList()
263 +
264 + for (; i < this._bufs.length; i++)
265 + copy.append(this._bufs[i])
266 +
267 + return copy
268 +}
269 +
270 +
271 +BufferList.prototype.destroy = function destroy () {
272 + this._bufs.length = 0
273 + this.length = 0
274 + this.push(null)
275 +}
276 +
277 +
278 +BufferList.prototype.indexOf = function (search, offset, encoding) {
279 + if (encoding === undefined && typeof offset === 'string') {
280 + encoding = offset
281 + offset = undefined
282 + }
283 + if (typeof search === 'function' || Array.isArray(search)) {
284 + throw new TypeError('The "value" argument must be one of type string, Buffer, BufferList, or Uint8Array.')
285 + } else if (typeof search === 'number') {
286 + search = Buffer.from([search])
287 + } else if (typeof search === 'string') {
288 + search = Buffer.from(search, encoding)
289 + } else if (search instanceof BufferList) {
290 + search = search.slice()
291 + } else if (!Buffer.isBuffer(search)) {
292 + search = Buffer.from(search)
293 + }
294 +
295 + offset = Number(offset || 0)
296 + if (isNaN(offset)) {
297 + offset = 0
298 + }
299 +
300 + if (offset < 0) {
301 + offset = this.length + offset
302 + }
303 +
304 + if (offset < 0) {
305 + offset = 0
306 + }
307 +
308 + if (search.length === 0) {
309 + return offset > this.length ? this.length : offset
310 + }
311 +
312 + var blOffset = this._offset(offset)
313 + var blIndex = blOffset[0] // index of which internal buffer we're working on
314 + var buffOffset = blOffset[1] // offset of the internal buffer we're working on
315 +
316 + // scan over each buffer
317 + for (blIndex; blIndex < this._bufs.length; blIndex++) {
318 + var buff = this._bufs[blIndex]
319 + while(buffOffset < buff.length) {
320 + var availableWindow = buff.length - buffOffset
321 + if (availableWindow >= search.length) {
322 + var nativeSearchResult = buff.indexOf(search, buffOffset)
323 + if (nativeSearchResult !== -1) {
324 + return this._reverseOffset([blIndex, nativeSearchResult])
325 + }
326 + buffOffset = buff.length - search.length + 1 // end of native search window
327 + } else {
328 + var revOffset = this._reverseOffset([blIndex, buffOffset])
329 + if (this._match(revOffset, search)) {
330 + return revOffset
331 + }
332 + buffOffset++
333 + }
334 + }
335 + buffOffset = 0
336 + }
337 + return -1
338 +}
339 +
340 +BufferList.prototype._match = function(offset, search) {
341 + if (this.length - offset < search.length) {
342 + return false
343 + }
344 + for (var searchOffset = 0; searchOffset < search.length ; searchOffset++) {
345 + if(this.get(offset + searchOffset) !== search[searchOffset]){
346 + return false
347 + }
348 + }
349 + return true
350 +}
351 +
352 +
353 +;(function () {
354 + var methods = {
355 + 'readDoubleBE' : 8
356 + , 'readDoubleLE' : 8
357 + , 'readFloatBE' : 4
358 + , 'readFloatLE' : 4
359 + , 'readInt32BE' : 4
360 + , 'readInt32LE' : 4
361 + , 'readUInt32BE' : 4
362 + , 'readUInt32LE' : 4
363 + , 'readInt16BE' : 2
364 + , 'readInt16LE' : 2
365 + , 'readUInt16BE' : 2
366 + , 'readUInt16LE' : 2
367 + , 'readInt8' : 1
368 + , 'readUInt8' : 1
369 + , 'readIntBE' : null
370 + , 'readIntLE' : null
371 + , 'readUIntBE' : null
372 + , 'readUIntLE' : null
373 + }
374 +
375 + for (var m in methods) {
376 + (function (m) {
377 + if (methods[m] === null) {
378 + BufferList.prototype[m] = function (offset, byteLength) {
379 + return this.slice(offset, offset + byteLength)[m](0, byteLength)
380 + }
381 + }
382 + else {
383 + BufferList.prototype[m] = function (offset) {
384 + return this.slice(offset, offset + methods[m])[m](0)
385 + }
386 + }
387 + }(m))
388 + }
389 +}())
390 +
391 +
392 +module.exports = BufferList
1 +{
2 + "_from": "bl@^2.2.1",
3 + "_id": "bl@2.2.1",
4 + "_inBundle": false,
5 + "_integrity": "sha512-6Pesp1w0DEX1N550i/uGV/TqucVL4AM/pgThFSN/Qq9si1/DF9aIHs1BxD8V/QU0HoeHO6cQRTAuYnLPKq1e4g==",
6 + "_location": "/bl",
7 + "_phantomChildren": {},
8 + "_requested": {
9 + "type": "range",
10 + "registry": true,
11 + "raw": "bl@^2.2.1",
12 + "name": "bl",
13 + "escapedName": "bl",
14 + "rawSpec": "^2.2.1",
15 + "saveSpec": null,
16 + "fetchSpec": "^2.2.1"
17 + },
18 + "_requiredBy": [
19 + "/mongodb"
20 + ],
21 + "_resolved": "https://registry.npmjs.org/bl/-/bl-2.2.1.tgz",
22 + "_shasum": "8c11a7b730655c5d56898cdc871224f40fd901d5",
23 + "_spec": "bl@^2.2.1",
24 + "_where": "/Users/mindyeoi/Desktop/We-Shop/boiler-plate/node_modules/mongodb",
25 + "authors": [
26 + "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)",
27 + "Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
28 + "Jarett Cruger <jcrugzz@gmail.com> (https://github.com/jcrugzz)"
29 + ],
30 + "bugs": {
31 + "url": "https://github.com/rvagg/bl/issues"
32 + },
33 + "bundleDependencies": false,
34 + "dependencies": {
35 + "readable-stream": "^2.3.5",
36 + "safe-buffer": "^5.1.1"
37 + },
38 + "deprecated": false,
39 + "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
40 + "devDependencies": {
41 + "faucet": "0.0.1",
42 + "hash_file": "~0.1.1",
43 + "tape": "~4.9.0"
44 + },
45 + "homepage": "https://github.com/rvagg/bl",
46 + "keywords": [
47 + "buffer",
48 + "buffers",
49 + "stream",
50 + "awesomesauce"
51 + ],
52 + "license": "MIT",
53 + "main": "bl.js",
54 + "name": "bl",
55 + "repository": {
56 + "type": "git",
57 + "url": "git+https://github.com/rvagg/bl.git"
58 + },
59 + "scripts": {
60 + "test": "node test/test.js | faucet"
61 + },
62 + "version": "2.2.1"
63 +}
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +The MIT License (MIT)
2 +
3 +Copyright (c) 2013-2017 Petka Antonov
4 +
5 +Permission is hereby granted, free of charge, to any person obtaining a copy
6 +of this software and associated documentation files (the "Software"), to deal
7 +in the Software without restriction, including without limitation the rights
8 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 +copies of the Software, and to permit persons to whom the Software is
10 +furnished to do so, subject to the following conditions:
11 +
12 +The above copyright notice and this permission notice shall be included in
13 +all copies or substantial portions of the Software.
14 +
15 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 +THE SOFTWARE.
1 +<a href="http://promisesaplus.com/">
2 + <img src="http://promisesaplus.com/assets/logo-small.png" alt="Promises/A+ logo"
3 + title="Promises/A+ 1.1 compliant" align="right" />
4 +</a>
5 +
6 +[![Build Status](https://travis-ci.org/petkaantonov/bluebird.svg?branch=master)](https://travis-ci.org/petkaantonov/bluebird)
7 +[![coverage-98%](https://img.shields.io/badge/coverage-98%25-brightgreen.svg?style=flat)](http://petkaantonov.github.io/bluebird/coverage/debug/index.html)
8 +
9 +**Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises)
10 +
11 +# Introduction
12 +
13 +Bluebird is a fully featured promise library with focus on innovative features and performance
14 +
15 +See the [**bluebird website**](http://bluebirdjs.com/docs/getting-started.html) for further documentation, references and instructions. See the [**API reference**](http://bluebirdjs.com/docs/api-reference.html) here.
16 +
17 +For bluebird 2.x documentation and files, see the [2.x tree](https://github.com/petkaantonov/bluebird/tree/2.x).
18 +
19 +# Questions and issues
20 +
21 +The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`.
22 +
23 +
24 +
25 +## Thanks
26 +
27 +Thanks to BrowserStack for providing us with a free account which lets us support old browsers like IE8.
28 +
29 +# License
30 +
31 +The MIT License (MIT)
32 +
33 +Copyright (c) 2013-2017 Petka Antonov
34 +
35 +Permission is hereby granted, free of charge, to any person obtaining a copy
36 +of this software and associated documentation files (the "Software"), to deal
37 +in the Software without restriction, including without limitation the rights
38 +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
39 +copies of the Software, and to permit persons to whom the Software is
40 +furnished to do so, subject to the following conditions:
41 +
42 +The above copyright notice and this permission notice shall be included in
43 +all copies or substantial portions of the Software.
44 +
45 +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
46 +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
47 +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
48 +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
49 +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
50 +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
51 +THE SOFTWARE.
52 +
1 +[http://bluebirdjs.com/docs/changelog.html](http://bluebirdjs.com/docs/changelog.html)
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
1 +"use strict";
2 +module.exports = function(Promise) {
3 +var SomePromiseArray = Promise._SomePromiseArray;
4 +function any(promises) {
5 + var ret = new SomePromiseArray(promises);
6 + var promise = ret.promise();
7 + ret.setHowMany(1);
8 + ret.setUnwrap();
9 + ret.init();
10 + return promise;
11 +}
12 +
13 +Promise.any = function (promises) {
14 + return any(promises);
15 +};
16 +
17 +Promise.prototype.any = function () {
18 + return any(this);
19 +};
20 +
21 +};
1 +"use strict";
2 +module.exports = (function(){
3 +var AssertionError = (function() {
4 + function AssertionError(a) {
5 + this.constructor$(a);
6 + this.message = a;
7 + this.name = "AssertionError";
8 + }
9 + AssertionError.prototype = new Error();
10 + AssertionError.prototype.constructor = AssertionError;
11 + AssertionError.prototype.constructor$ = Error;
12 + return AssertionError;
13 +})();
14 +
15 +function getParams(args) {
16 + var params = [];
17 + for (var i = 0; i < args.length; ++i) params.push("arg" + i);
18 + return params;
19 +}
20 +
21 +function nativeAssert(callName, args, expect) {
22 + try {
23 + var params = getParams(args);
24 + var constructorArgs = params;
25 + constructorArgs.push("return " +
26 + callName + "("+ params.join(",") + ");");
27 + var fn = Function.apply(null, constructorArgs);
28 + return fn.apply(null, args);
29 + } catch (e) {
30 + if (!(e instanceof SyntaxError)) {
31 + throw e;
32 + } else {
33 + return expect;
34 + }
35 + }
36 +}
37 +
38 +return function assert(boolExpr, message) {
39 + if (boolExpr === true) return;
40 +
41 + if (typeof boolExpr === "string" &&
42 + boolExpr.charAt(0) === "%") {
43 + var nativeCallName = boolExpr;
44 + var $_len = arguments.length;var args = new Array(Math.max($_len - 2, 0)); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];};
45 + if (nativeAssert(nativeCallName, args, message) === message) return;
46 + message = (nativeCallName + " !== " + message);
47 + }
48 +
49 + var ret = new AssertionError(message);
50 + if (Error.captureStackTrace) {
51 + Error.captureStackTrace(ret, assert);
52 + }
53 + throw ret;
54 +};
55 +})();
1 +"use strict";
2 +var firstLineError;
3 +try {throw new Error(); } catch (e) {firstLineError = e;}
4 +var schedule = require("./schedule");
5 +var Queue = require("./queue");
6 +var util = require("./util");
7 +
8 +function Async() {
9 + this._customScheduler = false;
10 + this._isTickUsed = false;
11 + this._lateQueue = new Queue(16);
12 + this._normalQueue = new Queue(16);
13 + this._haveDrainedQueues = false;
14 + this._trampolineEnabled = true;
15 + var self = this;
16 + this.drainQueues = function () {
17 + self._drainQueues();
18 + };
19 + this._schedule = schedule;
20 +}
21 +
22 +Async.prototype.setScheduler = function(fn) {
23 + var prev = this._schedule;
24 + this._schedule = fn;
25 + this._customScheduler = true;
26 + return prev;
27 +};
28 +
29 +Async.prototype.hasCustomScheduler = function() {
30 + return this._customScheduler;
31 +};
32 +
33 +Async.prototype.enableTrampoline = function() {
34 + this._trampolineEnabled = true;
35 +};
36 +
37 +Async.prototype.disableTrampolineIfNecessary = function() {
38 + if (util.hasDevTools) {
39 + this._trampolineEnabled = false;
40 + }
41 +};
42 +
43 +Async.prototype.haveItemsQueued = function () {
44 + return this._isTickUsed || this._haveDrainedQueues;
45 +};
46 +
47 +
48 +Async.prototype.fatalError = function(e, isNode) {
49 + if (isNode) {
50 + process.stderr.write("Fatal " + (e instanceof Error ? e.stack : e) +
51 + "\n");
52 + process.exit(2);
53 + } else {
54 + this.throwLater(e);
55 + }
56 +};
57 +
58 +Async.prototype.throwLater = function(fn, arg) {
59 + if (arguments.length === 1) {
60 + arg = fn;
61 + fn = function () { throw arg; };
62 + }
63 + if (typeof setTimeout !== "undefined") {
64 + setTimeout(function() {
65 + fn(arg);
66 + }, 0);
67 + } else try {
68 + this._schedule(function() {
69 + fn(arg);
70 + });
71 + } catch (e) {
72 + throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/MqrFmX\u000a");
73 + }
74 +};
75 +
76 +function AsyncInvokeLater(fn, receiver, arg) {
77 + this._lateQueue.push(fn, receiver, arg);
78 + this._queueTick();
79 +}
80 +
81 +function AsyncInvoke(fn, receiver, arg) {
82 + this._normalQueue.push(fn, receiver, arg);
83 + this._queueTick();
84 +}
85 +
86 +function AsyncSettlePromises(promise) {
87 + this._normalQueue._pushOne(promise);
88 + this._queueTick();
89 +}
90 +
91 +if (!util.hasDevTools) {
92 + Async.prototype.invokeLater = AsyncInvokeLater;
93 + Async.prototype.invoke = AsyncInvoke;
94 + Async.prototype.settlePromises = AsyncSettlePromises;
95 +} else {
96 + Async.prototype.invokeLater = function (fn, receiver, arg) {
97 + if (this._trampolineEnabled) {
98 + AsyncInvokeLater.call(this, fn, receiver, arg);
99 + } else {
100 + this._schedule(function() {
101 + setTimeout(function() {
102 + fn.call(receiver, arg);
103 + }, 100);
104 + });
105 + }
106 + };
107 +
108 + Async.prototype.invoke = function (fn, receiver, arg) {
109 + if (this._trampolineEnabled) {
110 + AsyncInvoke.call(this, fn, receiver, arg);
111 + } else {
112 + this._schedule(function() {
113 + fn.call(receiver, arg);
114 + });
115 + }
116 + };
117 +
118 + Async.prototype.settlePromises = function(promise) {
119 + if (this._trampolineEnabled) {
120 + AsyncSettlePromises.call(this, promise);
121 + } else {
122 + this._schedule(function() {
123 + promise._settlePromises();
124 + });
125 + }
126 + };
127 +}
128 +
129 +Async.prototype._drainQueue = function(queue) {
130 + while (queue.length() > 0) {
131 + var fn = queue.shift();
132 + if (typeof fn !== "function") {
133 + fn._settlePromises();
134 + continue;
135 + }
136 + var receiver = queue.shift();
137 + var arg = queue.shift();
138 + fn.call(receiver, arg);
139 + }
140 +};
141 +
142 +Async.prototype._drainQueues = function () {
143 + this._drainQueue(this._normalQueue);
144 + this._reset();
145 + this._haveDrainedQueues = true;
146 + this._drainQueue(this._lateQueue);
147 +};
148 +
149 +Async.prototype._queueTick = function () {
150 + if (!this._isTickUsed) {
151 + this._isTickUsed = true;
152 + this._schedule(this.drainQueues);
153 + }
154 +};
155 +
156 +Async.prototype._reset = function () {
157 + this._isTickUsed = false;
158 +};
159 +
160 +module.exports = Async;
161 +module.exports.firstLineError = firstLineError;
1 +"use strict";
2 +module.exports = function(Promise, INTERNAL, tryConvertToPromise, debug) {
3 +var calledBind = false;
4 +var rejectThis = function(_, e) {
5 + this._reject(e);
6 +};
7 +
8 +var targetRejected = function(e, context) {
9 + context.promiseRejectionQueued = true;
10 + context.bindingPromise._then(rejectThis, rejectThis, null, this, e);
11 +};
12 +
13 +var bindingResolved = function(thisArg, context) {
14 + if (((this._bitField & 50397184) === 0)) {
15 + this._resolveCallback(context.target);
16 + }
17 +};
18 +
19 +var bindingRejected = function(e, context) {
20 + if (!context.promiseRejectionQueued) this._reject(e);
21 +};
22 +
23 +Promise.prototype.bind = function (thisArg) {
24 + if (!calledBind) {
25 + calledBind = true;
26 + Promise.prototype._propagateFrom = debug.propagateFromFunction();
27 + Promise.prototype._boundValue = debug.boundValueFunction();
28 + }
29 + var maybePromise = tryConvertToPromise(thisArg);
30 + var ret = new Promise(INTERNAL);
31 + ret._propagateFrom(this, 1);
32 + var target = this._target();
33 + ret._setBoundTo(maybePromise);
34 + if (maybePromise instanceof Promise) {
35 + var context = {
36 + promiseRejectionQueued: false,
37 + promise: ret,
38 + target: target,
39 + bindingPromise: maybePromise
40 + };
41 + target._then(INTERNAL, targetRejected, undefined, ret, context);
42 + maybePromise._then(
43 + bindingResolved, bindingRejected, undefined, ret, context);
44 + ret._setOnCancel(maybePromise);
45 + } else {
46 + ret._resolveCallback(target);
47 + }
48 + return ret;
49 +};
50 +
51 +Promise.prototype._setBoundTo = function (obj) {
52 + if (obj !== undefined) {
53 + this._bitField = this._bitField | 2097152;
54 + this._boundTo = obj;
55 + } else {
56 + this._bitField = this._bitField & (~2097152);
57 + }
58 +};
59 +
60 +Promise.prototype._isBound = function () {
61 + return (this._bitField & 2097152) === 2097152;
62 +};
63 +
64 +Promise.bind = function (thisArg, value) {
65 + return Promise.resolve(value).bind(thisArg);
66 +};
67 +};
1 +"use strict";
2 +var old;
3 +if (typeof Promise !== "undefined") old = Promise;
4 +function noConflict() {
5 + try { if (Promise === bluebird) Promise = old; }
6 + catch (e) {}
7 + return bluebird;
8 +}
9 +var bluebird = require("./promise")();
10 +bluebird.noConflict = noConflict;
11 +module.exports = bluebird;
1 +"use strict";
2 +var cr = Object.create;
3 +if (cr) {
4 + var callerCache = cr(null);
5 + var getterCache = cr(null);
6 + callerCache[" size"] = getterCache[" size"] = 0;
7 +}
8 +
9 +module.exports = function(Promise) {
10 +var util = require("./util");
11 +var canEvaluate = util.canEvaluate;
12 +var isIdentifier = util.isIdentifier;
13 +
14 +var getMethodCaller;
15 +var getGetter;
16 +if (!false) {
17 +var makeMethodCaller = function (methodName) {
18 + return new Function("ensureMethod", " \n\
19 + return function(obj) { \n\
20 + 'use strict' \n\
21 + var len = this.length; \n\
22 + ensureMethod(obj, 'methodName'); \n\
23 + switch(len) { \n\
24 + case 1: return obj.methodName(this[0]); \n\
25 + case 2: return obj.methodName(this[0], this[1]); \n\
26 + case 3: return obj.methodName(this[0], this[1], this[2]); \n\
27 + case 0: return obj.methodName(); \n\
28 + default: \n\
29 + return obj.methodName.apply(obj, this); \n\
30 + } \n\
31 + }; \n\
32 + ".replace(/methodName/g, methodName))(ensureMethod);
33 +};
34 +
35 +var makeGetter = function (propertyName) {
36 + return new Function("obj", " \n\
37 + 'use strict'; \n\
38 + return obj.propertyName; \n\
39 + ".replace("propertyName", propertyName));
40 +};
41 +
42 +var getCompiled = function(name, compiler, cache) {
43 + var ret = cache[name];
44 + if (typeof ret !== "function") {
45 + if (!isIdentifier(name)) {
46 + return null;
47 + }
48 + ret = compiler(name);
49 + cache[name] = ret;
50 + cache[" size"]++;
51 + if (cache[" size"] > 512) {
52 + var keys = Object.keys(cache);
53 + for (var i = 0; i < 256; ++i) delete cache[keys[i]];
54 + cache[" size"] = keys.length - 256;
55 + }
56 + }
57 + return ret;
58 +};
59 +
60 +getMethodCaller = function(name) {
61 + return getCompiled(name, makeMethodCaller, callerCache);
62 +};
63 +
64 +getGetter = function(name) {
65 + return getCompiled(name, makeGetter, getterCache);
66 +};
67 +}
68 +
69 +function ensureMethod(obj, methodName) {
70 + var fn;
71 + if (obj != null) fn = obj[methodName];
72 + if (typeof fn !== "function") {
73 + var message = "Object " + util.classString(obj) + " has no method '" +
74 + util.toString(methodName) + "'";
75 + throw new Promise.TypeError(message);
76 + }
77 + return fn;
78 +}
79 +
80 +function caller(obj) {
81 + var methodName = this.pop();
82 + var fn = ensureMethod(obj, methodName);
83 + return fn.apply(obj, this);
84 +}
85 +Promise.prototype.call = function (methodName) {
86 + var $_len = arguments.length;var args = new Array(Math.max($_len - 1, 0)); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];};
87 + if (!false) {
88 + if (canEvaluate) {
89 + var maybeCaller = getMethodCaller(methodName);
90 + if (maybeCaller !== null) {
91 + return this._then(
92 + maybeCaller, undefined, undefined, args, undefined);
93 + }
94 + }
95 + }
96 + args.push(methodName);
97 + return this._then(caller, undefined, undefined, args, undefined);
98 +};
99 +
100 +function namedGetter(obj) {
101 + return obj[this];
102 +}
103 +function indexedGetter(obj) {
104 + var index = +this;
105 + if (index < 0) index = Math.max(0, index + obj.length);
106 + return obj[index];
107 +}
108 +Promise.prototype.get = function (propertyName) {
109 + var isIndex = (typeof propertyName === "number");
110 + var getter;
111 + if (!isIndex) {
112 + if (canEvaluate) {
113 + var maybeGetter = getGetter(propertyName);
114 + getter = maybeGetter !== null ? maybeGetter : namedGetter;
115 + } else {
116 + getter = namedGetter;
117 + }
118 + } else {
119 + getter = indexedGetter;
120 + }
121 + return this._then(getter, undefined, undefined, propertyName, undefined);
122 +};
123 +};
1 +"use strict";
2 +module.exports = function(Promise, PromiseArray, apiRejection, debug) {
3 +var util = require("./util");
4 +var tryCatch = util.tryCatch;
5 +var errorObj = util.errorObj;
6 +var async = Promise._async;
7 +
8 +Promise.prototype["break"] = Promise.prototype.cancel = function() {
9 + if (!debug.cancellation()) return this._warn("cancellation is disabled");
10 +
11 + var promise = this;
12 + var child = promise;
13 + while (promise._isCancellable()) {
14 + if (!promise._cancelBy(child)) {
15 + if (child._isFollowing()) {
16 + child._followee().cancel();
17 + } else {
18 + child._cancelBranched();
19 + }
20 + break;
21 + }
22 +
23 + var parent = promise._cancellationParent;
24 + if (parent == null || !parent._isCancellable()) {
25 + if (promise._isFollowing()) {
26 + promise._followee().cancel();
27 + } else {
28 + promise._cancelBranched();
29 + }
30 + break;
31 + } else {
32 + if (promise._isFollowing()) promise._followee().cancel();
33 + promise._setWillBeCancelled();
34 + child = promise;
35 + promise = parent;
36 + }
37 + }
38 +};
39 +
40 +Promise.prototype._branchHasCancelled = function() {
41 + this._branchesRemainingToCancel--;
42 +};
43 +
44 +Promise.prototype._enoughBranchesHaveCancelled = function() {
45 + return this._branchesRemainingToCancel === undefined ||
46 + this._branchesRemainingToCancel <= 0;
47 +};
48 +
49 +Promise.prototype._cancelBy = function(canceller) {
50 + if (canceller === this) {
51 + this._branchesRemainingToCancel = 0;
52 + this._invokeOnCancel();
53 + return true;
54 + } else {
55 + this._branchHasCancelled();
56 + if (this._enoughBranchesHaveCancelled()) {
57 + this._invokeOnCancel();
58 + return true;
59 + }
60 + }
61 + return false;
62 +};
63 +
64 +Promise.prototype._cancelBranched = function() {
65 + if (this._enoughBranchesHaveCancelled()) {
66 + this._cancel();
67 + }
68 +};
69 +
70 +Promise.prototype._cancel = function() {
71 + if (!this._isCancellable()) return;
72 + this._setCancelled();
73 + async.invoke(this._cancelPromises, this, undefined);
74 +};
75 +
76 +Promise.prototype._cancelPromises = function() {
77 + if (this._length() > 0) this._settlePromises();
78 +};
79 +
80 +Promise.prototype._unsetOnCancel = function() {
81 + this._onCancelField = undefined;
82 +};
83 +
84 +Promise.prototype._isCancellable = function() {
85 + return this.isPending() && !this._isCancelled();
86 +};
87 +
88 +Promise.prototype.isCancellable = function() {
89 + return this.isPending() && !this.isCancelled();
90 +};
91 +
92 +Promise.prototype._doInvokeOnCancel = function(onCancelCallback, internalOnly) {
93 + if (util.isArray(onCancelCallback)) {
94 + for (var i = 0; i < onCancelCallback.length; ++i) {
95 + this._doInvokeOnCancel(onCancelCallback[i], internalOnly);
96 + }
97 + } else if (onCancelCallback !== undefined) {
98 + if (typeof onCancelCallback === "function") {
99 + if (!internalOnly) {
100 + var e = tryCatch(onCancelCallback).call(this._boundValue());
101 + if (e === errorObj) {
102 + this._attachExtraTrace(e.e);
103 + async.throwLater(e.e);
104 + }
105 + }
106 + } else {
107 + onCancelCallback._resultCancelled(this);
108 + }
109 + }
110 +};
111 +
112 +Promise.prototype._invokeOnCancel = function() {
113 + var onCancelCallback = this._onCancel();
114 + this._unsetOnCancel();
115 + async.invoke(this._doInvokeOnCancel, this, onCancelCallback);
116 +};
117 +
118 +Promise.prototype._invokeInternalOnCancel = function() {
119 + if (this._isCancellable()) {
120 + this._doInvokeOnCancel(this._onCancel(), true);
121 + this._unsetOnCancel();
122 + }
123 +};
124 +
125 +Promise.prototype._resultCancelled = function() {
126 + this.cancel();
127 +};
128 +
129 +};
1 +"use strict";
2 +module.exports = function(NEXT_FILTER) {
3 +var util = require("./util");
4 +var getKeys = require("./es5").keys;
5 +var tryCatch = util.tryCatch;
6 +var errorObj = util.errorObj;
7 +
8 +function catchFilter(instances, cb, promise) {
9 + return function(e) {
10 + var boundTo = promise._boundValue();
11 + predicateLoop: for (var i = 0; i < instances.length; ++i) {
12 + var item = instances[i];
13 +
14 + if (item === Error ||
15 + (item != null && item.prototype instanceof Error)) {
16 + if (e instanceof item) {
17 + return tryCatch(cb).call(boundTo, e);
18 + }
19 + } else if (typeof item === "function") {
20 + var matchesPredicate = tryCatch(item).call(boundTo, e);
21 + if (matchesPredicate === errorObj) {
22 + return matchesPredicate;
23 + } else if (matchesPredicate) {
24 + return tryCatch(cb).call(boundTo, e);
25 + }
26 + } else if (util.isObject(e)) {
27 + var keys = getKeys(item);
28 + for (var j = 0; j < keys.length; ++j) {
29 + var key = keys[j];
30 + if (item[key] != e[key]) {
31 + continue predicateLoop;
32 + }
33 + }
34 + return tryCatch(cb).call(boundTo, e);
35 + }
36 + }
37 + return NEXT_FILTER;
38 + };
39 +}
40 +
41 +return catchFilter;
42 +};
1 +"use strict";
2 +module.exports = function(Promise) {
3 +var longStackTraces = false;
4 +var contextStack = [];
5 +
6 +Promise.prototype._promiseCreated = function() {};
7 +Promise.prototype._pushContext = function() {};
8 +Promise.prototype._popContext = function() {return null;};
9 +Promise._peekContext = Promise.prototype._peekContext = function() {};
10 +
11 +function Context() {
12 + this._trace = new Context.CapturedTrace(peekContext());
13 +}
14 +Context.prototype._pushContext = function () {
15 + if (this._trace !== undefined) {
16 + this._trace._promiseCreated = null;
17 + contextStack.push(this._trace);
18 + }
19 +};
20 +
21 +Context.prototype._popContext = function () {
22 + if (this._trace !== undefined) {
23 + var trace = contextStack.pop();
24 + var ret = trace._promiseCreated;
25 + trace._promiseCreated = null;
26 + return ret;
27 + }
28 + return null;
29 +};
30 +
31 +function createContext() {
32 + if (longStackTraces) return new Context();
33 +}
34 +
35 +function peekContext() {
36 + var lastIndex = contextStack.length - 1;
37 + if (lastIndex >= 0) {
38 + return contextStack[lastIndex];
39 + }
40 + return undefined;
41 +}
42 +Context.CapturedTrace = null;
43 +Context.create = createContext;
44 +Context.deactivateLongStackTraces = function() {};
45 +Context.activateLongStackTraces = function() {
46 + var Promise_pushContext = Promise.prototype._pushContext;
47 + var Promise_popContext = Promise.prototype._popContext;
48 + var Promise_PeekContext = Promise._peekContext;
49 + var Promise_peekContext = Promise.prototype._peekContext;
50 + var Promise_promiseCreated = Promise.prototype._promiseCreated;
51 + Context.deactivateLongStackTraces = function() {
52 + Promise.prototype._pushContext = Promise_pushContext;
53 + Promise.prototype._popContext = Promise_popContext;
54 + Promise._peekContext = Promise_PeekContext;
55 + Promise.prototype._peekContext = Promise_peekContext;
56 + Promise.prototype._promiseCreated = Promise_promiseCreated;
57 + longStackTraces = false;
58 + };
59 + longStackTraces = true;
60 + Promise.prototype._pushContext = Context.prototype._pushContext;
61 + Promise.prototype._popContext = Context.prototype._popContext;
62 + Promise._peekContext = Promise.prototype._peekContext = peekContext;
63 + Promise.prototype._promiseCreated = function() {
64 + var ctx = this._peekContext();
65 + if (ctx && ctx._promiseCreated == null) ctx._promiseCreated = this;
66 + };
67 +};
68 +return Context;
69 +};
This diff is collapsed. Click to expand it.
1 +"use strict";
2 +module.exports = function(Promise) {
3 +function returner() {
4 + return this.value;
5 +}
6 +function thrower() {
7 + throw this.reason;
8 +}
9 +
10 +Promise.prototype["return"] =
11 +Promise.prototype.thenReturn = function (value) {
12 + if (value instanceof Promise) value.suppressUnhandledRejections();
13 + return this._then(
14 + returner, undefined, undefined, {value: value}, undefined);
15 +};
16 +
17 +Promise.prototype["throw"] =
18 +Promise.prototype.thenThrow = function (reason) {
19 + return this._then(
20 + thrower, undefined, undefined, {reason: reason}, undefined);
21 +};
22 +
23 +Promise.prototype.catchThrow = function (reason) {
24 + if (arguments.length <= 1) {
25 + return this._then(
26 + undefined, thrower, undefined, {reason: reason}, undefined);
27 + } else {
28 + var _reason = arguments[1];
29 + var handler = function() {throw _reason;};
30 + return this.caught(reason, handler);
31 + }
32 +};
33 +
34 +Promise.prototype.catchReturn = function (value) {
35 + if (arguments.length <= 1) {
36 + if (value instanceof Promise) value.suppressUnhandledRejections();
37 + return this._then(
38 + undefined, returner, undefined, {value: value}, undefined);
39 + } else {
40 + var _value = arguments[1];
41 + if (_value instanceof Promise) _value.suppressUnhandledRejections();
42 + var handler = function() {return _value;};
43 + return this.caught(value, handler);
44 + }
45 +};
46 +};
1 +"use strict";
2 +module.exports = function(Promise, INTERNAL) {
3 +var PromiseReduce = Promise.reduce;
4 +var PromiseAll = Promise.all;
5 +
6 +function promiseAllThis() {
7 + return PromiseAll(this);
8 +}
9 +
10 +function PromiseMapSeries(promises, fn) {
11 + return PromiseReduce(promises, fn, INTERNAL, INTERNAL);
12 +}
13 +
14 +Promise.prototype.each = function (fn) {
15 + return PromiseReduce(this, fn, INTERNAL, 0)
16 + ._then(promiseAllThis, undefined, undefined, this, undefined);
17 +};
18 +
19 +Promise.prototype.mapSeries = function (fn) {
20 + return PromiseReduce(this, fn, INTERNAL, INTERNAL);
21 +};
22 +
23 +Promise.each = function (promises, fn) {
24 + return PromiseReduce(promises, fn, INTERNAL, 0)
25 + ._then(promiseAllThis, undefined, undefined, promises, undefined);
26 +};
27 +
28 +Promise.mapSeries = PromiseMapSeries;
29 +};
30 +
1 +"use strict";
2 +var es5 = require("./es5");
3 +var Objectfreeze = es5.freeze;
4 +var util = require("./util");
5 +var inherits = util.inherits;
6 +var notEnumerableProp = util.notEnumerableProp;
7 +
8 +function subError(nameProperty, defaultMessage) {
9 + function SubError(message) {
10 + if (!(this instanceof SubError)) return new SubError(message);
11 + notEnumerableProp(this, "message",
12 + typeof message === "string" ? message : defaultMessage);
13 + notEnumerableProp(this, "name", nameProperty);
14 + if (Error.captureStackTrace) {
15 + Error.captureStackTrace(this, this.constructor);
16 + } else {
17 + Error.call(this);
18 + }
19 + }
20 + inherits(SubError, Error);
21 + return SubError;
22 +}
23 +
24 +var _TypeError, _RangeError;
25 +var Warning = subError("Warning", "warning");
26 +var CancellationError = subError("CancellationError", "cancellation error");
27 +var TimeoutError = subError("TimeoutError", "timeout error");
28 +var AggregateError = subError("AggregateError", "aggregate error");
29 +try {
30 + _TypeError = TypeError;
31 + _RangeError = RangeError;
32 +} catch(e) {
33 + _TypeError = subError("TypeError", "type error");
34 + _RangeError = subError("RangeError", "range error");
35 +}
36 +
37 +var methods = ("join pop push shift unshift slice filter forEach some " +
38 + "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" ");
39 +
40 +for (var i = 0; i < methods.length; ++i) {
41 + if (typeof Array.prototype[methods[i]] === "function") {
42 + AggregateError.prototype[methods[i]] = Array.prototype[methods[i]];
43 + }
44 +}
45 +
46 +es5.defineProperty(AggregateError.prototype, "length", {
47 + value: 0,
48 + configurable: false,
49 + writable: true,
50 + enumerable: true
51 +});
52 +AggregateError.prototype["isOperational"] = true;
53 +var level = 0;
54 +AggregateError.prototype.toString = function() {
55 + var indent = Array(level * 4 + 1).join(" ");
56 + var ret = "\n" + indent + "AggregateError of:" + "\n";
57 + level++;
58 + indent = Array(level * 4 + 1).join(" ");
59 + for (var i = 0; i < this.length; ++i) {
60 + var str = this[i] === this ? "[Circular AggregateError]" : this[i] + "";
61 + var lines = str.split("\n");
62 + for (var j = 0; j < lines.length; ++j) {
63 + lines[j] = indent + lines[j];
64 + }
65 + str = lines.join("\n");
66 + ret += str + "\n";
67 + }
68 + level--;
69 + return ret;
70 +};
71 +
72 +function OperationalError(message) {
73 + if (!(this instanceof OperationalError))
74 + return new OperationalError(message);
75 + notEnumerableProp(this, "name", "OperationalError");
76 + notEnumerableProp(this, "message", message);
77 + this.cause = message;
78 + this["isOperational"] = true;
79 +
80 + if (message instanceof Error) {
81 + notEnumerableProp(this, "message", message.message);
82 + notEnumerableProp(this, "stack", message.stack);
83 + } else if (Error.captureStackTrace) {
84 + Error.captureStackTrace(this, this.constructor);
85 + }
86 +
87 +}
88 +inherits(OperationalError, Error);
89 +
90 +var errorTypes = Error["__BluebirdErrorTypes__"];
91 +if (!errorTypes) {
92 + errorTypes = Objectfreeze({
93 + CancellationError: CancellationError,
94 + TimeoutError: TimeoutError,
95 + OperationalError: OperationalError,
96 + RejectionError: OperationalError,
97 + AggregateError: AggregateError
98 + });
99 + es5.defineProperty(Error, "__BluebirdErrorTypes__", {
100 + value: errorTypes,
101 + writable: false,
102 + enumerable: false,
103 + configurable: false
104 + });
105 +}
106 +
107 +module.exports = {
108 + Error: Error,
109 + TypeError: _TypeError,
110 + RangeError: _RangeError,
111 + CancellationError: errorTypes.CancellationError,
112 + OperationalError: errorTypes.OperationalError,
113 + TimeoutError: errorTypes.TimeoutError,
114 + AggregateError: errorTypes.AggregateError,
115 + Warning: Warning
116 +};
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.