/**
 * ChunkCombiner is a simplified platform-neutral manipulation of Uint8arrays
 * that allows to process text data on the fly. The implementation can be optimized
 * for the target platform (node vs browser).
 */ export interface ChunkCombiner { param first param second returns concat ( first , second ) : Uint8Array ; param chunk param start param end returns toUtf8String ( chunk , start , end ) : string ; param chunk param start param end returns copy ( chunk , start , end ) : Uint8Array ; } declare const TextDecoder ; /**
 * Creates a chunk combiner instance that uses UTF-8
 * TextDecoder to decode Uint8Arrays into strings.
 */ export function createTextDecoderCombiner ( ) { const decoder = new TextDecoder ( 'utf-8' ) ; return { concat ( first , second ) { const retVal = new Uint8Array ( first . length + second . length ) ; retVal . set ( first ) ; retVal . set ( second , first . length ) ; return retVal ; } , copy ( chunk , start , end ) { const retVal = new Uint8Array ( end - start ) ; retVal . set ( chunk . subarray ( start , end ) ) ; return retVal ; } , toUtf8String ( chunk , start , end ) { return decoder . decode ( chunk . subarray ( start , end ) ) ; } , } ; }