diff --git a/lib/index.d.ts b/lib/index.d.ts index e756884c4..8d38e59ad 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -658,7 +658,7 @@ declare namespace sharp { * @param callback Callback function called on completion with three arguments (err, buffer, info). * @returns A sharp instance that can be used to chain operations */ - toBuffer(callback: (err: Error, buffer: Buffer, info: OutputInfo) => void): Sharp; + toBuffer(callback: (err: Error, buffer: Buffer, info: OutputInfo) => void): Sharp; /** * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported. @@ -667,7 +667,7 @@ declare namespace sharp { * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data. * @returns A promise that resolves with the Buffer data. */ - toBuffer(options?: { resolveWithObject: false }): Promise; + toBuffer(options?: { resolveWithObject: false }): Promise>; /** * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported. @@ -676,7 +676,7 @@ declare namespace sharp { * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data. * @returns A promise that resolves with an object containing the Buffer data and an info object containing the output image format, size (bytes), width, height and channels */ - toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer; info: OutputInfo }>; + toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer; info: OutputInfo }>; /** * Write output to a Uint8Array backed by a transferable ArrayBuffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported. diff --git a/package.json b/package.json index a62c6b67e..98b261a33 100644 --- a/package.json +++ b/package.json @@ -189,6 +189,11 @@ "@img/sharp-win32-ia32": "0.35.3-rc.0", "@img/sharp-win32-x64": "0.35.3-rc.0" }, + "peerDependenciesMeta": { + "@types/node": { + "optional": true + } + }, "devDependencies": { "@biomejs/biome": "^2.5.1", "@cpplint/cli": "^0.1.0",