Improve 'web3-provider-engine' typings

This commit is contained in:
Nikita Galkin
2018-06-23 16:32:07 +03:00
parent 8fb5c29b4b
commit 5472500119
2 changed files with 18 additions and 1 deletions

View File

@@ -1,4 +1,13 @@
[
{
"version": "0.4.2",
"changes": [
{
"note": "Improve 'web3-provider-engine' typings",
"pr": 768
}
]
},
{
"timestamp": 1529397769,
"version": "0.4.1",

View File

@@ -1,10 +1,18 @@
declare module 'web3-provider-engine' {
interface Web3ProviderEngineOptions {
pollingInterval?: number;
blockTracker?: any;
blockTrackerProvider?: any;
}
class Web3ProviderEngine {
constructor(options?: Web3ProviderEngineOptions);
public on(event: string, handler: () => void): void;
public send(payload: any): void;
public sendAsync(payload: any, callback: (error: any, response: any) => 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;