/*! 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 { PKIVerificationOptions } from "../Types"; import { Connection } from "./Connection"; import { CryptoApi } from "./CryptoApi"; import { EventApi } from "./EventApi"; import { EventQueue } from "./EventQueue"; import { InboxApi } from "./InboxApi"; import { KvdbApi } from "./KvdbApi"; import { StoreApi } from "./StoreApi"; import { StreamApi } from "./StreamApi"; import { ThreadApi } from "./ThreadApi"; /** * Contains static factory methods - generators for Connection and APIs. */ export declare class EndpointFactory { private static api; private static eventQueueInstance; private static assetsBasePath; /** * Load the Endpoint's WASM assets and initialize the Endpoint library. * * @param {string} [assetsBasePath] base path/url to the Endpoint's WebAssembly assets (like: endpoint-wasm-module.js, driver-web-context.js and others) */ static setup(assetsBasePath?: string): Promise; private static resolveAssetsBasePath; private static normalizeBasePath; private static buildAssetUrl; private static loadScript; /** * //doc-gen:ignore */ private static init; /** * Gets the EventQueue instance. * * @returns {EventQueue} instance of EventQueue */ static getEventQueue(): Promise; private static generateDefaultPKIVerificationOptions; /** * Connects to the platform backend. * * @param {string} userPrivKey user's private key * @param {string} solutionId ID of the Solution * @param {string} bridgeUrl the Bridge Server URL * @param {PKIVerificationOptions} [verificationOptions] PrivMX Bridge server instance verification options using a PKI server * @returns {Connection} instance of Connection */ static connect(userPrivKey: string, solutionId: string, bridgeUrl: string, verificationOptions?: PKIVerificationOptions): Promise; /** * Connects to the Platform backend as a guest user. * * @param {string} solutionId ID of the Solution * @param {string} bridgeUrl the Bridge Server URL * @param {PKIVerificationOptions} [verificationOptions] PrivMX Bridge server instance verification options using a PKI server * @returns {Connection} instance of Connection */ static connectPublic(solutionId: string, bridgeUrl: string, verificationOptions?: PKIVerificationOptions): Promise; /** * Creates an instance of the Thread API. * * @param {Connection} connection instance of Connection * * @returns {ThreadApi} instance of ThreadApi */ static createThreadApi(connection: Connection): Promise; /** * Creates an instance of the Store API. * * @param {Connection} connection instance of Connection * * @returns {StoreApi} instance of StoreApi */ static createStoreApi(connection: Connection): Promise; /** * Creates an instance of the Inbox API. * * @param {Connection} connection instance of Connection * @param {ThreadApi} threadApi instance of ThreadApi * @param {StoreApi} storeApi instance of StoreApi * @returns {InboxApi} instance of InboxApi */ static createInboxApi(connection: Connection, threadApi: ThreadApi, storeApi: StoreApi): Promise; /** * Creates an instance of the Kvdb API. * * @param {Connection} connection instance of Connection * * @returns {KvdbApi} instance of KvdbApi */ static createKvdbApi(connection: Connection): Promise; /** * Creates an instance of the Crypto API. * * @returns {CryptoApi} instance of CryptoApi */ static createCryptoApi(): Promise; /** * Creates an instance of 'EventApi'. * * @param connection instance of 'Connection' * * @returns {EventApi} instance of EventApi */ static createEventApi(connection: Connection): Promise; /** * Creates an instance of the Stream API. * * @param {Connection} connection instance of Connection * @param {EventApi} eventApi instance of EventApi * @param {StoreApi} storeApi instance of StoreApi * @returns {StreamApi} instance of StreamApi */ static createStreamApi(connection: Connection, eventApi: EventApi): Promise; }