From 47925ed158fbeaa16614871292ce4072c2ab3bf9 Mon Sep 17 00:00:00 2001 From: Rogier Schouten Date: Fri, 20 Feb 2015 15:16:12 +0100 Subject: [PATCH] Add typings for bitwise-xor --- CONTRIBUTORS.md | 1 + bitwise-xor/bitwise-xor-tests.ts | 12 ++++++++++++ bitwise-xor/bitwise-xor.d.ts | 16 ++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 bitwise-xor/bitwise-xor-tests.ts create mode 100644 bitwise-xor/bitwise-xor.d.ts diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index a8032eaab3..66c073598f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -65,6 +65,7 @@ This document generated by [dt-contributors-generator](https://github.com/vvakam * [:link:](bigint/bigint.d.ts) [BigInt](https://github.com/Evgenus/BigInt) by [Eugene Chernyshov](https://github.com/Evgenus) * [:link:](big-integer/big-integer.d.ts) [BigInteger.js](https://github.com/peterolson/BigInteger.js) by [Ingo Bürk](https://github.com/Airblader), [Roel van Uden](https://github.com/Deathspike) * [:link:](bigscreen/bigscreen.d.ts) [BigScreen](http://brad.is/coding/BigScreen) by [Douglas Eichelberger](https://github.com/dduugg) +* [:link:](bitwise-xor/bitwise-xor.d.ts) [bitwise-xor](https://github.com/czzarr/node-bitwise-xor) by [Rogier Schouten](https://github.com/rogierschouten) * [:link:](bluebird/bluebird.d.ts) [bluebird](https://github.com/petkaantonov/bluebird) by [Bart van der Schoor](https://github.com/Bartvds) * [:link:](body-parser/body-parser.d.ts) [body-parser](http://expressjs.com) by [Santi Albo](https://github.com/santialbo), [VILIC VANE](https://vilic.info), [Jonathan Häberle](https://github.com/dreampulse) * [:link:](boom/boom.d.ts) [boom](http://github.com/hapijs/boom) by [Igor Rogatty](http://github.com/rogatty) diff --git a/bitwise-xor/bitwise-xor-tests.ts b/bitwise-xor/bitwise-xor-tests.ts new file mode 100644 index 0000000000..9bd030fd18 --- /dev/null +++ b/bitwise-xor/bitwise-xor-tests.ts @@ -0,0 +1,12 @@ + +/// +/// + +"use strict"; + +import xor = require("bitwise-xor"); + +var b: Buffer; + +b = xor("a", "b"); +b = xor(new Buffer("a"), new Buffer("b")); diff --git a/bitwise-xor/bitwise-xor.d.ts b/bitwise-xor/bitwise-xor.d.ts new file mode 100644 index 0000000000..091789e7fd --- /dev/null +++ b/bitwise-xor/bitwise-xor.d.ts @@ -0,0 +1,16 @@ +// Type definitions for bitwise-xor 0.0.0 +// Project: https://github.com/czzarr/node-bitwise-xor +// Definitions by: Rogier Schouten +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "bitwise-xor" { + + /** + * Bitwise XOR between two Buffers or Strings, returns a Buffer + */ + function xor(b1: Buffer, b2: Buffer): Buffer; + function xor(s1: string, s2: string): Buffer; + + export = xor; +} +