Skip to content

Commit 3eff727

Browse files
committed
typescript definitions
1 parent 4d20cab commit 3eff727

File tree

4 files changed

+289
-5
lines changed

4 files changed

+289
-5
lines changed

index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/// <reference types="smartcrop" />
2+
3+
import { CropOptions, CropResult } from "smartcrop";
4+
5+
/**
6+
* Find the best crop for *image* using *options*.
7+
* @param image - A string (path to file) or buffer of image source.
8+
* @param cropOptions - Crop options based to `smartcrop.js`.
9+
* @return Promise that resolves with the final crop result that can then be
10+
* used by `sharp` to extract your final image.
11+
*/
12+
export function crop(image: Buffer | string, cropOptions: CropOptions): Promise<CropResult>;

0 commit comments

Comments
 (0)