@revizly/sharp 0.35.0-revizly41 → 0.35.0-revizly42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -658,25 +658,27 @@ declare namespace sharp {
658
658
  * @param callback Callback function called on completion with three arguments (err, buffer, info).
659
659
  * @returns A sharp instance that can be used to chain operations
660
660
  */
661
- toBuffer(callback: (err: Error, buffer: Buffer, info: OutputInfo) => void): Sharp;
661
+ toBuffer(callback: (err: Error, buffer: Buffer<ArrayBuffer>, info: OutputInfo) => void): Sharp;
662
662
 
663
663
  /**
664
664
  * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
665
665
  * By default, the format will match the input image, except SVG input which becomes PNG output.
666
+ * The underlying `ArrayBuffer` may be marked as non-transferable by some JavaScript runtimes.
666
667
  * @param options resolve options
667
668
  * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data.
668
669
  * @returns A promise that resolves with the Buffer data.
669
670
  */
670
- toBuffer(options?: { resolveWithObject: false }): Promise<Buffer>;
671
+ toBuffer(options?: { resolveWithObject: false }): Promise<Buffer<ArrayBuffer>>;
671
672
 
672
673
  /**
673
674
  * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
674
675
  * By default, the format will match the input image, except SVG input which becomes PNG output.
676
+ * The underlying `ArrayBuffer` may be marked as non-transferable by some JavaScript runtimes.
675
677
  * @param options resolve options
676
678
  * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data.
677
679
  * @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
678
680
  */
679
- toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer; info: OutputInfo }>;
681
+ toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer<ArrayBuffer>; info: OutputInfo }>;
680
682
 
681
683
  /**
682
684
  * Write output to a Uint8Array backed by a transferable ArrayBuffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
package/dist/index.d.mts CHANGED
@@ -652,25 +652,27 @@ export interface Sharp extends Duplex {
652
652
  * @param callback Callback function called on completion with three arguments (err, buffer, info).
653
653
  * @returns A sharp instance that can be used to chain operations
654
654
  */
655
- toBuffer(callback: (err: Error, buffer: Buffer, info: OutputInfo) => void): Sharp;
655
+ toBuffer(callback: (err: Error, buffer: Buffer<ArrayBuffer>, info: OutputInfo) => void): Sharp;
656
656
 
657
657
  /**
658
658
  * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
659
659
  * By default, the format will match the input image, except SVG input which becomes PNG output.
660
+ * The underlying `ArrayBuffer` may be marked as non-transferable by some JavaScript runtimes.
660
661
  * @param options resolve options
661
662
  * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data.
662
663
  * @returns A promise that resolves with the Buffer data.
663
664
  */
664
- toBuffer(options?: { resolveWithObject: false }): Promise<Buffer>;
665
+ toBuffer(options?: { resolveWithObject: false }): Promise<Buffer<ArrayBuffer>>;
665
666
 
666
667
  /**
667
668
  * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
668
669
  * By default, the format will match the input image, except SVG input which becomes PNG output.
670
+ * The underlying `ArrayBuffer` may be marked as non-transferable by some JavaScript runtimes.
669
671
  * @param options resolve options
670
672
  * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data.
671
673
  * @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
672
674
  */
673
- toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer; info: OutputInfo }>;
675
+ toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer<ArrayBuffer>; info: OutputInfo }>;
674
676
 
675
677
  /**
676
678
  * Write output to a Uint8Array backed by a transferable ArrayBuffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
package/dist/output.cjs CHANGED
@@ -113,24 +113,20 @@ function toFile (fileOut, callback) {
113
113
  * Animated output will also contain `pageHeight` and `pages`.
114
114
  * May also contain `textAutofitDpi` (dpi the font was rendered at) if image was created from text.
115
115
  *
116
- * A `Promise` is returned when `callback` is not provided.
116
+ * The underlying `ArrayBuffer` may be marked as non-transferable by some JavaScript runtimes.
117
+ * Use {@link #touint8array toUint8Array} for a guaranteed transferable `ArrayBuffer`.
117
118
  *
118
- * @example
119
- * sharp(input)
120
- * .toBuffer((err, data, info) => { ... });
119
+ * A `Promise` is returned when `callback` is not provided.
121
120
  *
122
121
  * @example
123
- * sharp(input)
124
- * .toBuffer()
125
- * .then(data => { ... })
126
- * .catch(err => { ... });
122
+ * const data = await sharp(input)
123
+ * .png()
124
+ * .toBuffer();
127
125
  *
128
126
  * @example
129
- * sharp(input)
127
+ * const { data, info } = await sharp(input)
130
128
  * .png()
131
- * .toBuffer({ resolveWithObject: true })
132
- * .then(({ data, info }) => { ... })
133
- * .catch(err => { ... });
129
+ * .toBuffer({ resolveWithObject: true });
134
130
  *
135
131
  * @example
136
132
  * const { data, info } = await sharp('my-image.jpg')
package/dist/output.mjs CHANGED
@@ -113,24 +113,20 @@ function toFile (fileOut, callback) {
113
113
  * Animated output will also contain `pageHeight` and `pages`.
114
114
  * May also contain `textAutofitDpi` (dpi the font was rendered at) if image was created from text.
115
115
  *
116
- * A `Promise` is returned when `callback` is not provided.
116
+ * The underlying `ArrayBuffer` may be marked as non-transferable by some JavaScript runtimes.
117
+ * Use {@link #touint8array toUint8Array} for a guaranteed transferable `ArrayBuffer`.
117
118
  *
118
- * @example
119
- * sharp(input)
120
- * .toBuffer((err, data, info) => { ... });
119
+ * A `Promise` is returned when `callback` is not provided.
121
120
  *
122
121
  * @example
123
- * sharp(input)
124
- * .toBuffer()
125
- * .then(data => { ... })
126
- * .catch(err => { ... });
122
+ * const data = await sharp(input)
123
+ * .png()
124
+ * .toBuffer();
127
125
  *
128
126
  * @example
129
- * sharp(input)
127
+ * const { data, info } = await sharp(input)
130
128
  * .png()
131
- * .toBuffer({ resolveWithObject: true })
132
- * .then(({ data, info }) => { ... })
133
- * .catch(err => { ... });
129
+ * .toBuffer({ resolveWithObject: true });
134
130
  *
135
131
  * @example
136
132
  * const { data, info } = await sharp('my-image.jpg')
package/lib/index.d.ts CHANGED
@@ -658,25 +658,27 @@ declare namespace sharp {
658
658
  * @param callback Callback function called on completion with three arguments (err, buffer, info).
659
659
  * @returns A sharp instance that can be used to chain operations
660
660
  */
