Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions types/exif-reader/exif-reader-tests.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import exifReader = require("exif-reader");

const buf = Buffer.from("some-exif-data");

const result = exifReader(buf);
console.log(result.exif);
console.log(result.gps);
console.log(result.image);
console.log(result.interoperability);
console.log(result.thumbnail);

// These records contain a variety of tags
console.log(result.gps?.GPSVersionID);

// But the list of valid tags is not provided in these typings
console.log(result.exif?.ThisTagDoesNotExist); // should pass
22 changes: 22 additions & 0 deletions types/exif-reader/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Type definitions for exif-reader 1.0
// Project: https://github.com/devongovett/exif-reader
// Definitions by: Andrzej Wódkiewicz <https://github.com/akwodkiewicz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped

/// <reference types="node" />

/** Decode raw EXIF data from a `Buffer` */
declare function exifReader(buffer: Buffer): {
/** Basic TIFF properties about the image */
image?: Record<string, unknown>;
/** Basic TIFF properties about the embedded thumbnail */
thumbnail?: Record<string, unknown>;
/** Full EXIF data */
exif?: Record<string, unknown>;
/** GPS/location data about the image */
gps?: Record<string, unknown>;
/** Interoperability information */
interoperability?: Record<string, unknown>;
};

export = exifReader;
23 changes: 23 additions & 0 deletions types/exif-reader/tsconfig.json
Original file line number Diff line number Diff line change
@@ -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",
"exif-reader-tests.ts"
]
}
1 change: 1 addition & 0 deletions types/exif-reader/tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": "@definitelytyped/dtslint/dt.json" }