UNPKG

@simplito/privmx-webendpoint

Version:

PrivMX Web Endpoint library

47 lines (44 loc) 2.28 kB
/*! 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. */ import { UserVerifierInterface } from "../service/UserVerifierInterface"; import { PagingQuery, PagingList, Context, UserInfo, VerificationRequest, PKIVerificationOptions, ConnectionEventType, ConnectionEventSelectorType } from "../Types"; import { BaseNative } from "./BaseNative"; type UserVierifierVerifyFunc = (request: VerificationRequest[]) => Promise<boolean[]>; declare global { interface Window { userVerifierBinder?: { [id: number]: { userVierifier_verify: UserVierifierVerifyFunc; }; }; } } export declare class ConnectionNative extends BaseNative { protected lastConnectionId: number; protected userVerifierPtr: number; protected static verifierBindingId: number; protected static getVerifierBindingId(): number; protected newApi(_connectionPtr: number): Promise<number>; deleteApi(ptr: number): Promise<void>; newConnection(): Promise<number>; deleteConnection(ptr: number): Promise<void>; connect(ptr: number, args: [string, string, string, PKIVerificationOptions]): Promise<void>; connectPublic(ptr: number, args: [string, string, PKIVerificationOptions]): Promise<void>; getConnectionId(ptr: number, args: []): Promise<number>; listContexts(ptr: number, args: [PagingQuery]): Promise<PagingList<Context>>; listContextUsers(ptr: number, args: [string, PagingQuery]): Promise<PagingList<UserInfo>>; subscribeFor(ptr: number, args: [string[]]): Promise<string[]>; unsubscribeFrom(ptr: number, args: [string[]]): Promise<void>; buildSubscriptionQuery(ptr: number, args: [ConnectionEventType, ConnectionEventSelectorType, string]): Promise<string>; disconnect(ptr: number, args: []): Promise<void>; setUserVerifier(_ptr: number, args: [number, UserVerifierInterface]): Promise<void>; protected newUserVerifierInterface(connectionPtr: number): Promise<number>; protected deleteUserVerifierInterface(ptr: number): Promise<void>; } export {};