docx
    Preparing search index...

    Type Alias OutputByType

    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.

    // 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);
    type OutputByType = {
        array: readonly number[];
        arraybuffer: ArrayBuffer;
        base64: string;
        binarystring: string;
        blob: Blob;
        nodebuffer: Buffer;
        string: string;
        text: string;
        uint8array: Uint8Array;
    }
    Index

    Properties

    array: readonly number[]

    Array of numbers (0-255) representing bytes

    arraybuffer: ArrayBuffer

    ArrayBuffer representation

    base64: string

    Base64-encoded string representation

    binarystring: string

    Binary string representation

    blob: Blob

    Blob representation (browser environments)

    nodebuffer: Buffer

    Node.js Buffer representation

    string: string

    UTF-8 string representation

    text: string

    Text string representation

    uint8array: Uint8Array

    Uint8Array (typed array) representation