etcd3-mock
Version:
19 lines (18 loc) • 822 B
TypeScript
/// <reference types="node" />
import { EtcdError } from 'etcd3';
import { EventEmitter } from 'events';
export declare class WatchBuilder {
key(key: string | Buffer): this;
prefix(value: string | Buffer): this;
create(): Promise<Watch>;
}
export declare class Watch extends EventEmitter {
on(event: 'connecting', handler: (req: any) => void): this;
on(event: 'connected', handler: (res: any) => void): this;
on(event: 'data', handler: (res: any) => void): this;
on(event: 'put', handler: (kv: any, previous?: any) => void): this;
on(event: 'delete', handler: (kv: any, previous?: any) => void): this;
on(event: 'end', handler: () => void): this;
on(event: 'disconnected', handler: (res: EtcdError) => void): this;
on(event: 'error', handler: (err: EtcdError) => void): this;
}