/// <reference types="node" />
import { Datastore } from 'interface-datastore';
import { Network } from '@textile/threads-network';
import { ThreadID, ThreadRecord } from '@textile/threads-core';
import { Options } from 'async-retry';
import { EventEmitter } from 'tsee';
import { Queue } from './queue';
export declare type Events = {
    record: (rec: ThreadRecord) => void;
};
export declare type EventJob<T> = {
    id: Buffer;
    body: T;
};
export declare class EventBus<T = any> extends EventEmitter<Events> {
    network: Network;
    isStarted: boolean;
    private closer?;
    queue: Queue<EventJob<T>>;
    constructor(queue: Queue<EventJob<T>> | Datastore<any>, network: Network, opts?: Options);
    private networkWatcher;
    start(id?: ThreadID): Promise<void>;
    stop(): Promise<void>;
    /**
     * Push an event onto to the queue
     * @param event Object to be serialized and pushed to queue via JSON.stringify().
     */
    push(event: EventJob<T>): Promise<string>;
}
