@noir-lang/noir_wasm
Advanced tools
Comparing version 0.16.0-88682da to 0.16.0-d4f61d3.nightly
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function __wbg_compileerror_free(a: number): void; | ||
export function __wbg_get_compileerror_message(a: number): number; | ||
export function __wbg_set_compileerror_message(a: number, b: number): void; | ||
export function __wbg_get_compileerror_diagnostics(a: number): number; | ||
export function __wbg_set_compileerror_diagnostics(a: number, b: number): void; | ||
export function init_log_level(a: number, b: number): void; | ||
export function build_info(): number; | ||
export function acir_read_bytes(a: number, b: number): number; | ||
export function acir_write_bytes(a: number, b: number): void; | ||
export function init_log_level(a: number, b: number): void; | ||
export function build_info(): number; | ||
export function compile(a: number, b: number, c: number, d: number, e: number): void; | ||
@@ -9,0 +14,0 @@ export function __wbindgen_export_0(a: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
/** | ||
* @param {Uint8Array} bytes | ||
@@ -14,10 +22,2 @@ * @returns {any} | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
/** | ||
* @param {string} entry_point | ||
@@ -30,4 +30,27 @@ * @param {boolean | undefined} contracts | ||
export type CompileError = Error; | ||
export type Diagnostic = { | ||
message: string; | ||
file_path: string; | ||
secondaries: ReadonlyArray<{ | ||
message: string; | ||
start: number; | ||
end: number; | ||
}>; | ||
} | ||
interface CompileError { | ||
diagnostics: ReadonlyArray<Diagnostic>; | ||
} | ||
/** | ||
*/ | ||
export class CompileError { | ||
free(): void; | ||
/** | ||
*/ | ||
diagnostics: any; | ||
/** | ||
*/ | ||
message: string; | ||
} |
@@ -13,2 +13,25 @@ let imports = {}; | ||
let heap_next = heap.length; | ||
function dropObject(idx) { | ||
if (idx < 132) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
@@ -91,16 +114,2 @@ | ||
let heap_next = heap.length; | ||
function dropObject(idx) { | ||
if (idx < 132) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
} | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
@@ -114,12 +123,19 @@ | ||
} | ||
/** | ||
* @param {string} level | ||
*/ | ||
module.exports.init_log_level = function(level) { | ||
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.init_log_level(ptr0, len0); | ||
}; | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
/** | ||
* @returns {any} | ||
*/ | ||
module.exports.build_info = function() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
}; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
function passArray8ToWasm0(arg, malloc) { | ||
@@ -165,19 +181,2 @@ const ptr = malloc(arg.length * 1) >>> 0; | ||
/** | ||
* @param {string} level | ||
*/ | ||
module.exports.init_log_level = function(level) { | ||
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.init_log_level(ptr0, len0); | ||
}; | ||
/** | ||
* @returns {any} | ||
*/ | ||
module.exports.build_info = function() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
}; | ||
/** | ||
* @param {string} entry_point | ||
@@ -213,3 +212,68 @@ * @param {boolean | undefined} contracts | ||
} | ||
/** | ||
*/ | ||
class CompileError { | ||
static __wrap(ptr) { | ||
ptr = ptr >>> 0; | ||
const obj = Object.create(CompileError.prototype); | ||
obj.__wbg_ptr = ptr; | ||
return obj; | ||
} | ||
__destroy_into_raw() { | ||
const ptr = this.__wbg_ptr; | ||
this.__wbg_ptr = 0; | ||
return ptr; | ||
} | ||
free() { | ||
const ptr = this.__destroy_into_raw(); | ||
wasm.__wbg_compileerror_free(ptr); | ||
} | ||
/** | ||
* @returns {string} | ||
*/ | ||
get message() { | ||
const ret = wasm.__wbg_get_compileerror_message(this.__wbg_ptr); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {string} arg0 | ||
*/ | ||
set message(arg0) { | ||
wasm.__wbg_set_compileerror_message(this.__wbg_ptr, addHeapObject(arg0)); | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
get diagnostics() { | ||
const ret = wasm.__wbg_get_compileerror_diagnostics(this.__wbg_ptr); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {any} arg0 | ||
*/ | ||
set diagnostics(arg0) { | ||
wasm.__wbg_set_compileerror_diagnostics(this.__wbg_ptr, addHeapObject(arg0)); | ||
} | ||
} | ||
module.exports.CompileError = CompileError; | ||
module.exports.__wbg_compileerror_new = function(arg0) { | ||
const ret = CompileError.__wrap(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
module.exports.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbindgen_string_get = function(arg0, arg1) { | ||
@@ -224,6 +288,2 @@ const obj = getObject(arg1); | ||
module.exports.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
module.exports.__wbindgen_is_undefined = function(arg0) { | ||
@@ -234,7 +294,2 @@ const ret = getObject(arg0) === undefined; | ||
module.exports.__wbg_constructor_ac1f808f67a5f1e9 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) { | ||
@@ -241,0 +296,0 @@ const ret = read_file(getStringFromWasm0(arg1, arg2)); |
@@ -6,3 +6,3 @@ { | ||
], | ||
"version": "0.16.0-88682da", | ||
"version": "0.16.0-d4f61d3.nightly", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -28,8 +28,10 @@ "main": "./nodejs/noir_wasm.js", | ||
"clean": "chmod u+w web nodejs || true && rm -rf ./nodejs ./web ./target ./result", | ||
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json", | ||
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json", | ||
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish", | ||
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" | ||
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0", | ||
"build:nix": "nix build -L .#noir_wasm", | ||
"install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/noir_wasm/nodejs ./ && cp -rL ./result/noir_wasm/web ./" | ||
}, | ||
"peerDependencies": { | ||
"@noir-lang/source-resolver": "0.16.0-88682da" | ||
"@noir-lang/source-resolver": "0.16.0-d4f61d3.nightly" | ||
}, | ||
@@ -36,0 +38,0 @@ "devDependencies": { |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
export const memory: WebAssembly.Memory; | ||
export function __wbg_compileerror_free(a: number): void; | ||
export function __wbg_get_compileerror_message(a: number): number; | ||
export function __wbg_set_compileerror_message(a: number, b: number): void; | ||
export function __wbg_get_compileerror_diagnostics(a: number): number; | ||
export function __wbg_set_compileerror_diagnostics(a: number, b: number): void; | ||
export function init_log_level(a: number, b: number): void; | ||
export function build_info(): number; | ||
export function acir_read_bytes(a: number, b: number): number; | ||
export function acir_write_bytes(a: number, b: number): void; | ||
export function init_log_level(a: number, b: number): void; | ||
export function build_info(): number; | ||
export function compile(a: number, b: number, c: number, d: number, e: number): void; | ||
@@ -9,0 +14,0 @@ export function __wbindgen_export_0(a: number): number; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
/** | ||
* @param {Uint8Array} bytes | ||
@@ -14,10 +22,2 @@ * @returns {any} | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level: string): void; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info(): any; | ||
/** | ||
* @param {string} entry_point | ||
@@ -30,6 +30,29 @@ * @param {boolean | undefined} contracts | ||
export type CompileError = Error; | ||
export type Diagnostic = { | ||
message: string; | ||
file_path: string; | ||
secondaries: ReadonlyArray<{ | ||
message: string; | ||
start: number; | ||
end: number; | ||
}>; | ||
} | ||
interface CompileError { | ||
diagnostics: ReadonlyArray<Diagnostic>; | ||
} | ||
/** | ||
*/ | ||
export class CompileError { | ||
free(): void; | ||
/** | ||
*/ | ||
diagnostics: any; | ||
/** | ||
*/ | ||
message: string; | ||
} | ||
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; | ||
@@ -39,6 +62,11 @@ | ||
readonly memory: WebAssembly.Memory; | ||
readonly __wbg_compileerror_free: (a: number) => void; | ||
readonly __wbg_get_compileerror_message: (a: number) => number; | ||
readonly __wbg_set_compileerror_message: (a: number, b: number) => void; | ||
readonly __wbg_get_compileerror_diagnostics: (a: number) => number; | ||
readonly __wbg_set_compileerror_diagnostics: (a: number, b: number) => void; | ||
readonly init_log_level: (a: number, b: number) => void; | ||
readonly build_info: () => number; | ||
readonly acir_read_bytes: (a: number, b: number) => number; | ||
readonly acir_write_bytes: (a: number, b: number) => void; | ||
readonly init_log_level: (a: number, b: number) => void; | ||
readonly build_info: () => number; | ||
readonly compile: (a: number, b: number, c: number, d: number, e: number) => void; | ||
@@ -45,0 +73,0 @@ readonly __wbindgen_export_0: (a: number) => number; |
@@ -11,2 +11,25 @@ import { read_file } from '@noir-lang/source-resolver'; | ||
let heap_next = heap.length; | ||
function dropObject(idx) { | ||
if (idx < 132) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
} | ||
let WASM_VECTOR_LEN = 0; | ||
@@ -89,16 +112,2 @@ | ||
let heap_next = heap.length; | ||
function dropObject(idx) { | ||
if (idx < 132) return; | ||
heap[idx] = heap_next; | ||
heap_next = idx; | ||
} | ||
function takeObject(idx) { | ||
const ret = getObject(idx); | ||
dropObject(idx); | ||
return ret; | ||
} | ||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
@@ -112,10 +121,17 @@ | ||
} | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level) { | ||
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.init_log_level(ptr0, len0); | ||
} | ||
function addHeapObject(obj) { | ||
if (heap_next === heap.length) heap.push(heap.length + 1); | ||
const idx = heap_next; | ||
heap_next = heap[idx]; | ||
heap[idx] = obj; | ||
return idx; | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
} | ||
@@ -163,19 +179,2 @@ | ||
/** | ||
* @param {string} level | ||
*/ | ||
export function init_log_level(level) { | ||
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1); | ||
const len0 = WASM_VECTOR_LEN; | ||
wasm.init_log_level(ptr0, len0); | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
export function build_info() { | ||
const ret = wasm.build_info(); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {string} entry_point | ||
@@ -211,3 +210,53 @@ * @param {boolean | undefined} contracts | ||
} | ||
/** | ||
*/ | ||
export class CompileError { | ||
static __wrap(ptr) { | ||
ptr = ptr >>> 0; | ||
const obj = Object.create(CompileError.prototype); | ||
obj.__wbg_ptr = ptr; | ||
return obj; | ||
} | ||
__destroy_into_raw() { | ||
const ptr = this.__wbg_ptr; | ||
this.__wbg_ptr = 0; | ||
return ptr; | ||
} | ||
free() { | ||
const ptr = this.__destroy_into_raw(); | ||
wasm.__wbg_compileerror_free(ptr); | ||
} | ||
/** | ||
* @returns {string} | ||
*/ | ||
get message() { | ||
const ret = wasm.__wbg_get_compileerror_message(this.__wbg_ptr); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {string} arg0 | ||
*/ | ||
set message(arg0) { | ||
wasm.__wbg_set_compileerror_message(this.__wbg_ptr, addHeapObject(arg0)); | ||
} | ||
/** | ||
* @returns {any} | ||
*/ | ||
get diagnostics() { | ||
const ret = wasm.__wbg_get_compileerror_diagnostics(this.__wbg_ptr); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {any} arg0 | ||
*/ | ||
set diagnostics(arg0) { | ||
wasm.__wbg_set_compileerror_diagnostics(this.__wbg_ptr, addHeapObject(arg0)); | ||
} | ||
} | ||
async function __wbg_load(module, imports) { | ||
@@ -247,2 +296,13 @@ if (typeof Response === 'function' && module instanceof Response) { | ||
imports.wbg = {}; | ||
imports.wbg.__wbg_compileerror_new = function(arg0) { | ||
const ret = CompileError.__wrap(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
imports.wbg.__wbindgen_object_clone_ref = function(arg0) { | ||
const ret = getObject(arg0); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_string_get = function(arg0, arg1) { | ||
@@ -256,5 +316,2 @@ const obj = getObject(arg1); | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
imports.wbg.__wbindgen_is_undefined = function(arg0) { | ||
@@ -264,6 +321,2 @@ const ret = getObject(arg0) === undefined; | ||
}; | ||
imports.wbg.__wbg_constructor_ac1f808f67a5f1e9 = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) { | ||
@@ -270,0 +323,0 @@ const ret = read_file(getStringFromWasm0(arg1, arg2)); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15010075
865
45
5