@visulima/ansi
Version:
ANSI escape codes for some terminal swag.
2 lines (1 loc) • 1.2 kB
JavaScript
import{a as r}from"./base64-DCRChUPq.js";const s=i=>{const t=[];return i.name&&t.push(`name=${i.name}`),i.size!==void 0&&t.push(`size=${String(i.size)}`),i.width!==void 0&&t.push(`width=${i.width.toString()}`),i.height!==void 0&&t.push(`height=${i.height.toString()}`),i.ignoreAspectRatio&&t.push("preserveAspectRatio=0"),i.inline&&t.push("inline=1"),i.doNotMoveCursor&&t.push("doNotMoveCursor=1"),t.join(";")};class n{fileProps;constructor(t,e){if(this.fileProps={...t},e){if(e.byteLength>10*1024*1024)throw new Error("File size exceeds maximum limit of 10MB");if(this.fileProps.content=r(e),this.fileProps.size??=e.byteLength,this.fileProps.size!==e.byteLength)throw new Error("File size property doesn't match actual data length")}}toString(){let t="File=";return t+=s(this.fileProps),this.fileProps.content!==void 0&&(t+=`:${this.fileProps.content}`),t}}class h{toString(){return"FileEnd"}}class l{constructor(t){this.base64Chunk=t}base64Chunk;toString(){return`FilePart=${this.base64Chunk}`}}class u{constructor(t){this.properties=t}properties;toString(){return`MultipartFile=${s(this.properties)}`}}export{n as ITerm2File,h as ITerm2FileEnd,l as ITerm2FilePart,u as ITerm2MultipartFileStart};