From 3991362524d84d28e42153ea2ee7302baae90632 Mon Sep 17 00:00:00 2001
From: Joanna Zakrzewska <816004+Silhoue@users.noreply.github.com>
Date: Fri, 11 Jan 2019 12:55:13 +0100
Subject: [PATCH 1/2] Add optional orientation field
---
types/image-size/image-size-tests.ts | 4 ++--
types/image-size/index.d.ts | 2 +-
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/types/image-size/image-size-tests.ts b/types/image-size/image-size-tests.ts
index 058ed7934f..633169105d 100644
--- a/types/image-size/image-size-tests.ts
+++ b/types/image-size/image-size-tests.ts
@@ -4,11 +4,11 @@ import sizeOf = require("image-size");
// Synchronous
const dimensions = sizeOf("images/funny-cats.png");
-console.log(dimensions.width, dimensions.height);
+console.log(dimensions.width, dimensions.height, dimensions.orientation);
// Asynchronous
sizeOf("images/funny-cats.png", (err, dimensions) => {
- console.log(dimensions.width, dimensions.height);
+ console.log(dimensions.width, dimensions.height, dimensions.orientation);
});
// From URL
diff --git a/types/image-size/index.d.ts b/types/image-size/index.d.ts
index 9e8681d514..51540c8fe5 100644
--- a/types/image-size/index.d.ts
+++ b/types/image-size/index.d.ts
@@ -6,11 +6,11 @@
///
-
interface ImageInfo {
width: number;
height: number;
type: string;
+ orientation?: number;
}
declare function sizeOf(path: string): ImageInfo;
From 4dcb353f165e290ccda17c0a7ee301b49e18a1d4 Mon Sep 17 00:00:00 2001
From: Joanna Zakrzewska <816004+Silhoue@users.noreply.github.com>
Date: Fri, 11 Jan 2019 13:25:06 +0100
Subject: [PATCH 2/2] Fix lint errors
---
types/image-size/index.d.ts | 7 +--
types/image-size/tsconfig.json | 2 +-
types/image-size/tslint.json | 78 +---------------------------------
3 files changed, 4 insertions(+), 83 deletions(-)
diff --git a/types/image-size/index.d.ts b/types/image-size/index.d.ts
index 51540c8fe5..443c319fb2 100644
--- a/types/image-size/index.d.ts
+++ b/types/image-size/index.d.ts
@@ -1,11 +1,10 @@
-// Type definitions for image-size
+// Type definitions for image-size 0.7
// Project: https://github.com/image-size/image-size
// Definitions by: Elisée MAURER
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///
-
interface ImageInfo {
width: number;
height: number;
@@ -13,11 +12,9 @@ interface ImageInfo {
orientation?: number;
}
-declare function sizeOf(path: string): ImageInfo;
+declare function sizeOf(pathOrBuffer: string | Buffer): ImageInfo;
declare function sizeOf(path: string, callback: (err: Error, dimensions: ImageInfo) => void): void;
-declare function sizeOf(buffer: Buffer): ImageInfo;
-
declare namespace sizeOf { }
export = sizeOf;
diff --git a/types/image-size/tsconfig.json b/types/image-size/tsconfig.json
index 7a864603b7..7c8d0db7d1 100644
--- a/types/image-size/tsconfig.json
+++ b/types/image-size/tsconfig.json
@@ -6,7 +6,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
- "strictNullChecks": false,
+ "strictNullChecks": true,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
diff --git a/types/image-size/tslint.json b/types/image-size/tslint.json
index a41bf5d19a..f93cf8562a 100644
--- a/types/image-size/tslint.json
+++ b/types/image-size/tslint.json
@@ -1,79 +1,3 @@
{
- "extends": "dtslint/dt.json",
- "rules": {
- "adjacent-overload-signatures": false,
- "array-type": false,
- "arrow-return-shorthand": false,
- "ban-types": false,
- "callable-types": false,
- "comment-format": false,
- "dt-header": false,
- "eofline": false,
- "export-just-namespace": false,
- "import-spacing": false,
- "interface-name": false,
- "interface-over-type-literal": false,
- "jsdoc-format": false,
- "max-line-length": false,
- "member-access": false,
- "new-parens": false,
- "no-any-union": false,
- "no-boolean-literal-compare": false,
- "no-conditional-assignment": false,
- "no-consecutive-blank-lines": false,
- "no-construct": false,
- "no-declare-current-package": false,
- "no-duplicate-imports": false,
- "no-duplicate-variable": false,
- "no-empty-interface": false,
- "no-for-in-array": false,
- "no-inferrable-types": false,
- "no-internal-module": false,
- "no-irregular-whitespace": false,
- "no-mergeable-namespace": false,
- "no-misused-new": false,
- "no-namespace": false,
- "no-object-literal-type-assertion": false,
- "no-padding": false,
- "no-redundant-jsdoc": false,
- "no-redundant-jsdoc-2": false,
- "no-redundant-undefined": false,
- "no-reference-import": false,
- "no-relative-import-in-test": false,
- "no-self-import": false,
- "no-single-declare-module": false,
- "no-string-throw": false,
- "no-unnecessary-callback-wrapper": false,
- "no-unnecessary-class": false,
- "no-unnecessary-generics": false,
- "no-unnecessary-qualifier": false,
- "no-unnecessary-type-assertion": false,
- "no-useless-files": false,
- "no-var-keyword": false,
- "no-var-requires": false,
- "no-void-expression": false,
- "no-trailing-whitespace": false,
- "object-literal-key-quotes": false,
- "object-literal-shorthand": false,
- "one-line": false,
- "one-variable-per-declaration": false,
- "only-arrow-functions": false,
- "prefer-conditional-expression": false,
- "prefer-const": false,
- "prefer-declare-function": false,
- "prefer-for-of": false,
- "prefer-method-signature": false,
- "prefer-template": false,
- "radix": false,
- "semicolon": false,
- "space-before-function-paren": false,
- "space-within-parens": false,
- "strict-export-declare-modifiers": false,
- "trim-file": false,
- "triple-equals": false,
- "typedef-whitespace": false,
- "unified-signatures": false,
- "void-return": false,
- "whitespace": false
- }
+ "extends": "dtslint/dt.json"
}