Improve 'web3-provider-engine' typings

This commit is contained in:
Nikita Galkin
2018-06-23 16:32:07 +03:00
committed by Leonid Logvinov
parent 73c36fe2d2
commit 84bd54ba40
2 changed files with 18 additions and 1 deletions

View File

@@ -1,6 +1,12 @@
declare module 'web3-provider-engine' {
import { Provider, JSONRPCRequestPayload, JSONRPCResponsePayload } from 'ethereum-types';
interface Web3ProviderEngineOptions {
pollingInterval?: number;
blockTracker?: any;
blockTrackerProvider?: any;
}
class Web3ProviderEngine implements Provider {
constructor(options?: Web3ProviderEngineOptions);
public on(event: string, handler: () => void): void;
public send(payload: JSONRPCRequestPayload): void;
public sendAsync(
@@ -8,7 +14,9 @@ declare module 'web3-provider-engine' {
callback: (error: null | Error, response: JSONRPCResponsePayload) => void,
): void;
public addProvider(provider: any): void;
public start(): void;
// start block polling
public start(callback?: () => void): void;
// stop block polling
public stop(): void;
}
export = Web3ProviderEngine;