661
- toBuffer(callback: (err: Error, buffer: Buffer, info: OutputInfo) => void): Sharp;
661
+ toBuffer(callback: (err: Error, buffer: Buffer<ArrayBuffer>, info: OutputInfo) => void): Sharp;
662
662
 
663
663
  /**
664
664
  * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
665
665
  * By default, the format will match the input image, except SVG input which becomes PNG output.
666
+ * The underlying `ArrayBuffer` may be marked as non-transferable by some JavaScript runtimes.
666
667
  * @param options resolve options
667
668
  * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data.
668
669
  * @returns A promise that resolves with the Buffer data.
669
670
  */
670
- toBuffer(options?: { resolveWithObject: false }): Promise<Buffer>;
671
+ toBuffer(options?: { resolveWithObject: false }): Promise<Buffer<ArrayBuffer>>;
671
672
 
672
673
  /**
673
674
  * Write output to a Buffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
674
675
  * By default, the format will match the input image, except SVG input which becomes PNG output.
676
+ * The underlying `ArrayBuffer` may be marked as non-transferable by some JavaScript runtimes.
675
677
  * @param options resolve options
676
678
  * @param options.resolveWithObject Resolve the Promise with an Object containing data and info properties instead of resolving only with data.
677
679
  * @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
678
680
  */
679
- toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer; info: OutputInfo }>;
681
+ toBuffer(options: { resolveWithObject: true }): Promise<{ data: Buffer<ArrayBuffer>; info: OutputInfo }>;
680
682
 
681
683
  /**
682
684
  * Write output to a Uint8Array backed by a transferable ArrayBuffer. JPEG, PNG, WebP, AVIF, TIFF, GIF and RAW output are supported.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@revizly/sharp",
3
3
  "description": "High performance Node.js image processing, the fastest module to resize JPEG, PNG, WebP, GIF, AVIF and TIFF images",
4
- "version": "0.35.0-revizly41",
4
+ "version": "0.35.0-revizly42",
5
5
  "author": "Lovell Fuller <npm@lovell.info>",
6
6
  "homepage": "https://sharp.pixelplumbing.com",
7
7
  "contributors": [
@@ -163,25 +163,30 @@
163
163
  "semver": "^7.8.5"
164
164
  },
165
165
  "optionalDependencies": {
166
- "@revizly/sharp-libvips-linux-arm64": "1.0.42",
167
- "@revizly/sharp-libvips-linux-x64": "1.0.42",
168
- "@revizly/sharp-linux-arm64": "0.35.0-revizly41",
169
- "@revizly/sharp-linux-x64": "0.35.0-revizly41"
166
+ "@revizly/sharp-libvips-linux-arm64": "1.0.43",
167
+ "@revizly/sharp-libvips-linux-x64": "1.0.43",
168
+ "@revizly/sharp-linux-arm64": "0.35.0-revizly42",
169
+ "@revizly/sharp-linux-x64": "0.35.0-revizly42"
170
+ },
171
+ "peerDependenciesMeta": {
172
+ "@types/node": {
173
+ "optional": true
174
+ }
170
175
  },
171
176
  "devDependencies": {
172
177
  "@biomejs/biome": "^2.5.1",
173
178
  "@cpplint/cli": "^0.1.0",
174
179
  "@emnapi/runtime": "^1.11.1",
175
- "@revizly/sharp-libvips-dev": "1.0.42",
180
+ "@revizly/sharp-libvips-dev": "1.0.43",
176
181
  "@types/node": "*",
177
182
  "emnapi": "^1.11.1",
178
183
  "exif-reader": "^2.0.3",
179
184
  "extract-zip": "^2.0.1",
180
185
  "icc": "^4.0.0",
181
- "node-addon-api": "^8.8.0",
186
+ "node-addon-api": "^8.9.0",
182
187
  "node-gyp": "^12.4.0",
183
188
  "publint": "^0.3.21",
184
- "tar-fs": "^3.1.2",
189
+ "tar-fs": "^3.1.3",
185
190
  "tsd": "^0.33.0"
186
191
  },
187
192
  "license": "Apache-2.0",