UI for Zipcoin Blue

index.d.ts 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * Minimal `EventEmitter` interface that is molded against the Node.js
  3. * `EventEmitter` interface.
  4. */
  5. declare class EventEmitter<EventTypes extends string | symbol = string | symbol> {
  6. static prefixed: string | boolean;
  7. /**
  8. * Return an array listing the events for which the emitter has registered
  9. * listeners.
  10. */
  11. eventNames(): Array<EventTypes>;
  12. /**
  13. * Return the listeners registered for a given event.
  14. */
  15. listeners(event: EventTypes): Array<EventEmitter.ListenerFn>;
  16. /**
  17. * Return the number of listeners listening to a given event.
  18. */
  19. listenerCount(event: EventTypes): number;
  20. /**
  21. * Calls each of the listeners registered for a given event.
  22. */
  23. emit(event: EventTypes, ...args: Array<any>): boolean;
  24. /**
  25. * Add a listener for a given event.
  26. */
  27. on(event: EventTypes, fn: EventEmitter.ListenerFn, context?: any): this;
  28. addListener(event: EventTypes, fn: EventEmitter.ListenerFn, context?: any): this;
  29. /**
  30. * Add a one-time listener for a given event.
  31. */
  32. once(event: EventTypes, fn: EventEmitter.ListenerFn, context?: any): this;
  33. /**
  34. * Remove the listeners of a given event.
  35. */
  36. removeListener(event: EventTypes, fn?: EventEmitter.ListenerFn, context?: any, once?: boolean): this;
  37. off(event: EventTypes, fn?: EventEmitter.ListenerFn, context?: any, once?: boolean): this;
  38. /**
  39. * Remove all listeners, or those of the specified event.
  40. */
  41. removeAllListeners(event?: EventTypes): this;
  42. }
  43. declare namespace EventEmitter {
  44. export interface ListenerFn {
  45. (...args: Array<any>): void;
  46. }
  47. export interface EventEmitterStatic {
  48. new<EventTypes extends string | symbol = string | symbol>(): EventEmitter<EventTypes>;
  49. }
  50. export const EventEmitter: EventEmitterStatic;
  51. }
  52. export = EventEmitter;