mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 17:20:09 +00:00
5
types/cuint/cuint-tests.ts
Normal file
5
types/cuint/cuint-tests.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { UINT32 } from "cuint";
|
||||
|
||||
const u = UINT32(1, 2);
|
||||
const d = u.fromBits(4, 5, 6);
|
||||
d.add(u.multiply(d)).rotl(17).subtract(u).shiftRight(123);
|
||||
39
types/cuint/index.d.ts
vendored
Normal file
39
types/cuint/index.d.ts
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
// Type definitions for cuint 0.2
|
||||
// Project: https://github.com/pierrec/js-cuint
|
||||
// Definitions by: Lukas Tetzlaff <https://github.com/ltetzlaff>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
export interface Uint {
|
||||
clone(): this;
|
||||
add(x: this): this;
|
||||
subtract(x: this): this;
|
||||
multiply(x: this): this;
|
||||
xor(x: this): this;
|
||||
rotl(n: number): this;
|
||||
shiftRight(n: number): this;
|
||||
|
||||
fromNumber(n: number): this;
|
||||
fromBits(...bits: number[]): this;
|
||||
|
||||
_low: number;
|
||||
_high: number;
|
||||
|
||||
toString(base?: number): string;
|
||||
}
|
||||
|
||||
export interface UintConstructor<T extends Uint> {
|
||||
// called as a function:
|
||||
(low: number, high?: number): T;
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
(text: string, radix?: number): T;
|
||||
|
||||
// called as a constructor:
|
||||
new (low: number, high?: number): T;
|
||||
// tslint:disable-next-line:unified-signatures
|
||||
new (text: string, radix?: number): T;
|
||||
|
||||
prototype: T;
|
||||
}
|
||||
|
||||
export const UINT64: UintConstructor<Uint>;
|
||||
export const UINT32: UintConstructor<Uint>;
|
||||
23
types/cuint/tsconfig.json
Normal file
23
types/cuint/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"cuint-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/cuint/tslint.json
Normal file
1
types/cuint/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user