1 |
|
2 |
|
3 |
|
4 |
|
5 | import EventEmitter from 'eventemitter3';
|
6 | import { Logger } from '@polkadot/util/types';
|
7 |
|
8 | export type MockState$Subscription$Callback = (error: Error | null, value: any) => void;
|
9 |
|
10 | export type MockState$Subscriptions = {
|
11 | [index: string]: {
|
12 | callbacks: {
|
13 | [index: number]: MockState$Subscription$Callback
|
14 | },
|
15 | lastValue: any
|
16 | }
|
17 | };
|
18 |
|
19 | export type MockState$Db = {
|
20 | [index: string]: Uint8Array
|
21 | };
|
22 |
|
23 | export type MockState$Requests = {
|
24 | [index: string]: (db: MockState$Db, params: Array<any>) => string
|
25 | };
|
26 |
|
27 | export type MockState = {
|
28 | emitter: EventEmitter,
|
29 | l: Logger,
|
30 | requests: MockState$Requests,
|
31 | db: MockState$Db,
|
32 | subscriptionId: number,
|
33 | subscriptionMap: {
|
34 | [index: number]: string
|
35 | },
|
36 | subscriptions: MockState$Subscriptions
|
37 | };
|