import{BufferTargetWriter as n,StreamTargetWriter as a}from"./writer.js";export class Target{constructor(){this._output=null}}export class BufferTarget extends Target{constructor(){super(...arguments),this.buffer=null}_createWriter(){return new n(this)}}export class StreamTarget extends Target{constructor(t,e={}){if(super(),!(t instanceof WritableStream))throw new TypeError("StreamTarget requires a WritableStream instance.");if(e!=null&&typeof e!="object")throw new TypeError("StreamTarget options, when provided, must be an object.");if(e.chunked!==void 0&&typeof e.chunked!="boolean")throw new TypeError("options.chunked, when provided, must be a boolean.");if(e.chunkSize!==void 0&&(!Number.isInteger(e.chunkSize)||e.chunkSize<1024))throw new TypeError("options.chunkSize, when provided, must be an integer and not smaller than 1024.");this._writable=t,this._options=e}_createWriter(){return new a(this)}}
