-
Notifications
You must be signed in to change notification settings - Fork 0
/
project.d.ts
73 lines (62 loc) · 2.32 KB
/
project.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//------------------------------------------------------------------------------------
// EXPORT MODULES
//------------------------------------------------------------------------------------
/* DEPRECATED: Export of the BabylonJS declarations to allow the components to be imported into project
declare module 'babylonjs' {
export = BABYLON;
}
*/
//------------------------------------------------------------------------------------
interface Math {
/*
* Returns a random value between a given maximum and minimum.
* @param min is the lower constraint for the random number.
* @param max is the upper constraint for the random number.
*/
randomBetween(min: number, max: number): number;
/*
* Returns the value contrained by a minimum and maximum.
* @param value which is to be contraint by the min and max.
* @param min is the lower constraint for the value.
* @param max is the upper constraint for the value.
*/
clamp(value: number, min: number, max: number): number;
/*
* Returns a number inside a linear interpolation based on the alpha.
* @param min is the starting value for the linear interpolation.
* @param max is the finishing value for the linear interpolation.
* @param alpha is the percentage at which to select the value.
*/
lerp(min: number, max: number, alpha: number): number;
}
interface Array<T> {
/*
* Returns a random element from this array.
* @param seed if provided, will be used as a base to calculate which item is to be returned.
*/
random(seed?: number): T;
}
interface String {
/*
* Capitalizes the first letter of the string.
*/
capitalize(): string;
}
//------------------------------------------------------------------------------------
// CONTENT TYPES
//------------------------------------------------------------------------------------
declare module '*.svg' {
const content: any;
export default content;
}
//------------------------------------------------------------------------------------
// POTENTIAL TEMP FIXES
//------------------------------------------------------------------------------------
/* HTMLCanvasElement definition mismatch
interface HTMLCanvasElement extends HTMLElement {
requestPointerLock(): void;
msRequestPointerLock(): void;
mozRequestPointerLock(): void;
webkitRequestPointerLock(): void;
}
*/