@bitbybit-dev/base 0.19.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +71 -0
- package/babel.config.cjs +14 -0
- package/babel.config.d.cts +5 -0
- package/index.d.ts +1 -0
- package/index.js +4 -0
- package/lib/api/index.d.ts +1 -0
- package/lib/api/index.js +1 -0
- package/lib/api/inputs/base-inputs.d.ts +35 -0
- package/lib/api/inputs/base-inputs.js +1 -0
- package/lib/api/inputs/color-inputs.d.ts +122 -0
- package/lib/api/inputs/color-inputs.js +164 -0
- package/lib/api/inputs/index.d.ts +8 -0
- package/lib/api/inputs/index.js +8 -0
- package/lib/api/inputs/inputs.d.ts +10 -0
- package/lib/api/inputs/inputs.js +10 -0
- package/lib/api/inputs/lists-inputs.d.ts +478 -0
- package/lib/api/inputs/lists-inputs.js +576 -0
- package/lib/api/inputs/logic-inputs.d.ts +163 -0
- package/lib/api/inputs/logic-inputs.js +111 -0
- package/lib/api/inputs/math-inputs.d.ts +311 -0
- package/lib/api/inputs/math-inputs.js +391 -0
- package/lib/api/inputs/point-inputs.d.ts +446 -0
- package/lib/api/inputs/point-inputs.js +521 -0
- package/lib/api/inputs/text-inputs.d.ts +83 -0
- package/lib/api/inputs/text-inputs.js +120 -0
- package/lib/api/inputs/transforms-inputs.d.ts +136 -0
- package/lib/api/inputs/transforms-inputs.js +200 -0
- package/lib/api/inputs/vector-inputs.d.ts +300 -0
- package/lib/api/inputs/vector-inputs.js +304 -0
- package/lib/api/services/color.d.ts +114 -0
- package/lib/api/services/color.js +170 -0
- package/lib/api/services/geometry-helper.d.ts +15 -0
- package/lib/api/services/geometry-helper.js +151 -0
- package/lib/api/services/index.d.ts +9 -0
- package/lib/api/services/index.js +9 -0
- package/lib/api/services/lists.d.ts +287 -0
- package/lib/api/services/lists.js +682 -0
- package/lib/api/services/logic.d.ts +99 -0
- package/lib/api/services/logic.js +203 -0
- package/lib/api/services/math.d.ts +349 -0
- package/lib/api/services/math.js +621 -0
- package/lib/api/services/point.d.ts +223 -0
- package/lib/api/services/point.js +351 -0
- package/lib/api/services/text.d.ts +69 -0
- package/lib/api/services/text.js +84 -0
- package/lib/api/services/transforms.d.ts +122 -0
- package/lib/api/services/transforms.js +256 -0
- package/lib/api/services/vector.d.ts +320 -0
- package/lib/api/services/vector.js +468 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/package.json +93 -0
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import * as Inputs from "../inputs/inputs";
|
|
2
|
+
/**
|
|
3
|
+
* Contains various logic methods.
|
|
4
|
+
*/
|
|
5
|
+
export declare class Logic {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a boolean value - true or false
|
|
8
|
+
* @param inputs a true or false boolean
|
|
9
|
+
* @returns boolean
|
|
10
|
+
* @group create
|
|
11
|
+
* @shortname boolean
|
|
12
|
+
* @drawable false
|
|
13
|
+
*/
|
|
14
|
+
boolean(inputs: Inputs.Logic.BooleanDto): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Creates a random boolean list of predefined length
|
|
17
|
+
* @param inputs a length and a threshold for randomization of true values
|
|
18
|
+
* @returns booleans
|
|
19
|
+
* @group create
|
|
20
|
+
* @shortname random booleans
|
|
21
|
+
* @drawable false
|
|
22
|
+
*/
|
|
23
|
+
randomBooleans(inputs: Inputs.Logic.RandomBooleansDto): boolean[];
|
|
24
|
+
/**
|
|
25
|
+
* Creates a random boolean list of true and false values based on a list of numbers.
|
|
26
|
+
* All values between true threshold will be true, all values above false threshold will be false,
|
|
27
|
+
* and the rest will be distributed between true and false based on the number of levels in a gradient pattern.
|
|
28
|
+
* That means that the closer the number gets to the false threshold the bigger the chance will be to get random false value.
|
|
29
|
+
* @param inputs a length and a threshold for randomization of true values
|
|
30
|
+
* @returns booleans
|
|
31
|
+
* @group create
|
|
32
|
+
* @shortname 2 threshold random gradient
|
|
33
|
+
* @drawable false
|
|
34
|
+
*/
|
|
35
|
+
twoThresholdRandomGradient(inputs: Inputs.Logic.TwoThresholdRandomGradientDto): boolean[];
|
|
36
|
+
/**
|
|
37
|
+
* Creates a boolean list based on a list of numbers and a threshold.
|
|
38
|
+
* @param inputs a length and a threshold for randomization of true values
|
|
39
|
+
* @returns booleans
|
|
40
|
+
* @group create
|
|
41
|
+
* @shortname threshold boolean list
|
|
42
|
+
* @drawable false
|
|
43
|
+
*/
|
|
44
|
+
thresholdBooleanList(inputs: Inputs.Logic.ThresholdBooleanListDto): boolean[];
|
|
45
|
+
/**
|
|
46
|
+
* Creates a boolean list based on a list of numbers and a gap thresholds. Gap thresholds are pairs of numbers that define a range of numbers that will be true.
|
|
47
|
+
* @param inputs a length and a threshold for randomization of true values
|
|
48
|
+
* @returns booleans
|
|
49
|
+
* @group create
|
|
50
|
+
* @shortname threshold gaps boolean list
|
|
51
|
+
* @drawable false
|
|
52
|
+
*/
|
|
53
|
+
thresholdGapsBooleanList(inputs: Inputs.Logic.ThresholdGapsBooleanListDto): boolean[];
|
|
54
|
+
/**
|
|
55
|
+
* Apply not operator on the boolean
|
|
56
|
+
* @param inputs a true or false boolean
|
|
57
|
+
* @returns boolean
|
|
58
|
+
* @group edit
|
|
59
|
+
* @shortname not
|
|
60
|
+
* @drawable false
|
|
61
|
+
*/
|
|
62
|
+
not(inputs: Inputs.Logic.BooleanDto): boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Apply not operator on a list of booleans
|
|
65
|
+
* @param inputs a list of true or false booleans
|
|
66
|
+
* @returns booleans
|
|
67
|
+
* @group edit
|
|
68
|
+
* @shortname not list
|
|
69
|
+
* @drawable false
|
|
70
|
+
*/
|
|
71
|
+
notList(inputs: Inputs.Logic.BooleanListDto): boolean[];
|
|
72
|
+
/**
|
|
73
|
+
* Does comparison between first and second values
|
|
74
|
+
* @param inputs two values to be compared
|
|
75
|
+
* @returns Result of the comparison
|
|
76
|
+
* @group operations
|
|
77
|
+
* @shortname compare
|
|
78
|
+
* @drawable false
|
|
79
|
+
*/
|
|
80
|
+
compare<T>(inputs: Inputs.Logic.ComparisonDto<T>): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Transmits a value if boolean provided is true and undefined if boolean provided is false
|
|
83
|
+
* @param inputs a value and a boolean value
|
|
84
|
+
* @returns value or undefined
|
|
85
|
+
* @group operations
|
|
86
|
+
* @shortname value gate
|
|
87
|
+
* @drawable false
|
|
88
|
+
*/
|
|
89
|
+
valueGate<T>(inputs: Inputs.Logic.ValueGateDto<T>): T | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Returns first defined value out of two
|
|
92
|
+
* @param inputs two values
|
|
93
|
+
* @returns value or undefined
|
|
94
|
+
* @group operations
|
|
95
|
+
* @shortname first defined value gate
|
|
96
|
+
* @drawable false
|
|
97
|
+
*/
|
|
98
|
+
firstDefinedValueGate<T, U>(inputs: Inputs.Logic.TwoValueGateDto<T, U>): T | U | undefined;
|
|
99
|
+
}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Contains various logic methods.
|
|
3
|
+
*/
|
|
4
|
+
export class Logic {
|
|
5
|
+
/**
|
|
6
|
+
* Creates a boolean value - true or false
|
|
7
|
+
* @param inputs a true or false boolean
|
|
8
|
+
* @returns boolean
|
|
9
|
+
* @group create
|
|
10
|
+
* @shortname boolean
|
|
11
|
+
* @drawable false
|
|
12
|
+
*/
|
|
13
|
+
boolean(inputs) {
|
|
14
|
+
return inputs.boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Creates a random boolean list of predefined length
|
|
18
|
+
* @param inputs a length and a threshold for randomization of true values
|
|
19
|
+
* @returns booleans
|
|
20
|
+
* @group create
|
|
21
|
+
* @shortname random booleans
|
|
22
|
+
* @drawable false
|
|
23
|
+
*/
|
|
24
|
+
randomBooleans(inputs) {
|
|
25
|
+
const booleans = [];
|
|
26
|
+
for (let i = 0; i < inputs.length; i++) {
|
|
27
|
+
booleans.push(Math.random() < inputs.trueThreshold);
|
|
28
|
+
}
|
|
29
|
+
return booleans;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Creates a random boolean list of true and false values based on a list of numbers.
|
|
33
|
+
* All values between true threshold will be true, all values above false threshold will be false,
|
|
34
|
+
* and the rest will be distributed between true and false based on the number of levels in a gradient pattern.
|
|
35
|
+
* That means that the closer the number gets to the false threshold the bigger the chance will be to get random false value.
|
|
36
|
+
* @param inputs a length and a threshold for randomization of true values
|
|
37
|
+
* @returns booleans
|
|
38
|
+
* @group create
|
|
39
|
+
* @shortname 2 threshold random gradient
|
|
40
|
+
* @drawable false
|
|
41
|
+
*/
|
|
42
|
+
twoThresholdRandomGradient(inputs) {
|
|
43
|
+
const booleans = [];
|
|
44
|
+
inputs.numbers.forEach(n => {
|
|
45
|
+
if (n < inputs.thresholdTotalTrue) {
|
|
46
|
+
booleans.push(true);
|
|
47
|
+
}
|
|
48
|
+
else if (n > inputs.thresholdTotalFalse) {
|
|
49
|
+
booleans.push(false);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
const leveledNr = n - inputs.thresholdTotalTrue;
|
|
53
|
+
const step = (inputs.thresholdTotalFalse - inputs.thresholdTotalTrue) / inputs.nrLevels;
|
|
54
|
+
const whichCat = Math.ceil(leveledNr / step);
|
|
55
|
+
const bound = whichCat / inputs.nrLevels;
|
|
56
|
+
const random = Math.random();
|
|
57
|
+
if (random > bound) {
|
|
58
|
+
booleans.push(true);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
booleans.push(false);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
return booleans;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Creates a boolean list based on a list of numbers and a threshold.
|
|
69
|
+
* @param inputs a length and a threshold for randomization of true values
|
|
70
|
+
* @returns booleans
|
|
71
|
+
* @group create
|
|
72
|
+
* @shortname threshold boolean list
|
|
73
|
+
* @drawable false
|
|
74
|
+
*/
|
|
75
|
+
thresholdBooleanList(inputs) {
|
|
76
|
+
const booleans = [];
|
|
77
|
+
inputs.numbers.forEach(n => {
|
|
78
|
+
if (n < inputs.threshold) {
|
|
79
|
+
booleans.push(true);
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
booleans.push(false);
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
if (inputs.inverse) {
|
|
86
|
+
return booleans.map(b => !b);
|
|
87
|
+
}
|
|
88
|
+
return booleans;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Creates a boolean list based on a list of numbers and a gap thresholds. Gap thresholds are pairs of numbers that define a range of numbers that will be true.
|
|
92
|
+
* @param inputs a length and a threshold for randomization of true values
|
|
93
|
+
* @returns booleans
|
|
94
|
+
* @group create
|
|
95
|
+
* @shortname threshold gaps boolean list
|
|
96
|
+
* @drawable false
|
|
97
|
+
*/
|
|
98
|
+
thresholdGapsBooleanList(inputs) {
|
|
99
|
+
const booleans = [];
|
|
100
|
+
inputs.numbers.forEach(n => {
|
|
101
|
+
let foundInThresholds = false;
|
|
102
|
+
inputs.gapThresholds.forEach(t => {
|
|
103
|
+
const min = t[0];
|
|
104
|
+
const max = t[1];
|
|
105
|
+
if (n >= min && n <= max) {
|
|
106
|
+
booleans.push(true);
|
|
107
|
+
foundInThresholds = true;
|
|
108
|
+
}
|
|
109
|
+
});
|
|
110
|
+
if (!foundInThresholds) {
|
|
111
|
+
booleans.push(false);
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
if (inputs.inverse) {
|
|
115
|
+
return booleans.map(b => !b);
|
|
116
|
+
}
|
|
117
|
+
return booleans;
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Apply not operator on the boolean
|
|
121
|
+
* @param inputs a true or false boolean
|
|
122
|
+
* @returns boolean
|
|
123
|
+
* @group edit
|
|
124
|
+
* @shortname not
|
|
125
|
+
* @drawable false
|
|
126
|
+
*/
|
|
127
|
+
not(inputs) {
|
|
128
|
+
return !inputs.boolean;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Apply not operator on a list of booleans
|
|
132
|
+
* @param inputs a list of true or false booleans
|
|
133
|
+
* @returns booleans
|
|
134
|
+
* @group edit
|
|
135
|
+
* @shortname not list
|
|
136
|
+
* @drawable false
|
|
137
|
+
*/
|
|
138
|
+
notList(inputs) {
|
|
139
|
+
return inputs.booleans.map(b => !b);
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Does comparison between first and second values
|
|
143
|
+
* @param inputs two values to be compared
|
|
144
|
+
* @returns Result of the comparison
|
|
145
|
+
* @group operations
|
|
146
|
+
* @shortname compare
|
|
147
|
+
* @drawable false
|
|
148
|
+
*/
|
|
149
|
+
compare(inputs) {
|
|
150
|
+
switch (inputs.operator) {
|
|
151
|
+
case "==":
|
|
152
|
+
return inputs.first == inputs.second;
|
|
153
|
+
case "!=":
|
|
154
|
+
return inputs.first != inputs.second;
|
|
155
|
+
case "===":
|
|
156
|
+
return inputs.first === inputs.second;
|
|
157
|
+
case "!==":
|
|
158
|
+
return inputs.first !== inputs.second;
|
|
159
|
+
case "<":
|
|
160
|
+
return inputs.first < inputs.second;
|
|
161
|
+
case "<=":
|
|
162
|
+
return inputs.first <= inputs.second;
|
|
163
|
+
case ">":
|
|
164
|
+
return inputs.first > inputs.second;
|
|
165
|
+
case ">=":
|
|
166
|
+
return inputs.first >= inputs.second;
|
|
167
|
+
default:
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Transmits a value if boolean provided is true and undefined if boolean provided is false
|
|
173
|
+
* @param inputs a value and a boolean value
|
|
174
|
+
* @returns value or undefined
|
|
175
|
+
* @group operations
|
|
176
|
+
* @shortname value gate
|
|
177
|
+
* @drawable false
|
|
178
|
+
*/
|
|
179
|
+
valueGate(inputs) {
|
|
180
|
+
return inputs.boolean ? inputs.value : undefined;
|
|
181
|
+
}
|
|
182
|
+
/**
|
|
183
|
+
* Returns first defined value out of two
|
|
184
|
+
* @param inputs two values
|
|
185
|
+
* @returns value or undefined
|
|
186
|
+
* @group operations
|
|
187
|
+
* @shortname first defined value gate
|
|
188
|
+
* @drawable false
|
|
189
|
+
*/
|
|
190
|
+
firstDefinedValueGate(inputs) {
|
|
191
|
+
let res;
|
|
192
|
+
if (inputs.value1 !== undefined) {
|
|
193
|
+
res = inputs.value1;
|
|
194
|
+
}
|
|
195
|
+
else if (inputs.value2 !== undefined) {
|
|
196
|
+
res = inputs.value2;
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
res = undefined;
|
|
200
|
+
}
|
|
201
|
+
return res;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
@@ -0,0 +1,349 @@
|
|
|
1
|
+
import * as Inputs from "../inputs/inputs";
|
|
2
|
+
/**
|
|
3
|
+
* Contains various math methods.
|
|
4
|
+
*/
|
|
5
|
+
export declare class MathBitByBit {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a number
|
|
8
|
+
* @param inputs a number to be created
|
|
9
|
+
* @returns number
|
|
10
|
+
* @group create
|
|
11
|
+
* @shortname number
|
|
12
|
+
* @drawable false
|
|
13
|
+
*/
|
|
14
|
+
number(inputs: Inputs.Math.NumberDto): number;
|
|
15
|
+
/**
|
|
16
|
+
* Does basic math operations
|
|
17
|
+
* @param inputs two numbers and operator
|
|
18
|
+
* @returns Result of math operation action
|
|
19
|
+
* @group operations
|
|
20
|
+
* @shortname two numbers
|
|
21
|
+
* @drawable false
|
|
22
|
+
*/
|
|
23
|
+
twoNrOperation(inputs: Inputs.Math.ActionOnTwoNumbersDto): number;
|
|
24
|
+
/**
|
|
25
|
+
* Does modulus operation
|
|
26
|
+
* @param inputs two numbers and operator
|
|
27
|
+
* @returns Result of modulus operation
|
|
28
|
+
* @group operations
|
|
29
|
+
* @shortname modulus
|
|
30
|
+
* @drawable false
|
|
31
|
+
*/
|
|
32
|
+
modulus(inputs: Inputs.Math.ModulusDto): number;
|
|
33
|
+
/**
|
|
34
|
+
* Does rounding to decimals
|
|
35
|
+
* @param inputs a number and decimal places
|
|
36
|
+
* @returns Result of rounding
|
|
37
|
+
* @group operations
|
|
38
|
+
* @shortname round to decimals
|
|
39
|
+
* @drawable false
|
|
40
|
+
*/
|
|
41
|
+
roundToDecimals(inputs: Inputs.Math.RoundToDecimalsDto): number;
|
|
42
|
+
/**
|
|
43
|
+
* Does basic math operations on one number
|
|
44
|
+
* @param inputs one number and operator action
|
|
45
|
+
* @returns Result of math operation
|
|
46
|
+
* @group operations
|
|
47
|
+
* @shortname one number
|
|
48
|
+
* @drawable false
|
|
49
|
+
*/
|
|
50
|
+
oneNrOperation(inputs: Inputs.Math.ActionOnOneNumberDto): number;
|
|
51
|
+
/**
|
|
52
|
+
* Remaps a number from one range to another
|
|
53
|
+
* @param inputs one number and operator action
|
|
54
|
+
* @returns Result of mapping
|
|
55
|
+
* @group operations
|
|
56
|
+
* @shortname remap
|
|
57
|
+
* @drawable false
|
|
58
|
+
*/
|
|
59
|
+
remap(inputs: Inputs.Math.RemapNumberDto): number;
|
|
60
|
+
/**
|
|
61
|
+
* Creates a random number between 0 and 1
|
|
62
|
+
* @returns A random number between 0 and 1
|
|
63
|
+
* @group generate
|
|
64
|
+
* @shortname random 0 - 1
|
|
65
|
+
* @drawable false
|
|
66
|
+
*/
|
|
67
|
+
random(): number;
|
|
68
|
+
/**
|
|
69
|
+
* Creates a random number between low and high value
|
|
70
|
+
* @param inputs low and high numbers
|
|
71
|
+
* @returns A random number
|
|
72
|
+
* @group generate
|
|
73
|
+
* @shortname random number
|
|
74
|
+
* @drawable false
|
|
75
|
+
*/
|
|
76
|
+
randomNumber(inputs: Inputs.Math.RandomNumberDto): number;
|
|
77
|
+
/**
|
|
78
|
+
* Creates random numbers between low and high values
|
|
79
|
+
* @param inputs low and high numbers
|
|
80
|
+
* @returns A list of random numbers
|
|
81
|
+
* @group generate
|
|
82
|
+
* @shortname random numbers
|
|
83
|
+
* @drawable false
|
|
84
|
+
*/
|
|
85
|
+
randomNumbers(inputs: Inputs.Math.RandomNumbersDto): number[];
|
|
86
|
+
/**
|
|
87
|
+
* Creates a PI number
|
|
88
|
+
* @returns A number PI
|
|
89
|
+
* @group generate
|
|
90
|
+
* @shortname π
|
|
91
|
+
* @drawable false
|
|
92
|
+
*/
|
|
93
|
+
pi(): number;
|
|
94
|
+
/**
|
|
95
|
+
* Rounds the number to decimal places
|
|
96
|
+
* @param inputs a number to be rounded to decimal places
|
|
97
|
+
* @returns number
|
|
98
|
+
* @group operations
|
|
99
|
+
* @shortname to fixed
|
|
100
|
+
* @drawable false
|
|
101
|
+
*/
|
|
102
|
+
toFixed(inputs: Inputs.Math.ToFixedDto): string;
|
|
103
|
+
/**
|
|
104
|
+
* Adds two numbers
|
|
105
|
+
* @param inputs two numbers
|
|
106
|
+
* @returns number
|
|
107
|
+
* @group basics
|
|
108
|
+
* @shortname add
|
|
109
|
+
* @drawable false
|
|
110
|
+
*/
|
|
111
|
+
add(inputs: Inputs.Math.TwoNumbersDto): number;
|
|
112
|
+
/**
|
|
113
|
+
* Subtracts two numbers
|
|
114
|
+
* @param inputs two numbers
|
|
115
|
+
* @returns number
|
|
116
|
+
* @group basics
|
|
117
|
+
* @shortname subtract
|
|
118
|
+
* @drawable false
|
|
119
|
+
*/
|
|
120
|
+
subtract(inputs: Inputs.Math.TwoNumbersDto): number;
|
|
121
|
+
/**
|
|
122
|
+
* Multiplies two numbers
|
|
123
|
+
* @param inputs two numbers
|
|
124
|
+
* @returns number
|
|
125
|
+
* @group basics
|
|
126
|
+
* @shortname multiply
|
|
127
|
+
* @drawable false
|
|
128
|
+
*/
|
|
129
|
+
multiply(inputs: Inputs.Math.TwoNumbersDto): number;
|
|
130
|
+
/**
|
|
131
|
+
* Divides two numbers
|
|
132
|
+
* @param inputs two numbers
|
|
133
|
+
* @returns number
|
|
134
|
+
* @group basics
|
|
135
|
+
* @shortname divide
|
|
136
|
+
* @drawable false
|
|
137
|
+
*/
|
|
138
|
+
divide(inputs: Inputs.Math.TwoNumbersDto): number;
|
|
139
|
+
/**
|
|
140
|
+
* Powers a number
|
|
141
|
+
* @param inputs two numbers
|
|
142
|
+
* @returns number
|
|
143
|
+
* @group basics
|
|
144
|
+
* @shortname power
|
|
145
|
+
* @drawable false
|
|
146
|
+
*/
|
|
147
|
+
power(inputs: Inputs.Math.TwoNumbersDto): number;
|
|
148
|
+
/**
|
|
149
|
+
* Gets the square root of a number
|
|
150
|
+
* @param inputs a number
|
|
151
|
+
* @returns number
|
|
152
|
+
* @group basics
|
|
153
|
+
* @shortname sqrt
|
|
154
|
+
* @drawable false
|
|
155
|
+
*/
|
|
156
|
+
sqrt(inputs: Inputs.Math.NumberDto): number;
|
|
157
|
+
/**
|
|
158
|
+
* Gets the absolute value of a number
|
|
159
|
+
* @param inputs a number
|
|
160
|
+
* @returns number
|
|
161
|
+
* @group basics
|
|
162
|
+
* @shortname abs
|
|
163
|
+
* @drawable false
|
|
164
|
+
*/
|
|
165
|
+
abs(inputs: Inputs.Math.NumberDto): number;
|
|
166
|
+
/**
|
|
167
|
+
* Rounds a number
|
|
168
|
+
* @param inputs a number
|
|
169
|
+
* @returns number
|
|
170
|
+
* @group basics
|
|
171
|
+
* @shortname round
|
|
172
|
+
* @drawable false
|
|
173
|
+
*/
|
|
174
|
+
round(inputs: Inputs.Math.NumberDto): number;
|
|
175
|
+
/**
|
|
176
|
+
* Floors a number
|
|
177
|
+
* @param inputs a number
|
|
178
|
+
* @returns number
|
|
179
|
+
* @group basics
|
|
180
|
+
* @shortname floor
|
|
181
|
+
* @drawable false
|
|
182
|
+
*/
|
|
183
|
+
floor(inputs: Inputs.Math.NumberDto): number;
|
|
184
|
+
/**
|
|
185
|
+
* Ceils a number
|
|
186
|
+
* @param inputs a number
|
|
187
|
+
* @returns number
|
|
188
|
+
* @group basics
|
|
189
|
+
* @shortname ceil
|
|
190
|
+
* @drawable false
|
|
191
|
+
*/
|
|
192
|
+
ceil(inputs: Inputs.Math.NumberDto): number;
|
|
193
|
+
/**
|
|
194
|
+
* Negates a number
|
|
195
|
+
* @param inputs a number
|
|
196
|
+
* @returns number
|
|
197
|
+
* @group basics
|
|
198
|
+
* @shortname negate
|
|
199
|
+
* @drawable false
|
|
200
|
+
*/
|
|
201
|
+
negate(inputs: Inputs.Math.NumberDto): number;
|
|
202
|
+
/**
|
|
203
|
+
* Gets the natural logarithm of a number
|
|
204
|
+
* @param inputs a number
|
|
205
|
+
* @returns number
|
|
206
|
+
* @group basics
|
|
207
|
+
* @shortname ln
|
|
208
|
+
* @drawable false
|
|
209
|
+
*/
|
|
210
|
+
ln(inputs: Inputs.Math.NumberDto): number;
|
|
211
|
+
/**
|
|
212
|
+
* Gets the base 10 logarithm of a number
|
|
213
|
+
* @param inputs a number
|
|
214
|
+
* @returns number
|
|
215
|
+
* @group basics
|
|
216
|
+
* @shortname log10
|
|
217
|
+
* @drawable false
|
|
218
|
+
*/
|
|
219
|
+
log10(inputs: Inputs.Math.NumberDto): number;
|
|
220
|
+
/**
|
|
221
|
+
* Raises 10 to the power of a number
|
|
222
|
+
* @param inputs a number
|
|
223
|
+
* @returns number
|
|
224
|
+
* @group basics
|
|
225
|
+
* @shortname ten pow
|
|
226
|
+
* @drawable false
|
|
227
|
+
*/
|
|
228
|
+
tenPow(inputs: Inputs.Math.NumberDto): number;
|
|
229
|
+
/**
|
|
230
|
+
* Gets the sine of a number
|
|
231
|
+
* @param inputs a number
|
|
232
|
+
* @returns number
|
|
233
|
+
* @group basics
|
|
234
|
+
* @shortname sin
|
|
235
|
+
* @drawable false
|
|
236
|
+
*/
|
|
237
|
+
sin(inputs: Inputs.Math.NumberDto): number;
|
|
238
|
+
/**
|
|
239
|
+
* Gets the cosine of a number
|
|
240
|
+
* @param inputs a number
|
|
241
|
+
* @returns number
|
|
242
|
+
* @group basics
|
|
243
|
+
* @shortname cos
|
|
244
|
+
* @drawable false
|
|
245
|
+
*/
|
|
246
|
+
cos(inputs: Inputs.Math.NumberDto): number;
|
|
247
|
+
/**
|
|
248
|
+
* Gets the tangent of a number
|
|
249
|
+
* @param inputs a number
|
|
250
|
+
* @returns number
|
|
251
|
+
* @group basics
|
|
252
|
+
* @shortname tan
|
|
253
|
+
* @drawable false
|
|
254
|
+
*/
|
|
255
|
+
tan(inputs: Inputs.Math.NumberDto): number;
|
|
256
|
+
/**
|
|
257
|
+
* Gets the arcsine of a number
|
|
258
|
+
* @param inputs a number
|
|
259
|
+
* @returns number
|
|
260
|
+
* @group basics
|
|
261
|
+
* @shortname asin
|
|
262
|
+
* @drawable false
|
|
263
|
+
*/
|
|
264
|
+
asin(inputs: Inputs.Math.NumberDto): number;
|
|
265
|
+
/**
|
|
266
|
+
* Gets the arccosine of a number
|
|
267
|
+
* @param inputs a number
|
|
268
|
+
* @returns number
|
|
269
|
+
* @group basics
|
|
270
|
+
* @shortname acos
|
|
271
|
+
* @drawable false
|
|
272
|
+
*/
|
|
273
|
+
acos(inputs: Inputs.Math.NumberDto): number;
|
|
274
|
+
/**
|
|
275
|
+
* Gets the arctangent of a number
|
|
276
|
+
* @param inputs a number
|
|
277
|
+
* @returns number
|
|
278
|
+
* @group basics
|
|
279
|
+
* @shortname atan
|
|
280
|
+
* @drawable false
|
|
281
|
+
*/
|
|
282
|
+
atan(inputs: Inputs.Math.NumberDto): number;
|
|
283
|
+
/**
|
|
284
|
+
* Gets the natural exponent of a number
|
|
285
|
+
* @param inputs a number
|
|
286
|
+
* @returns number
|
|
287
|
+
* @group basics
|
|
288
|
+
* @shortname exp
|
|
289
|
+
* @drawable false
|
|
290
|
+
*/
|
|
291
|
+
exp(inputs: Inputs.Math.NumberDto): number;
|
|
292
|
+
/**
|
|
293
|
+
* Converts degrees to radians
|
|
294
|
+
* @param inputs a number in degrees
|
|
295
|
+
* @returns number
|
|
296
|
+
* @group basics
|
|
297
|
+
* @shortname deg to rad
|
|
298
|
+
* @drawable false
|
|
299
|
+
*/
|
|
300
|
+
degToRad(inputs: Inputs.Math.NumberDto): number;
|
|
301
|
+
/**
|
|
302
|
+
* Converts radians to degrees
|
|
303
|
+
* @param inputs a number in radians
|
|
304
|
+
* @returns number
|
|
305
|
+
* @group basics
|
|
306
|
+
* @shortname rad to deg
|
|
307
|
+
* @drawable false
|
|
308
|
+
*/
|
|
309
|
+
radToDeg(inputs: Inputs.Math.NumberDto): number;
|
|
310
|
+
/**
|
|
311
|
+
* Eases a number by providing x parameter 0-1 and a range of output values
|
|
312
|
+
* @param inputs a number, min and max values, and ease type
|
|
313
|
+
* @returns number
|
|
314
|
+
* @group operations
|
|
315
|
+
* @shortname ease
|
|
316
|
+
* @drawable false
|
|
317
|
+
*/
|
|
318
|
+
ease(inputs: Inputs.Math.EaseDto): number;
|
|
319
|
+
private easeInSine;
|
|
320
|
+
private easeOutSine;
|
|
321
|
+
private easeInOutSine;
|
|
322
|
+
private easeInQuad;
|
|
323
|
+
private easeOutQuad;
|
|
324
|
+
private easeInOutQuad;
|
|
325
|
+
private easeInCubic;
|
|
326
|
+
private easeOutCubic;
|
|
327
|
+
private easeInOutCubic;
|
|
328
|
+
private easeInQuart;
|
|
329
|
+
private easeOutQuart;
|
|
330
|
+
private easeInOutQuart;
|
|
331
|
+
private easeInQuint;
|
|
332
|
+
private easeOutQuint;
|
|
333
|
+
private easeInOutQuint;
|
|
334
|
+
private easeInExpo;
|
|
335
|
+
private easeOutExpo;
|
|
336
|
+
private easeInOutExpo;
|
|
337
|
+
private easeInCirc;
|
|
338
|
+
private easeOutCirc;
|
|
339
|
+
private easeInOutCirc;
|
|
340
|
+
private easeInBack;
|
|
341
|
+
private easeOutBack;
|
|
342
|
+
private easeInOutBack;
|
|
343
|
+
private easeInElastic;
|
|
344
|
+
private easeOutElastic;
|
|
345
|
+
private easeInOutElastic;
|
|
346
|
+
private easeInBounce;
|
|
347
|
+
private easeOutBounce;
|
|
348
|
+
private easeInOutBounce;
|
|
349
|
+
}
|