mrafiqk / html-pdf-node

187 stars 119 forks source link

Return Type of "generatePdf" Method #95

Open decozo150 opened 1 year ago

decozo150 commented 1 year ago

The return type of the "generatePdf" method should be "Buffer" instead of "void":

export function generatePdf(
    file: File,
    options?: Options,
    callback?: (err: Error, buffer: Buffer) => void,
): void // this should be Buffer;
maiksicks commented 1 year ago

In the current version, the return type is Promise<Buffer>.

This is my workaround for typescript:

const output = await (generatePdf(...) as unknown as Promise<Buffer>);