Comparing version 4.0.11 to 4.0.12
@@ -6,2 +6,5 @@ /* tslint:disable */ | ||
/** | ||
* Super Mario Maker course file. | ||
* | ||
* This struct is a wrapper to hold a [SMMCourse](crate::proto::SMMCourse) struct which can be serialized via Protocol Buffer. | ||
*/ | ||
@@ -45,16 +48,24 @@ export class Course { | ||
* @param {Uint8Array} buffer | ||
* @param {Uint8Array | undefined} thumb | ||
* @returns {Course2} | ||
*/ | ||
static from_proto(buffer: Uint8Array): Course2; | ||
static from_proto(buffer: Uint8Array, thumb?: Uint8Array): Course2; | ||
/** | ||
* @param {Uint8Array} buffer | ||
* @param {Uint8Array | undefined} thumb | ||
* @returns {Course2} | ||
*/ | ||
static from_boxed_proto(buffer: Uint8Array): Course2; | ||
static from_boxed_proto(buffer: Uint8Array, thumb?: Uint8Array): Course2; | ||
/** | ||
* @param {any} course | ||
* @param {Uint8Array | undefined} thumb | ||
* @returns {Course2} | ||
*/ | ||
static from_js(course: any): Course2; | ||
static from_js(course: any, thumb?: Uint8Array): Course2; | ||
/** | ||
* @param {Uint8Array} buffer | ||
* @returns {any[]} | ||
*/ | ||
static from_packed_js(buffer: Uint8Array): any[]; | ||
/** | ||
* @returns {Uint8Array} | ||
@@ -73,1 +84,6 @@ */ | ||
} | ||
/** | ||
*/ | ||
export class Thumbnail2 { | ||
free(): void; | ||
} |
@@ -20,2 +20,6 @@ import * as wasm from './cemu_smm_bg.wasm'; | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
const heap = new Array(32); | ||
@@ -46,4 +50,8 @@ | ||
function getArrayU8FromWasm(ptr, len) { | ||
return getUint8Memory().subarray(ptr / 1, ptr / 1 + len); | ||
let cachegetUint32Memory = null; | ||
function getUint32Memory() { | ||
if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) { | ||
cachegetUint32Memory = new Uint32Array(wasm.memory.buffer); | ||
} | ||
return cachegetUint32Memory; | ||
} | ||
@@ -65,10 +73,2 @@ | ||
let cachegetUint32Memory = null; | ||
function getUint32Memory() { | ||
if (cachegetUint32Memory === null || cachegetUint32Memory.buffer !== wasm.memory.buffer) { | ||
cachegetUint32Memory = new Uint32Array(wasm.memory.buffer); | ||
} | ||
return cachegetUint32Memory; | ||
} | ||
function getArrayJsValueFromWasm(ptr, len) { | ||
@@ -83,2 +83,6 @@ const mem = getUint32Memory(); | ||
} | ||
function getArrayU8FromWasm(ptr, len) { | ||
return getUint8Memory().subarray(ptr / 1, ptr / 1 + len); | ||
} | ||
/** | ||
@@ -160,7 +164,6 @@ */ | ||
} | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
/** | ||
* Super Mario Maker course file. | ||
* | ||
* This struct is a wrapper to hold a [SMMCourse](crate::proto::SMMCourse) struct which can be serialized via Protocol Buffer. | ||
*/ | ||
@@ -256,6 +259,9 @@ export class Course { | ||
* @param {Uint8Array} buffer | ||
* @param {Uint8Array | undefined} thumb | ||
* @returns {Course2} | ||
*/ | ||
static from_proto(buffer) { | ||
const ret = wasm.course2_from_proto(passArray8ToWasm(buffer), WASM_VECTOR_LEN); | ||
static from_proto(buffer, thumb) { | ||
const ptr0 = isLikeNone(thumb) ? 0 : passArray8ToWasm(thumb); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.course2_from_proto(passArray8ToWasm(buffer), WASM_VECTOR_LEN, ptr0, len0); | ||
return Course2.__wrap(ret); | ||
@@ -265,6 +271,9 @@ } | ||
* @param {Uint8Array} buffer | ||
* @param {Uint8Array | undefined} thumb | ||
* @returns {Course2} | ||
*/ | ||
static from_boxed_proto(buffer) { | ||
const ret = wasm.course2_from_boxed_proto(passArray8ToWasm(buffer), WASM_VECTOR_LEN); | ||
static from_boxed_proto(buffer, thumb) { | ||
const ptr0 = isLikeNone(thumb) ? 0 : passArray8ToWasm(thumb); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.course2_from_boxed_proto(passArray8ToWasm(buffer), WASM_VECTOR_LEN, ptr0, len0); | ||
return Course2.__wrap(ret); | ||
@@ -274,9 +283,24 @@ } | ||
* @param {any} course | ||
* @param {Uint8Array | undefined} thumb | ||
* @returns {Course2} | ||
*/ | ||
static from_js(course) { | ||
const ret = wasm.course2_from_js(addHeapObject(course)); | ||
static from_js(course, thumb) { | ||
const ptr0 = isLikeNone(thumb) ? 0 : passArray8ToWasm(thumb); | ||
const len0 = WASM_VECTOR_LEN; | ||
const ret = wasm.course2_from_js(addHeapObject(course), ptr0, len0); | ||
return Course2.__wrap(ret); | ||
} | ||
/** | ||
* @param {Uint8Array} buffer | ||
* @returns {any[]} | ||
*/ | ||
static from_packed_js(buffer) { | ||
const retptr = 8; | ||
const ret = wasm.course2_from_packed_js(retptr, passArray8ToWasm(buffer), WASM_VECTOR_LEN); | ||
const memi32 = getInt32Memory(); | ||
const v0 = getArrayJsValueFromWasm(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1]).slice(); | ||
wasm.__wbindgen_free(memi32[retptr / 4 + 0], memi32[retptr / 4 + 1] * 4); | ||
return v0; | ||
} | ||
/** | ||
* @returns {Uint8Array} | ||
@@ -312,3 +336,14 @@ */ | ||
} | ||
/** | ||
*/ | ||
export class Thumbnail2 { | ||
free() { | ||
const ptr = this.ptr; | ||
this.ptr = 0; | ||
wasm.__wbg_thumbnail2_free(ptr); | ||
} | ||
} | ||
export const __wbindgen_json_serialize = function(arg0, arg1) { | ||
@@ -315,0 +350,0 @@ const ret = JSON.stringify(getObject(arg1)); |
@@ -7,3 +7,3 @@ { | ||
"description": "A utility library for Super Mario Maker and possibly Super Mario Maker 2 in the future to read and manipulate game files.", | ||
"version": "4.0.11", | ||
"version": "4.0.12", | ||
"license": "MIT", | ||
@@ -10,0 +10,0 @@ "repository": { |
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
506
2242931