import { c as ColorUtilProps } from '../__types-Cs6vjY5W.js'; import { b as HttpResponse } from '../_http.type-BkYW7bxd.js'; import 'react'; declare class ColorUtil { /** * To convert css hex color values to css rgba color values. * * returns hex color value if the input hex value is invalid. * @example * const rgba = ConvertColor.hexToRGBA("#FFF", 0.5); */ static hexToRGBA(hex: string, alpha?: number, ...arg: any): string; /** * To convert css rgba color string to hex color string. * * returns intput rgba color string in case of invalid rgba color string. * @example * const hexColor = ConvertColor.rgbaStringToHEX("rgba(255, 0, 10, 0.5)"); */ static rgbaStringToHEX(rgbaString: string): string; /** * To convert rgb values to hex colors string * @example * const hexColor = ConvertColor.rgbToHex({ r: 255, g: 200, b: 100 }); */ static rgbToHex({ r, g, b }: ColorUtilProps): string; } /** A publisher publishes contents to a topic and interested subscribers access these contents by sending * subscriptions to the PubSubEvent to subscribe to that topic. * * User [ PubSubEvent.getInstance() ] static method to get the existing instance without creating a new one, * This method is used to subscribe to same topic from different places with destroying the presence reference */ declare class PubSub { #private; constructor(); /** This will give the reference to already created instance without creating new PubSubEvent Class . * @returns {PubSubEvent} * @example * const pubsub = PubSubEvent.getInstance(); */ static getInstance(): PubSub; /** Subscribe to the custom events ["topics"] * @param {String} event * @param {(event:String, ...args:any)=>void} func * * @example * const pubsub = PubSubEvent.getInstance(); * const subscription = pubsub.subscribe("event", (event, ...args) => {}); */ subscribe(event: string, func: (event: string, ...args: any) => void): { /** To unsbscribe from the created event */ unSubscribe: () => void; }; /** * Publish to the custom events ["topics"] * @param {String} event * @param {...any} args * * @example * const pubsub = PubSubEvent.getInstance(); * const subscription = pubsub.publish("event", ...args); */ publish(event: string, ...args: any): void; } interface ChunkHelperOptions { clientId: string; uploadUrl: string; actionUrl: string; dirId: string; chunkSize?: number; maxConcurrentUpload?: number; } declare class FileUploadByChunk { #private; constructor({ clientId, dirId, uploadUrl, actionUrl, chunkSize, maxConcurrentUpload }: ChunkHelperOptions); onStatus: (data?: any) => void; addEventListener: (event: "status", callback: (data: any) => void) => { destroy: () => void; }; uploadFiles(files: Array): Promise; getStatus(): Promise; pause(): boolean; resume(): boolean; done(id: string): Promise; } interface UuidProps { length?: number; generate?: "numeric" | "alphabet" | "alphanumeric"; transform?: "upper" | "lower" | "none"; separator?: string; } declare function generateUUID(options?: UuidProps): string; declare class Converter { static byteToHumanReadable(bytes: number): string; static base64(file: File): Promise; static array: { removeDuplicates(arr: T[]): T[]; sortBy(arr: T[], order?: "asc" | "desc"): T[]; splitIntoChunks(arr: T[], chunkSize: number): Array; binarySearchRecursive(arr: Array, target: any, low?: number, high?: number): number; }; static media: { secondsToDuration: (seconds: number) => string; }; } declare class SharedPreference { static set(key: string, value: any): void; static get(key: string): any; static clear(): void; static remove(key: string): void; } declare class WebSocketClient { #private; constructor(props: ConnectionProps); ensureInit(): void; subscribe(topic: string, callback?: (data: T) => void): { unSubscribe: () => void; }; unSubscribe(topic: string): void; publish(topic: string, options: { data: any; event?: event; }): void; disconnect(): void; onConnect: (e: WebSocketClient) => void; onDisconnect: (e: any) => void; onMessage: (topic: string, data: any) => void; onError: (e: any) => void; } type event = "auth" | "token" | "request-auth" | "request-token" | "subscribe" | "un-subscribe" | "message" | "chat" | "call" | "notification" | "other" | "publish" | undefined; interface ConnectionProps { url: string; username?: string; password?: string; authToken?: string; retry?: boolean; retryInterval?: number; } declare function openFilePicker(accept?: string, limitSize?: number): Promise; declare class FileChunk { #private; static getchunks(file: File, chunkSizeInMB?: number): Promise>; } interface FileChunks { fileName: string; fileSize: number; fileType: string; fileExt: string; totalChunks: number; chunkIndex: number; data: string | ArrayBuffer | null | undefined; start?: number; end?: number; } declare class ArrayQueue { private items; private head; private tail; enqueue(element: T): void; dequeue(): T; peek(): T; size(): number; isEmpty(): boolean; print(): void; } interface E2EEmodel { iv: string; key: string; data: string; } declare class E2EE { static encryptPayload(base64RsaPublicKey: string, payload: any): Promise; static decryptPayload(rsaPrivateKey: string | CryptoKey, payload: E2EEmodel): Promise; } interface AES_GCM_key { key: CryptoKey; base64Key: string; iv: string; } interface AES_GCM_Derived_key extends AES_GCM_key { salt: string; } interface EncryptDecryptArgs { key?: CryptoKey; base64Key?: string; iv: string; } interface DecryptFileArgs extends EncryptDecryptArgs { fileName: string; mimeType: string; } declare class AES_GCM { #private; static generateKey(): Promise; static deriveKey(password: string, salt?: string): Promise; static generateBase64Iv(): string; static generateBase64Salt(): string; static encrypt(plainText: string, args: EncryptDecryptArgs): Promise; static decrypt(cipherText: string, args: EncryptDecryptArgs): Promise; static encryptFile(file: File, args: EncryptDecryptArgs): Promise; static decryptFile(cipherText: string, args: DecryptFileArgs): Promise; } interface RSAkeyPair { keyPair: CryptoKeyPair; privateKey: CryptoKey; publicKey: CryptoKey; publicKeyBase64: string; } declare class RSA { #private; static generateKeys(): Promise; static encrypt(base64PublicKey: string, payload: string): Promise; static decrypt(privateKey: string | CryptoKey, cipherText: string): Promise; } declare const Cryptography: { EndToEndEncryption: typeof E2EE; RSA: typeof RSA; AES_GCM: typeof AES_GCM; }; type Listener = (value: T) => void; declare class EventEmitter { private _value; private _listeners; emit(value: T): void; getValue(): T | undefined; listener(listener: Listener): () => void; } interface Args$1 { database: string; version?: number; tables: string[]; } declare class IndexDatabase { #private; constructor(arg: Args$1); table(tableName: Table[number]): { get: (id: any) => Promise; getAll: () => Promise; set: (data: any) => Promise; delete: (id: any) => Promise; clear: () => void; }; dropTable(tableName: string): Promise; setData(tableName: string, data: any): Promise; getData(tableName: string, id?: any): Promise; deleteData(tableName: string, id: any): Promise; } interface WebE2EESecureKeys { recipientPublicKey: string; myPrivateKey: CryptoKey | string; } interface Topic { topicToSubscribe: string; topicToPublish: string; } interface Args { topic: Topic; config: RTCConfiguration; wssUrl: string; doEncrypt?: boolean; e2eeSecureKeys?: WebE2EESecureKeys; mediaStreamConstraints?: MediaStreamConstraints; } /** * Config for web rtc ice servers in case of network connection * failures the rtc will be redirected over google stun server ... * {iceServers: [ { urls: "stun:stun.l.google.com:19302" } ]} */ declare class WebRTC { #private; peerConnections?: Map; constructor(args: Args); getLocalStream(enableAudio?: boolean, enableVideo?: boolean): Promise; enableAudio(enable?: boolean): void; enableVideo(enable?: boolean): void; startStream(mediaStream?: MediaStream): Promise; stopStream(): void; onRemoteStreamReceived: (_track: RTCTrackEvent) => void; onClose: (_message: string) => void; onConnectionState: (_state: RTCPeerConnectionState) => any; onRemoteVideoStateChange: (_paused: boolean) => void; onRemoteAudioStateChange: (_muted: boolean) => void; } export { ArrayQueue, ColorUtil, Converter, Cryptography, EventEmitter, FileChunk, FileUploadByChunk, IndexDatabase, PubSub, SharedPreference, WebRTC, WebSocketClient, generateUUID, openFilePicker }; export type { AES_GCM_key, FileChunks, RSAkeyPair };