From b9536c14d6030b3b99261b35fc3602e54dd838e6 Mon Sep 17 00:00:00 2001 From: dencap Date: Thu, 12 Nov 2015 17:02:21 +0100 Subject: [PATCH] Fixed problems suggested by Travis --- bytebuffer/bytebuffer-tests.ts | 8 ++++++++ bytebuffer/bytebuffer.d.ts | 12 ++++++------ bytebuffer/long-tests.ts | 6 ++++++ 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 bytebuffer/bytebuffer-tests.ts create mode 100644 bytebuffer/long-tests.ts diff --git a/bytebuffer/bytebuffer-tests.ts b/bytebuffer/bytebuffer-tests.ts new file mode 100644 index 0000000000..34db7368d5 --- /dev/null +++ b/bytebuffer/bytebuffer-tests.ts @@ -0,0 +1,8 @@ +/// + +import ByteBuffer = require("bytebuffer"); + +var bb = new ByteBuffer() + .writeIString("Hello world!") + .flip(); +console.log(bb.readIString()+" from bytebuffer.js"); \ No newline at end of file diff --git a/bytebuffer/bytebuffer.d.ts b/bytebuffer/bytebuffer.d.ts index 71782bcb10..bf1251e5f6 100644 --- a/bytebuffer/bytebuffer.d.ts +++ b/bytebuffer/bytebuffer.d.ts @@ -1,10 +1,10 @@ -// Type definitions for ByteBuffer.js 5.0.0 +// Type definitions for bytebuffer.js 5.0.0 // Project: https://github.com/dcodeIO/bytebuffer.js -// Definitions by: SINTEF-9012 // Definitions by: Denis Cappellin // Definitions: https://github.com/borisyankov/DefinitelyTyped +// Definitions by: SINTEF-9012 -/// +/// declare class ByteBuffer { @@ -26,7 +26,7 @@ declare class ByteBuffer /** * Default no assertions flag of false. */ - static DEFAULT_NOASSERT + static DEFAULT_NOASSERT: boolean; /** * Little endian constant that can be used instead of its boolean value. Evaluates to true. @@ -51,7 +51,7 @@ declare class ByteBuffer /** * Metrics representing number of UTF8 characters.Evaluates to 1. */ - static METRICS_CHARS + static METRICS_CHARS: number; /** * ByteBuffer version. @@ -286,7 +286,7 @@ declare class ByteBuffer /** * Prints debug information about this ByteBuffer's contents. */ - printDebug( out?: ( string ) => void ): void; + printDebug( out?: ( text: string ) => void ): void; /** * Reads an 8bit signed integer. This is an alias of ByteBuffer#readInt8. diff --git a/bytebuffer/long-tests.ts b/bytebuffer/long-tests.ts new file mode 100644 index 0000000000..35dd6d7844 --- /dev/null +++ b/bytebuffer/long-tests.ts @@ -0,0 +1,6 @@ +/// + +import Long = require("long"); + +var longVal = new Long(0xFFFFFFFF, 0x7FFFFFFF); +console.log(longVal.toString()); \ No newline at end of file