diff --git a/types/ganache-core/ganache-core-tests.ts b/types/ganache-core/ganache-core-tests.ts new file mode 100644 index 0000000000..c0a6121c34 --- /dev/null +++ b/types/ganache-core/ganache-core-tests.ts @@ -0,0 +1,3 @@ +import { provider } from "ganache-core"; + +provider({ verbose: true }); diff --git a/types/ganache-core/index.d.ts b/types/ganache-core/index.d.ts new file mode 100644 index 0000000000..9297848806 --- /dev/null +++ b/types/ganache-core/index.d.ts @@ -0,0 +1,19 @@ +// Type definitions for ganache-core 2.1 +// Project: https://github.com/trufflesuite/ganache-core#readme +// Definitions by: Leonid Logvinov +// 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; diff --git a/types/ganache-core/tsconfig.json b/types/ganache-core/tsconfig.json new file mode 100644 index 0000000000..ecbab1915e --- /dev/null +++ b/types/ganache-core/tsconfig.json @@ -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" + ] +} diff --git a/types/ganache-core/tslint.json b/types/ganache-core/tslint.json new file mode 100644 index 0000000000..3db14f85ea --- /dev/null +++ b/types/ganache-core/tslint.json @@ -0,0 +1 @@ +{ "extends": "dtslint/dt.json" }