OutputByType
Updated 22 Oct 2026
OutputByType = object
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10323
Maps output type names to their corresponding TypeScript types.
This type is used to provide type-safe document generation where the output format determines the return type. Based on JSZip's output types.
Example
// Generate as base64 string
const doc: OutputByType["base64"] = await packer.toBase64(document);
// Generate as Buffer (Node.js)
const doc: OutputByType["nodebuffer"] = await packer.toBuffer(document);
// Generate as Blob (browser)
const doc: OutputByType["blob"] = await packer.toBlob(document);Properties
array
readonly array: readonly number[]
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10333
Array of numbers (0-255) representing bytes
arraybuffer
readonly arraybuffer: ArrayBuffer
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10337
ArrayBuffer representation
base64
readonly base64: string
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10325
Base64-encoded string representation
binarystring
readonly binarystring: string
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10331
Binary string representation
blob
readonly blob: Blob
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10339
Blob representation (browser environments)
nodebuffer
readonly nodebuffer: Buffer
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10341
Node.js Buffer representation
string
readonly string: string
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10327
UTF-8 string representation
text
readonly text: string
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10329
Text string representation
uint8array
readonly uint8array: Uint8Array
Defined in: node_modules/.pnpm/docx@9.13.0/node_modules/docx/dist/index.d.ts:10335
Uint8Array (typed array) representation