Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<ArrayBuffer>, info: OutputInfo) => void): Sharp;

/**
* Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
Expand All @@ -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<Buffer>;
toBuffer(options?: { resolveWithObject: false }): Promise<Buffer<ArrayBuffer>>;

/**
* Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
Expand All @@ -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<ArrayBuffer>; info: OutputInfo }>;

/**
* Write output to a Uint8Array backed by a transferable ArrayBuffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
},
Comment thread
lovell marked this conversation as resolved.
Resolved
"devDependencies": {
"@biomejs/biome": "^2.5.1",
"@cpplint/cli": "^0.1.0",
Expand Down