From 6d8196db5108ecf3d89fcf942c516fbb61a59b42 Mon Sep 17 00:00:00 2001 From: Daniel Byrne Date: Tue, 28 Aug 2018 20:08:48 -0700 Subject: [PATCH] adds typings for the 'buffer-xor' package --- types/buffer-xor/buffer-xor-tests.ts | 4 ++++ types/buffer-xor/index.d.ts | 10 ++++++++++ types/buffer-xor/tsconfig.json | 19 +++++++++++++++++++ types/buffer-xor/tslint.json | 3 +++ 4 files changed, 36 insertions(+) create mode 100644 types/buffer-xor/buffer-xor-tests.ts create mode 100644 types/buffer-xor/index.d.ts create mode 100644 types/buffer-xor/tsconfig.json create mode 100644 types/buffer-xor/tslint.json diff --git a/types/buffer-xor/buffer-xor-tests.ts b/types/buffer-xor/buffer-xor-tests.ts new file mode 100644 index 0000000000..7c55514eaa --- /dev/null +++ b/types/buffer-xor/buffer-xor-tests.ts @@ -0,0 +1,4 @@ +import xor = require('buffer-xor'); + +// $ExpectType Buffer +xor(Buffer.from('a'), Buffer.from('b')); diff --git a/types/buffer-xor/index.d.ts b/types/buffer-xor/index.d.ts new file mode 100644 index 0000000000..5e98793266 --- /dev/null +++ b/types/buffer-xor/index.d.ts @@ -0,0 +1,10 @@ +// Type definitions for buffer-xor 2.0 +// Project: https://github.com/crypto-browserify/buffer-xor +// Definitions by: Daniel Byrne +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +/// + +declare function xor(a: Buffer, b: Buffer): Buffer; + +export = xor; diff --git a/types/buffer-xor/tsconfig.json b/types/buffer-xor/tsconfig.json new file mode 100644 index 0000000000..adbeaec3b7 --- /dev/null +++ b/types/buffer-xor/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": ["es6"], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": true, + "strictFunctionTypes": true, + "baseUrl": "../", + "typeRoots": ["../"], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "buffer-xor-tests.ts" + ] +} diff --git a/types/buffer-xor/tslint.json b/types/buffer-xor/tslint.json new file mode 100644 index 0000000000..d88586e5bd --- /dev/null +++ b/types/buffer-xor/tslint.json @@ -0,0 +1,3 @@ +{ + "extends": "dtslint/dt.json" +}