@noir-lang/noir_wasm 0.23.0-f466fa1.nightly → 0.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,9 @@ export function compile_(entry_point: string, contracts: boolean | undefined, de
3
3
  export function init_log_level(filter: string): void;
4
4
  export function build_info(): any;
5
5
  export function __wbindgen_object_drop_ref(arg0: any): void;
6
- export function __wbg_constructor_28ca684b2f9696ac(...args: any[]): any;
6
+ export function __wbg_constructor_05d6d198f3477d6f(...args: any[]): any;
7
7
  export function __wbindgen_is_undefined(arg0: any): boolean;
8
- export function __wbg_constructor_287b714b768ecf13(...args: any[]): any;
8
+ export function __wbg_constructor_e8767839abf8a966(...args: any[]): any;
9
9
  export function __wbg_new_abda76e883ba8a5f(...args: any[]): any;
10
10
  export function __wbg_stack_658279fe44541cf6(...args: any[]): any;
11
11
  export function __wbg_error_f851667af71bcfc6(...args: any[]): any;
@@ -3,6 +3,36 @@ import { createNodejsFileManager } from './noir/file-manager/nodejs-file-manager
3
3
  import { LogFn } from './utils';
4
4
  import { CompilationResult } from './types/noir_artifact';
5
5
  import { inflateDebugSymbols } from './noir/debug';
6
+ /**
7
+ * Compiles a Noir project
8
+ *
9
+ * @param fileManager - The file manager to use
10
+ * @param projectPath - The path to the project inside the file manager. Defaults to the root of the file manager
11
+ * @param logFn - A logging function. If not provided, console.log will be used
12
+ * @param debugLogFn - A debug logging function. If not provided, logFn will be used
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * // Node.js
17
+ *
18
+ * import { compile, createFileManager } from '@noir-lang/noir_wasm';
19
+ *
20
+ * const fm = createFileManager(myProjectPath);
21
+ * const myCompiledCode = await compile(fm);
22
+ * ```
23
+ *
24
+ * ```typescript
25
+ * // Browser
26
+ *
27
+ * import { compile, createFileManager } from '@noir-lang/noir_wasm';
28
+ *
29
+ * const fm = createFileManager('/');
30
+ * for (const path of files) {
31
+ * await fm.writeFile(path, await getFileAsStream(path));
32
+ * }
33
+ * const myCompiledCode = await compile(fm);
34
+ * ```
35
+ */
6
36
  declare function compile(fileManager: FileManager, projectPath?: string, logFn?: LogFn, debugLogFn?: LogFn): Promise<CompilationResult>;
7
37
  declare const createFileManager: typeof createNodejsFileManager;
8
38
  export { compile, createFileManager, inflateDebugSymbols, CompilationResult };
@@ -3,6 +3,36 @@ import { createNodejsFileManager } from './noir/file-manager/nodejs-file-manager
3
3
  import { LogFn } from './utils';
4
4
  import { CompilationResult } from './types/noir_artifact';
5
5
  import { inflateDebugSymbols } from './noir/debug';
6
+ /**
7
+ * Compiles a Noir project
8
+ *
9
+ * @param fileManager - The file manager to use
10
+ * @param projectPath - The path to the project inside the file manager. Defaults to the root of the file manager
11
+ * @param logFn - A logging function. If not provided, console.log will be used
12
+ * @param debugLogFn - A debug logging function. If not provided, logFn will be used
13
+ *
14
+ * @example
15
+ * ```typescript
16
+ * // Node.js
17
+ *
18
+ * import { compile, createFileManager } from '@noir-lang/noir_wasm';
19
+ *
20
+ * const fm = createFileManager(myProjectPath);
21
+ * const myCompiledCode = await compile(fm);
22
+ * ```
23
+ *
24
+ * ```typescript
25
+ * // Browser
26
+ *
27
+ * import { compile, createFileManager } from '@noir-lang/noir_wasm';
28
+ *
29
+ * const fm = createFileManager('/');
30
+ * for (const path of files) {
31
+ * await fm.writeFile(path, await getFileAsStream(path));
32
+ * }
33
+ * const myCompiledCode = await compile(fm);
34
+ * ```
35
+ */
6
36
  declare function compile(fileManager: FileManager, projectPath?: string, logFn?: LogFn, debugLogFn?: LogFn): Promise<CompilationResult>;
7
37
  declare const createFileManager: typeof createNodejsFileManager;
8
38
  export { compile, createFileManager, inflateDebugSymbols, CompilationResult };
@@ -1,2 +1,5 @@
1
- /** Decompresses and decodes the debug symbols */
1
+ /**
2
+ * Decompresses and decodes the debug symbols
3
+ * @param debugSymbols - The base64 encoded debug symbols
4
+ */
2
5
  export declare function inflateDebugSymbols(debugSymbols: string): any;
@@ -1,7 +1,8 @@
1
1
  import { FileManager } from './file-manager';
2
2
  export declare function readdirRecursive(dir: string): Promise<string[]>;
3
3
  /**
4
- * Creates a new FileManager instance based on nodejs fs
5
- * @param dataDir - where to store files
4
+ * Creates a new FileManager instance based on fs in node and memfs in the browser (via webpack alias)
5
+ *
6
+ * @param dataDir - root of the file system
6
7
  */
7
8
  export declare function createNodejsFileManager(dataDir: string): FileManager;
@@ -1,4 +1,4 @@
1
- import { Abi, AbiType } from '@noir-lang/noirc_abi';
1
+ import { Abi, AbiType } from '@noir-lang/types';
2
2
  /**
3
3
  * A named type.
4
4
  */