mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 04:50:18 +00:00
Merge pull request #28943 from higuri/resize-img
Add type definitions for 'resize-img'
This commit is contained in:
Vendored
+19
@@ -0,0 +1,19 @@
|
||||
// Type definitions for resize-img 1.1
|
||||
// Project: https://github.com/kevva/resize-img#readme
|
||||
// Definitions by: Yusuke Higuchi <https://github.com/higuri>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference types="node" />
|
||||
|
||||
export = ResizeImg;
|
||||
|
||||
declare function ResizeImg(
|
||||
input: Buffer,
|
||||
options: ResizeImg.ResizeImgOptions): Promise<Buffer>;
|
||||
|
||||
declare namespace ResizeImg {
|
||||
interface ResizeImgOptions {
|
||||
width?: number;
|
||||
height?: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as fs from "fs";
|
||||
import resizeImg = require("resize-img");
|
||||
|
||||
resizeImg(fs.readFileSync("images/dog.jpg"), {
|
||||
width: 128,
|
||||
height: 128,
|
||||
}).then((buf) => {
|
||||
fs.writeFileSync("resized.jpg", buf);
|
||||
});
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"resize-img-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user