From 97f8a113abde8f7de63cbb7a28d961e37a38a05b Mon Sep 17 00:00:00 2001 From: ikatyang Date: Wed, 12 Jul 2017 00:01:46 +0800 Subject: [PATCH] feat(rev-hash): initial commit --- types/rev-hash/index.d.ts | 14 ++++++++++++++ types/rev-hash/rev-hash-tests.ts | 6 ++++++ types/rev-hash/tsconfig.json | 22 ++++++++++++++++++++++ types/rev-hash/tslint.json | 3 +++ 4 files changed, 45 insertions(+) create mode 100644 types/rev-hash/index.d.ts create mode 100644 types/rev-hash/rev-hash-tests.ts create mode 100644 types/rev-hash/tsconfig.json create mode 100644 types/rev-hash/tslint.json diff --git a/types/rev-hash/index.d.ts b/types/rev-hash/index.d.ts new file mode 100644 index 0000000000..5147c20891 --- /dev/null +++ b/types/rev-hash/index.d.ts @@ -0,0 +1,14 @@ +// Type definitions for rev-hash 2.0 +// Project: https://github.com/sindresorhus/rev-hash +// Definitions by: Ika +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +/** + * Create a hash for file revving + * @param input Data to create a hash from. + */ +declare function revHash(input: Buffer | string): string; + +export = revHash; diff --git a/types/rev-hash/rev-hash-tests.ts b/types/rev-hash/rev-hash-tests.ts new file mode 100644 index 0000000000..82d38f535f --- /dev/null +++ b/types/rev-hash/rev-hash-tests.ts @@ -0,0 +1,6 @@ +import * as fs from 'fs'; +import revHash = require('rev-hash'); + +revHash(fs.readFileSync('unicorn.png')); + +revHash('Lorem ipsum dolor sit amet'); diff --git a/types/rev-hash/tsconfig.json b/types/rev-hash/tsconfig.json new file mode 100644 index 0000000000..5cb85dd768 --- /dev/null +++ b/types/rev-hash/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "rev-hash-tests.ts" + ] +} diff --git a/types/rev-hash/tslint.json b/types/rev-hash/tslint.json new file mode 100644 index 0000000000..f93cf8562a --- /dev/null +++ b/types/rev-hash/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}