mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-01 15:50:13 +00:00
Add type definitions for 'resize-img'
This commit is contained in:
19
types/resize-img/index.d.ts
vendored
Normal file
19
types/resize-img/index.d.ts
vendored
Normal file
@@ -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;
|
||||
}
|
||||
}
|
||||
9
types/resize-img/resize-img-tests.ts
Normal file
9
types/resize-img/resize-img-tests.ts
Normal file
@@ -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);
|
||||
});
|
||||
23
types/resize-img/tsconfig.json
Normal file
23
types/resize-img/tsconfig.json
Normal file
@@ -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"
|
||||
]
|
||||
}
|
||||
1
types/resize-img/tslint.json
Normal file
1
types/resize-img/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user