import { TTransport } from '../transports' ; import { defaultLogger } from '../logger' ; import { IInt64 , Int64 , IThriftField , IThriftList , IThriftMap , IThriftMessage , IThriftSet , IThriftStruct , LogFunction , MessageType , TType , } from '../types' ; export abstract class TProtocol { protected transport : TTransport ; protected logger : LogFunction ; protected requestId : number | null ; constructor ( trans , logger = defaultLogger ) { this . transport = trans ; this . logger = logger ; this . requestId = null ; } public getTransport ( ) { return this . transport ; } public flush ( ) { return this . transport . flush ( ) ; } public abstract writeMessageBegin ( name , type , seqid ) ; public abstract writeMessageEnd ( ) ; public abstract writeStructBegin ( name ) ; public abstract writeStructEnd ( ) ; public abstract writeFieldBegin ( name , type , id ) ; public abstract writeFieldEnd ( ) ; public abstract writeFieldStop ( ) ; public abstract writeMapBegin ( keyType , valueType , size ) ; public abstract writeMapEnd ( ) ; public abstract writeListBegin ( elementType , size ) ; public abstract writeListEnd ( ) ; public abstract writeSetBegin ( elementType , size ) ; public abstract writeSetEnd ( ) ; public abstract writeBool ( bool ) ; public abstract writeByte ( b ) ; public abstract writeI16 ( i16 ) ; public abstract writeI32 ( i32 ) ; public abstract writeI64 ( i64 ) ; public abstract writeDouble ( dbl ) ; public abstract writeString ( arg ) ; public abstract writeBinary ( arg ) ; public abstract readMessageBegin ( ) ; public abstract readMessageEnd ( ) ; public abstract readStructBegin ( ) ; public abstract readStructEnd ( ) ; public abstract readFieldBegin ( ) ; public abstract readFieldEnd ( ) ; public abstract readMapBegin ( ) ; public abstract readMapEnd ( ) ; public abstract readListBegin ( ) ; public abstract readListEnd ( ) ; public abstract readSetBegin ( ) ; public abstract readSetEnd ( ) ; public abstract readBool ( ) ; public abstract readByte ( ) ; public abstract readI16 ( ) ; public abstract readI32 ( ) ; public abstract readI64 ( ) ; public abstract readDouble ( ) ; public abstract readBinary ( ) ; public abstract readString ( ) ; public abstract skip ( type ) ; }