UNPKG

babylon-mmd

Version:
31 lines (30 loc) 1.44 kB
import type { IWasmTypedArray } from "./Misc/IWasmTypedArray"; import type { TypedArray, TypedArrayConstructor } from "./Misc/wasmTypedArray"; export type MmdWasmType = typeof import("./wasm/mpr") | typeof import("./wasm/mpd") | typeof import("./wasm/mr") | typeof import("./wasm/md") | typeof import("./wasm/spr") | typeof import("./wasm/spd") | typeof import("./wasm/sr") | typeof import("./wasm/sd"); /** * MMD WASM instance * * entry point of the MMD WASM */ export interface IMmdWasmInstance extends MmdWasmType { memory: WebAssembly.Memory; createTypedArray<T extends TypedArray>(typedArrayConstructor: TypedArrayConstructor<T>, byteOffset: number, length: number): IWasmTypedArray<T>; } export interface IMmdWasmInstanceType { /** * Get MMD wasm-bindgen instance * @returns MMD wasm-bindgen instance */ getWasmInstanceInner(): MmdWasmType; } /** * Load MMD WASM instance * * Wasm instance type is determined by the argument instanceType * * For example, if you want to use most stable MMD WASM instance, pass MmdWasmDebugInstanceType to instanceType * @param instanceType MMD WASM instance type * @param threadCount Thread count for WASM threading (default: navigator.hardwareConcurrency). threadCount must be greater than 0 * @returns MMD WASM instance */ export declare function GetMmdWasmInstance(instanceType: IMmdWasmInstanceType, threadCount?: number): Promise<IMmdWasmInstance>;