@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.
Files changed (53) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +71 -0
  3. package/babel.config.cjs +14 -0
  4. package/babel.config.d.cts +5 -0
  5. package/index.d.ts +1 -0
  6. package/index.js +4 -0
  7. package/lib/api/index.d.ts +1 -0
  8. package/lib/api/index.js +1 -0
  9. package/lib/api/inputs/base-inputs.d.ts +35 -0
  10. package/lib/api/inputs/base-inputs.js +1 -0
  11. package/lib/api/inputs/color-inputs.d.ts +122 -0
  12. package/lib/api/inputs/color-inputs.js +164 -0
  13. package/lib/api/inputs/index.d.ts +8 -0
  14. package/lib/api/inputs/index.js +8 -0
  15. package/lib/api/inputs/inputs.d.ts +10 -0
  16. package/lib/api/inputs/inputs.js +10 -0
  17. package/lib/api/inputs/lists-inputs.d.ts +478 -0
  18. package/lib/api/inputs/lists-inputs.js +576 -0
  19. package/lib/api/inputs/logic-inputs.d.ts +163 -0
  20. package/lib/api/inputs/logic-inputs.js +111 -0
  21. package/lib/api/inputs/math-inputs.d.ts +311 -0
  22. package/lib/api/inputs/math-inputs.js +391 -0
  23. package/lib/api/inputs/point-inputs.d.ts +446 -0
  24. package/lib/api/inputs/point-inputs.js +521 -0
  25. package/lib/api/inputs/text-inputs.d.ts +83 -0
  26. package/lib/api/inputs/text-inputs.js +120 -0
  27. package/lib/api/inputs/transforms-inputs.d.ts +136 -0
  28. package/lib/api/inputs/transforms-inputs.js +200 -0
  29. package/lib/api/inputs/vector-inputs.d.ts +300 -0
  30. package/lib/api/inputs/vector-inputs.js +304 -0
  31. package/lib/api/services/color.d.ts +114 -0
  32. package/lib/api/services/color.js +170 -0
  33. package/lib/api/services/geometry-helper.d.ts +15 -0
  34. package/lib/api/services/geometry-helper.js +151 -0
  35. package/lib/api/services/index.d.ts +9 -0
  36. package/lib/api/services/index.js +9 -0
  37. package/lib/api/services/lists.d.ts +287 -0
  38. package/lib/api/services/lists.js +682 -0
  39. package/lib/api/services/logic.d.ts +99 -0
  40. package/lib/api/services/logic.js +203 -0
  41. package/lib/api/services/math.d.ts +349 -0
  42. package/lib/api/services/math.js +621 -0
  43. package/lib/api/services/point.d.ts +223 -0
  44. package/lib/api/services/point.js +351 -0
  45. package/lib/api/services/text.d.ts +69 -0
  46. package/lib/api/services/text.js +84 -0
  47. package/lib/api/services/transforms.d.ts +122 -0
  48. package/lib/api/services/transforms.js +256 -0
  49. package/lib/api/services/vector.d.ts +320 -0
  50. package/lib/api/services/vector.js +468 -0
  51. package/lib/index.d.ts +1 -0
  52. package/lib/index.js +1 -0
  53. package/package.json +93 -0
