@simplito/privmx-webendpoint
Version:
PrivMX Web Endpoint library
38 lines (35 loc) • 1.41 kB
JavaScript
;
/*!
PrivMX Web Endpoint.
Copyright © 2024 Simplito sp. z o.o.
This file is part of the PrivMX Platform (https://privmx.dev).
This software is Licensed under the PrivMX Free License.
See the License for the specific language governing permissions and
limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.EventQueueNative = void 0;
const BaseNative_1 = require("./BaseNative");
class EventQueueNative extends BaseNative_1.BaseNative {
async newApi(_connectionPtr) {
throw new Error("Use the newEventQueue() - specialized version of method instead.");
}
async deleteApi(ptr) {
await this.runAsync((taskId) => this.api.lib.EventQueue_deleteEventQueue(taskId, ptr));
this.deleteApiRef();
}
async newEventQueue() {
return this.runAsync((taskId) => this.api.lib.EventQueue_newEventQueue(taskId));
}
async deleteEventQueue(ptr) {
await this.runAsync((taskId) => this.api.lib.EventQueue_deleteEventQueue(taskId, ptr));
this.deleteApiRef();
}
async waitEvent(ptr, args) {
return this.runAsync((taskId) => this.api.lib.EventQueue_waitEvent(taskId, ptr, args));
}
async emitBreakEvent(ptr, args) {
return this.runAsync((taskId) => this.api.lib.EventQueue_emitBreakEvent(taskId, ptr, args));
}
}
exports.EventQueueNative = EventQueueNative;