mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-05 15:27:05 +00:00
Merge pull request #28213 from wooseopkim/master
[sharp] Fix #28100: make the first argument omitable
This commit is contained in:
Vendored
+1
@@ -15,6 +15,7 @@ import { Duplex } from "stream";
|
||||
* @throws {Error} Invalid parameters
|
||||
* @returns A sharp instance that can be used to chain operations
|
||||
*/
|
||||
declare function sharp(options?: sharp.SharpOptions): sharp.SharpInstance;
|
||||
declare function sharp(input?: string | Buffer, options?: sharp.SharpOptions): sharp.SharpInstance;
|
||||
declare namespace sharp {
|
||||
const gravity: GravityEnum;
|
||||
|
||||
@@ -47,6 +47,17 @@ sharp('input.jpg')
|
||||
// containing a scaled and cropped version of input.jpg
|
||||
});
|
||||
|
||||
sharp({
|
||||
create: {
|
||||
width: 300,
|
||||
height: 200,
|
||||
channels: 4,
|
||||
background: { r: 255, g: 0, b: 0, alpha: 128 }
|
||||
}
|
||||
})
|
||||
.png()
|
||||
.toBuffer();
|
||||
|
||||
let transformer = sharp()
|
||||
.resize(300)
|
||||
.on('info', (info: sharp.OutputInfo) => {
|
||||
|
||||
Reference in New Issue
Block a user