adds basic typings for the 'isaac' package

This commit is contained in:
Martin Olsson
2018-09-21 21:14:05 +02:00
parent 39c439d76d
commit 0c43fa6d67
4 changed files with 43 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
// Type definitions for isaac 0.0
// Project: https://github.com/StefanoBalocco/isaac.js
// Definitions by: Martin Olsson <https://github.com/mo>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export function internals(): any;
export function prng(n: number): void;
export function rand(): number;
export function random(): number;
export function reset(): void;
export function seed(s: string | number | ReadonlyArray<number>): void;
+8
View File
@@ -0,0 +1,8 @@
import * as isaac from 'isaac';
const r1 = isaac.random();
const r2 = isaac.rand();
isaac.reset();
isaac.seed(42);
const r3 = isaac.random();
const r4 = isaac.rand();
+23
View 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",
"isaac-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }