Artifact Content
Not logged in

Artifact 23450254e960846a65d5e94e7b5d085b32bcd724:



import { EventEmitter } from 'events'
export interface FunctionWithVersion extends Function {
  version?: number
}

export type DataHandler = (data: Buffer) => Promise<Buffer>

export type MoneyHandler = (amount: string) => Promise<void>

export interface PluginV2 extends EventEmitter {
  constructor: FunctionWithVersion
  connect: () => Promise<void>
  disconnect: () => Promise<void>
  isConnected: () => boolean
  sendData: DataHandler
  sendMoney: MoneyHandler
  registerDataHandler: (handler: DataHandler) => void
  deregisterDataHandler: () => void
  registerMoneyHandler: (handler: MoneyHandler) => void
  deregisterMoneyHandler: () => void
}