Added typings for "heapdump". (#20716)

* Added typings for "require-dir".

* Fixed dtslint errors.

* Fixed By field.

* Added typings for "restify-cookies".

* Added "cookies" field to Request interface.

* Added typings for "heapdump".
This commit is contained in:
Viktor Isaev
2017-10-19 18:31:05 +03:00
committed by Andy
parent 1d3179901c
commit f9aa971b27
4 changed files with 41 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
import * as heapdump from 'heapdump';
heapdump.writeSnapshot('/tmp/myDump', (err) => {
if (err) {
console.log('Failed to dump heap: ' + err);
} else {
console.log('Successfully dumped heap!');
}
});

6
types/heapdump/index.d.ts vendored Normal file
View File

@@ -0,0 +1,6 @@
// Type definitions for heapdump 0.3
// Project: https://github.com/bnoordhuis/node-heapdump
// Definitions by: weekens <https://github.com/weekens>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function writeSnapshot(dumpFileName: string, callback: (err?: Error) => void): void;

View File

@@ -0,0 +1,25 @@
{
"compilerOptions": {
"target": "es6",
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"heapdump-tests.ts"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }