mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Merge pull request #30846 from BendingBender/randombytes
Add types for randombytes
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
// Type definitions for randombytes 2.0
|
||||
// Project: https://github.com/crypto-browserify/randombytes
|
||||
// Definitions by: BendingBender <https://github.com/BendingBender>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
import { randomBytes as _randomBytes } from 'crypto';
|
||||
|
||||
export = randomBytes;
|
||||
|
||||
declare const randomBytes: typeof _randomBytes;
|
||||
@@ -0,0 +1,11 @@
|
||||
import randomBytes = require('randombytes');
|
||||
|
||||
// $ExpectType Buffer
|
||||
randomBytes(16);
|
||||
// $ExpectType void
|
||||
randomBytes(16, (err, resp) => {
|
||||
// $ExpectType Error | null
|
||||
err;
|
||||
// $ExpectType Buffer
|
||||
resp;
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"randombytes-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user