buttplug-wasm
Advanced tools
Comparing version 1.0.0-beta2 to 1.0.0-beta3
@@ -81,15 +81,19 @@ /* tslint:disable */ | ||
/** | ||
* @param {string} client_name | ||
* @param {any} connector_options | ||
* @returns {Promise<any>} | ||
*/ | ||
static connectEmbedded(): Promise<any>; | ||
static connect(client_name: string, connector_options: any): Promise<any>; | ||
/** | ||
* @param {ButtplugServerOptions} options | ||
* @param {string} client_name | ||
* @param {ButtplugEmbeddedConnectorOptions} options | ||
* @returns {Promise<any>} | ||
*/ | ||
static connectEmbeddedWithOptions(options: ButtplugServerOptions): Promise<any>; | ||
static connect_embedded(client_name: string, options: ButtplugEmbeddedConnectorOptions): Promise<any>; | ||
/** | ||
* @param {any} js_address | ||
* @param {string} client_name | ||
* @param {ButtplugWebsocketConnectorOptions} options | ||
* @returns {Promise<any>} | ||
*/ | ||
static connectWebsocket(js_address: any): Promise<any>; | ||
static connect_websocket(client_name: string, options: ButtplugWebsocketConnectorOptions): Promise<any>; | ||
/** | ||
@@ -218,8 +222,7 @@ * @returns {Promise<any>} | ||
*/ | ||
export class ButtplugServerOptions { | ||
export class ButtplugEmbeddedConnectorOptions { | ||
free(): void; | ||
/** | ||
* @returns {ButtplugServerOptions} | ||
*/ | ||
static new(): ButtplugServerOptions; | ||
constructor(); | ||
/** | ||
@@ -240,3 +243,3 @@ * @returns {boolean} | ||
*/ | ||
name: string; | ||
server_name: string; | ||
/** | ||
@@ -247,1 +250,13 @@ * @returns {string | undefined} | ||
} | ||
/** | ||
*/ | ||
export class ButtplugWebsocketConnectorOptions { | ||
free(): void; | ||
/** | ||
*/ | ||
constructor(); | ||
/** | ||
* @returns {string} | ||
*/ | ||
address: string; | ||
} |
@@ -81,15 +81,19 @@ /* tslint:disable */ | ||
/** | ||
* @param {string} client_name | ||
* @param {any} connector_options | ||
* @returns {Promise<any>} | ||
*/ | ||
static connectEmbedded(): Promise<any>; | ||
static connect(client_name: string, connector_options: any): Promise<any>; | ||
/** | ||
* @param {ButtplugServerOptions} options | ||
* @param {string} client_name | ||
* @param {ButtplugEmbeddedConnectorOptions} options | ||
* @returns {Promise<any>} | ||
*/ | ||
static connectEmbeddedWithOptions(options: ButtplugServerOptions): Promise<any>; | ||
static connect_embedded(client_name: string, options: ButtplugEmbeddedConnectorOptions): Promise<any>; | ||
/** | ||
* @param {any} js_address | ||
* @param {string} client_name | ||
* @param {ButtplugWebsocketConnectorOptions} options | ||
* @returns {Promise<any>} | ||
*/ | ||
static connectWebsocket(js_address: any): Promise<any>; | ||
static connect_websocket(client_name: string, options: ButtplugWebsocketConnectorOptions): Promise<any>; | ||
/** | ||
@@ -218,8 +222,7 @@ * @returns {Promise<any>} | ||
*/ | ||
export class ButtplugServerOptions { | ||
export class ButtplugEmbeddedConnectorOptions { | ||
free(): void; | ||
/** | ||
* @returns {ButtplugServerOptions} | ||
*/ | ||
static new(): ButtplugServerOptions; | ||
constructor(); | ||
/** | ||
@@ -240,3 +243,3 @@ * @returns {boolean} | ||
*/ | ||
name: string; | ||
server_name: string; | ||
/** | ||
@@ -247,2 +250,14 @@ * @returns {string | undefined} | ||
} | ||
/** | ||
*/ | ||
export class ButtplugWebsocketConnectorOptions { | ||
free(): void; | ||
/** | ||
*/ | ||
constructor(); | ||
/** | ||
* @returns {string} | ||
*/ | ||
address: string; | ||
} | ||
@@ -253,20 +268,23 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module; | ||
readonly memory: WebAssembly.Memory; | ||
readonly start: () => void; | ||
readonly __wbg_buttplugserveroptions_free: (a: number) => void; | ||
readonly buttplugserveroptions_new: () => number; | ||
readonly buttplugserveroptions_name: (a: number, b: number) => void; | ||
readonly buttplugserveroptions_set_name: (a: number, b: number, c: number) => void; | ||
readonly buttplugserveroptions_max_ping_time: (a: number, b: number) => void; | ||
readonly buttplugserveroptions_set_max_ping_time: (a: number, b: number, c: number) => void; | ||
readonly buttplugserveroptions_allow_raw_messages: (a: number) => number; | ||
readonly buttplugserveroptions_set_allow_raw_messages: (a: number, b: number) => void; | ||
readonly buttplugserveroptions_device_configuration_json: (a: number, b: number) => void; | ||
readonly buttplugserveroptions_set_device_configuration_json: (a: number, b: number, c: number) => void; | ||
readonly buttplugserveroptions_user_device_configuration_json: (a: number, b: number) => void; | ||
readonly buttplugserveroptions_set_user_device_configuration_json: (a: number, b: number, c: number) => void; | ||
readonly __wbg_buttplugembeddedconnectoroptions_free: (a: number) => void; | ||
readonly buttplugembeddedconnectoroptions_new: () => number; | ||
readonly buttplugembeddedconnectoroptions_server_name: (a: number, b: number) => void; | ||
readonly buttplugembeddedconnectoroptions_set_server_name: (a: number, b: number, c: number) => void; | ||
readonly buttplugembeddedconnectoroptions_max_ping_time: (a: number, b: number) => void; | ||
readonly buttplugembeddedconnectoroptions_set_max_ping_time: (a: number, b: number, c: number) => void; | ||
readonly buttplugembeddedconnectoroptions_allow_raw_messages: (a: number) => number; | ||
readonly buttplugembeddedconnectoroptions_set_allow_raw_messages: (a: number, b: number) => void; | ||
readonly buttplugembeddedconnectoroptions_device_configuration_json: (a: number, b: number) => void; | ||
readonly buttplugembeddedconnectoroptions_set_device_configuration_json: (a: number, b: number, c: number) => void; | ||
readonly buttplugembeddedconnectoroptions_user_device_configuration_json: (a: number, b: number) => void; | ||
readonly buttplugembeddedconnectoroptions_set_user_device_configuration_json: (a: number, b: number, c: number) => void; | ||
readonly __wbg_buttplugwebsocketconnectoroptions_free: (a: number) => void; | ||
readonly buttplugwebsocketconnectoroptions_new: () => number; | ||
readonly buttplugwebsocketconnectoroptions_address: (a: number, b: number) => void; | ||
readonly buttplugwebsocketconnectoroptions_set_address: (a: number, b: number, c: number) => void; | ||
readonly __wbg_buttplugclient_free: (a: number) => void; | ||
readonly buttplugclient_connected: (a: number) => number; | ||
readonly buttplugclient_connectEmbedded: () => number; | ||
readonly buttplugclient_connectEmbeddedWithOptions: (a: number) => number; | ||
readonly buttplugclient_connectWebsocket: (a: number) => number; | ||
readonly buttplugclient_connect: (a: number, b: number, c: number) => number; | ||
readonly buttplugclient_connect_embedded: (a: number, b: number, c: number) => number; | ||
readonly buttplugclient_connect_websocket: (a: number, b: number, c: number) => number; | ||
readonly buttplugclient_disconnect: (a: number) => number; | ||
@@ -279,2 +297,3 @@ readonly buttplugclient_addListener: (a: number, b: number, c: number) => void; | ||
readonly buttplugclient_stopAllDevices: (a: number) => number; | ||
readonly start: () => void; | ||
readonly __wbg_buttplugclientdevice_free: (a: number) => void; | ||
@@ -281,0 +300,0 @@ readonly buttplugclientdevice_name: (a: number, b: number) => void; |
@@ -225,8 +225,2 @@ | ||
/** | ||
*/ | ||
export function start() { | ||
wasm.start(); | ||
} | ||
const u32CvtShim = new Uint32Array(2); | ||
@@ -236,9 +230,2 @@ | ||
function _assertClass(instance, klass) { | ||
if (!(instance instanceof klass)) { | ||
throw new Error(`expected instance of ${klass.name}`); | ||
} | ||
return instance.ptr; | ||
} | ||
let stack_pointer = 32; | ||
@@ -252,2 +239,14 @@ | ||
function _assertClass(instance, klass) { | ||
if (!(instance instanceof klass)) { | ||
throw new Error(`expected instance of ${klass.name}`); | ||
} | ||
return instance.ptr; | ||
} | ||
/** | ||
*/ | ||
export function start() { | ||
wasm.start(); | ||
} | ||
function handleError(f) { | ||
@@ -267,3 +266,3 @@ return function () { | ||
} | ||
function __wbg_adapter_180(arg0, arg1, arg2, arg3) { | ||
function __wbg_adapter_189(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h3fe1d13911421f29(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
@@ -305,28 +304,39 @@ } | ||
/** | ||
* @param {string} client_name | ||
* @param {any} connector_options | ||
* @returns {Promise<any>} | ||
*/ | ||
static connectEmbedded() { | ||
var ret = wasm.buttplugclient_connectEmbedded(); | ||
return takeObject(ret); | ||
static connect(client_name, connector_options) { | ||
try { | ||
var ptr0 = passStringToWasm0(client_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
var ret = wasm.buttplugclient_connect(ptr0, len0, addBorrowedObject(connector_options)); | ||
return takeObject(ret); | ||
} finally { | ||
heap[stack_pointer++] = undefined; | ||
} | ||
} | ||
/** | ||
* @param {ButtplugServerOptions} options | ||
* @param {string} client_name | ||
* @param {ButtplugEmbeddedConnectorOptions} options | ||
* @returns {Promise<any>} | ||
*/ | ||
static connectEmbeddedWithOptions(options) { | ||
_assertClass(options, ButtplugServerOptions); | ||
var ret = wasm.buttplugclient_connectEmbeddedWithOptions(options.ptr); | ||
static connect_embedded(client_name, options) { | ||
var ptr0 = passStringToWasm0(client_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
_assertClass(options, ButtplugEmbeddedConnectorOptions); | ||
var ret = wasm.buttplugclient_connect_embedded(ptr0, len0, options.ptr); | ||
return takeObject(ret); | ||
} | ||
/** | ||
* @param {any} js_address | ||
* @param {string} client_name | ||
* @param {ButtplugWebsocketConnectorOptions} options | ||
* @returns {Promise<any>} | ||
*/ | ||
static connectWebsocket(js_address) { | ||
try { | ||
var ret = wasm.buttplugclient_connectWebsocket(addBorrowedObject(js_address)); | ||
return takeObject(ret); | ||
} finally { | ||
heap[stack_pointer++] = undefined; | ||
} | ||
static connect_websocket(client_name, options) { | ||
var ptr0 = passStringToWasm0(client_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
_assertClass(options, ButtplugWebsocketConnectorOptions); | ||
var ret = wasm.buttplugclient_connect_websocket(ptr0, len0, options.ptr); | ||
return takeObject(ret); | ||
} | ||
@@ -593,6 +603,6 @@ /** | ||
*/ | ||
export class ButtplugServerOptions { | ||
export class ButtplugEmbeddedConnectorOptions { | ||
static __wrap(ptr) { | ||
const obj = Object.create(ButtplugServerOptions.prototype); | ||
const obj = Object.create(ButtplugEmbeddedConnectorOptions.prototype); | ||
obj.ptr = ptr; | ||
@@ -607,10 +617,9 @@ | ||
wasm.__wbg_buttplugserveroptions_free(ptr); | ||
wasm.__wbg_buttplugembeddedconnectoroptions_free(ptr); | ||
} | ||
/** | ||
* @returns {ButtplugServerOptions} | ||
*/ | ||
static new() { | ||
var ret = wasm.buttplugserveroptions_new(); | ||
return ButtplugServerOptions.__wrap(ret); | ||
constructor() { | ||
var ret = wasm.buttplugembeddedconnectoroptions_new(); | ||
return ButtplugEmbeddedConnectorOptions.__wrap(ret); | ||
} | ||
@@ -620,7 +629,7 @@ /** | ||
*/ | ||
get name() { | ||
get server_name() { | ||
try { | ||
const retptr = wasm.__wbindgen_export_6.value - 16; | ||
wasm.__wbindgen_export_6.value = retptr; | ||
wasm.buttplugserveroptions_name(retptr, this.ptr); | ||
wasm.buttplugembeddedconnectoroptions_server_name(retptr, this.ptr); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
@@ -637,6 +646,6 @@ var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
*/ | ||
set name(name) { | ||
set server_name(name) { | ||
var ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.buttplugserveroptions_set_name(this.ptr, ptr0, len0); | ||
wasm.buttplugembeddedconnectoroptions_set_server_name(this.ptr, ptr0, len0); | ||
} | ||
@@ -650,3 +659,3 @@ /** | ||
wasm.__wbindgen_export_6.value = retptr; | ||
wasm.buttplugserveroptions_max_ping_time(retptr, this.ptr); | ||
wasm.buttplugembeddedconnectoroptions_max_ping_time(retptr, this.ptr); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
@@ -669,3 +678,3 @@ var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
const high0 = u32CvtShim[1]; | ||
wasm.buttplugserveroptions_set_max_ping_time(this.ptr, low0, high0); | ||
wasm.buttplugembeddedconnectoroptions_set_max_ping_time(this.ptr, low0, high0); | ||
} | ||
@@ -676,3 +685,3 @@ /** | ||
get allow_raw_messages() { | ||
var ret = wasm.buttplugserveroptions_allow_raw_messages(this.ptr); | ||
var ret = wasm.buttplugembeddedconnectoroptions_allow_raw_messages(this.ptr); | ||
return ret !== 0; | ||
@@ -684,3 +693,3 @@ } | ||
set allow_raw_messages(allow_raw_messages) { | ||
wasm.buttplugserveroptions_set_allow_raw_messages(this.ptr, allow_raw_messages); | ||
wasm.buttplugembeddedconnectoroptions_set_allow_raw_messages(this.ptr, allow_raw_messages); | ||
} | ||
@@ -694,3 +703,3 @@ /** | ||
wasm.__wbindgen_export_6.value = retptr; | ||
wasm.buttplugserveroptions_device_configuration_json(retptr, this.ptr); | ||
wasm.buttplugembeddedconnectoroptions_device_configuration_json(retptr, this.ptr); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
@@ -714,3 +723,3 @@ var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.buttplugserveroptions_set_device_configuration_json(this.ptr, ptr0, len0); | ||
wasm.buttplugembeddedconnectoroptions_set_device_configuration_json(this.ptr, ptr0, len0); | ||
} | ||
@@ -724,3 +733,3 @@ /** | ||
wasm.__wbindgen_export_6.value = retptr; | ||
wasm.buttplugserveroptions_user_device_configuration_json(retptr, this.ptr); | ||
wasm.buttplugembeddedconnectoroptions_user_device_configuration_json(retptr, this.ptr); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
@@ -744,6 +753,54 @@ var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.buttplugserveroptions_set_user_device_configuration_json(this.ptr, ptr0, len0); | ||
wasm.buttplugembeddedconnectoroptions_set_user_device_configuration_json(this.ptr, ptr0, len0); | ||
} | ||
} | ||
/** | ||
*/ | ||
export class ButtplugWebsocketConnectorOptions { | ||
static __wrap(ptr) { | ||
const obj = Object.create(ButtplugWebsocketConnectorOptions.prototype); | ||
obj.ptr = ptr; | ||
return obj; | ||
} | ||
free() { | ||
const ptr = this.ptr; | ||
this.ptr = 0; | ||
wasm.__wbg_buttplugwebsocketconnectoroptions_free(ptr); | ||
} | ||
/** | ||
*/ | ||
constructor() { | ||
var ret = wasm.buttplugwebsocketconnectoroptions_new(); | ||
return ButtplugWebsocketConnectorOptions.__wrap(ret); | ||
} | ||
/** | ||
* @returns {string} | ||
*/ | ||
get address() { | ||
try { | ||
const retptr = wasm.__wbindgen_export_6.value - 16; | ||
wasm.__wbindgen_export_6.value = retptr; | ||
wasm.buttplugwebsocketconnectoroptions_address(retptr, this.ptr); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
return getStringFromWasm0(r0, r1); | ||
} finally { | ||
wasm.__wbindgen_export_6.value += 16; | ||
wasm.__wbindgen_free(r0, r1); | ||
} | ||
} | ||
/** | ||
* @param {string} address | ||
*/ | ||
set address(address) { | ||
var ptr0 = passStringToWasm0(address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); | ||
var len0 = WASM_VECTOR_LEN; | ||
wasm.buttplugwebsocketconnectoroptions_set_address(this.ptr, ptr0, len0); | ||
} | ||
} | ||
async function load(module, imports) { | ||
@@ -1020,2 +1077,6 @@ if (typeof Response === 'function' && module instanceof Response) { | ||
}); | ||
imports.wbg.__wbg_name_fc3f17e6300898bb = function(arg0) { | ||
var ret = getObject(arg0).name; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_next_2966fa909601a075 = handleError(function(arg0) { | ||
@@ -1029,2 +1090,10 @@ var ret = getObject(arg0).next(); | ||
}; | ||
imports.wbg.__wbg_constructor_096b1420237ba003 = function(arg0) { | ||
var ret = getObject(arg0).constructor; | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_getPrototypeOf_26ecfed6931c6c96 = function(arg0) { | ||
var ret = Object.getPrototypeOf(getObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_is_333329c4a02916de = function(arg0, arg1) { | ||
@@ -1045,3 +1114,3 @@ var ret = Object.is(getObject(arg0), getObject(arg1)); | ||
try { | ||
return __wbg_adapter_180(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_189(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -1183,12 +1252,12 @@ state0.a = a; | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper1113 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 30, __wbg_adapter_38); | ||
imports.wbg.__wbindgen_closure_wrapper1145 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 34, __wbg_adapter_38); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper1115 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 28, __wbg_adapter_41); | ||
imports.wbg.__wbindgen_closure_wrapper1147 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 32, __wbg_adapter_41); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbindgen_closure_wrapper6582 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 1891, __wbg_adapter_44); | ||
imports.wbg.__wbindgen_closure_wrapper6618 = function(arg0, arg1, arg2) { | ||
var ret = makeMutClosure(arg0, arg1, 1893, __wbg_adapter_44); | ||
return addHeapObject(ret); | ||
@@ -1195,0 +1264,0 @@ }; |
@@ -7,3 +7,3 @@ { | ||
"description": "Buttplug WASM library for web applications (Node/Web). Does not work for native node at the moment.", | ||
"version": "1.0.0-beta2", | ||
"version": "1.0.0-beta3", | ||
"license": "BSD-3-Clause", | ||
@@ -10,0 +10,0 @@ "homepage": "https://buttplug.io", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Uses eval
Supply chain riskPackage uses dynamic code execution (e.g., eval()), which is a dangerous practice. This can prevent the code from running in certain environments and increases the risk that the code may contain exploits or malicious behavior.
Found 1 instance in 1 package
16
1
4461290
1779