Add Packer.pack and Packer.toArrayBuffer (#2959)

* Add Packer.pack and Packer.toArrayBuffer

To mirror patchDocument's outputType parameter.

See https://github.com/dolanmiu/docx/discussions/2920

* Ignore coverage

---------

Co-authored-by: Dolan Miu <dolan_miu@hotmail.com>
This commit is contained in:
Josh Kelley
2025-02-16 13:24:15 -05:00
committed by GitHub
parent 05fcf6edd4
commit 170309a7ed
4 changed files with 78 additions and 50 deletions

18
src/util/output-type.ts Normal file
View File

@ -0,0 +1,18 @@
/* v8 ignore start */
// Simply type definitions. Can ignore testing and coverage
// From JSZip
export type OutputByType = {
readonly base64: string;
// eslint-disable-next-line id-denylist
readonly string: string;
readonly text: string;
readonly binarystring: string;
readonly array: readonly number[];
readonly uint8array: Uint8Array;
readonly arraybuffer: ArrayBuffer;
readonly blob: Blob;
readonly nodebuffer: Buffer;
};
export type OutputType = keyof OutputByType;
/* v8 ignore stop */