import { type RoomException, type RoomMethodName } from '../errors/RoomExceptions.ts'; export type Type = new (...args: any[]) => T; export type MethodName = string & { [K in keyof T]: T[K] extends (...args: any[]) => any ? K : never; }[keyof T]; /** * Utility type that extracts the return type of a method or the type of a property * from a given class/object type. * * - If the key is a method, returns the awaited return type of that method * - If the key is a property, returns the type of that property */ export type ExtractMethodOrPropertyType = TClass[TKey] extends (...args: any[]) => infer R ? Awaited : TClass[TKey]; export declare const REMOTE_ROOM_SHORT_TIMEOUT: number; export declare const MAX_CONCURRENT_CREATE_ROOM_WAIT_TIME: number; export declare function generateId(length?: number): string; export declare function getBearerToken(authHeader: string): string; export declare function registerGracefulShutdown(callback: (err?: Error) => void): void; export declare function retry(cb: Function, maxRetries?: number, errorWhiteList?: any[], retries?: number): Promise; export declare function spliceOne(arr: any[], index: number): boolean; export declare class Deferred { promise: Promise; resolve: Function; reject: Function; constructor(promise?: Promise); then(onFulfilled?: (value: T) => any, onRejected?: (reason: any) => any): Promise; catch(func: (value: any) => any): Promise; static reject(reason?: any): Deferred; static resolve(value?: T): Deferred; } export declare function merge(a: any, ...objs: any[]): any; export declare function wrapTryCatch(method: Function, onError: (error: RoomException, methodName: RoomMethodName) => void, exceptionClass: Type, methodName: RoomMethodName, rethrow?: boolean, ...additionalErrorArgs: any[]): (...args: any[]) => any; /** * Dynamically import a module using either require() or import() * based on the current module system (CJS vs ESM). * * This avoids double-loading packages when running in mixed ESM/CJS environments. * Errors are silently caught - await the promise and handle errors at usage site. */ export declare function dynamicImport(moduleName: string): Promise;