forked from jwagner/simplex-noise.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
49 lines (44 loc) · 1.37 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// Type definitions for simplex-noise 2.3.0
declare module 'simplex-noise'
{
export = SimplexNoise;
/** Deterministic simplex noise generator suitable for 2D, 3D and 4D spaces. */
class SimplexNoise
{
/**
* Creates a new `SimplexNoise` instance. You want to use this sparingly, as it is a relatively
* expensive.
* @param {SimplexNoise.RandomNumberGenerator | string} [random=Math.random] - The random number
* generator to use. This argument could e.g. be used to inject a seeded generator.
*/
constructor(random?: SimplexNoise.RandomNumberGenerator | string);
/**
* Calculates the noise value in the range [-1;1] for the given point in a 2D space.
* @param {number} x
* @param {number} y
* @return {number}
*/
noise2D(x: number, y: number): number;
/**
* Calculates the noise value in the range [-1;1] for the given point in a 3D space.
* @param {number} x
* @param {number} y
* @param {number} z
* @return {number}
*/
noise3D(x: number, y: number, z: number): number;
/**
* Calculates the noise value in the range [-1;1] for the given point in a 4D space.
* @param {number} x
* @param {number} y
* @param {number} z
* @param {number} w
* @return {number}
*/
noise4D(x: number, y: number, z: number, w: number): number;
}
namespace SimplexNoise
{
export type RandomNumberGenerator = {(): number};
}
}