@@ -0,0 +1,163 @@
1
+ import { Base } from "./base-inputs";
2
+ export declare namespace Logic {
3
+ enum BooleanOperatorsEnum {
4
+ less = "<",
5
+ lessOrEqual = "<=",
6
+ greater = ">",
7
+ greaterOrEqual = ">=",
8
+ tripleEqual = "===",
9
+ tripleNotEqual = "!==",
10
+ equal = "==",
11
+ notEqual = "!="
12
+ }
13
+ class ComparisonDto<T> {
14
+ constructor(first?: T, second?: T, operator?: BooleanOperatorsEnum);
15
+ /**
16
+ * First item
17
+ * @default undefined
18
+ */
19
+ first: T;
20
+ /**
21
+ * Second item
22
+ * @default undefined
23
+ */
24
+ second: T;
25
+ /**
26
+ * Operator
27
+ * @default less
28
+ */
29
+ operator: BooleanOperatorsEnum;
30
+ }
31
+ class BooleanDto {
32
+ constructor(boolean?: boolean);
33
+ /**
34
+ * Boolean value
35
+ * @default false
36
+ */
37
+ boolean: boolean;
38
+ }
39
+ class BooleanListDto {
40
+ constructor(booleans?: boolean);
41
+ /**
42
+ * Boolean value
43
+ * @default undefined
44
+ */
45
+ booleans: any;
46
+ }
47
+ class ValueGateDto<T> {
48
+ constructor(value?: T, boolean?: boolean);
49
+ /**
50
+ * Value to transmit when gate will be released. When value is not released we will transmit undefined value
51
+ * @default undefined
52
+ */
53
+ value: T;
54
+ /**
55
+ * Boolean value to release the gate
56
+ * @default false
57
+ */
58
+ boolean: boolean;
59
+ }
60
+ class TwoValueGateDto<T, U> {
61
+ constructor(value1?: T, value2?: U);
62
+ /**
63
+ * First value to check
64
+ * @default undefined
65
+ * @optional true
66
+ */
67
+ value1?: T;
68
+ /**
69
+ * Second value to check
70
+ * @default undefined
71
+ * @optional true
72
+ */
73
+ value2?: U;
74
+ }
75
+ class RandomBooleansDto {
76
+ constructor(length?: number);
77
+ /**
78
+ * Length of the list
79
+ * @default 10
80
+ * @minimum 1
81
+ * @maximum Infinity
82
+ * @step 1
83
+ */
84
+ length: number;
85
+ /**
86
+ * Threshold for true value between 0 and 1. The closer the value is to 1 the more true values there will be in the list.
87
+ * @default 0.5
88
+ * @minimum 0
89
+ * @maximum 1
90
+ * @step 0.1
91
+ */
92
+ trueThreshold: number;
93
+ }
94
+ class TwoThresholdRandomGradientDto {
95
+ /**
96
+ * Numbers to remap to bools
97
+ * @default undefined
98
+ */
99
+ numbers: number[];
100
+ /**
101
+ * Threshold for the numeric value until which the output will be true
102
+ * @default 1
103
+ * @minimum 0
104
+ * @maximum Infinity
105
+ * @step 0.1
106
+ */
107
+ thresholdTotalTrue: number;
108
+ /**
109
+ * Threshold for the numeric value until which the output will be true
110
+ * @default 2
111
+ * @minimum 0
112
+ * @maximum Infinity
113
+ * @step 0.1
114
+ */
115
+ thresholdTotalFalse: number;
116
+ /**
117
+ * Number of levels to go through in between thresholds for gradient
118
+ * @default 10
119
+ * @minimum 0
120
+ * @maximum Infinity
121
+ * @step 1
122
+ */
123
+ nrLevels: number;
124
+ }
125
+ class ThresholdBooleanListDto {
126
+ /**
127
+ * Numbers to remap to bools based on threshold
128
+ * @default undefined
129
+ */
130
+ numbers: number[];
131
+ /**
132
+ * Threshold for the numeric value until which the output will be true.
133
+ * If number in the list is larger than this threshold it will become false if inverse stays false.
134
+ * @default 1
135
+ * @minimum 0
136
+ * @maximum Infinity
137
+ * @step 0.1
138
+ */
139
+ threshold: number;
140
+ /**
141
+ * True values become false and false values become true
142
+ * @default false
143
+ */
144
+ inverse: boolean;
145
+ }
146
+ class ThresholdGapsBooleanListDto {
147
+ /**
148
+ * Numbers to remap to bools based on threshold
149
+ * @default undefined
150
+ */
151
+ numbers: number[];
152
+ /**
153
+ * 2D arrays representing gaps of the thresholds on which numbers should be flipped from false to true if inverse is false.
154
+ * @default undefined
155
+ */
156
+ gapThresholds: Base.Vector2[];
157
+ /**
158
+ * True values become false and false values become true
159
+ * @default false
160
+ */
161
+ inverse: boolean;
162
+ }
163
+ }
@@ -0,0 +1,111 @@
1
+ /* eslint-disable @typescript-eslint/no-namespace */
2
+ // tslint:disable-next-line: no-namespace
3
+ export var Logic;
4
+ (function (Logic) {
5
+ let BooleanOperatorsEnum;
6
+ (function (BooleanOperatorsEnum) {
7
+ BooleanOperatorsEnum["less"] = "<";
8
+ BooleanOperatorsEnum["lessOrEqual"] = "<=";
9
+ BooleanOperatorsEnum["greater"] = ">";
10
+ BooleanOperatorsEnum["greaterOrEqual"] = ">=";
11
+ BooleanOperatorsEnum["tripleEqual"] = "===";
12
+ BooleanOperatorsEnum["tripleNotEqual"] = "!==";
13
+ BooleanOperatorsEnum["equal"] = "==";
14
+ BooleanOperatorsEnum["notEqual"] = "!=";
15
+ })(BooleanOperatorsEnum = Logic.BooleanOperatorsEnum || (Logic.BooleanOperatorsEnum = {}));
16
+ class ComparisonDto {
17
+ constructor(first, second, operator) {
18
+ if (first !== undefined) {
19
+ this.first = first;
20
+ }
21
+ if (second !== undefined) {
22
+ this.second = second;
23
+ }
24
+ if (operator !== undefined) {
25
+ this.operator = operator;
26
+ }
27
+ }
28
+ }
29
+ Logic.ComparisonDto = ComparisonDto;
30
+ class BooleanDto {
31
+ constructor(boolean) {
32
+ /**
33
+ * Boolean value
34
+ * @default false
35
+ */
36
+ this.boolean = false;
37
+ if (boolean !== undefined) {
38
+ this.boolean = boolean;
39
+ }
40
+ }
41
+ }
42
+ Logic.BooleanDto = BooleanDto;
43
+ class BooleanListDto {
44
+ constructor(booleans) {
45
+ if (booleans !== undefined) {
46
+ this.booleans = booleans;
47
+ }
48
+ }
49
+ }
50
+ Logic.BooleanListDto = BooleanListDto;
51
+ class ValueGateDto {
52
+ constructor(value, boolean) {
53
+ /**
54
+ * Boolean value to release the gate
55
+ * @default false
56
+ */
57
+ this.boolean = false;
58
+ if (value !== undefined) {
59
+ this.value = value;
60
+ }
61
+ if (boolean !== undefined) {
62
+ this.boolean = boolean;
63
+ }
64
+ }
65
+ }
66
+ Logic.ValueGateDto = ValueGateDto;
67
+ class TwoValueGateDto {
68
+ constructor(value1, value2) {
69
+ if (value1 !== undefined) {
70
+ this.value1 = value1;
71
+ }
72
+ if (value2 !== undefined) {
73
+ this.value2 = value2;
74
+ }
75
+ }
76
+ }
77
+ Logic.TwoValueGateDto = TwoValueGateDto;
78
+ class RandomBooleansDto {
79
+ constructor(length) {
80
+ /**
81
+ * Length of the list
82
+ * @default 10
83
+ * @minimum 1
84
+ * @maximum Infinity
85
+ * @step 1
86
+ */
87
+ this.length = 10;
88
+ /**
89
+ * Threshold for true value between 0 and 1. The closer the value is to 1 the more true values there will be in the list.
90
+ * @default 0.5
91
+ * @minimum 0
92
+ * @maximum 1
93
+ * @step 0.1
94
+ */
95
+ this.trueThreshold = 0.5;
96
+ if (length !== undefined) {
97
+ this.length = length;
98
+ }
99
+ }
100
+ }
101
+ Logic.RandomBooleansDto = RandomBooleansDto;
102
+ class TwoThresholdRandomGradientDto {
103
+ }
104
+ Logic.TwoThresholdRandomGradientDto = TwoThresholdRandomGradientDto;
105
+ class ThresholdBooleanListDto {
106
+ }
107
+ Logic.ThresholdBooleanListDto = ThresholdBooleanListDto;
108
+ class ThresholdGapsBooleanListDto {
109
+ }
110
+ Logic.ThresholdGapsBooleanListDto = ThresholdGapsBooleanListDto;
111
+ })(Logic || (Logic = {}));
@@ -0,0 +1,311 @@
1
+ export declare namespace Math {
2
+ enum mathTwoNrOperatorEnum {
3
+ add = "add",
4
+ subtract = "subtract",
5
+ multiply = "multiply",
6
+ divide = "divide",
7
+ power = "power",
8
+ modulus = "modulus"
9
+ }
10
+ enum mathOneNrOperatorEnum {
11
+ absolute = "absolute",
12
+ negate = "negate",
13
+ ln = "ln",
14
+ log10 = "log10",
15
+ tenPow = "tenPow",
16
+ round = "round",
17
+ floor = "floor",
18
+ ceil = "ceil",
19
+ sqrt = "sqrt",
20
+ sin = "sin",
21
+ cos = "cos",
22
+ tan = "tan",
23
+ asin = "asin",
24
+ acos = "acos",
25
+ atan = "atan",
26
+ log = "log",
27
+ exp = "exp",
28
+ radToDeg = "radToDeg",
29
+ degToRad = "degToRad"
30
+ }
31
+ enum easeEnum {
32
+ easeInSine = "easeInSine",
33
+ easeOutSine = "easeOutSine",
34
+ easeInOutSine = "easeInOutSine",
35
+ easeInQuad = "easeInQuad",
36
+ easeOutQuad = "easeOutQuad",
37
+ easeInOutQuad = "easeInOutQuad",
38
+ easeInCubic = "easeInCubic",
39
+ easeOutCubic = "easeOutCubic",
40
+ easeInOutCubic = "easeInOutCubic",
41
+ easeInQuart = "easeInQuart",
42
+ easeOutQuart = "easeOutQuart",
43
+ easeInOutQuart = "easeInOutQuart",
44
+ easeInQuint = "easeInQuint",
45
+ easeOutQuint = "easeOutQuint",
46
+ easeInOutQuint = "easeInOutQuint",
47
+ easeInExpo = "easeInExpo",
48
+ easeOutExpo = "easeOutExpo",
49
+ easeInOutExpo = "easeInOutExpo",
50
+ easeInCirc = "easeInCirc",
51
+ easeOutCirc = "easeOutCirc",
52
+ easeInOutCirc = "easeInOutCirc",
53
+ easeInElastic = "easeInElastic",
54
+ easeOutElastic = "easeOutElastic",
55
+ easeInOutElastic = "easeInOutElastic",
56
+ easeInBack = "easeInBack",
57
+ easeOutBack = "easeOutBack",
58
+ easeInOutBack = "easeInOutBack",
59
+ easeInBounce = "easeInBounce",
60
+ easeOutBounce = "easeOutBounce",
61
+ easeInOutBounce = "easeInOutBounce"
62
+ }
63
+ class ModulusDto {
64
+ constructor(number?: number, modulus?: number);
65
+ /**
66
+ * Number
67
+ * @default 1
68
+ * @minimum -Infinity
69
+ * @maximum Infinity
70
+ * @step 0.1
71
+ */
72
+ number: number;
73
+ /**
74
+ * Modulus
75
+ * @default 1
76
+ * @minimum -Infinity
77
+ * @maximum Infinity
78
+ * @step 0.1
79
+ */
80
+ modulus: number;
81
+ }
82
+ class NumberDto {
83
+ constructor(number?: number);
84
+ /**
85
+ * Number
86
+ * @default 1
87
+ * @minimum -Infinity
88
+ * @maximum Infinity
89
+ * @step 0.1
90
+ */
91
+ number: number;
92
+ }
93
+ class EaseDto {
94
+ constructor(x?: number);
95
+ /**
96
+ * X value param between 0-1
97
+ * @default 0.5
98
+ * @minimum 0
99
+ * @maximum 1
100
+ * @step 0.1
101
+ */
102
+ x: number;
103
+ /**
104
+ * Minimum value
105
+ * @default 0
106
+ * @minimum -Infinity
107
+ * @maximum Infinity
108
+ * @step 0.1
109
+ */
110
+ min: number;
111
+ /**
112
+ * Maximum value
113
+ * @default 1
114
+ * @minimum -Infinity
115
+ * @maximum Infinity
116
+ * @step 0.1
117
+ */
118
+ max: number;
119
+ /**
120
+ * Ease function
121
+ * @default easeInSine
122
+ */
123
+ ease: easeEnum;
124
+ }
125
+ class RoundToDecimalsDto {
126
+ constructor(number?: number, decimalPlaces?: number);
127
+ /**
128
+ * Number to round
129
+ * @default 1.123456
130
+ * @minimum -Infinity
131
+ * @maximum Infinity
132
+ * @step 0.1
133
+ */
134
+ number: number;
135
+ /**
136
+ * Number of decimal places
137
+ * @default 2
138
+ * @minimum -Infinity
139
+ * @maximum Infinity
140
+ * @step 1
141
+ */
142
+ decimalPlaces: number;
143
+ }
144
+ class ActionOnTwoNumbersDto {
145
+ constructor(first?: number, second?: number, operation?: mathTwoNrOperatorEnum);
146
+ /**
147
+ * First number
148
+ * @default 1
149
+ * @minimum -Infinity
150
+ * @maximum Infinity
151
+ * @step 0.1
152
+ */
153
+ first: number;
154
+ /**
155
+ * Second number
156
+ * @default 1
157
+ * @minimum -Infinity
158
+ * @maximum Infinity
159
+ * @step 0.1
160
+ */
161
+ second: number;
162
+ /**
163
+ * Point
164
+ * @default add
165
+ */
166
+ operation: mathTwoNrOperatorEnum;
167
+ }
168
+ class TwoNumbersDto {
169
+ constructor(first?: number, second?: number);
170
+ /**
171
+ * First number
172
+ * @default 1
173
+ * @minimum -Infinity
174
+ * @maximum Infinity
175
+ * @step 0.1
176
+ */
177
+ first: number;
178
+ /**
179
+ * Second number
180
+ * @default 2
181
+ * @minimum -Infinity
182
+ * @maximum Infinity
183
+ * @step 0.1
184
+ */
185
+ second: number;
186
+ }
187
+ class ActionOnOneNumberDto {
188
+ constructor(number?: number, operation?: mathOneNrOperatorEnum);
189
+ /**
190
+ * First number
191
+ * @default 1
192
+ * @minimum -Infinity
193
+ * @maximum Infinity
194
+ * @step 0.1
195
+ */
196
+ number: number;
197
+ /**
198
+ * Point
199
+ * @default absolute
200
+ */
201
+ operation: mathOneNrOperatorEnum;
202
+ }
203
+ class RemapNumberDto {
204
+ constructor(number?: number, fromLow?: number, fromHigh?: number, toLow?: number, toHigh?: number);
205
+ /**
206
+ * Number to remap
207
+ * @default 0.5
208
+ * @minimum -Infinity
209
+ * @maximum Infinity
210
+ * @step 0.1
211
+ */
212
+ number: number;
213
+ /**
214
+ * First number range min
215
+ * @default 0
216
+ * @minimum -Infinity
217
+ * @maximum Infinity
218
+ * @step 0.1
219
+ */
220
+ fromLow: number;
221
+ /**
222
+ * Map to range min
223
+ * @default 1
224
+ * @minimum -Infinity
225
+ * @maximum Infinity
226
+ * @step 0.1
227
+ */
228
+ fromHigh: number;
229
+ /**
230
+ * First number range max
231
+ * @default 1
232
+ * @minimum -Infinity
233
+ * @maximum Infinity
234
+ * @step 0.1
235
+ */
236
+ toLow: number;
237
+ /**
238
+ * Map to range max
239
+ * @default 2
240
+ * @minimum -Infinity
241
+ * @maximum Infinity
242
+ * @step 0.1
243
+ */
244
+ toHigh: number;
245
+ }
246
+ class RandomNumberDto {
247
+ constructor(low?: number, high?: number);
248
+ /**
249
+ * Low range of random value
250
+ * @default 0
251
+ * @minimum -Infinity
252
+ * @maximum Infinity
253
+ * @step 0.1
254
+ */
255
+ low: number;
256
+ /**
257
+ * High range of random value
258
+ * @default 1
259
+ * @minimum -Infinity
260
+ * @maximum Infinity
261
+ * @step 0.1
262
+ */
263
+ high: number;
264
+ }
265
+ class RandomNumbersDto {
266
+ constructor(low?: number, high?: number, count?: number);
267
+ /**
268
+ * Low range of random value
269
+ * @default 0
270
+ * @minimum -Infinity
271
+ * @maximum Infinity
272
+ * @step 0.1
273
+ */
274
+ low: number;
275
+ /**
276
+ * High range of random value
277
+ * @default 1
278
+ * @minimum -Infinity
279
+ * @maximum Infinity
280
+ * @step 0.1
281
+ */
282
+ high: number;
283
+ /**
284
+ * Number of produced random values
285
+ * @default 10
286
+ * @minimum -Infinity
287
+ * @maximum Infinity
288
+ * @step 1
289
+ */
290
+ count: number;
291
+ }
292
+ class ToFixedDto {
293
+ constructor(number?: number, decimalPlaces?: number);
294
+ /**
295
+ * Number to round
296
+ * @default undefined
297
+ * @minimum -Infinity
298
+ * @maximum Infinity
299
+ * @step 0.1
300
+ */
301
+ number: number;
302
+ /**
303
+ * Number of decimal places
304
+ * @default 2
305
+ * @minimum -Infinity
306
+ * @maximum Infinity
307
+ * @step 1
308
+ */
309
+ decimalPlaces: number;
310
+ }
311
+ }