export declare function startPeriodicGarbageCollection(): NodeJS.Timeout; export interface RpcMessage { type: 'apply' | 'result' | 'finalize' | 'param'; } export interface RpcParam extends RpcMessage { type: 'param'; id: string; param: string; } export interface RpcApply extends RpcMessage { type: 'apply'; id: string | undefined; proxyId: string; args: any[]; method: string; oneway?: boolean; } export interface RpcResult extends RpcMessage { type: 'result'; id: string; throw?: boolean; result?: any; } interface RpcRemoteProxyValue { __remote_proxy_id: string | undefined; __remote_proxy_finalizer_id: string | undefined; __remote_constructor_name: string; __remote_proxy_props: any; __remote_proxy_oneway_methods: string[]; __serialized_value?: any; } interface Deferred { resolve: (value: any) => void; reject: (e: Error) => void; method: string; } export interface PrimitiveProxyHandler extends ProxyHandler { toPrimitive(): any; } interface SerialiedRpcResultError { name: string; stack: string; message: string; } export declare class RPCResultError extends Error { cause?: Error; constructor(peer: RpcPeer, message: string, cause?: Error, options?: { name: string; stack: string | undefined; }); } declare class WeakRef { target: T; constructor(target: any); deref(): T; } export interface RpcSerializer { serialize(value: any, serializationContext?: any): any; deserialize(serialized: any, serializationContext?: any): any; } interface LocalProxiedEntry { id: string; finalizerId: string | undefined; } interface ErrorType { name: string; message: string; stack?: string; } export declare class RpcPeer { selfName: string; peerName: string; send: (message: RpcMessage, reject?: (e: Error) => void, serializationContext?: any) => void; params: { [name: string]: any; }; pendingResults: { [id: string]: Deferred; }; localProxied: Map; localProxyMap: Map; remoteWeakProxies: { [id: string]: WeakRef; }; finalizers: FinalizationRegistry; nameDeserializerMap: Map; onProxyTypeSerialization: Map void>; onProxySerialization: (value: any) => { proxyId: string; properties: any; }; constructorSerializerMap: Map; transportSafeArgumentTypes: Set; killed: Promise; killedSafe: Promise; killedDeferred: Deferred; tags: any; yieldedAsyncIterators: Set>; static readonly finalizerIdSymbol: unique symbol; static remotesCollected: number; static remotesCreated: number; static activeRpcPeer: RpcPeer; static isRpcProxy(value: any): boolean; static getDefaultTransportSafeArgumentTypes(): Set; static handleFunctionInvocations(thiz: PrimitiveProxyHandler, target: any, p: PropertyKey, receiver: any): any; static getIteratorNext(target: any): string; static prepareProxyProperties(value: any): any; static readonly RANDOM_DIGITS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"; static readonly RPC_RESULT_ERROR_NAME = "RPCResultError"; static readonly PROPERTY_PROXY_ID = "__proxy_id"; static readonly PROPERTY_PROXY_PEER = "__proxy_peer"; static readonly PROPERTY_PROXY_ONEWAY_METHODS = "__proxy_oneway_methods"; static readonly PROPERTY_JSON_DISABLE_SERIALIZATION = "__json_disable_serialization"; static readonly PROPERTY_PROXY_PROPERTIES = "__proxy_props"; static readonly PROPERTY_JSON_COPY_SERIALIZE_CHILDREN = "__json_copy_serialize_children"; static readonly PROBED_PROPERTIES: Set; constructor(selfName: string, peerName: string, send: (message: RpcMessage, reject?: (e: Error) => void, serializationContext?: any) => void); static isTransportSafe(value: any): boolean; isTransportSafe(value: any): boolean; static generateId(): string; createPendingResult(method: string, cb: (id: string, reject: (e: Error) => void) => void): Promise; kill(message?: string): void; addSerializer(ctr: any, name: string, serializer: RpcSerializer): void; finalize(entry: LocalProxiedEntry): void; getParam(param: string): Promise; createErrorResult(result: RpcResult, e: ErrorType): RpcResult; deserialize(value: any, deserializationContext: any): any; deserializeError(e: SerialiedRpcResultError): RPCResultError; serializeError(e: ErrorType): RpcRemoteProxyValue; serialize(value: any, serializationContext: any): any; newProxy(proxyId: string, proxyConstructorName: string, proxyProps: any, proxyOneWayMethods: string[]): any; handleMessage(message: RpcMessage, deserializationContext?: any): void; sendResult(result: RpcResult, serializationContext: any): void; private handleMessageInternal; } export declare function getEvalSource(): string; export {};