@noir-lang/noir_wasm 1.0.0-beta.14-0de2ac8.nightly → 1.0.0-beta.14-303dd21.nightly

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.
@@ -1,957 +0,0 @@
1
- export = __webpack_exports__;
2
- /**
3
- * class Deflate
4
- *
5
- * Generic JS-style wrapper for zlib calls. If you don't need
6
- * streaming behaviour - use more simple functions: [[deflate]],
7
- * [[deflateRaw]] and [[gzip]].
8
- **/
9
- /**
10
- * Deflate.result -> Uint8Array
11
- *
12
- * Compressed result, generated by default [[Deflate#onData]]
13
- * and [[Deflate#onEnd]] handlers. Filled after you push last chunk
14
- * (call [[Deflate#push]] with `Z_FINISH` / `true` param).
15
- **/
16
- /**
17
- * Deflate.err -> Number
18
- *
19
- * Error code after deflate finished. 0 (Z_OK) on success.
20
- * You will not need it in real life, because deflate errors
21
- * are possible only on wrong options or bad `onData` / `onEnd`
22
- * custom handlers.
23
- **/
24
- /**
25
- * Deflate.msg -> String
26
- *
27
- * Error message, if [[Deflate.err]] != 0
28
- **/
29
- /**
30
- * new Deflate(options)
31
- * - options (Object): zlib deflate options.
32
- *
33
- * Creates new deflator instance with specified params. Throws exception
34
- * on bad params. Supported options:
35
- *
36
- * - `level`
37
- * - `windowBits`
38
- * - `memLevel`
39
- * - `strategy`
40
- * - `dictionary`
41
- *
42
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
43
- * for more information on these.
44
- *
45
- * Additional options, for internal needs:
46
- *
47
- * - `chunkSize` - size of generated data chunks (16K by default)
48
- * - `raw` (Boolean) - do raw deflate
49
- * - `gzip` (Boolean) - create gzip wrapper
50
- * - `header` (Object) - custom header for gzip
51
- * - `text` (Boolean) - true if compressed data believed to be text
52
- * - `time` (Number) - modification time, unix timestamp
53
- * - `os` (Number) - operation system code
54
- * - `extra` (Array) - array of bytes with extra data (max 65536)
55
- * - `name` (String) - file name (binary string)
56
- * - `comment` (String) - comment (binary string)
57
- * - `hcrc` (Boolean) - true if header crc should be added
58
- *
59
- * ##### Example:
60
- *
61
- * ```javascript
62
- * const pako = require('pako')
63
- * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])
64
- * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);
65
- *
66
- * const deflate = new pako.Deflate({ level: 3});
67
- *
68
- * deflate.push(chunk1, false);
69
- * deflate.push(chunk2, true); // true -> last chunk
70
- *
71
- * if (deflate.err) { throw new Error(deflate.err); }
72
- *
73
- * console.log(deflate.result);
74
- * ```
75
- **/
76
- export function Deflate(options: any): void;
77
- export class Deflate {
78
- /**
79
- * class Deflate
80
- *
81
- * Generic JS-style wrapper for zlib calls. If you don't need
82
- * streaming behaviour - use more simple functions: [[deflate]],
83
- * [[deflateRaw]] and [[gzip]].
84
- **/
85
- /**
86
- * Deflate.result -> Uint8Array
87
- *
88
- * Compressed result, generated by default [[Deflate#onData]]
89
- * and [[Deflate#onEnd]] handlers. Filled after you push last chunk
90
- * (call [[Deflate#push]] with `Z_FINISH` / `true` param).
91
- **/
92
- /**
93
- * Deflate.err -> Number
94
- *
95
- * Error code after deflate finished. 0 (Z_OK) on success.
96
- * You will not need it in real life, because deflate errors
97
- * are possible only on wrong options or bad `onData` / `onEnd`
98
- * custom handlers.
99
- **/
100
- /**
101
- * Deflate.msg -> String
102
- *
103
- * Error message, if [[Deflate.err]] != 0
104
- **/
105
- /**
106
- * new Deflate(options)
107
- * - options (Object): zlib deflate options.
108
- *
109
- * Creates new deflator instance with specified params. Throws exception
110
- * on bad params. Supported options:
111
- *
112
- * - `level`
113
- * - `windowBits`
114
- * - `memLevel`
115
- * - `strategy`
116
- * - `dictionary`
117
- *
118
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
119
- * for more information on these.
120
- *
121
- * Additional options, for internal needs:
122
- *
123
- * - `chunkSize` - size of generated data chunks (16K by default)
124
- * - `raw` (Boolean) - do raw deflate
125
- * - `gzip` (Boolean) - create gzip wrapper
126
- * - `header` (Object) - custom header for gzip
127
- * - `text` (Boolean) - true if compressed data believed to be text
128
- * - `time` (Number) - modification time, unix timestamp
129
- * - `os` (Number) - operation system code
130
- * - `extra` (Array) - array of bytes with extra data (max 65536)
131
- * - `name` (String) - file name (binary string)
132
- * - `comment` (String) - comment (binary string)
133
- * - `hcrc` (Boolean) - true if header crc should be added
134
- *
135
- * ##### Example:
136
- *
137
- * ```javascript
138
- * const pako = require('pako')
139
- * , chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])
140
- * , chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);
141
- *
142
- * const deflate = new pako.Deflate({ level: 3});
143
- *
144
- * deflate.push(chunk1, false);
145
- * deflate.push(chunk2, true); // true -> last chunk
146
- *
147
- * if (deflate.err) { throw new Error(deflate.err); }
148
- *
149
- * console.log(deflate.result);
150
- * ```
151
- **/
152
- constructor(options: any);
153
- options: any;
154
- err: number;
155
- msg: string;
156
- ended: boolean;
157
- chunks: any[];
158
- strm: any;
159
- _dict_set: boolean | undefined;
160
- /**
161
- * Deflate#push(data[, flush_mode]) -> Boolean
162
- * - data (Uint8Array|ArrayBuffer|String): input data. Strings will be
163
- * converted to utf8 byte sequence.
164
- * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE modes.
165
- * See constants. Skipped or `false` means Z_NO_FLUSH, `true` means Z_FINISH.
166
- *
167
- * Sends input data to deflate pipe, generating [[Deflate#onData]] calls with
168
- * new compressed chunks. Returns `true` on success. The last data block must
169
- * have `flush_mode` Z_FINISH (or `true`). That will flush internal pending
170
- * buffers and call [[Deflate#onEnd]].
171
- *
172
- * On fail call [[Deflate#onEnd]] with error code and return false.
173
- *
174
- * ##### Example
175
- *
176
- * ```javascript
177
- * push(chunk, false); // push one of data chunks
178
- * ...
179
- * push(chunk, true); // push last chunk
180
- * ```
181
- **/
182
- push(data: any, flush_mode: any): boolean;
183
- /**
184
- * Deflate#onData(chunk) -> Void
185
- * - chunk (Uint8Array): output data.
186
- *
187
- * By default, stores data blocks in `chunks[]` property and glue
188
- * those in `onEnd`. Override this handler, if you need another behaviour.
189
- **/
190
- onData(chunk: any): void;
191
- /**
192
- * Deflate#onEnd(status) -> Void
193
- * - status (Number): deflate status. 0 (Z_OK) on success,
194
- * other if not.
195
- *
196
- * Called once after you tell deflate that the input stream is
197
- * complete (Z_FINISH). By default - join collected chunks,
198
- * free memory and fill `results` / `err` properties.
199
- **/
200
- onEnd(status: any): void;
201
- result: any;
202
- }
203
- export function deflate(strm: any, flush: any): any;
204
- /**
205
- * deflateRaw(data[, options]) -> Uint8Array
206
- * - data (Uint8Array|ArrayBuffer|String): input data to compress.
207
- * - options (Object): zlib deflate options.
208
- *
209
- * The same as [[deflate]], but creates raw data, without wrapper
210
- * (header and adler32 crc).
211
- **/
212
- export function deflateRaw(input: any, options: any): any;
213
- /**
214
- * gzip(data[, options]) -> Uint8Array
215
- * - data (Uint8Array|ArrayBuffer|String): input data to compress.
216
- * - options (Object): zlib deflate options.
217
- *
218
- * The same as [[deflate]], but create gzip wrapper instead of
219
- * deflate one.
220
- **/
221
- export function gzip(input: any, options: any): any;
222
- /**
223
- * class Inflate
224
- *
225
- * Generic JS-style wrapper for zlib calls. If you don't need
226
- * streaming behaviour - use more simple functions: [[inflate]]
227
- * and [[inflateRaw]].
228
- **/
229
- /**
230
- * Inflate.result -> Uint8Array|String
231
- *
232
- * Uncompressed result, generated by default [[Inflate#onData]]
233
- * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
234
- * (call [[Inflate#push]] with `Z_FINISH` / `true` param).
235
- **/
236
- /**
237
- * Inflate.err -> Number
238
- *
239
- * Error code after inflate finished. 0 (Z_OK) on success.
240
- * Should be checked if broken data possible.
241
- **/
242
- /**
243
- * Inflate.msg -> String
244
- *
245
- * Error message, if [[Inflate.err]] != 0
246
- **/
247
- /**
248
- * new Inflate(options)
249
- * - options (Object): zlib inflate options.
250
- *
251
- * Creates new inflator instance with specified params. Throws exception
252
- * on bad params. Supported options:
253
- *
254
- * - `windowBits`
255
- * - `dictionary`
256
- *
257
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
258
- * for more information on these.
259
- *
260
- * Additional options, for internal needs:
261
- *
262
- * - `chunkSize` - size of generated data chunks (16K by default)
263
- * - `raw` (Boolean) - do raw inflate
264
- * - `to` (String) - if equal to 'string', then result will be converted
265
- * from utf8 to utf16 (javascript) string. When string output requested,
266
- * chunk length can differ from `chunkSize`, depending on content.
267
- *
268
- * By default, when no options set, autodetect deflate/gzip data format via
269
- * wrapper header.
270
- *
271
- * ##### Example:
272
- *
273
- * ```javascript
274
- * const pako = require('pako')
275
- * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])
276
- * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);
277
- *
278
- * const inflate = new pako.Inflate({ level: 3});
279
- *
280
- * inflate.push(chunk1, false);
281
- * inflate.push(chunk2, true); // true -> last chunk
282
- *
283
- * if (inflate.err) { throw new Error(inflate.err); }
284
- *
285
- * console.log(inflate.result);
286
- * ```
287
- **/
288
- export function Inflate(options: any): void;
289
- export class Inflate {
290
- /**
291
- * class Inflate
292
- *
293
- * Generic JS-style wrapper for zlib calls. If you don't need
294
- * streaming behaviour - use more simple functions: [[inflate]]
295
- * and [[inflateRaw]].
296
- **/
297
- /**
298
- * Inflate.result -> Uint8Array|String
299
- *
300
- * Uncompressed result, generated by default [[Inflate#onData]]
301
- * and [[Inflate#onEnd]] handlers. Filled after you push last chunk
302
- * (call [[Inflate#push]] with `Z_FINISH` / `true` param).
303
- **/
304
- /**
305
- * Inflate.err -> Number
306
- *
307
- * Error code after inflate finished. 0 (Z_OK) on success.
308
- * Should be checked if broken data possible.
309
- **/
310
- /**
311
- * Inflate.msg -> String
312
- *
313
- * Error message, if [[Inflate.err]] != 0
314
- **/
315
- /**
316
- * new Inflate(options)
317
- * - options (Object): zlib inflate options.
318
- *
319
- * Creates new inflator instance with specified params. Throws exception
320
- * on bad params. Supported options:
321
- *
322
- * - `windowBits`
323
- * - `dictionary`
324
- *
325
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
326
- * for more information on these.
327
- *
328
- * Additional options, for internal needs:
329
- *
330
- * - `chunkSize` - size of generated data chunks (16K by default)
331
- * - `raw` (Boolean) - do raw inflate
332
- * - `to` (String) - if equal to 'string', then result will be converted
333
- * from utf8 to utf16 (javascript) string. When string output requested,
334
- * chunk length can differ from `chunkSize`, depending on content.
335
- *
336
- * By default, when no options set, autodetect deflate/gzip data format via
337
- * wrapper header.
338
- *
339
- * ##### Example:
340
- *
341
- * ```javascript
342
- * const pako = require('pako')
343
- * const chunk1 = new Uint8Array([1,2,3,4,5,6,7,8,9])
344
- * const chunk2 = new Uint8Array([10,11,12,13,14,15,16,17,18,19]);
345
- *
346
- * const inflate = new pako.Inflate({ level: 3});
347
- *
348
- * inflate.push(chunk1, false);
349
- * inflate.push(chunk2, true); // true -> last chunk
350
- *
351
- * if (inflate.err) { throw new Error(inflate.err); }
352
- *
353
- * console.log(inflate.result);
354
- * ```
355
- **/
356
- constructor(options: any);
357
- options: any;
358
- err: number;
359
- msg: string;
360
- ended: boolean;
361
- chunks: any[];
362
- strm: any;
363
- header: any;
364
- /**
365
- * Inflate#push(data[, flush_mode]) -> Boolean
366
- * - data (Uint8Array|ArrayBuffer): input data
367
- * - flush_mode (Number|Boolean): 0..6 for corresponding Z_NO_FLUSH..Z_TREE
368
- * flush modes. See constants. Skipped or `false` means Z_NO_FLUSH,
369
- * `true` means Z_FINISH.
370
- *
371
- * Sends input data to inflate pipe, generating [[Inflate#onData]] calls with
372
- * new output chunks. Returns `true` on success. If end of stream detected,
373
- * [[Inflate#onEnd]] will be called.
374
- *
375
- * `flush_mode` is not needed for normal operation, because end of stream
376
- * detected automatically. You may try to use it for advanced things, but
377
- * this functionality was not tested.
378
- *
379
- * On fail call [[Inflate#onEnd]] with error code and return false.
380
- *
381
- * ##### Example
382
- *
383
- * ```javascript
384
- * push(chunk, false); // push one of data chunks
385
- * ...
386
- * push(chunk, true); // push last chunk
387
- * ```
388
- **/
389
- push(data: any, flush_mode: any): boolean;
390
- /**
391
- * Inflate#onData(chunk) -> Void
392
- * - chunk (Uint8Array|String): output data. When string output requested,
393
- * each chunk will be string.
394
- *
395
- * By default, stores data blocks in `chunks[]` property and glue
396
- * those in `onEnd`. Override this handler, if you need another behaviour.
397
- **/
398
- onData(chunk: any): void;
399
- /**
400
- * Inflate#onEnd(status) -> Void
401
- * - status (Number): inflate status. 0 (Z_OK) on success,
402
- * other if not.
403
- *
404
- * Called either after you tell inflate that the input stream is
405
- * complete (Z_FINISH). By default - join collected chunks,
406
- * free memory and fill `results` / `err` properties.
407
- **/
408
- onEnd(status: any): void;
409
- result: any;
410
- }
411
- export function inflate(strm: any, flush: any): any;
412
- /**
413
- * inflateRaw(data[, options]) -> Uint8Array|String
414
- * - data (Uint8Array|ArrayBuffer): input data to decompress.
415
- * - options (Object): zlib inflate options.
416
- *
417
- * The same as [[inflate]], but creates raw data, without wrapper
418
- * (header and adler32 crc).
419
- **/
420
- export function inflateRaw(input: any, options: any): any;
421
- /**
422
- * inflate(data[, options]) -> Uint8Array|String
423
- * - data (Uint8Array|ArrayBuffer): input data to decompress.
424
- * - options (Object): zlib inflate options.
425
- *
426
- * Decompress `data` with inflate/ungzip and `options`. Autodetect
427
- * format via wrapper header by default. That's why we don't provide
428
- * separate `ungzip` method.
429
- *
430
- * Supported options are:
431
- *
432
- * - windowBits
433
- *
434
- * [http://zlib.net/manual.html#Advanced](http://zlib.net/manual.html#Advanced)
435
- * for more information.
436
- *
437
- * Sugar (options):
438
- *
439
- * - `raw` (Boolean) - say that we work with raw stream, if you don't wish to specify
440
- * negative windowBits implicitly.
441
- * - `to` (String) - if equal to 'string', then result will be converted
442
- * from utf8 to utf16 (javascript) string. When string output requested,
443
- * chunk length can differ from `chunkSize`, depending on content.
444
- *
445
- *
446
- * ##### Example:
447
- *
448
- * ```javascript
449
- * const pako = require('pako');
450
- * const input = pako.deflate(new Uint8Array([1,2,3,4,5,6,7,8,9]));
451
- * let output;
452
- *
453
- * try {
454
- * output = pako.inflate(input);
455
- * } catch (err) {
456
- * console.log(err);
457
- * }
458
- * ```
459
- **/
460
- declare function inflate_1(input: any, options: any): any;
461
- export const constants: any;
462
- export function assign(obj: any, ...args: any[]): any;
463
- export function flattenChunks(chunks: any): Uint8Array<ArrayBuffer>;
464
- export function string2buf(str: any): Uint8Array<ArrayBufferLike>;
465
- export function buf2string(buf: any, max: any): string;
466
- export function utf8border(buf: any, max: any): any;
467
- export function deflateInit(strm: any, level: any): any;
468
- export function deflateInit2(strm: any, level: any, method: any, windowBits: any, memLevel: any, strategy: any): any;
469
- export function deflateReset(strm: any): any;
470
- export function deflateResetKeep(strm: any): any;
471
- export function deflateSetHeader(strm: any, head: any): any;
472
- export function deflateEnd(strm: any): any;
473
- export function deflateSetDictionary(strm: any, dictionary: any): any;
474
- export const deflateInfo: "pako deflate (from Nodeca project)";
475
- export function inflateReset(strm: any): any;
476
- export function inflateReset2(strm: any, windowBits: any): any;
477
- export function inflateResetKeep(strm: any): any;
478
- export function inflateInit(strm: any): any;
479
- export function inflateInit2(strm: any, windowBits: any): any;
480
- export function inflateEnd(strm: any): any;
481
- export function inflateGetHeader(strm: any, head: any): any;
482
- export function inflateSetDictionary(strm: any, dictionary: any): any;
483
- export const inflateInfo: "pako inflate (from Nodeca project)";
484
- export function _tr_init(s: any): void;
485
- export function _tr_stored_block(s: any, buf: any, stored_len: any, last: any): void;
486
- export function _tr_flush_block(s: any, buf: any, stored_len: any, last: any): void;
487
- export function _tr_tally(s: any, dist: any, lc: any): boolean;
488
- export function _tr_align(s: any): void;
489
- export function init_log_level(level: string): void;
490
- export function build_info(): any;
491
- /**
492
- * Compiles a Noir project
493
- *
494
- * @param fileManager - The file manager to use
495
- * @param projectPath - The path to the project inside the file manager. Defaults to the root of the file manager
496
- * @param logFn - A logging function. If not provided, console.log will be used
497
- * @param debugLogFn - A debug logging function. If not provided, logFn will be used
498
- *
499
- * @example
500
- * ```typescript
501
- * // Node.js
502
- *
503
- * import { compile_program, createFileManager } from '@noir-lang/noir_wasm';
504
- *
505
- * const fm = createFileManager(myProjectPath);
506
- * const myCompiledCode = await compile_program(fm);
507
- * ```
508
- *
509
- * ```typescript
510
- * // Browser
511
- *
512
- * import { compile_program, createFileManager } from '@noir-lang/noir_wasm';
513
- *
514
- * const fm = createFileManager('/');
515
- * for (const path of files) {
516
- * await fm.writeFile(path, await getFileAsStream(path));
517
- * }
518
- * const myCompiledCode = await compile_program(fm);
519
- * ```
520
- */
521
- export function compile_program(fileManager: any, projectPath: any, logFn: any, debugLogFn: any): Promise<any>;
522
- /**
523
- * Compiles a Noir project
524
- *
525
- * @param fileManager - The file manager to use
526
- * @param projectPath - The path to the project inside the file manager. Defaults to the root of the file manager
527
- * @param logFn - A logging function. If not provided, console.log will be used
528
- * @param debugLogFn - A debug logging function. If not provided, logFn will be used
529
- *
530
- * @example
531
- * ```typescript
532
- * // Node.js
533
- *
534
- * import { compile_contract, createFileManager } from '@noir-lang/noir_wasm';
535
- *
536
- * const fm = createFileManager(myProjectPath);
537
- * const myCompiledCode = await compile_contract(fm);
538
- * ```
539
- *
540
- * ```typescript
541
- * // Browser
542
- *
543
- * import { compile_contract, createFileManager } from '@noir-lang/noir_wasm';
544
- *
545
- * const fm = createFileManager('/');
546
- * for (const path of files) {
547
- * await fm.writeFile(path, await getFileAsStream(path));
548
- * }
549
- * const myCompiledCode = await compile_contract(fm);
550
- * ```
551
- */
552
- export function compile_contract(fileManager: any, projectPath: any, logFn: any, debugLogFn: any): Promise<any>;
553
- export function compile_program_(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: {
554
- __destroy_into_raw(): number;
555
- __wbg_ptr: number;
556
- free(): void;
557
- /**
558
- * @param {string} path
559
- * @param {string} source_code
560
- * @returns {boolean}
561
- */
562
- add_source_code(path: string, source_code: string): boolean;
563
- }): ProgramCompileResult;
564
- export function compile_contract_(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: {
565
- __destroy_into_raw(): number;
566
- __wbg_ptr: number;
567
- free(): void;
568
- /**
569
- * @param {string} path
570
- * @param {string} source_code
571
- * @returns {boolean}
572
- */
573
- add_source_code(path: string, source_code: string): boolean;
574
- }): ContractCompileResult;
575
- /**
576
- * This is a wrapper class that is wasm-bindgen compatible
577
- * We do not use js_name and rename it like CrateId because
578
- * then the impl block is not picked up in javascript.
579
- */
580
- export class CompilerContext {
581
- /**
582
- * @param {PathToFileSourceMap} source_map
583
- */
584
- constructor(source_map: {
585
- __destroy_into_raw(): number;
586
- __wbg_ptr: number;
587
- free(): void;
588
- /**
589
- * @param {string} path
590
- * @param {string} source_code
591
- * @returns {boolean}
592
- */
593
- add_source_code(path: string, source_code: string): boolean;
594
- });
595
- __destroy_into_raw(): number;
596
- __wbg_ptr: number;
597
- free(): void;
598
- /**
599
- * @param {string} path_to_crate
600
- * @returns {CrateId}
601
- */
602
- process_root_crate(path_to_crate: string): {
603
- __destroy_into_raw(): number | undefined;
604
- __wbg_ptr: number | undefined;
605
- free(): void;
606
- };
607
- /**
608
- * @param {string} path_to_crate
609
- * @returns {CrateId}
610
- */
611
- process_dependency_crate(path_to_crate: string): {
612
- __destroy_into_raw(): number | undefined;
613
- __wbg_ptr: number | undefined;
614
- free(): void;
615
- };
616
- /**
617
- * @param {string} crate_name
618
- * @param {CrateId} from
619
- * @param {CrateId} to
620
- */
621
- add_dependency_edge(crate_name: string, from: {
622
- __destroy_into_raw(): number | undefined;
623
- __wbg_ptr: number | undefined;
624
- free(): void;
625
- }, to: {
626
- __destroy_into_raw(): number | undefined;
627
- __wbg_ptr: number | undefined;
628
- free(): void;
629
- }): void;
630
- /**
631
- * @param {number} program_width
632
- * @returns {ProgramCompileResult}
633
- */
634
- compile_program(program_width: number): ProgramCompileResult;
635
- /**
636
- * @param {number} program_width
637
- * @returns {ContractCompileResult}
638
- */
639
- compile_contract(program_width: number): ContractCompileResult;
640
- }
641
- export class CrateId {
642
- static __wrap(ptr: any): any;
643
- __destroy_into_raw(): number | undefined;
644
- __wbg_ptr: number | undefined;
645
- free(): void;
646
- }
647
- /**
648
- * This map contains the paths of all of the files in the entry-point crate and
649
- * the transitive dependencies of the entry-point crate.
650
- *
651
- * This is for all intents and purposes the file system that the compiler will use to resolve/compile
652
- * files in the crate being compiled and its dependencies.
653
- *
654
- * Using a `BTreeMap` to add files to the [FileManager] in a deterministic order,
655
- * which affects the `FileId` in the `Location`s in the AST on which the `hash` is based.
656
- * Note that we cannot expect to match the IDs assigned by the `FileManager` used by `nargo`,
657
- * because there the order is determined by the dependency graph as well as the file name.
658
- */
659
- export class PathToFileSourceMap {
660
- __destroy_into_raw(): number;
661
- __wbg_ptr: number;
662
- free(): void;
663
- /**
664
- * @param {string} path
665
- * @param {string} source_code
666
- * @returns {boolean}
667
- */
668
- add_source_code(path: string, source_code: string): boolean;
669
- }
670
- export function __wbg_constructor_19c0594083ed2726(): Object;
671
- export function __wbg_constructor_ca2c405af0a3dc0e(arg0: any): Error;
672
- export function __wbg_constructor_f854babd177fb6a7(): Object;
673
- export function __wbg_debug_3cb59063b29f58c1(arg0: any): void;
674
- export function __wbg_debug_e17b51583ca6a632(arg0: any, arg1: any, arg2: any, arg3: any): void;
675
- export function __wbg_error_524f506f44df1645(arg0: any): void;
676
- export function __wbg_error_7534b8e9a36f1ab4(arg0: any, arg1: any): void;
677
- export function __wbg_error_80de38b3f7cc3c3c(arg0: any, arg1: any, arg2: any, arg3: any): void;
678
- export function __wbg_getTime_46267b1c24877e30(arg0: any): any;
679
- export function __wbg_info_033d8b8a0838f1d3(arg0: any, arg1: any, arg2: any, arg3: any): void;
680
- export function __wbg_info_3daf2e093e091b66(arg0: any): void;
681
- export function __wbg_new0_f788a2397c7ca929(): Date;
682
- export function __wbg_new_8a6f238a6ece86ea(): Error;
683
- export function __wbg_parse_def2e24ef1252aff(...args: any[]): any;
684
- export function __wbg_set_bb8cecf6a62b9f46(...args: any[]): any;
685
- export function __wbg_stack_0ed75d68575b0f3c(arg0: any, arg1: any): void;
686
- export function __wbg_stringify_f7ed6987935b4a24(...args: any[]): any;
687
- export function __wbg_warn_4ca3906c248c47c4(arg0: any): void;
688
- export function __wbg_warn_aaf1f4664a035bd6(arg0: any, arg1: any, arg2: any, arg3: any): void;
689
- export function __wbindgen_debug_string(arg0: any, arg1: any): void;
690
- export function __wbindgen_init_externref_table(): void;
691
- export function __wbindgen_is_undefined(arg0: any): boolean;
692
- export function __wbindgen_string_get(arg0: any, arg1: any): void;
693
- export function __wbindgen_string_new(arg0: any, arg1: any): any;
694
- export function __wbindgen_throw(arg0: any, arg1: any): never;
695
- declare let wasm: any;
696
- export const __esModule: boolean;
697
- /**
698
- * Decompresses and decodes the debug symbols
699
- * @param debugSymbols - The base64 encoded debug symbols
700
- */
701
- export function inflateDebugSymbols(debugSymbols: any): any;
702
- /**
703
- * Noir Dependency Resolver
704
- */
705
- export class DependencyManager {
706
- /**
707
- * Creates a new dependency resolver
708
- * @param resolvers - A list of dependency resolvers to use
709
- * @param entryPoint - The entry point of the project
710
- */
711
- constructor(resolvers: any[] | undefined, entryPoint: any);
712
- /**
713
- * Gets dependencies for the entry point
714
- */
715
- getEntrypointDependencies(): any;
716
- /**
717
- * Get transitive libraries used by the package
718
- */
719
- getLibraries(): [any, any][];
720
- /**
721
- * A map of library dependencies
722
- */
723
- getLibraryDependencies(): any;
724
- /**
725
- * Resolves dependencies for a package.
726
- */
727
- resolveDependencies(): Promise<void>;
728
- /**
729
- * Gets the version of a dependency in the dependency tree
730
- * @param name - Dependency name
731
- * @returns The dependency's version
732
- */
733
- getVersionOf(name: any): any;
734
- /**
735
- * Gets the names of the crates in this dependency list
736
- */
737
- getPackageNames(): any[];
738
- /**
739
- * Looks up a dependency
740
- * @param sourceId - The source being resolved
741
- * @returns The path to the resolved file
742
- */
743
- findFile(sourceId: any): any;
744
- #private;
745
- }
746
- /**
747
- * Returns a safe filename for a value
748
- * @param val - The value to convert
749
- */
750
- export function safeFilename(val: any): any;
751
- /**
752
- * Resolves a dependency's archive URL.
753
- * @param dependency - The dependency configuration
754
- * @returns The URL to the library archive
755
- */
756
- export function resolveGithubCodeArchive(dependency: any, format: any): URL;
757
- /**
758
- * Downloads dependencies from github
759
- */
760
- export class GithubDependencyResolver {
761
- constructor(fm: any, fetcher: any);
762
- /**
763
- * Resolves a dependency from github. Returns null if URL is for a different website.
764
- * @param _pkg - The package to resolve the dependency for
765
- * @param dependency - The dependency configuration
766
- * @returns asd
767
- */
768
- resolveDependency(_pkg: any, dependency: any): Promise<{
769
- version: any;
770
- package: any;
771
- } | null>;
772
- #private;
773
- }
774
- /**
775
- * Resolves dependencies on-disk, relative to current package
776
- */
777
- export class LocalDependencyResolver {
778
- constructor(fm: any);
779
- resolveDependency(parent: any, config: any): Promise<{
780
- version: undefined;
781
- package: any;
782
- } | null>;
783
- #private;
784
- }
785
- /**
786
- * A file manager that writes file to a specific directory but reads globally.
787
- */
788
- export class FileManager {
789
- constructor(fs: any, dataDir: any);
790
- /**
791
- * Returns the data directory
792
- */
793
- getDataDir(): any;
794
- /**
795
- * Saves a file to the data directory.
796
- * @param name - File to save
797
- * @param stream - File contents
798
- */
799
- writeFile(name: any, stream: any): Promise<void>;
800
- /**
801
- * Reads a file from the filesystem and returns a buffer
802
- * Saves a file to the data directory.
803
- * @param oldName - File to save
804
- * @param newName - File contents
805
- */
806
- moveFile(oldName: any, newName: any): Promise<void>;
807
- /**
808
- * Reads a file from the filesystem
809
- * @param name - File to read
810
- * @param encoding - Encoding to use
811
- */
812
- readFile(name: any, encoding: any): Promise<any>;
813
- /**
814
- * Checks if a file exists and is accessible
815
- * @param name - File to check
816
- */
817
- hasFileSync(name: any): any;
818
- /**
819
- * Reads a file from the filesystem
820
- * @param dir - File to read
821
- * @param options - Readdir options
822
- */
823
- readdir(dir: any, options: any): Promise<any>;
824
- #private;
825
- }
826
- export function readdirRecursive(dir: any): any;
827
- /**
828
- * Creates a new FileManager instance based on fs in node and memfs in the browser (via webpack alias)
829
- *
830
- * @param dataDir - root of the file system
831
- */
832
- export function createNodejsFileManager(dataDir: any): any;
833
- /**
834
- * Noir Package Compiler
835
- */
836
- export class NoirWasmCompiler {
837
- /**
838
- * Creates a new compiler instance.
839
- * @param fileManager - The file manager to use
840
- * @param projectPath - The path to the project
841
- * @param opts - Compilation options
842
- */
843
- static "new"(fileManager: any, projectPath: any, wasmCompiler: any, sourceMap: any, opts: any): Promise<{
844
- "__#6982@#log": any;
845
- "__#6982@#debugLog": any;
846
- "__#6982@#package": any;
847
- "__#6982@#wasmCompiler": any;
848
- "__#6982@#sourceMap": any;
849
- "__#6982@#fm": any;
850
- "__#6982@#dependencyManager": any;
851
- /**
852
- * Compile EntryPoint
853
- */
854
- compile_program(): Promise<any>;
855
- /**
856
- * Compile EntryPoint
857
- */
858
- compile_contract(): Promise<any>;
859
- "__#6982@#resolveFile"(path: any): Promise<any>;
860
- "__#6982@#processCompileError"(err: any): Promise<string[]>;
861
- }>;
862
- constructor(entrypoint: any, dependencyManager: any, fileManager: any, wasmCompiler: any, sourceMap: any, opts: any);
863
- /**
864
- * Compile EntryPoint
865
- */
866
- compile_program(): Promise<any>;
867
- /**
868
- * Compile EntryPoint
869
- */
870
- compile_contract(): Promise<any>;
871
- #private;
872
- }
873
- /**
874
- * A Noir package.
875
- */
876
- export class Package {
877
- /**
878
- * Opens a path on the filesystem.
879
- * @param path - Path to the package.
880
- * @param fm - A file manager to use.
881
- * @returns The Noir package at the given location
882
- */
883
- static open(path: any, fm: any): Promise<{
884
- "__#6983@#packagePath": any;
885
- "__#6983@#srcPath": any;
886
- "__#6983@#config": any;
887
- /**
888
- * Gets this package's path.
889
- */
890
- getPackagePath(): any;
891
- /**
892
- * Gets this package's Nargo.toml (NoirPackage)Config.
893
- */
894
- getPackageConfig(): any;
895
- /**
896
- * The path to the source directory.
897
- */
898
- getSrcPath(): any;
899
- /**
900
- * Gets the entrypoint path for this package.
901
- */
902
- getEntryPointPath(): any;
903
- /**
904
- * Gets the project type
905
- */
906
- getType(): any;
907
- /**
908
- * Gets this package's dependencies.
909
- */
910
- getDependencies(): any;
911
- /**
912
- * Gets this package's sources.
913
- * @param fm - A file manager to use
914
- * @param alias - An alias for the sources, if this package is a dependency
915
- */
916
- getSources(fm: any, alias: any): Promise<any[]>;
917
- }>;
918
- constructor(path: any, srcDir: any, config: any);
919
- /**
920
- * Gets this package's path.
921
- */
922
- getPackagePath(): any;
923
- /**
924
- * Gets this package's Nargo.toml (NoirPackage)Config.
925
- */
926
- getPackageConfig(): any;
927
- /**
928
- * The path to the source directory.
929
- */
930
- getSrcPath(): any;
931
- /**
932
- * Gets the entrypoint path for this package.
933
- */
934
- getEntryPointPath(): any;
935
- /**
936
- * Gets the project type
937
- */
938
- getType(): any;
939
- /**
940
- * Gets this package's dependencies.
941
- */
942
- getDependencies(): any;
943
- /**
944
- * Gets this package's sources.
945
- * @param fm - A file manager to use
946
- * @param alias - An alias for the sources, if this package is a dependency
947
- */
948
- getSources(fm: any, alias: any): Promise<any[]>;
949
- #private;
950
- }
951
- /**
952
- * Checks that an object is a package configuration.
953
- * @param config - Config to check
954
- */
955
- export function parseNoirPackageConfig(config: any): any;
956
- export const createFileManager: any;
957
- export { exports as default, inflate_1 as ungzip, wasm as __wasm, compile_program as compile };