Move all packages to a types directory

This commit is contained in:
Andy Hanson
2017-03-24 14:27:52 -07:00
parent f9869dc191
commit 354cec620d
13846 changed files with 0 additions and 0 deletions
+8
View File
@@ -0,0 +1,8 @@
import BitArray = require("bit-array");
const a = new BitArray(32);
a.set(0, true);
a.set(31, true);
a.toString(); // "10000000000000000000000000000001"
a.get(1); // false
a.get(31); // true
+105
View File
@@ -0,0 +1,105 @@
// Type definitions for bit-array v0.2.2
// Project: https://github.com/bramstein/bit-array
// Definitions by: Mudkip <https://github.com/mudkipme>
// Definitions: https://github.com/mudkipme/DefinitelyTyped
declare module "bit-array" {
class BitArray {
/**
* Creates a new empty BitArray with the given length or initialises the BitArray with the given hex representation.
*/
constructor(size: number, hex?: string);
/**
* Returns the total number of bits in this BitArray.
*/
size(): number;
/**
* Sets the bit at index to a value (boolean.)
*/
set(index: number, value: boolean): BitArray;
/**
* Toggles the bit at index. If the bit is on, it is turned off. Likewise, if the bit is off it is turned on.
*/
toggle(index: number): BitArray;
/**
* Returns the value of the bit at index (boolean.)
*/
get(index: number): boolean;
/**
* Resets the BitArray so that it is empty and can be re-used.
*/
reset(): BitArray;
/**
* Returns a copy of this BitArray.
*/
copy(): BitArray;
/**
* Returns true if this BitArray equals another. Two BitArrays are considered
* equal if both have the same length and bit pattern.
*/
equals(x: BitArray): boolean;
/**
* Returns the JSON representation of this BitArray.
*/
toJSON(): string;
/**
* Returns a string representation of the BitArray with bits
* in mathemetical order.
*/
toBinaryString(): string;
/**
* Returns a hexadecimal string representation of the BitArray
* with bits in logical order.
*/
toHexString(): string;
/**
* Returns a string representation of the BitArray with bits
* in logical order.
*/
toString(): string;
/**
* Convert the BitArray to an Array of boolean values (slow).
*/
toArray(): boolean[];
/**
* Returns the total number of bits set to one in this BitArray.
*/
count(): number;
/**
* Inverts this BitArray.
*/
not(): BitArray;
/**
* Bitwise OR on the values of this BitArray using BitArray x.
*/
or(x: BitArray): BitArray;
/**
* Bitwise AND on the values of this BitArray using BitArray x.
*/
and(x: BitArray): BitArray;
/**
* Bitwise XOR on the values of this BitArray using BitArray x.
*/
xor(x: BitArray): BitArray;
}
export = BitArray;
}
+22
View File
@@ -0,0 +1,22 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"bit-array-tests.ts"
]
}