Closed luicfrr closed 7 months ago
After some tests I suppose the error is in this type definition.
I have no function error (only typescript error) if I add an undefined
as second param of my function:
const pdfBuffer = Buffer.from( 'base64string...', 'base64' )
const newBuffer = await new Promise<Buffer>( async ( res ) => {
const pdfDoc = new Recipe( pdfBuffer, undefined, {
author: 'test',
title: 'pdf test',
subject: 'test on muhammara'
} )
pdfDoc.endPDF( buffer => res( buffer ) )
} )
I think Recipe
type declaration should be something like this:
export class Recipe {
constructor(src: string, output?: string | null, options?: Recipe.RecipeOptions);
constructor(buffer: Buffer, output?: string | null, options?: Recipe.RecipeOptions);
....
fixed in #354
Here's my code:
Runnint this code I get the following error:
Reading docs i think there's an error on it because I can't add
null
as seccond param while creatingnew Recipe
.