UNPKG

@simplito/privmx-webendpoint

Version:

PrivMX Web Endpoint library

37 lines (34 loc) 1.43 kB
"use strict"; /*! 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.EventApiNative = void 0; const BaseNative_1 = require("./BaseNative"); class EventApiNative extends BaseNative_1.BaseNative { async newApi(connectionPtr) { return this.runAsync((taskId) => this.api.lib.EventApi_newEventApi(taskId, connectionPtr)); } async deleteApi(ptr) { await this.runAsync((taskId) => this.api.lib.EventApi_deleteEventApi(taskId, ptr)); this.deleteApiRef(); } async create(ptr, args) { return this.runAsync((taskId) => this.api.lib.EventApi_create(taskId, ptr, args)); } async emitEvent(ptr, args) { return this.runAsync((taskId) => this.api.lib.EventApi_emitEvent(taskId, ptr, args)); } async subscribeForCustomEvents(ptr, args) { return this.runAsync((taskId) => this.api.lib.EventApi_subscribeForCustomEvents(taskId, ptr, args)); } async unsubscribeFromCustomEvents(ptr, args) { return this.runAsync((taskId) => this.api.lib.EventApi_unsubscribeFromCustomEvents(taskId, ptr, args)); } } exports.EventApiNative = EventApiNative;