asajs 4.1.3 → 4.1.4
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/config.d.ts +4 -0
- package/dist/js/compilers/Configuration.js +5 -0
- package/dist/js/compilers/Random.js +1 -5
- package/dist/js/compilers/bindings/Function.js +9 -1
- package/dist/js/compilers/bindings/Parser.js +2 -2
- package/dist/js/components/AnimationKeyframe.js +1 -2
- package/dist/js/components/UI.js +12 -7
- package/dist/js/components/Utils.js +102 -45
- package/dist/types/compilers/Configuration.d.ts +5 -0
- package/dist/types/compilers/Random.d.ts +1 -1
- package/dist/types/compilers/bindings/Function.d.ts +5 -0
- package/dist/types/components/UI.d.ts +1 -1
- package/dist/types/components/Utils.d.ts +30 -23
- package/package.json +1 -1
- package/resources/example-config.js +3 -0
package/config.d.ts
CHANGED
|
@@ -16,6 +16,10 @@ export interface Config {
|
|
|
16
16
|
buildFolder?: string
|
|
17
17
|
fileExtension?: string
|
|
18
18
|
uiBuildFolder?: string
|
|
19
|
+
obfuscateStringName?: boolean
|
|
20
|
+
allowRandomStringName?: boolean
|
|
21
|
+
namespaceCount?: number
|
|
22
|
+
forceRandomStringLength?: number
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
ui_analyzer?: {
|
|
@@ -49,11 +49,16 @@ if (!fs.existsSync("asajs.config.js")) {
|
|
|
49
49
|
}
|
|
50
50
|
}
|
|
51
51
|
export const config = createRequire(import.meta.url)(path.resolve(process.cwd(), "asajs.config.js")).config;
|
|
52
|
+
export const debugMode = options["debug"] ?? false;
|
|
52
53
|
export const isBuildMode = options["build"] ?? config.compiler?.enabled ?? false;
|
|
53
54
|
export const isLinkMode = options["link"] ?? config.compiler?.autoImport ?? false;
|
|
54
55
|
export const unLinked = options["unlink"] ?? !(config.compiler?.autoImport ?? true);
|
|
55
56
|
export const buildFolder = config.compiler?.buildFolder || "build";
|
|
56
57
|
export const uiBuildFolder = config.compiler?.uiBuildFolder || "asajs";
|
|
58
|
+
export const isNotObfuscate = debugMode || !(config.compiler?.obfuscateStringName ?? false);
|
|
59
|
+
export const allowRandomStringName = !debugMode || (config.compiler?.allowRandomStringName ?? true);
|
|
60
|
+
export const namespaceCount = debugMode ? 5 : (config.compiler?.namespaceCount ?? 15);
|
|
61
|
+
export const forceRandomStringLength = debugMode ? 10 : config.compiler?.forceRandomStringLength;
|
|
57
62
|
export const bindingFuntions = config.binding_functions;
|
|
58
63
|
if (!fs.existsSync(".gitignore")) {
|
|
59
64
|
fs.writeFileSync(".gitignore", "node_modules\ncustom", "utf-8");
|
|
@@ -1,6 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
const namespaces = Array.from({ length: 15 }, () => RandomString(16));
|
|
3
|
-
export function RandomNamespace() {
|
|
4
|
-
return namespaces[Math.floor(Math.random() * namespaces.length)];
|
|
5
|
-
}
|
|
1
|
+
export {};
|
|
6
2
|
//# sourceMappingURL=Random.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { RandomBindingString, RandomString, ResolveBinding } from "../../components/Utils.js";
|
|
1
|
+
import { bs, RandomBindingString, RandomString, ResolveBinding } from "../../components/Utils.js";
|
|
2
2
|
import { bindingFuntions } from "../Configuration.js";
|
|
3
3
|
import { isBinding, isNumber, isString } from "./Checker.js";
|
|
4
4
|
export const FunctionMap = new Map();
|
|
@@ -216,6 +216,14 @@ export const defaultFunctions = {
|
|
|
216
216
|
};
|
|
217
217
|
}
|
|
218
218
|
},
|
|
219
|
+
bs: input_binding => {
|
|
220
|
+
if (!isBinding(input_binding))
|
|
221
|
+
throw new Error("Invalid input binding");
|
|
222
|
+
return {
|
|
223
|
+
doNotAddParentesis: true,
|
|
224
|
+
value: bs(input_binding),
|
|
225
|
+
};
|
|
226
|
+
},
|
|
219
227
|
/**
|
|
220
228
|
* Return a translatable string
|
|
221
229
|
* @param key
|
|
@@ -322,10 +322,10 @@ export class Parser {
|
|
|
322
322
|
return this.expect(TokenKind.WORD, "Function not found!");
|
|
323
323
|
}
|
|
324
324
|
else {
|
|
325
|
-
const { genBindings, value } = func(...params);
|
|
325
|
+
const { genBindings, value, doNotAddParentesis } = func(...params);
|
|
326
326
|
if (genBindings)
|
|
327
327
|
this.genBindings.push(...genBindings);
|
|
328
|
-
return `(${value})`;
|
|
328
|
+
return doNotAddParentesis ? value : `(${value})`;
|
|
329
329
|
}
|
|
330
330
|
}
|
|
331
331
|
expect(kind, err) {
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { FormatAnimationProperties } from "../compilers/FormatProperties.js";
|
|
2
2
|
import { Memory } from "../compilers/Memory.js";
|
|
3
3
|
import { Class } from "./Class.js";
|
|
4
|
-
import { RandomString } from "./Utils.js";
|
|
5
|
-
import { RandomNamespace } from "../compilers/Random.js";
|
|
4
|
+
import { RandomNamespace, RandomString } from "./Utils.js";
|
|
6
5
|
import util from "node:util";
|
|
7
6
|
export class AnimationKeyframe extends Class {
|
|
8
7
|
type;
|
package/dist/js/components/UI.js
CHANGED
|
@@ -3,11 +3,10 @@ import { Memory } from "../compilers/Memory.js";
|
|
|
3
3
|
import { ArrayName } from "../types/enums/ArrayName.js";
|
|
4
4
|
import { Operation } from "../types/enums/Operation.js";
|
|
5
5
|
import { Class } from "./Class.js";
|
|
6
|
-
import { RandomString, ResolveBinding } from "./Utils.js";
|
|
7
|
-
import { RandomNamespace } from "../compilers/Random.js";
|
|
6
|
+
import { defaultNamespace, RandomNamespace, RandomString, ResolveBinding } from "./Utils.js";
|
|
8
7
|
import nodepath from "path";
|
|
9
8
|
import util from "node:util";
|
|
10
|
-
import { config, uiBuildFolder } from "../compilers/Configuration.js";
|
|
9
|
+
import { config, isNotObfuscate, uiBuildFolder } from "../compilers/Configuration.js";
|
|
11
10
|
const fileExt = config.compiler?.fileExtension
|
|
12
11
|
? config.compiler.fileExtension.startsWith(".")
|
|
13
12
|
? config.compiler.fileExtension
|
|
@@ -28,15 +27,21 @@ export class UI extends Class {
|
|
|
28
27
|
extendType;
|
|
29
28
|
properties = {};
|
|
30
29
|
bindCache = new Map();
|
|
31
|
-
constructor(type, name, namespace, path) {
|
|
30
|
+
constructor(type, name, namespace, path, allowObfuscate) {
|
|
32
31
|
super();
|
|
33
32
|
this.type = type;
|
|
34
33
|
if (name === "namespace") {
|
|
35
34
|
console.error("The 'namespace' cannot be used as a name");
|
|
36
35
|
process.exit(1);
|
|
37
36
|
}
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
if (isNotObfuscate || !(allowObfuscate ?? true)) {
|
|
38
|
+
this.name = name?.match(/^(\w|\/)+/)?.[0] || RandomString(16);
|
|
39
|
+
this.namespace = namespace || defaultNamespace || RandomNamespace();
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.name = RandomString(16);
|
|
43
|
+
this.namespace = RandomNamespace();
|
|
44
|
+
}
|
|
40
45
|
if (!path)
|
|
41
46
|
this.path = nodepath.join(uiBuildFolder, `${this.namespace}${fileExt}`);
|
|
42
47
|
else
|
|
@@ -159,7 +164,7 @@ export class ModifyUI extends UI {
|
|
|
159
164
|
isClearButtonMappings = false;
|
|
160
165
|
modifications = [];
|
|
161
166
|
constructor(namespace, name, path) {
|
|
162
|
-
super(undefined, name, namespace, path);
|
|
167
|
+
super(undefined, name, namespace, path, false);
|
|
163
168
|
}
|
|
164
169
|
/**
|
|
165
170
|
* Remove all bindings of this modify element
|
|
@@ -11,6 +11,7 @@ import { Animation } from "./Animation.js";
|
|
|
11
11
|
import { MemoryModify } from "../compilers/Memory.js";
|
|
12
12
|
import { Lexer } from "../compilers/bindings/Lexer.js";
|
|
13
13
|
import { TokenKind, TSTokenKind } from "../compilers/bindings/types.js";
|
|
14
|
+
import { allowRandomStringName, forceRandomStringLength, isNotObfuscate, namespaceCount, } from "../compilers/Configuration.js";
|
|
14
15
|
export function Color(hex) {
|
|
15
16
|
if (typeof hex === "number") {
|
|
16
17
|
return [((hex >> 16) & 0xff) / 0xff, ((hex >> 8) & 0xff) / 0xff, (hex & 0xff) / 0xff];
|
|
@@ -116,9 +117,18 @@ export function ResolveBinding(cache, ...bindings) {
|
|
|
116
117
|
}
|
|
117
118
|
return result;
|
|
118
119
|
}
|
|
119
|
-
export
|
|
120
|
+
export let defaultNamespace = null;
|
|
121
|
+
export function SetDefaultNamespace(input) {
|
|
122
|
+
defaultNamespace = input;
|
|
123
|
+
}
|
|
124
|
+
export function ClearDefaultNamespace() {
|
|
125
|
+
defaultNamespace = null;
|
|
126
|
+
}
|
|
127
|
+
export function GenRandomString(length, base = 32) {
|
|
120
128
|
const chars = "0123456789abcdefghijklmnopqrstuvwxyz".slice(0, base);
|
|
121
129
|
const out = new Array(length);
|
|
130
|
+
if (forceRandomStringLength)
|
|
131
|
+
length = forceRandomStringLength;
|
|
122
132
|
try {
|
|
123
133
|
const buffer = new Uint8Array(length);
|
|
124
134
|
crypto.getRandomValues(buffer);
|
|
@@ -133,8 +143,55 @@ export function RandomString(length, base = 32) {
|
|
|
133
143
|
}
|
|
134
144
|
return out.join("");
|
|
135
145
|
}
|
|
136
|
-
|
|
137
|
-
|
|
146
|
+
const StringID = GenRandomString(5, undefined);
|
|
147
|
+
const nspl = allowRandomStringName
|
|
148
|
+
? Array.from({ length: namespaceCount }, () => RandomString(16))
|
|
149
|
+
: (() => {
|
|
150
|
+
return Array.from({ length: namespaceCount }, (i, index) => `${StringID}_namespace_${index + 1}`);
|
|
151
|
+
})();
|
|
152
|
+
export function RandomNamespace() {
|
|
153
|
+
return nspl[Math.floor(Math.random() * nspl.length)];
|
|
154
|
+
}
|
|
155
|
+
let rndStr = 1;
|
|
156
|
+
export function RandomString(length, base = 32, force) {
|
|
157
|
+
if (force || allowRandomStringName)
|
|
158
|
+
return GenRandomString(length, base);
|
|
159
|
+
else
|
|
160
|
+
return `${StringID}_string_${rndStr++}`;
|
|
161
|
+
}
|
|
162
|
+
let rndStrBind = 1;
|
|
163
|
+
export function RandomBindingString(length = 16, base = 32, force) {
|
|
164
|
+
if (force || allowRandomStringName)
|
|
165
|
+
return `#${GenRandomString(length, base)}`;
|
|
166
|
+
else
|
|
167
|
+
return `#${StringID}_binding_${rndStrBind++}`;
|
|
168
|
+
}
|
|
169
|
+
const rndMap = new Map();
|
|
170
|
+
export function s(input) {
|
|
171
|
+
if (isNotObfuscate)
|
|
172
|
+
return input;
|
|
173
|
+
else {
|
|
174
|
+
if (rndMap.has(input))
|
|
175
|
+
return rndMap.get(input);
|
|
176
|
+
else {
|
|
177
|
+
const ret = RandomBindingString();
|
|
178
|
+
rndMap.set(input, ret);
|
|
179
|
+
return ret;
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
export function bs(input) {
|
|
184
|
+
if (isNotObfuscate)
|
|
185
|
+
return input;
|
|
186
|
+
else {
|
|
187
|
+
if (rndMap.has(input))
|
|
188
|
+
return rndMap.get(input);
|
|
189
|
+
else {
|
|
190
|
+
const ret = RandomBindingString();
|
|
191
|
+
rndMap.set(input, ret);
|
|
192
|
+
return ret;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
138
195
|
}
|
|
139
196
|
export function GetItemByAuxID(auxID) {
|
|
140
197
|
const item = ItemAuxID[auxID];
|
|
@@ -186,73 +243,73 @@ export function Modify(namespace, name) {
|
|
|
186
243
|
(MemoryModify[getPath] ||= {})[name] = modifyUI;
|
|
187
244
|
return modifyUI;
|
|
188
245
|
}
|
|
189
|
-
export function Panel(properties, namespace, name) {
|
|
190
|
-
return new UI(Type.PANEL, name, namespace).setProperties(properties || {});
|
|
246
|
+
export function Panel(properties, namespace, name, allowObfuscate) {
|
|
247
|
+
return new UI(Type.PANEL, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
191
248
|
}
|
|
192
|
-
export function CollectionPanel(properties, namespace, name) {
|
|
193
|
-
return new UI(Type.COLLECTION_PANEL, name, namespace).setProperties(properties || {});
|
|
249
|
+
export function CollectionPanel(properties, namespace, name, allowObfuscate) {
|
|
250
|
+
return new UI(Type.COLLECTION_PANEL, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
194
251
|
}
|
|
195
|
-
export function StackPanel(properties, namespace, name) {
|
|
196
|
-
return new UI(Type.STACK_PANEL, name, namespace).setProperties(properties || {});
|
|
252
|
+
export function StackPanel(properties, namespace, name, allowObfuscate) {
|
|
253
|
+
return new UI(Type.STACK_PANEL, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
197
254
|
}
|
|
198
|
-
export function InputPanel(properties, namespace, name) {
|
|
199
|
-
return new UI(Type.INPUT_PANEL, name, namespace).setProperties(properties || {});
|
|
255
|
+
export function InputPanel(properties, namespace, name, allowObfuscate) {
|
|
256
|
+
return new UI(Type.INPUT_PANEL, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
200
257
|
}
|
|
201
|
-
export function Gird(properties, namespace, name) {
|
|
202
|
-
return new UI(Type.GRID, name, namespace).setProperties(properties || {});
|
|
258
|
+
export function Gird(properties, namespace, name, allowObfuscate) {
|
|
259
|
+
return new UI(Type.GRID, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
203
260
|
}
|
|
204
|
-
export function Screen(properties, namespace, name) {
|
|
205
|
-
return new UI(Type.SCREEN, name, namespace).setProperties(properties || {});
|
|
261
|
+
export function Screen(properties, namespace, name, allowObfuscate) {
|
|
262
|
+
return new UI(Type.SCREEN, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
206
263
|
}
|
|
207
|
-
export function Image(properties, namespace, name) {
|
|
208
|
-
return new UI(Type.IMAGE, name, namespace).setProperties(properties || {});
|
|
264
|
+
export function Image(properties, namespace, name, allowObfuscate) {
|
|
265
|
+
return new UI(Type.IMAGE, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
209
266
|
}
|
|
210
|
-
export function Label(properties, namespace, name) {
|
|
211
|
-
return new UI(Type.LABEL, name, namespace).setProperties(properties || {});
|
|
267
|
+
export function Label(properties, namespace, name, allowObfuscate) {
|
|
268
|
+
return new UI(Type.LABEL, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
212
269
|
}
|
|
213
|
-
export function Custom(renderer, properties, namespace, name) {
|
|
214
|
-
const custom = new UI(Type.CUSTOM, name, namespace);
|
|
270
|
+
export function Custom(renderer, properties, namespace, name, allowObfuscate) {
|
|
271
|
+
const custom = new UI(Type.CUSTOM, name, namespace, undefined, allowObfuscate);
|
|
215
272
|
if (properties)
|
|
216
273
|
custom.setProperties({ renderer, ...properties });
|
|
217
274
|
return custom;
|
|
218
275
|
}
|
|
219
|
-
export function TooltipTrigger(properties, namespace, name) {
|
|
220
|
-
return new UI(Type.TOOLTIP_TRIGGER, name, namespace).setProperties(properties || {});
|
|
276
|
+
export function TooltipTrigger(properties, namespace, name, allowObfuscate) {
|
|
277
|
+
return new UI(Type.TOOLTIP_TRIGGER, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
221
278
|
}
|
|
222
|
-
export function Button(properties, namespace, name) {
|
|
223
|
-
return new UI(Type.BUTTON, name, namespace).setProperties(properties || {});
|
|
279
|
+
export function Button(properties, namespace, name, allowObfuscate) {
|
|
280
|
+
return new UI(Type.BUTTON, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
224
281
|
}
|
|
225
|
-
export function Toggle(properties, namespace, name) {
|
|
226
|
-
return new UI(Type.TOGGLE, name, namespace).setProperties(properties || {});
|
|
282
|
+
export function Toggle(properties, namespace, name, allowObfuscate) {
|
|
283
|
+
return new UI(Type.TOGGLE, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
227
284
|
}
|
|
228
|
-
export function Dropdown(properties, namespace, name) {
|
|
229
|
-
return new UI(Type.DROPDOWN, name, namespace).setProperties(properties || {});
|
|
285
|
+
export function Dropdown(properties, namespace, name, allowObfuscate) {
|
|
286
|
+
return new UI(Type.DROPDOWN, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
230
287
|
}
|
|
231
|
-
export function SelectionWheel(properties, namespace, name) {
|
|
232
|
-
return new UI(Type.SELECTION_WHEEL, name, namespace).setProperties(properties || {});
|
|
288
|
+
export function SelectionWheel(properties, namespace, name, allowObfuscate) {
|
|
289
|
+
return new UI(Type.SELECTION_WHEEL, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
233
290
|
}
|
|
234
|
-
export function EditBox(properties, namespace, name) {
|
|
235
|
-
return new UI(Type.EDIT_BOX, name, namespace).setProperties(properties || {});
|
|
291
|
+
export function EditBox(properties, namespace, name, allowObfuscate) {
|
|
292
|
+
return new UI(Type.EDIT_BOX, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
236
293
|
}
|
|
237
|
-
export function ScrollbarBox(properties, namespace, name) {
|
|
238
|
-
return new UI(Type.SCROLLBAR_BOX, name, namespace).setProperties(properties || {});
|
|
294
|
+
export function ScrollbarBox(properties, namespace, name, allowObfuscate) {
|
|
295
|
+
return new UI(Type.SCROLLBAR_BOX, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
239
296
|
}
|
|
240
|
-
export function ScrollbarTrack(properties, namespace, name) {
|
|
241
|
-
return new UI(Type.SCROLL_TRACK, name, namespace).setProperties(properties || {});
|
|
297
|
+
export function ScrollbarTrack(properties, namespace, name, allowObfuscate) {
|
|
298
|
+
return new UI(Type.SCROLL_TRACK, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
242
299
|
}
|
|
243
|
-
export function ScrollView(properties, namespace, name) {
|
|
244
|
-
return new UI(Type.SCROLL_VIEW, name, namespace).setProperties(properties || {});
|
|
300
|
+
export function ScrollView(properties, namespace, name, allowObfuscate) {
|
|
301
|
+
return new UI(Type.SCROLL_VIEW, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
245
302
|
}
|
|
246
|
-
export function Slider(properties, namespace, name) {
|
|
247
|
-
return new UI(Type.SLIDER, name, namespace).setProperties(properties || {});
|
|
303
|
+
export function Slider(properties, namespace, name, allowObfuscate) {
|
|
304
|
+
return new UI(Type.SLIDER, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
248
305
|
}
|
|
249
|
-
export function SliderBox(properties, namespace, name) {
|
|
250
|
-
return new UI(Type.SLIDER_BOX, name, namespace).setProperties(properties || {});
|
|
306
|
+
export function SliderBox(properties, namespace, name, allowObfuscate) {
|
|
307
|
+
return new UI(Type.SLIDER_BOX, name, namespace, undefined, allowObfuscate).setProperties(properties || {});
|
|
251
308
|
}
|
|
252
|
-
export function ExtendsOf(element, properties, namespace, name) {
|
|
309
|
+
export function ExtendsOf(element, properties, namespace, name, allowObfuscate) {
|
|
253
310
|
if (!element.extendable)
|
|
254
311
|
throw new Error("Cannot extend a UI that cannot be extended");
|
|
255
|
-
const ui = new UI(undefined, name, namespace);
|
|
312
|
+
const ui = new UI(undefined, name, namespace, undefined, allowObfuscate);
|
|
256
313
|
if (properties)
|
|
257
314
|
ui.setProperties(properties);
|
|
258
315
|
// @ts-ignore
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { Config, RetBindingValue } from "../../config.js";
|
|
2
2
|
export declare let isTestMode: boolean;
|
|
3
3
|
export declare const config: Config;
|
|
4
|
+
export declare const debugMode: {};
|
|
4
5
|
export declare const isBuildMode: {};
|
|
5
6
|
export declare const isLinkMode: {};
|
|
6
7
|
export declare const unLinked: {};
|
|
7
8
|
export declare const buildFolder: string;
|
|
8
9
|
export declare const uiBuildFolder: string;
|
|
10
|
+
export declare const isNotObfuscate: {};
|
|
11
|
+
export declare const allowRandomStringName: boolean;
|
|
12
|
+
export declare const namespaceCount: number;
|
|
13
|
+
export declare const forceRandomStringLength: number | undefined;
|
|
9
14
|
export declare const bindingFuntions: Record<string, (...args: string[]) => RetBindingValue> | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Expression, GenBinding } from "./types.js";
|
|
2
2
|
type CallbackRet = {
|
|
3
3
|
genBindings?: GenBinding[];
|
|
4
|
+
doNotAddParentesis?: boolean;
|
|
4
5
|
value: Expression;
|
|
5
6
|
};
|
|
6
7
|
type Callback = (...args: Expression[]) => CallbackRet;
|
|
@@ -83,6 +84,10 @@ export declare const defaultFunctions: {
|
|
|
83
84
|
genBindings: GenBinding[];
|
|
84
85
|
value: string;
|
|
85
86
|
};
|
|
87
|
+
bs: (input_binding: string) => {
|
|
88
|
+
doNotAddParentesis: true;
|
|
89
|
+
value: `#${string}`;
|
|
90
|
+
};
|
|
86
91
|
/**
|
|
87
92
|
* Return a translatable string
|
|
88
93
|
* @param key
|
|
@@ -27,7 +27,7 @@ export declare class UI<T extends Type, K extends Renderer | null = null> extend
|
|
|
27
27
|
protected readonly extendType?: Type;
|
|
28
28
|
protected properties: Properties<T, K>;
|
|
29
29
|
protected bindCache: Map<string, unknown>;
|
|
30
|
-
constructor(type?: T | undefined, name?: string, namespace?: string, path?: string);
|
|
30
|
+
constructor(type?: T | undefined, name?: string, namespace?: string, path?: string, allowObfuscate?: boolean);
|
|
31
31
|
/**
|
|
32
32
|
* Set properties for this element
|
|
33
33
|
* @param properties
|
|
@@ -12,8 +12,15 @@ import { SmartAnimation } from "../types/enums/SmartAnimation.js";
|
|
|
12
12
|
type CompileBinding = `[${string}]`;
|
|
13
13
|
export declare function Color(hex: string | number): Array3<number>;
|
|
14
14
|
export declare function ResolveBinding(cache: Map<string, unknown>, ...bindings: BindingItem[]): BindingItem[];
|
|
15
|
-
export declare
|
|
16
|
-
export declare function
|
|
15
|
+
export declare let defaultNamespace: string | null;
|
|
16
|
+
export declare function SetDefaultNamespace(input: string): void;
|
|
17
|
+
export declare function ClearDefaultNamespace(): void;
|
|
18
|
+
export declare function GenRandomString(length: number, base?: number): string;
|
|
19
|
+
export declare function RandomNamespace(): string;
|
|
20
|
+
export declare function RandomString(length: number, base?: number, force?: boolean): string;
|
|
21
|
+
export declare function RandomBindingString(length?: number, base?: number, force?: boolean): Binding;
|
|
22
|
+
export declare function s(input: string): string;
|
|
23
|
+
export declare function bs(input: `#${string}`): `#${string}`;
|
|
17
24
|
export declare function GetItemByAuxID(auxID: number): string | undefined;
|
|
18
25
|
/**
|
|
19
26
|
* Return format string binding input
|
|
@@ -28,27 +35,27 @@ export declare function f(input: string): CompileBinding;
|
|
|
28
35
|
*/
|
|
29
36
|
export declare function b(input: string): CompileBinding;
|
|
30
37
|
export declare function Modify<T extends Namespace, K extends Element<T>>(namespace: T, name: K): ModifyUI<VanillaType<T, K>, VanillaElementChilds<T, K>>;
|
|
31
|
-
export declare function Panel(properties?: Panel, namespace?: string, name?: string): UI<Type.PANEL, null>;
|
|
32
|
-
export declare function CollectionPanel(properties?: CollectionPanel, namespace?: string, name?: string): UI<Type.COLLECTION_PANEL, null>;
|
|
33
|
-
export declare function StackPanel(properties?: StackPanel, namespace?: string, name?: string): UI<Type.STACK_PANEL, null>;
|
|
34
|
-
export declare function InputPanel(properties?: InputPanel, namespace?: string, name?: string): UI<Type.INPUT_PANEL, null>;
|
|
35
|
-
export declare function Gird(properties?: Grid, namespace?: string, name?: string): UI<Type.GRID, null>;
|
|
36
|
-
export declare function Screen(properties?: Screen, namespace?: string, name?: string): UI<Type.SCREEN, null>;
|
|
37
|
-
export declare function Image(properties?: Image, namespace?: string, name?: string): UI<Type.IMAGE, null>;
|
|
38
|
-
export declare function Label(properties?: Label, namespace?: string, name?: string): UI<Type.LABEL, null>;
|
|
39
|
-
export declare function Custom<R extends Renderer>(renderer: R, properties?: Properties<Type.CUSTOM, R>, namespace?: string, name?: string): UI<Type.CUSTOM, R>;
|
|
40
|
-
export declare function TooltipTrigger(properties?: TooltipTrigger, namespace?: string, name?: string): UI<Type.TOOLTIP_TRIGGER, null>;
|
|
41
|
-
export declare function Button(properties?: Button, namespace?: string, name?: string): UI<Type.BUTTON, null>;
|
|
42
|
-
export declare function Toggle(properties?: Toggle, namespace?: string, name?: string): UI<Type.TOGGLE, null>;
|
|
43
|
-
export declare function Dropdown(properties?: Dropdown, namespace?: string, name?: string): UI<Type.DROPDOWN, null>;
|
|
44
|
-
export declare function SelectionWheel(properties?: SelectionWheel, namespace?: string, name?: string): UI<Type.SELECTION_WHEEL, null>;
|
|
45
|
-
export declare function EditBox(properties?: EditBox, namespace?: string, name?: string): UI<Type.EDIT_BOX, null>;
|
|
46
|
-
export declare function ScrollbarBox(properties?: ScrollbarBox, namespace?: string, name?: string): UI<Type.SCROLLBAR_BOX, null>;
|
|
47
|
-
export declare function ScrollbarTrack(properties?: ScrollbarTrack, namespace?: string, name?: string): UI<Type.SCROLL_TRACK, null>;
|
|
48
|
-
export declare function ScrollView(properties?: ScrollView, namespace?: string, name?: string): UI<Type.SCROLL_VIEW, null>;
|
|
49
|
-
export declare function Slider(properties?: Slider, namespace?: string, name?: string): UI<Type.SLIDER, null>;
|
|
50
|
-
export declare function SliderBox(properties?: SliderBox, namespace?: string, name?: string): UI<Type.SLIDER_BOX, null>;
|
|
51
|
-
export declare function ExtendsOf<T extends Type, K extends Renderer | null>(element: UI<T, K>, properties?: Properties<T, K>, namespace?: string, name?: string): typeof element;
|
|
38
|
+
export declare function Panel(properties?: Panel, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.PANEL, null>;
|
|
39
|
+
export declare function CollectionPanel(properties?: CollectionPanel, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.COLLECTION_PANEL, null>;
|
|
40
|
+
export declare function StackPanel(properties?: StackPanel, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.STACK_PANEL, null>;
|
|
41
|
+
export declare function InputPanel(properties?: InputPanel, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.INPUT_PANEL, null>;
|
|
42
|
+
export declare function Gird(properties?: Grid, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.GRID, null>;
|
|
43
|
+
export declare function Screen(properties?: Screen, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.SCREEN, null>;
|
|
44
|
+
export declare function Image(properties?: Image, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.IMAGE, null>;
|
|
45
|
+
export declare function Label(properties?: Label, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.LABEL, null>;
|
|
46
|
+
export declare function Custom<R extends Renderer>(renderer: R, properties?: Properties<Type.CUSTOM, R>, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.CUSTOM, R>;
|
|
47
|
+
export declare function TooltipTrigger(properties?: TooltipTrigger, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.TOOLTIP_TRIGGER, null>;
|
|
48
|
+
export declare function Button(properties?: Button, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.BUTTON, null>;
|
|
49
|
+
export declare function Toggle(properties?: Toggle, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.TOGGLE, null>;
|
|
50
|
+
export declare function Dropdown(properties?: Dropdown, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.DROPDOWN, null>;
|
|
51
|
+
export declare function SelectionWheel(properties?: SelectionWheel, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.SELECTION_WHEEL, null>;
|
|
52
|
+
export declare function EditBox(properties?: EditBox, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.EDIT_BOX, null>;
|
|
53
|
+
export declare function ScrollbarBox(properties?: ScrollbarBox, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.SCROLLBAR_BOX, null>;
|
|
54
|
+
export declare function ScrollbarTrack(properties?: ScrollbarTrack, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.SCROLL_TRACK, null>;
|
|
55
|
+
export declare function ScrollView(properties?: ScrollView, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.SCROLL_VIEW, null>;
|
|
56
|
+
export declare function Slider(properties?: Slider, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.SLIDER, null>;
|
|
57
|
+
export declare function SliderBox(properties?: SliderBox, namespace?: string, name?: string, allowObfuscate?: boolean): UI<Type.SLIDER_BOX, null>;
|
|
58
|
+
export declare function ExtendsOf<T extends Type, K extends Renderer | null>(element: UI<T, K>, properties?: Properties<T, K>, namespace?: string, name?: string, allowObfuscate?: boolean): typeof element;
|
|
52
59
|
export declare function VanillaExtendsOf<T extends Namespace, K extends Exclude<Element<T>, `${string}/${string}`>>(originNamespace: T, originName: K, properties?: Properties<VanillaType<T, K>, null>, namespace?: string, name?: string): UI<VanillaType<T, K>, null>;
|
|
53
60
|
export declare function OffsetKeyframe(properties?: KeyframeAnimationProperties<AnimType.OFFSET>, namespace?: string, name?: string): AnimationKeyframe<AnimType.OFFSET>;
|
|
54
61
|
export declare function SizeKeyframe(properties?: KeyframeAnimationProperties<AnimType.SIZE>, namespace?: string, name?: string): AnimationKeyframe<AnimType.SIZE>;
|
package/package.json
CHANGED