import { PacketBody } from './packet';

export interface ProtocolRequest {
  _id?: string;
}

export interface ProtocolResponse {
  _id?: string;
  Type?: number;
}

export interface ProtocolStream {
  _id?: string;
  Type?: number;
}

// tslint:disable-next-line: no-empty-interface
export interface ProtocolNotification {}

export interface ProtocolMessage {
  serviceType: number;
  subServiceType: number;
  senderSeq: number;
  bodyList: any[];
}

export type ProtocolEncoder<REQ> = (req: REQ) => PacketBody[];

export type ProtocolDecoder<RES> = (message: ProtocolMessage) => RES;
