Add types for ganache-core (#27572)

This commit is contained in:
Leonid Logvinov 2018-07-25 18:06:43 +02:00 committed by Andy
parent 2a3696f7b4
commit 74bb1da61c
4 changed files with 46 additions and 0 deletions

View File

@ -0,0 +1,3 @@
import { provider } from "ganache-core";
provider({ verbose: true });

19
types/ganache-core/index.d.ts vendored Normal file
View File

@ -0,0 +1,19 @@
// Type definitions for ganache-core 2.1
// Project: https://github.com/trufflesuite/ganache-core#readme
// Definitions by: Leonid Logvinov <https://github.com/LogvinovLeon>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.4
import { Provider } from "ethereum-protocol";
export interface GanacheOpts {
verbose?: boolean;
logger?: {
log(msg: string): void;
};
port?: number;
network_id?: number;
networkId?: number;
mnemonic?: string;
gasLimit?: number;
}
export function provider(opts: GanacheOpts): Provider;

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",
"ganache-core-tests.ts"
]
}

View File

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