Adding typings for json-rpc-random-id

Matching dslint

Using declare function

Header is required

Adding a comment

Moving export line

Missing space

Tslint...
This commit is contained in:
Micah Riggan 2018-10-27 15:18:48 -04:00
parent 644c7b5909
commit 833ffc438b
No known key found for this signature in database
GPG Key ID: 1DF0722D8116EE83
4 changed files with 40 additions and 0 deletions

14
types/json-rpc-random-id/index.d.ts vendored Normal file
View File

@ -0,0 +1,14 @@
// Type definitions for json-rpc-random-id 1.0
// Project: https://github.com/kumavis/json-rpc-random-id#readme
// Definitions by: Micah Riggan <https://github.com/micahriggan>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/**
* Returns a function that generates a random number
* This number is to be used with web3 rpc
*/
declare function IdIterator(options?: {
max?: number;
start?: number;
}): () => number;
export = IdIterator;

View File

@ -0,0 +1,2 @@
import jsonRPCRandomID = require("json-rpc-random-id");
const generateId = jsonRPCRandomID();

View File

@ -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",
"json-rpc-random-id-tests.ts"
]
}

View File

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