@noir-lang/noir_wasm 0.23.0-5e3c0f1.nightly → 0.23.0-746b0c7.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.
@@ -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;