markuno_lib 1.1.26 → 1.1.27

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/package.json CHANGED
@@ -1,26 +1,50 @@
1
1
  {
2
2
  "name": "markuno_lib",
3
- "version": "1.1.26",
3
+ "version": "1.1.27",
4
4
  "description": "Croswil Markuno Language Lib",
5
- "main": "bin/index.js",
6
5
  "authors": [
7
6
  "Croswil <info@croswil.com>"
8
7
  ],
9
8
  "license": "ISC",
10
9
  "type": "module",
11
- "dependencies": {},
12
10
  "exports": {
13
- ".": "./bin/markuno.js",
14
- "./proto": "./bin/proto.js",
15
- "./bus": "./bin/bus_utils.js",
16
- "./cad": "./bin/markcad.js",
17
- "./cad3d": "./bin/markcad3d.js",
18
- "./marked": "./bin/marked.js"
11
+ ".": {
12
+ "import": "./bin/markuno.js",
13
+ "require": "./bin/markuno.js",
14
+ "types": "./types/markuno.d.ts"
15
+ },
16
+ "./proto": {
17
+ "import": "./bin/proto.js",
18
+ "require": "./bin/proto.js",
19
+ "types": "./types/proto.d.ts"
20
+ },
21
+ "./bus": {
22
+ "import": "./bin/bus_utils.js",
23
+ "require": "./bin/bus_utils.js",
24
+ "types": "./types/bus_utils.d.ts"
25
+ },
26
+ "./cad": {
27
+ "import": "./bin/markcad.js",
28
+ "require": "./bin/markcad.js",
29
+ "types": "./types/markcad.d.ts"
30
+ },
31
+ "./cad3d": {
32
+ "import": "./bin/markcad3d.js",
33
+ "require": "./bin/markcad3d.js",
34
+ "types": "./types/markcad3d.d.ts"
35
+ },
36
+ "./marked": {
37
+ "import": "./bin/marked.js",
38
+ "require": "./bin/marked.js",
39
+ "types": "./types/marked.d.ts"
40
+ }
19
41
  },
20
- "files": [
21
- "bin/**"
22
- ],
23
42
  "imports": {
24
43
  "#markuno_cad": "./bin/markcad.js"
25
- }
44
+ },
45
+ "files": [
46
+ "bin/**",
47
+ "types/**"
48
+ ],
49
+ "dependencies": {}
26
50
  }
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Implementa un sistema di eventi publish/subscribe
3
+ */ export const bus: {
4
+ buslist: {};
5
+ /**
6
+ * Registra un handler per un evento
7
+ * @param {string} des - Nome dell'evento
8
+ * @param {Function} func - Handler da eseguire
9
+ * @returns {number} Indice dell'handler nella lista
10
+ */ on(des: string, func: Function): number;
11
+ /**
12
+ * Emette un evento con i relativi parametri
13
+ * @param {string} des - Nome dell'evento
14
+ * @param {...any} args - Parametri da passare agli handler
15
+ */ emit(des: string, ...args: any[]): void;
16
+ /**
17
+ * Rimuove un handler per un evento
18
+ * @param {string} des - Nome dell'evento
19
+ * @param {Function|number} func - Handler da rimuovere o suo indice
20
+ */ off(des: string, func: Function | number): void;
21
+ $on(des: any, func: any): void;
22
+ $off(des: any, func: any): void;
23
+ $emit(des: any, ...args: any[]): void;
24
+ };
25
+ export function evalcustomfunction(amb: any, code: any, vv: any, objects: any): Promise<any>;
26
+ /**
27
+ * Formatta una data nel formato YYYY-MM-DD
28
+ * @param {string|Date} dateString - La data da formattare
29
+ * @returns {string} La data formattata come YYYY-MM-DD
30
+ */ export function formatDate(dateString: string | Date): string;
31
+ export function getdim(l: any, a: any, p: any, al: any, aa: any, ap: any, fmodl: any, fmoda: any, fmodp: any): string;
32
+ /**
33
+ * Converte una stringa delimitata in array di oggetti {cod, des}
34
+ * @param {string|Array} x - Stringa con valori delimitati da \n ; o ,
35
+ * @returns {Array<{cod: string, des: string}>} Array di oggetti con codice e descrizione
36
+ */
37
+ export function listfromstring(x: string | any[]): Array<{
38
+ cod: string;
39
+ des: string;
40
+ }>;
41
+ export function myuuid(): number;
42
+ export function strDate(date: any, formato: any): any;
43
+ /**
44
+ * Converte una data nel formato DD/MM/YYYY HH:mm
45
+ * @param {Date|number} date - La data da convertire
46
+ * @returns {string} La data formattata come DD/MM/YYYY HH:mm
47
+ */ export function toDateStr(date: Date | number): string;
48
+ export function toEuro(n: any, gratis: any, des?: string): any;
49
+ export function tonum(s: any, dec?: number): number;
@@ -0,0 +1,411 @@
1
+ /**
2
+ * Classe che rappresenta una linea 2D definita da due punti
3
+ */ export class Linea2 {
4
+ /**
5
+ * Crea una nuova linea 2D
6
+ * @param {number|Object} p1 - Coordinata x del primo punto o oggetto {x,y}
7
+ * @param {number|Object} p2 - Coordinata y del primo punto o oggetto {x,y}
8
+ * @param {number} [x2=null] - Coordinata x del secondo punto (opzionale)
9
+ * @param {number} [y2=null] - Coordinata y del secondo punto (opzionale)
10
+ */
11
+ constructor(p1: number | any, p2: number | any, x2?: number, y2?: number);
12
+ p1: Punto2;
13
+ p2: Punto2;
14
+ /**
15
+ * Restituisce una rappresentazione testuale della linea
16
+ * @returns {string} Stringa nel formato "p1-p2"
17
+ */ get dump(): string;
18
+ /**
19
+ * Calcola la differenza delle coordinate x dei punti
20
+ * @returns {number} Differenza x
21
+ */ get dx(): number;
22
+ /**
23
+ * Calcola la differenza delle coordinate y dei punti
24
+ * @returns {number} Differenza y
25
+ */ get dy(): number;
26
+ /**
27
+ * Calcola il quadrato della lunghezza della linea
28
+ * @returns {number} Lunghezza al quadrato
29
+ */ get len2(): number;
30
+ /**
31
+ * Calcola la lunghezza della linea
32
+ * @returns {number} Lunghezza
33
+ */ get len(): number;
34
+ /**
35
+ * Estende la linea di una certa lunghezza o fino all'intersezione con un'altra linea
36
+ * @param {number|Linea2} l - Lunghezza di estensione o linea da intersecare
37
+ * @returns {Linea2} Nuova linea estesa
38
+ */ estendi(l: number | Linea2): Linea2;
39
+ /**
40
+ * Calcola il vettore direzione normalizzato della linea
41
+ * @returns {Punto2} Vettore direzione
42
+ */ get direzione(): Punto2;
43
+ /**
44
+ * Calcola il vettore normale normalizzato della linea
45
+ * @returns {Punto2} Vettore normale
46
+ */ get normale(): Punto2;
47
+ /**
48
+ * Crea una nuova linea ruotata di un certo angolo
49
+ * @param {number} [angle=Math.PI/2] - Angolo di rotazione in radianti
50
+ * @param {number} [length=0] - Lunghezza della nuova linea
51
+ * @param {boolean} [fine=false] - Se true ruota attorno al primo punto, altrimenti al secondo
52
+ * @returns {Linea2} Nuova linea ruotata
53
+ */ ruotata(angle?: number, length?: number, fine?: boolean): Linea2;
54
+ /**
55
+ * Calcola un punto sulla direzione della linea a una certa distanza
56
+ * @param {Punto2} p1 - Punto di partenza
57
+ * @param {number} lunghezza - Distanza dal punto di partenza
58
+ * @returns {Punto2} Nuovo punto
59
+ */ puntosudirezione(p1: Punto2, lunghezza: number): Punto2;
60
+ /**
61
+ * Crea una nuova linea parallela a questa passante per un punto
62
+ * @param {Punto2} p1 - Punto di passaggio
63
+ * @param {number} lunghezza - Lunghezza della nuova linea
64
+ * @returns {Linea2} Nuova linea parallela
65
+ */ parallela(p1: Punto2, lunghezza: number): Linea2;
66
+ /**
67
+ * Calcola il punto di intersezione con un'altra linea
68
+ * @param {Linea2} line2 - Seconda linea
69
+ * @returns {Punto2|null} Punto di intersezione o null se parallele
70
+ */ intersezione(line2: Linea2): Punto2 | null;
71
+ onsegment(p: any, eps?: number): boolean;
72
+ /**
73
+ * Verifica se la linea è parallela a un'altra
74
+ * @param {Linea2} line2 - Seconda linea
75
+ * @returns {boolean} True se parallele
76
+ */ isparallela(line2: Linea2): boolean;
77
+ /**
78
+ * Restituisce alcune info sul “quadrilatero” formato da questa linea e da line2,
79
+ * assumendo che siano parallele e abbiano verso invertito.
80
+ * @param {Linea2} line2
81
+ * @returns {Object|undefined}
82
+ * { angle, aini, afin, l, distanza } oppure undefined se non parallele o degenere
83
+ */ infoquad(line2: Linea2): any | undefined;
84
+ /**
85
+ * Verifica se la linea è perpendicolare a un'altra
86
+ * @param {Linea2} line2 - Seconda linea
87
+ * @returns {boolean} True se perpendicolari
88
+ */ isperpendicolare(line2: Linea2): boolean;
89
+ /**
90
+ * Crea una nuova linea parallela a questa a una certa distanza
91
+ * @param {number} delta - Distanza di offset (positiva a sinistra, negativa a destra)
92
+ * @returns {Linea2} Nuova linea parallela
93
+ */ offset(delta: number): Linea2;
94
+ /**
95
+ * Calcola l'angolo tra questa linea e un'altra
96
+ * @param {Linea2} line2 - Seconda linea
97
+ * @returns {number} Angolo in radianti
98
+ */ angolo(line2: Linea2): number;
99
+ ortopt(l: any): {
100
+ x: any;
101
+ y: any;
102
+ };
103
+ offsetline(l: any): Linea2;
104
+ /**
105
+ * Calcola la distanza tra due segmenti paralleli
106
+ * @param {Linea2} line2 - Seconda linea
107
+ * @returns {number} Distanza tra i segmenti o 1e9 se non paralleli
108
+ */ distanzaSegmentiParalleli(line2: Linea2): number;
109
+ /**
110
+ * Verifica se due linee sono collineari
111
+ * @param {Linea2} line2 - Seconda linea
112
+ * @param {boolean} [checkpunticomune=false] - Se true verifica anche la sovrapposizione
113
+ * @returns {boolean} True se collineari
114
+ */ isCollineare(line2: Linea2, checkpunticomune?: boolean): boolean;
115
+ }
116
+ export class Matrix3D {
117
+ m: Float32Array;
118
+ st: any[];
119
+ init(): this;
120
+ atranslate(x: any, y: any, z: any): this;
121
+ translate(x: any, y: any, z: any): this;
122
+ rotateX(angolo: any): this;
123
+ rotateY(angolo: any): this;
124
+ rotateZ(angolo: any): this;
125
+ getdati(): number[];
126
+ setdati(d: any): this;
127
+ push(): this;
128
+ pop(): this;
129
+ transform(x: any, y: any, z?: number): {
130
+ x: number;
131
+ y: number;
132
+ z: number;
133
+ };
134
+ invert(): Matrix3D;
135
+ determinant(): number;
136
+ multiply(matrix: any): this;
137
+ }
138
+ export const PIF: number;
139
+ /** Tolleranza utilizzata per i confronti numerici */
140
+ /**
141
+ * Classe che rappresenta un punto 2D con coordinate x,y
142
+ * @class
143
+ */
144
+ export class Punto2 {
145
+ /**
146
+ * Crea un nuovo punto 2D
147
+ * @param {number|Array|Object} x - Coordinata x, array [x,y] o oggetto {x,y}
148
+ * @param {number} [y] - Coordinata y se x è un numero
149
+ */
150
+ constructor(x: number | any[] | any, y?: number);
151
+ x: any;
152
+ y: any;
153
+ /**
154
+ * Restituisce una rappresentazione testuale del punto
155
+ * @returns {string} Stringa nel formato {x,y}
156
+ */ get dump(): string;
157
+ /**
158
+ * Calcola il quadrato della lunghezza del vettore dal punto all'origine
159
+ * @returns {number} Lunghezza al quadrato
160
+ */ get len2(): number;
161
+ /**
162
+ * Calcola la lunghezza del vettore dal punto all'origine
163
+ * @returns {number} Lunghezza del vettore
164
+ */ get len(): number;
165
+ /**
166
+ * Calcola l'angolo del vettore rispetto all'asse x
167
+ * @returns {number} Angolo in radianti
168
+ */ get angle(): number;
169
+ /**
170
+ * Restituisce il vettore normalizzato (lunghezza unitaria)
171
+ * @returns {Punto2} Nuovo punto con le coordinate normalizzate
172
+ */ dir(): Punto2;
173
+ }
174
+ declare var splitter: Readonly<{
175
+ __proto__: any;
176
+ addhoriz: (ff: any, tipodim: any, dim: any, sps: any, des: any, align: any, cuts: any) => void;
177
+ addvert: (ff: any, tipodim: any, dim: any, sps: any, des: any, align: any, cuts: any) => void;
178
+ bordi: typeof bordi;
179
+ calcoladivisioni: (ff: any, shape: any, shape2: any) => any;
180
+ creabordi: typeof creabordi;
181
+ create: (x: any, y: any, bordo: any, options: any) => {
182
+ x: any;
183
+ y: any;
184
+ bordo: any;
185
+ minvano: any;
186
+ priority: any;
187
+ taglio: any;
188
+ tipo: any;
189
+ h1: any;
190
+ h2: any;
191
+ l1: any;
192
+ l2: any;
193
+ vert: any[];
194
+ horiz: any[];
195
+ dati: any[];
196
+ countid: number;
197
+ };
198
+ findid: (ff: any, id: any) => {
199
+ f: any;
200
+ };
201
+ generatesegments: typeof generatesegments;
202
+ internalshape: typeof internalshape;
203
+ makeshape: (ff: any) => {
204
+ shape: any;
205
+ internalshape: any;
206
+ };
207
+ priorita: {
208
+ v: string;
209
+ h: string;
210
+ };
211
+ pushlineare: typeof pushlineare;
212
+ pushshape: typeof pushshape;
213
+ tagli: {
214
+ d: string;
215
+ v: string;
216
+ h: string;
217
+ };
218
+ tipi: {
219
+ i: string;
220
+ a: string;
221
+ d: string;
222
+ s: string;
223
+ x: string;
224
+ };
225
+ tipoalign: {
226
+ l: string;
227
+ c: string;
228
+ r: string;
229
+ };
230
+ tipocut: {
231
+ d: string;
232
+ "d-": string;
233
+ p: string;
234
+ "p-": string;
235
+ };
236
+ }>;
237
+ export class Vis2d {
238
+ constructor(name: any, p1: any, p2: any);
239
+ name: any;
240
+ clear(p1: any, p2: any): this;
241
+ vec: any[];
242
+ xp1: any;
243
+ xp2: any;
244
+ randomcolor(transp?: string): string;
245
+ addpoint(p: any, id?: number, color?: any, spessore?: number): this;
246
+ addline(l: any, id?: number, color?: any, spessore?: number): this;
247
+ addrect(l: any, id?: number, color?: any, spessore?: number): this;
248
+ addrecta(l: any, id?: number, color?: any): this;
249
+ addshape(s: any, color?: any, spessore?: number): this;
250
+ addshapelin(s: any, color?: any, spessore?: number): this;
251
+ addarea(s: any, color?: any): this;
252
+ addoffset(x: any, y: any): this;
253
+ }
254
+ /**
255
+ * Calcola l'angolo tra due vettori in gradi.
256
+ * @param {Object} v1 - Primo vettore {x,y}
257
+ * @param {Object} v2 - Secondo vettore {x,y}
258
+ * @returns {number} Angolo in gradi
259
+ */ export function angle2vec(v1: any, v2: any): number;
260
+ /**
261
+ * Calcola l'angolo tra tre punti in radianti.
262
+ * @param {Object} p1 - Primo punto {x,y}
263
+ * @param {Object} p2 - Punto centrale {x,y}
264
+ * @param {Object} p3 - Terzo punto {x,y}
265
+ * @returns {number} Angolo in radianti
266
+ */ export function angle3point(p1: any, p2: any, p3: any): number;
267
+ export function clamp(n: any, min?: number, max?: number): any;
268
+ export function clean(k: any, locase?: boolean): any;
269
+ export function getdumpmacro(nodo: any): string;
270
+ export function getnodebyid(id: any, nodocorrente: any): any;
271
+ export function getprojectkeys(project: any): any;
272
+ /**
273
+ * Calcola i punti di offset tra due percorsi
274
+ * Trova i punti del secondo percorso che corrispondono all'offset del primo
275
+ * @param {Array<{x:number,y:number}>} pt - Array di punti del primo percorso
276
+ * @param {Array<{x:number,y:number}>} pt2 - Array di punti del secondo percorso
277
+ * @param {number} delta - Distanza di offset
278
+ * @returns {Array<{x:number,y:number}>} Array di punti del percorso offset
279
+ */ export function getptsoffset(pt: Array<{
280
+ x: number;
281
+ y: number;
282
+ }>, pt2: Array<{
283
+ x: number;
284
+ y: number;
285
+ }>, delta: number): Array<{
286
+ x: number;
287
+ y: number;
288
+ }>;
289
+ /**
290
+ * Calcola le normali e i valori UV per un percorso chiuso.
291
+ * @param {Array<Object>} path - Array di punti {x,y}
292
+ * @param {number} [c=0] - Coefficiente c per il calcolo di z
293
+ * @param {number} [a=0] - Coefficiente a per il calcolo di z
294
+ * @param {number} [b=0] - Coefficiente b per il calcolo di z
295
+ * @param {number} [anglemin=30] - Angolo minimo in gradi per la suddivisione dei punti
296
+ * @returns {Array<Object>} Array di punti con normali e coordinate UV
297
+ */
298
+ /**
299
+ * Crea un oggetto shape per manipolare forme 2D
300
+ * @returns {Object} Oggetto con metodi per manipolare la forma
301
+ * @property {string} key - Hash univoco della forma
302
+ * @property {Array<{x:number,y:number}>} pt - Array dei punti della forma
303
+ * @property {Array<number>} vec - Array dei punti come vettore [x1,y1,x2,y2,...]
304
+ * @property {number} orient - Orientamento della forma (1 orario, -1 antiorario, 0 degenere)
305
+ * @method clone() - Crea una copia della forma
306
+ * @method rotate(deg) - Ruota la forma di deg gradi
307
+ * @method move(x,y) - Sposta la forma di x,y
308
+ * @method fromclip(vv) - Inizializza da punti in formato clipper
309
+ * @method fromvec(aa) - Inizializza da array di coordinate [x1,y1,x2,y2,...]
310
+ * @method frompt(pts) - Inizializza da array di punti [{x,y},...]
311
+ * @method fromstr(str) - Inizializza da stringa con sintassi speciale
312
+ * @method addpt(pts) - Aggiunge punti alla forma
313
+ * @method addracc(v1,v2,suddivisioni,addv1v2) - Aggiunge raccordo tra punti
314
+ * @method setorient(mode) - Imposta l'orientamento della forma
315
+ * @method reverse() - Inverte l'ordine dei punti
316
+ * @method pointinshape(p) - Verifica se un punto è interno alla forma
317
+ * @method azzera() - Rimuove tutti i punti
318
+ * @method removeduplicate(delta) - Rimuove punti duplicati
319
+ * @method to3d(u0,c,a,b) - Converte in forma 3D con normali
320
+ */
321
+ export function getshape(): any;
322
+ export function getsubrules(nodocorrente: any): ({
323
+ id: string;
324
+ level: number;
325
+ name: string;
326
+ des?: undefined;
327
+ spec?: undefined;
328
+ } | {
329
+ id: any;
330
+ name: any;
331
+ des: any;
332
+ spec: number;
333
+ level: number;
334
+ })[];
335
+ /**
336
+ * Esegue una semplice somma sincrona di due numeri
337
+ * @param {number} a - Primo numero da sommare
338
+ * @param {number} b - Secondo numero da sommare
339
+ * @returns {number} La somma dei due numeri
340
+ */ export function hash(obj: any): number;
341
+ export function isfn(row: any): boolean;
342
+ export function ismacro(row: any): any;
343
+ /**
344
+ * Calcola il vettore normale unitario di un segmento di linea.
345
+ * @param {Object} p1 - Punto iniziale {x,y}
346
+ * @param {Object} p2 - Punto finale {x,y}
347
+ * @returns {Object} Vettore normale unitario {nx,ny}
348
+ */ export function normal2(p1: any, p2: any): any;
349
+ /**
350
+ * Crea una curva di Bézier quadratica tra due segmenti di linea.
351
+ * @param {Object} a1 - Punto iniziale del primo segmento {x,y}
352
+ * @param {Object} a2 - Punto finale del primo segmento {x,y}
353
+ * @param {Object} b1 - Punto iniziale del secondo segmento {x,y}
354
+ * @param {Object} b2 - Punto finale del secondo segmento {x,y}
355
+ * @param {number} [subdivisions=10] - Numero di suddivisioni della curva
356
+ * @returns {Array<Object>} Array di punti {x,y} che formano la curva
357
+ */
358
+ export function raccordabezier(a1: any, a2: any, b1: any, b2: any, subdivisions?: number): Array<any>;
359
+ /**
360
+ * Crea un oggetto per operazioni booleane e manipolazione di forme 2D usando la libreria Clipper
361
+ * @returns {Object} Oggetto con metodi per operazioni su forme
362
+ * @property {Function} offset - Crea un offset della forma
363
+ * @property {Function} inflate - Espande o contrae una forma
364
+ * @property {Function} unisci - Unisce più forme con gestione di fori e tagli
365
+ */
366
+ export function shapeclip(): any;
367
+ export function valutagrafica(amb: any, startmacro: any, rulespec: any, progetto: any, fnreload: any): Promise<{
368
+ oo: any;
369
+ vari: any;
370
+ fnlist: any[];
371
+ }>;
372
+ declare function bordi(ff: any): {
373
+ bt: any;
374
+ bb: any;
375
+ bl: any;
376
+ br: any;
377
+ };
378
+ declare function creabordi(ff: any, shape: any, shape2: any): {
379
+ pt: any;
380
+ type: string;
381
+ }[];
382
+ /**
383
+ * Genera segmenti basati su intervalli e punti di interruzione
384
+ * @param {Array<{a: number, b: number}>} t1 - Array di oggetti che rappresentano intervalli con coordinate a e b
385
+ * @param {Array<number>} [t2] - Array opzionale di punti di interruzione
386
+ * @param {boolean} [interna=false] - Se true, usa i bordi interni degli intervalli
387
+ * @param {boolean} [allbreak=false] - Se true, considera ogni punto degli intervalli come una rottura
388
+ * @returns {Array<{a: number, b: number}>} Array di segmenti generati
389
+ */ declare function generatesegments(t1: Array<{
390
+ a: number;
391
+ b: number;
392
+ }>, t2?: Array<number>, interna?: boolean, allbreak?: boolean): Array<{
393
+ a: number;
394
+ b: number;
395
+ }>;
396
+ declare function internalshape(ff: any, shape: any): any;
397
+ declare function pushlineare(ff: any, type: any, des: any, l0: any, l1: any, id: number, shapecontorno: any, areas: any): {
398
+ id: number;
399
+ type: any;
400
+ des: any;
401
+ shape: any;
402
+ info: any;
403
+ };
404
+ declare function pushshape(ff: any, type: any, des: any, shape: any, info: any, id?: number): {
405
+ id: number;
406
+ type: any;
407
+ des: any;
408
+ shape: any;
409
+ info: any;
410
+ };
411
+ export { splitter as SP };
@@ -0,0 +1,162 @@
1
+ export const SIDE: any;
2
+ /**
3
+ * Aggiunge un pivot a un oggetto 3D esistente, mantenendone posizione e orientamento globale.
4
+ * @param {THREE.Object3D} grp - Oggetto esistente già posizionato nella scena.
5
+ * @param {THREE.Vector3} pivotLocal - Punto (locale) attorno a cui ruotare (es: -x/2, -y/2, 0).
6
+ * @param {Object} movimento - Istanza della classe MovimentoBase o derivata.
7
+ * @returns {THREE.Group} - Nuovo gruppo contenitore con pivot.
8
+ */
9
+ export function addmovpivot(gcad: any, grp: THREE.Object3D, movimento: any, op?: {}, x?: number, y?: number, z?: number): THREE.Group;
10
+ export function creategroup(name: any): any;
11
+ export function deletegroup(grpbase: any, name: any): void;
12
+ export function edgesfromgeometry(g1: any, layer?: number): any;
13
+ /**
14
+ * Crea una geometria estrusa con opzioni avanzate
15
+ * @param {string} orient - Orientamento dell'estrusione
16
+ * @param {number} hshape - Altezza dell'estrusione
17
+ * @param {Object} shape - Forma base
18
+ * @param {Array} holes - Array di fori
19
+ * @param {Array} mats - Array di materiali
20
+ * @param {Object} options - Opzioni di configurazione
21
+ * @returns {THREE.Group} Gruppo contenente la geometria estrusa
22
+ */ export function estruso(gcad: any, orient: string, hshape: number, shape: any, holes: any[], mats: any[], options: any): THREE.Group;
23
+ /**
24
+ * Crea una geometria estrusa con opzioni avanzate
25
+ * @param {string} orient - Orientamento dell'estrusione
26
+ * @param {number} hshape - Altezza dell'estrusione
27
+ * @param {Object} shape - Forma base
28
+ * @param {Array} holes - Array di fori
29
+ * @param {Array} mats - Array di materiali
30
+ * @param {Object} options - Opzioni di configurazione
31
+ * @returns {THREE.Group} Gruppo contenente la geometria estrusa
32
+ */ export function estrusopat(gcad: any, orient: string, pat: any, shape: any, mats: any[], options: any): THREE.Group;
33
+ export function get3dshape(punti: any, material: any, layer: any): any;
34
+ export function getbox(gcad: any, x: any, y: any, z: any, mat: any, options: any): Promise<any>;
35
+ /**
36
+ * Crea un cilindro 3D con orientamento personalizzabile
37
+ * @param {string} ori - Orientamento (X/L, Y/A, Z/P)
38
+ * @param {number} h - Altezza
39
+ * @param {number} r1 - Raggio base
40
+ * @param {number} r2 - Raggio top
41
+ * @param {THREE.Material|Array} mats - Materiale/i da applicare
42
+ * @param {Object} options - Opzioni di configurazione
43
+ * @returns {Promise<THREE.Group>} Gruppo contenente il cilindro
44
+ */
45
+ export function getcilindro(gcad: any, ori: string, h: number, r1: number, r2: number, mats: THREE.Material | any[], options: any): Promise<THREE.Group>;
46
+ /**
47
+ * Crea un box 3D con linee di bordo opzionali
48
+ * @param {number} x - Larghezza
49
+ * @param {number} y - Altezza
50
+ * @param {number} z - Profondità
51
+ * @param {THREE.Material} mat - Materiale da applicare
52
+ * @param {Object} options - Opzioni di configurazione
53
+ * @returns {Promise<THREE.Group>} Gruppo contenente il box
54
+ */ export function getface(gcad: any, x: number, y: number, mat: THREE.Material, scaled?: boolean): Promise<THREE.Group>;
55
+ /**
56
+ * Crea una linea 3D
57
+ * @param {Object} l - Oggetto contenente punti p1 e p2
58
+ * @param {string} id - Identificatore
59
+ * @param {THREE.Material} [mat=null] - Materiale da applicare
60
+ * @returns {THREE.Line} Linea 3D
61
+ */ export function getline(l: any, id: string, mat?: THREE.Material): THREE.Line;
62
+ export function getlinesgeom(edges: any, layer?: number): any;
63
+ export function getmesh(geom: any, material: any, layer?: number, clone?: boolean): any;
64
+ /**
65
+ * Crea un gestore di movimento per animare oggetti 3D.
66
+ * @param {string} key - Chiave identificativa del movimento
67
+ * @param {Array<Object>} gtimeline - Timeline di passi di animazione. Ogni passo può contenere:
68
+ * @param {number} time - Durata del passo in millisecondi
69
+ * @param {(number|function)} [x] - Traslazione X (unità o funzione che restituisce unità)
70
+ * @param {(number|function)} [y] - Traslazione Y
71
+ * @param {(number|function)} [z] - Traslazione Z
72
+ * @param {(number|function)} [s] - Scala uniforme (moltiplicatore)
73
+ * @param {(number|function)} [sx] - Scala X
74
+ * @param {(number|function)} [sy] - Scala Y
75
+ * @param {(number|function)} [sz] - Scala Z
76
+ * @param {(number|function)} [ax] - Rotazione X (in giri)
77
+ * @param {(number|function)} [ay] - Rotazione Y
78
+ * @param {(number|function)} [az] - Rotazione Z
79
+ * @param {(number|function)} [t] - Trasparenza (0-1)
80
+ * @returns {Object} Oggetto gestore del movimento con metodi:
81
+ * @property {number} tline - Durata totale della timeline
82
+ * @property {function} clear - Pulisce la timeline
83
+ * @property {function} add - Aggiunge un passo alla timeline
84
+ * @property {string} key - Chiave del movimento
85
+ * @property {function} step - Esegue un passo dell'animazione
86
+ * @property {function} reset - Resetta l'oggetto alla posizione iniziale
87
+ */ export function getmovimento(key: string, gtimeline?: Array<any>): any;
88
+ export function getpannello(gcad: any, orientamento: any, x: any, y: any, z: any, mat1: any, mat2: any, options: any): Promise<any>;
89
+ /**
90
+ * Crea un punto 3D rappresentato da una sfera
91
+ * @param {Object} p - Coordinate del punto
92
+ * @param {string} id - Identificatore
93
+ * @param {THREE.Material} [mat=null] - Materiale da applicare
94
+ * @param {number} [size=5] - Dimensione della sfera
95
+ * @returns {THREE.Mesh} Punto 3D
96
+ */ export function getpoint(p: any, id: string, mat?: THREE.Material, size?: number): THREE.Mesh;
97
+ export function getpunto(gcad: any, x: any, y: any, z: any, color: string, options: any): Promise<any>;
98
+ /**
99
+ * Crea una quota tra due punti in 3D sul piano XY
100
+ * @param {string} testo - Testo da visualizzare nella quota
101
+ * @param {number} x1 - Coordinata X del primo punto
102
+ * @param {number} y1 - Coordinata Y del primo punto
103
+ * @param {number} x2 - Coordinata X del secondo punto
104
+ * @param {number} y2 - Coordinata Y del secondo punto
105
+ * @param {number} sizetesto - Dimensione del testo
106
+ * @param {Object} options - Opzioni aggiuntive
107
+ * @returns {THREE.Group} Gruppo contenente la quota
108
+ */ export function getquota(gcad: any, testo: string, x1: number, y1: number, x2: number, y2: number, altezza?: number, offset?: number, options?: any): THREE.Group;
109
+ /**
110
+ * Crea un punto di riferimento invisibile nell'albero 3D
111
+ * @param {number} x - Coordinata X
112
+ * @param {number} y - Coordinata Y
113
+ * @param {number} z - Coordinata Z
114
+ * @param {Object} dati - Dati da archiviare nell'oggetto
115
+ * @param {string} [id=null] - Identificatore opzionale
116
+ * @returns {THREE.Object3D} Oggetto di riferimento invisibile
117
+ */
118
+ export function getriferimento(dati: any, x?: number, y?: number, z?: number, id?: string): THREE.Object3D;
119
+ export function getsprite(gcad: any, x: any, y: any, z: any, mat: any, options?: {}): Promise<any>;
120
+ /**
121
+ * Crea una targhetta rettangolare con testo
122
+ * @param {Array|string} testo - Array di oggetti {testo, size, colore} o stringa
123
+ * @param {number} dim - Larghezza/altezza della targhetta
124
+ * @param {Object} options - Opzioni aggiuntive
125
+ * @returns {THREE.Mesh} Mesh con la targhetta
126
+ */ export function gettarghetta(gcad: any, testo: any[] | string, dim?: number, options?: any): THREE.Mesh;
127
+ export function groupfromgeometry(geometry: any, material: any, x: any, y: any, z: any, name: any, layer: any): any;
128
+ export function infoestrudi(shape: any, hshape: any, pts: any, options: any): {
129
+ aini: any;
130
+ aini2: any;
131
+ afin: any;
132
+ afin2: any;
133
+ pts: any;
134
+ mi: any;
135
+ ma: any;
136
+ rect: {
137
+ x: any;
138
+ y: any;
139
+ }[];
140
+ dimx: number;
141
+ dimy: number;
142
+ lnom: number;
143
+ lmax: number;
144
+ lmin: number;
145
+ lmed: number;
146
+ };
147
+ export let materialline1: any;
148
+ export let materialline2: any;
149
+ export const mblack: any;
150
+ export const mblue: any;
151
+ export const mgray1: any;
152
+ export const mgray2: any;
153
+ export const mgreen: any;
154
+ export const mred: any;
155
+ declare const mwhite$1: any;
156
+ export function posiziona(grp: any, pos?: {}): any;
157
+ export function randombasemat(): any;
158
+ export function revolve(gcad: any, shape: any, orient: any, mat: any, options: any): any;
159
+ export const scaleunit: 0.001;
160
+ export function spritemat(gcad: any, file: any): Promise<any>;
161
+ export function svuotanodo(n: any): void;
162
+ export { mwhite$1 as mwhite };
@@ -0,0 +1,71 @@
1
+ export class Render {
2
+ constructor(baseurl: any, easy: any, callback: any);
3
+ baseurl: any;
4
+ easy: any;
5
+ callback: any;
6
+ code(code: any, lang: any, codes: any): string;
7
+ blockquote(quote: any): any;
8
+ html(html: any): any;
9
+ heading(text: any, level: any, raw: any): string;
10
+ hr(): "" | "<div class=\"my-4\"><hr/></div>";
11
+ list(body: any, ordered: any): string;
12
+ listtitle(body: any): string;
13
+ listitem(text: any, num: any): string;
14
+ paragraph(text: any): any;
15
+ table(header: any, body: any): string;
16
+ tablerow(content: any): string;
17
+ tablecell(content: any, header: any, align: any): string;
18
+ colorbase(text: any): string;
19
+ formula(text: any, full?: boolean): string;
20
+ coloralt(text: any): string;
21
+ blink(text: any): void;
22
+ strong(text: any): string;
23
+ ico(text: any): string;
24
+ em(text: any): string;
25
+ codespan(text: any): string;
26
+ br(): string;
27
+ del(text: any): string;
28
+ link(href: any, title: any, text: any): string;
29
+ image(href: any, title: any, text: any): string;
30
+ text(text: any): any;
31
+ }
32
+ export const aliasInfo: {
33
+ alias: any;
34
+ check(): void;
35
+ retoalias: {};
36
+ regex: Set<any>;
37
+ add(sigla: any, valore: any): any;
38
+ removeAll(): any;
39
+ setmappa(mappa: any): void;
40
+ parse(data: any, info: any, mappa: any): {
41
+ comments: any[];
42
+ info: boolean;
43
+ };
44
+ };
45
+ export function elang(str: any, lang: any, punct: any, codes: any): string;
46
+ export function escapeHTML(str: any): any;
47
+ export function formatrule(code: any): string;
48
+ export function formatvariante(str: any): string;
49
+ export function mark(xx: any, baseurl: any, notitle: boolean, parsedlist: boolean, callback: any): any;
50
+ export function markeasy(xx: any, maxlen?: number, notitle?: boolean): any;
51
+ export function markunoFormatCodeMirror(CodeMirror: any): void;
52
+ export function parseinfomd(data: any, info: any, mappa: any): {
53
+ comments: any[];
54
+ info: boolean;
55
+ };
56
+ export function parselist(text: any, title?: string): {
57
+ txt: string;
58
+ cards: {
59
+ title: any;
60
+ lev: any;
61
+ data: any;
62
+ }[];
63
+ tm: any[];
64
+ };
65
+ export function parserule(tt: any): any[];
66
+ export function parsetext(tt: any): any[];
67
+ declare function tokenparser(res: any, render: any, maxlen?: number): any;
68
+ export function parsevars(v: any, vars: any): any;
69
+ export function tokenize(src: any, easylen: any, noheader?: boolean): any;
70
+ export function unescapeHTML(str: any): any;
71
+ export { tokenparser as parsetokens };
@@ -0,0 +1,552 @@
1
+ export class Ambiente {
2
+ constructor(cat?: string, maxdelays?: number, righevuote?: boolean);
3
+ righevuote: boolean;
4
+ maxdelays: number;
5
+ setcatalog(cat: any): any;
6
+ cat: any;
7
+ item: any;
8
+ rule: any;
9
+ model: any;
10
+ get muvalutatore(): {
11
+ getcolonne: typeof getcolonne;
12
+ muCalc: typeof muCalc;
13
+ muEval: typeof muEval;
14
+ tipifree: string[];
15
+ };
16
+ azzera(mode?: boolean): void;
17
+ /** @type {Variabile} */
18
+ vari: Variabile;
19
+ ruleheader: string;
20
+ /** @type {Object.<string, Macro>} */
21
+ macro: {};
22
+ /** @type {Object.<string, Variante>} */
23
+ varianti: {};
24
+ varelenco: {};
25
+ macroelenco: {};
26
+ scripts: {};
27
+ setfndot(fndotcallback: any): Promise<void>;
28
+ fndotcallback: any;
29
+ parseheaderfrominfo(tm: any): void;
30
+ setitem(item: any, rule: any, model: any, datadelgiorno: any): void;
31
+ data: any;
32
+ getheader(cod: any): Promise<any>;
33
+ getalias(): Promise<any>;
34
+ get deriva(): any;
35
+ getmacro(riga: any): Promise<{
36
+ macro: any;
37
+ pars: string[];
38
+ } | {
39
+ macro?: undefined;
40
+ pars?: undefined;
41
+ }>;
42
+ getvariante(cod: any): Promise<any>;
43
+ varcompila(v: any, callback: any): Promise<void>;
44
+ macrocompila(v: any, callback: any): Promise<void>;
45
+ barrecompila(articolibarre: any, titolibarre: any, callback: any): Promise<CodiceBarra>;
46
+ tojson(d: any): Promise<any>;
47
+ compila(info: any, callback: any): Promise<void>;
48
+ getheaderfromdb(name: any): Promise<{
49
+ head: any;
50
+ rows: any;
51
+ macros: any;
52
+ }>;
53
+ getlinkedmacros(rule: any, macros: any): Promise<void>;
54
+ setruleheader(rule: any, pars: any): Promise<any>;
55
+ getruleheader(): any;
56
+ setvariante(cod: any, opz: any): Promise<any>;
57
+ valuta(codice: any): Promise<any>;
58
+ setinfos(tm: any): void;
59
+ #private;
60
+ }
61
+ export class CodiceBarra {
62
+ barre: {};
63
+ azzera(): void;
64
+ oriented(t: any, l: any, a: any, p: any): {
65
+ t: string;
66
+ x: any;
67
+ y?: undefined;
68
+ z?: undefined;
69
+ } | {
70
+ t: any;
71
+ x: any;
72
+ y: any;
73
+ z: any;
74
+ };
75
+ getcode(codicebarratot: any, l: any, a: any, p: any, callback: any): Promise<any>;
76
+ compila(vettore: any, headers: any): void;
77
+ }
78
+ export class Macro {
79
+ constructor(amb: any, name: any);
80
+ name: any;
81
+ cat: string;
82
+ /** @type {Ambiente} */
83
+ amb: any;
84
+ azzera(): void;
85
+ key: string;
86
+ localvar: {};
87
+ head: any[] | {
88
+ cod: any;
89
+ t: string;
90
+ }[];
91
+ frontend: boolean;
92
+ valid: any[];
93
+ parametri: {};
94
+ paralias: {};
95
+ formula: {};
96
+ settings: {};
97
+ errori: any[];
98
+ codice: any;
99
+ genera: {};
100
+ get isgenera(): number;
101
+ get iscodice(): any;
102
+ get isheader(): number;
103
+ geterrori(): any[];
104
+ getparametri(): {};
105
+ setparametri(pars: any): Promise<{}>;
106
+ setparametro(name: any, value: any, propaga?: boolean): Promise<any>;
107
+ impostaparametri(parimposta: any, parcall: any, ismacro?: boolean): Promise<void>;
108
+ checkvalid(formula: any): Promise<boolean>;
109
+ getmacrostr(): string;
110
+ getmacro(): any;
111
+ setmacro(vv: any): void;
112
+ load(xname: any, xcat: any): Promise<boolean>;
113
+ loadAndCompile(file: any, cat: any, acapo?: boolean): Promise<any>;
114
+ parsedata(res: any, acapo?: boolean): Promise<void>;
115
+ cleanfiltraparametri(key: any, codice: any, acapo: any): any[];
116
+ #private;
117
+ }
118
+ export class Variabile {
119
+ static isValidKey(key: any): boolean;
120
+ static sanitizeKey(key: any): any;
121
+ dictionary: {};
122
+ vec: any[];
123
+ counter: number;
124
+ setfndot(fndotcallback: any): void;
125
+ fndotcallback: any;
126
+ /**
127
+ * Salva lo stato corrente delle variabili nello stack
128
+ */ push(): void;
129
+ /**
130
+ * Ripristina l'ultimo stato salvato delle variabili
131
+ */ pop(): void;
132
+ /**
133
+ * Rimuove tutte le variabili e pulisce lo stack
134
+ */ clear(): void;
135
+ azzera: () => void;
136
+ var(key: any): any;
137
+ getvar(key: any): any;
138
+ colonna(value: any, index: any): any;
139
+ /**
140
+ * Restituisce un dump delle variabili
141
+ */ dump(isstr?: boolean): string[] | {
142
+ cod: string;
143
+ val: any;
144
+ }[];
145
+ /**
146
+ * Aggiunge o rimuove una variabile
147
+ */ add(key: any, value: any): void;
148
+ /**
149
+ * Valuta un'espressione con supporto per callback asincroni
150
+ */ valutasync(str: any): any;
151
+ valuta(ex: any, callback: any): Promise<any>;
152
+ parametrokeyval(p: any): Promise<{
153
+ k?: undefined;
154
+ v?: undefined;
155
+ } | {
156
+ k: any;
157
+ v: any;
158
+ }>;
159
+ }
160
+ /**
161
+ * Classe per gestire le varianti di un prodotto.
162
+ * Permette di caricare, manipolare e convertire varianti di prodotto con relativi attributi e limiti.
163
+ * @class
164
+ * @exports
165
+ */ export class Variante {
166
+ /**
167
+ * Crea una nuova istanza di Variante
168
+ * @param {Object} amb - Ambiente di esecuzione contenente il contesto applicativo
169
+ */
170
+ constructor(amb: any);
171
+ rows: {};
172
+ name: string;
173
+ key: string;
174
+ /** @type {Ambiente} */
175
+ amb: any;
176
+ /**
177
+ * Imposta i dati principali della variante
178
+ * @param {string} id - Identificativo univoco della variante
179
+ * @param {string} cat - Categoria di appartenenza
180
+ * @returns {Object} Oggetto contenente nome e categoria normalizzati
181
+ */ setheader(id: string, cat: string): any;
182
+ cat: string;
183
+ alias: string;
184
+ obbligo: boolean;
185
+ des: any;
186
+ vdef: any[] | string[];
187
+ h: any[] | {
188
+ des: string;
189
+ }[];
190
+ /**
191
+ * Cerca la riga con dimensione più vicina a quella richiesta
192
+ * @param {number|string} dim - Dimensione target da cercare
193
+ * @param {number} colonna - Indice della colonna (1-based) contenente la dimensione
194
+ * @returns {string} Riga formattata nel formato CSV
195
+ */ fromdim(dim: number | string, colonna?: number): string;
196
+ /**
197
+ * Carica una variante dal database o da file
198
+ * @param {string} id - Identificativo della variante
199
+ * @param {string} cat - Categoria della variante
200
+ * @param {boolean} nofilter - Se true, non carica i filtri associati
201
+ * @returns {Promise<boolean>} Promise che risolve a true se il caricamento ha successo
202
+ */ load(id: string, cat: string, nofilter?: boolean): Promise<boolean>;
203
+ limits: {}[] | {
204
+ v: any[];
205
+ datai: number;
206
+ dataf: number;
207
+ }[];
208
+ /**
209
+ * Carica il contenuto della variante da array di stringhe
210
+ * @private
211
+ * @param {string[]} lines - Array di stringhe contenenti la definizione della variante
212
+ * @returns {Promise<boolean>} Promise che risolve a true se il caricamento ha successo
213
+ */ private _loadContent;
214
+ noerp: boolean;
215
+ /**
216
+ * Converte la variante in un vettore di righe
217
+ * @returns {string[]} Array di righe formattate
218
+ */ tovec(): string[];
219
+ /**
220
+ * Converte un codice nella sua rappresentazione CSV
221
+ * @param {string} cod - Codice da convertire
222
+ * @returns {string} Stringa CSV o codice originale se non trovato
223
+ */ tovar(cod: string, vcod?: string): string;
224
+ /**
225
+ * Verifica se un'opzione è valida
226
+ * @param {string} opz - Opzione da verificare
227
+ * @returns {boolean} True se l'opzione è valida
228
+ */ isvalidopz(opz: string): boolean;
229
+ /**
230
+ * Trova la prima opzione valida tra quelle disponibili
231
+ * @param {string} opz - Opzione da controllare per prima
232
+ * @returns {string|undefined} Prima opzione valida trovata o undefined
233
+ */ firstvalid(opz: string): string | undefined;
234
+ /**
235
+ * Resetta tutti i filtri applicati alla variante
236
+ */ resetfilter(): void;
237
+ /**
238
+ * Restituisce le chiavi valide ordinate alfabeticamente
239
+ * @returns {string[]} Array di chiavi valide
240
+ */ validkeys(): string[];
241
+ limitfiltra(filtra: any): void;
242
+ /**
243
+ * Applica i limiti configurati alle opzioni della variante
244
+ * @returns {Array|void} Array di limiti applicati o void se reset
245
+ */ limita(filtra: any): any[] | void;
246
+ /**
247
+ * Carica il contenuto esteso della variante
248
+ * @param {Object|string} content - Contenuto da caricare, può essere un oggetto o una stringa
249
+ * @returns {Promise<void>} Promise che si risolve al completamento del caricamento
250
+ */ loadContentExtended(content: any | string): Promise<void>;
251
+ todata(): {
252
+ name: string;
253
+ des: any;
254
+ alias: string;
255
+ obbligo: boolean;
256
+ h: any[] | {
257
+ des: string;
258
+ }[];
259
+ rows: {};
260
+ limits: {}[] | {
261
+ v: any[];
262
+ datai: number;
263
+ dataf: number;
264
+ }[];
265
+ key: string;
266
+ };
267
+ #private;
268
+ }
269
+ /**
270
+ * Valida e separa un identificatore e una categoria
271
+ * @param {string} id - Identificatore da validare (formato: "categoria/nome" o solo "nome")
272
+ * @param {string} cat - Categoria di default
273
+ * @throws {Error} Se manca la categoria
274
+ * @returns {{name: string, cat: string}} Oggetto con nome e categoria validati
275
+ */ export function checkmu(id: string, cat: string): {
276
+ name: string;
277
+ cat: string;
278
+ };
279
+ /**
280
+ * Valida un identificatore verificando che contenga solo caratteri permessi
281
+ * @param {string} id - Identificatore da validare
282
+ * @throws {Error} Se l'identificatore contiene caratteri non validi
283
+ * @returns {string} Identificatore validato in minuscolo
284
+ */ export function checkname(id: string): string;
285
+ export function clamp(n: any, min?: number, max?: number): any;
286
+ export function clean(k: any, locase?: boolean): any;
287
+ export function dammivariante(amb: any, macro: any, ky: any): Promise<any>;
288
+ export const errori: {
289
+ /**
290
+ * Azzera la lista degli errori
291
+ */ azzera(): void;
292
+ err: any[];
293
+ /**
294
+ * Aggiunge un errore alla lista
295
+ * @param {string} msg - Messaggio di errore
296
+ * @param {Object} row - Informazioni aggiuntive sull'errore
297
+ */ add(msg: string, row: any): void;
298
+ /**
299
+ * Restituisce la lista completa degli errori
300
+ * @returns {Array} Lista degli errori
301
+ */ get(): any[];
302
+ /**
303
+ * Restituisce il numero di errori presenti
304
+ * @returns {number} Numero di errori
305
+ */ readonly length: number;
306
+ /**
307
+ * Converte la lista degli errori in stringa
308
+ * @returns {string} Rappresentazione testuale degli errori
309
+ */ toString(): string;
310
+ };
311
+ /**
312
+ * Converte una stringa in un oggetto JSON, gestendo errori e restituendo un valore di default se non valido
313
+ * @param {string|Array|Object} str - Stringa da convertire in JSON, array o oggetto da restituire direttamente
314
+ * @param {*} [def={}] - Valore di default da restituire in caso di errore di parsing
315
+ * @throws {Error} Non genera eccezioni, gli errori vengono loggati internamente
316
+ * @returns {*} L'oggetto JSON convertito dalla stringa, l'input originale se è un array/oggetto, o il valore di default in caso di errore
317
+ * @example
318
+ * fromjson('{"a": 1}') // returns {a: 1}
319
+ * fromjson([1,2,3]) // returns [1,2,3]
320
+ * fromjson('invalid json', {}) // returns {}
321
+ */ export function fromjson(str: string | any[] | any, def?: any): any;
322
+ /**
323
+ * Estrae le proprietà non-funzione da un oggetto, escludendo chiavi specificate
324
+ * @param {Object} obj - Oggetto da cui estrarre le proprietà
325
+ * @param {string[]} [exclude] - Array di chiavi da escludere
326
+ * @returns {Object} Nuovo oggetto con le proprietà estratte
327
+ */ export function getOggetto(obj: any, exclude?: string[]): any;
328
+ /**
329
+ * Converte una stringa in array di colonne, gestendo diversi formati
330
+ * @param {string} value - Stringa da convertire
331
+ * @returns {string[]} Array di colonne
332
+ */ export function getcolonne(value: string, keepquote?: boolean): string[];
333
+ /**
334
+ * Analizza una stringa per estrarre una coppia chiave-valore
335
+ * @param {string} r - Stringa da analizzare (es: "chiave=valore")
336
+ * @param {string} [sep='='] - Carattere separatore
337
+ * @returns {{v: string, o: string, fl: boolean}} Oggetto contenente chiave (v), valore (o) e flag presenza separatore (fl)
338
+ */ export function getcouple(r: string, sep?: string, locase?: boolean): {
339
+ v: string;
340
+ o: string;
341
+ fl: boolean;
342
+ };
343
+ /**
344
+ * Formatta un messaggio di errore rimuovendo informazioni non necessarie
345
+ * @param {Error|string} err - L'errore da formattare
346
+ * @returns {string} Il messaggio di errore formattato
347
+ */ export function geterrdes(err: Error | string): string;
348
+ export function getheaddims(dims: any): any;
349
+ export function gettipocolonna(cod: any): string;
350
+ export function gettipofolder(cod: any): string;
351
+ export function hash(obj: any): string;
352
+ export function impostavariante(amb: any, macro: any, a: any, b: any, head: any): Promise<any>;
353
+ export function intvaluta(amb: any, mac: any, str: any): Promise<any>;
354
+ export function muInit(cat: any, cbGetMacro: any, cbGetVariante: any, cbFunc: any, cbInfo: any, cbGetFile: any, cbLogga: any): Ambiente;
355
+ /**
356
+ * Funzione di logging che utilizza un callback personalizzato se disponibile
357
+ * @param {...any} args - Argomenti da loggare
358
+ */ export function logga(...args: any[]): void;
359
+ /**
360
+ * Valuta un'espressione matematica o logica e restituisce il risultato
361
+ * @param {string|number} expression - L'espressione da valutare
362
+ * @returns {number} Il risultato della valutazione dell'espressione
363
+ * @description
364
+ * Supporta operazioni matematiche di base, funzioni trigonometriche,
365
+ * operatori di confronto e operazioni logiche.
366
+ * Le funzioni supportate includono: sqrt, floor, abs, sin, cos, random, clamp, round
367
+ */ export function muCalc(expression: string | number): number;
368
+ /**
369
+ * Rimuove i commenti dal codice sorgente mantenendo la struttura del codice
370
+ * @param {string} codice - Il codice sorgente da processare
371
+ * @param {boolean} tienivuoti - Se true mantiene le righe vuote
372
+ * @returns {string[]} Array di righe di codice senza commenti
373
+ */ export function muClComments(codice: string, tienivuoti: boolean): string[];
374
+ /**
375
+ * Analizza e organizza il codice in una struttura dati gerarchica
376
+ * @param {string[]} tt - Array di righe di codice da analizzare
377
+ * @param {boolean} acapo - Se true mantiene i ritorni a capo nel contenuto
378
+ * @returns {Object[]} Array di oggetti rappresentanti la struttura del codice
379
+ * @throws {Error} Se tt non è un array
380
+ */ export function muClean(tt: string[], acapo?: boolean): any[];
381
+ export function muCompileScript(codice: any): any;
382
+ export function muEval(amb: any, mac: any, codice: any, options: any): any;
383
+ export function muEvalScript(amb: Ambiente, codice: any, pars: any, reset?: boolean): Promise<{
384
+ output: any;
385
+ vari: {};
386
+ errori: {
387
+ /**
388
+ * Azzera la lista degli errori
389
+ */ azzera(): void;
390
+ err: any[];
391
+ /**
392
+ * Aggiunge un errore alla lista
393
+ * @param {string} msg - Messaggio di errore
394
+ * @param {Object} row - Informazioni aggiuntive sull'errore
395
+ */ add(msg: string, row: any): void;
396
+ /**
397
+ * Restituisce la lista completa degli errori
398
+ * @returns {Array} Lista degli errori
399
+ */ get(): any[];
400
+ /**
401
+ * Restituisce il numero di errori presenti
402
+ * @returns {number} Numero di errori
403
+ */ readonly length: number;
404
+ /**
405
+ * Converte la lista degli errori in stringa
406
+ * @returns {string} Rappresentazione testuale degli errori
407
+ */ toString(): string;
408
+ };
409
+ }>;
410
+ export function muGenerate(macro: any, amb: any, genera: any, callback: any, isTestmode?: number): Promise<boolean>;
411
+ /**
412
+ * Analizza e processa i limiti definiti nel codice
413
+ * @param {string} dati - Dati contenenti le definizioni dei limiti
414
+ * @returns {Object[]} Array di oggetti rappresentanti i limiti processati
415
+ */ export function muLimits(dati: string): any[];
416
+ /**
417
+ * Analizza il codice sorgente e restituisce un array di token con classi CSS
418
+ * @param {string} tt - Il codice sorgente da analizzare
419
+ * @param {boolean} isvar - Flag che indica se analizzare come variabile
420
+ * @returns {Array<{class: string, text: string}>} Array di token con classi CSS
421
+ */ export function muParsecode(tt: string, isvar: boolean): Array<{
422
+ class: string;
423
+ text: string;
424
+ }>;
425
+ export function muValuta(mu: any, codice: any, azzera: any): any;
426
+ export namespace mustr {
427
+ namespace mus {
428
+ namespace variants {
429
+ let cod: string;
430
+ let des: string;
431
+ let alias: string;
432
+ let info: string;
433
+ let md: string;
434
+ let __pk: string;
435
+ }
436
+ namespace extras {
437
+ export let tipo: string;
438
+ let cod_1: string;
439
+ export { cod_1 as cod };
440
+ let info_1: string;
441
+ export { info_1 as info };
442
+ let __pk_1: string;
443
+ export { __pk_1 as __pk };
444
+ }
445
+ namespace macros {
446
+ let cod_2: string;
447
+ export { cod_2 as cod };
448
+ let des_1: string;
449
+ export { des_1 as des };
450
+ let info_2: string;
451
+ export { info_2 as info };
452
+ let md_1: string;
453
+ export { md_1 as md };
454
+ export let def: string;
455
+ export let isgenera: string;
456
+ export let iscodice: string;
457
+ export let isheader: string;
458
+ let __pk_2: string;
459
+ export { __pk_2 as __pk };
460
+ }
461
+ namespace infos {
462
+ let cod_3: string;
463
+ export { cod_3 as cod };
464
+ let des_2: string;
465
+ export { des_2 as des };
466
+ let info_3: string;
467
+ export { info_3 as info };
468
+ let __pk_3: string;
469
+ export { __pk_3 as __pk };
470
+ }
471
+ namespace barcodes {
472
+ let cod_4: string;
473
+ export { cod_4 as cod };
474
+ let des_3: string;
475
+ export { des_3 as des };
476
+ let info_4: string;
477
+ export { info_4 as info };
478
+ let __pk_4: string;
479
+ export { __pk_4 as __pk };
480
+ }
481
+ }
482
+ }
483
+ export function newAmbiente(cat: any, maxmillis?: number): Ambiente;
484
+ export function newMacro(amb: any, name: any): Macro;
485
+ export function newVariabile(): Variabile;
486
+ export function newVariante(cod: any, cat: any, amb: any): Promise<Variante>;
487
+ export function parselimitifromdb(rr: any): {}[];
488
+ export function parselimitifromrule(limvec: any): {
489
+ v: any[];
490
+ datai: number;
491
+ dataf: number;
492
+ }[];
493
+ /**
494
+ * Analizza variabili in un'espressione usando delimitatori
495
+ * @param {string} ex - Espressione da analizzare
496
+ * @param {number} k0 - Posizione iniziale
497
+ * @param {string} inipar - Delimitatore iniziale ([, (, {)
498
+ * @param {string} endpar - Delimitatore finale (], ), })
499
+ * @param {boolean} [nonewline=false] - Se true, termina all'incontro di un newline
500
+ * @returns {{i: number, res: string[]}} Risultato dell'analisi con posizione finale e array risultati
501
+ */ export function parsevar(ex: string, k0: number, inipar: string, endpar: string, nonewline?: boolean): {
502
+ i: number;
503
+ res: string[];
504
+ };
505
+ export function poppars(amb: any, tm: any): Promise<void>;
506
+ export function pushpars(amb: any, macro: any, parsfunzione: any, parsinit: any): Promise<{
507
+ v: string;
508
+ o: any;
509
+ }[]>;
510
+ export function quote(v: any): any;
511
+ /**
512
+ * Classe per la gestione degli errori con funzionalità di accumulo e formattazione
513
+ */
514
+ /**
515
+ * Copia le proprietà non-funzione da un oggetto sorgente a uno destinazione
516
+ * @param {Object} objDestinazione - Oggetto destinazione
517
+ * @param {Object} objSorgente - Oggetto sorgente
518
+ */
519
+ export function setOggetto(objDestinazione: any, objSorgente: any): void;
520
+ /**
521
+ * Esegue una semplice somma sincrona di due numeri
522
+ * @param {number} a - Primo numero da sommare
523
+ * @param {number} b - Secondo numero da sommare
524
+ * @returns {number} La somma dei due numeri
525
+ */
526
+ export function testsync(a: number, b: number): number;
527
+ export const tipicolonna: ({
528
+ cod: string;
529
+ des: string;
530
+ folder?: undefined;
531
+ } | {
532
+ cod: string;
533
+ des: string;
534
+ folder: string;
535
+ })[];
536
+ export const tipifree: string[];
537
+ export const tipiheader: {
538
+ cod: string;
539
+ des: string;
540
+ }[];
541
+ /**
542
+ * Restituisce il timestamp corrente in millisecondi
543
+ * @returns {number} Timestamp corrente
544
+ */ export function tk(): number;
545
+ export function toCadPars(str: any): {};
546
+ export function toJson(t: any): string;
547
+ export function tonum(s: any, dec?: number): number;
548
+ /**
549
+ * Restituisce il timestamp corrente in millisecondi
550
+ * @returns {number} Timestamp corrente
551
+ */ export function xdt(): number;
552
+ export { muInit as jsTest };
File without changes