mirror of
https://github.com/lovell/sharp.git
synced 2026-02-10 16:46:14 +01:00
Add toArrayBuffer to generate transferable output #4355
This commit is contained in:
7
lib/index.d.ts
vendored
7
lib/index.d.ts
vendored
@@ -693,6 +693,13 @@ declare namespace sharp {
|
||||
*/
|
||||
toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer; info: OutputInfo }>;
|
||||
|
||||
/**
|
||||
* Write output to a transferable ArrayBuffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
|
||||
* By default, the format will match the input image, except SVG input which becomes PNG output.
|
||||
* @returns A promise that resolves with an object containing the ArrayBuffer data and an info object containing the output image format, size (bytes), width, height and channels
|
||||
*/
|
||||
toArrayBuffer(): Promise<{ data: ArrayBuffer; info: OutputInfo }>;
|
||||
|
||||
/**
|
||||
* Keep all EXIF metadata from the input image in the output image.
|
||||
* EXIF metadata is unsupported for TIFF output.
|
||||
|
||||
Reference in New Issue
Block a user