@noir-lang/noir_wasm 0.23.0-682b159.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.
- package/README.md +24 -1
- package/dist/node/index_bg.wasm +0 -0
- package/dist/node/main.js +37 -3
- package/dist/node/main.js.map +1 -1
- package/dist/types/src/index.d.cts +30 -0
- package/dist/types/src/index.d.mts +30 -0
- package/dist/types/src/noir/debug.d.ts +4 -1
- package/dist/types/src/noir/file-manager/nodejs-file-manager.d.ts +3 -2
- package/dist/web/main.mjs +38 -4
- package/dist/web/main.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -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,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
|
|
5
|
-
*
|
|
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;
|