import { type ProxyBrand } from "./internal"; type Func = (...args: A) => R; type RegisterFunction = (id: any, ...args: any[]) => void; type RID = T extends (id: infer P, ...args: any[]) => void ? P : never; type RArgs = T extends (id: any, ...args: infer P) => void ? P : never; type ProxyKind = ProxyBrand["kind"]; declare const PROXY_BRAND: unique symbol; export interface AttachmentLease { generation: number; owner: string; provider: string; } /** Returns whether a value implements this runtime's stable proxy protocol. */ export declare function IsInterfaceProxy(value: unknown, kind?: ProxyKind): boolean; /** Returns the stable identity used to bind a proxy to a provider route. */ export declare function GetInterfaceProxyIdentity(value: unknown): string | undefined; /** @internal */ export declare function InvalidateResponsibleModule(module: string): void; /** Runs work with explicit module ownership across asynchronous boundaries. */ export declare function RunWithResponsibleModule(module: string, callback: () => T): T; /** Proxy for an asynchronous interface function. */ export declare class AsyncProxy>> { readonly [PROXY_BRAND]: ProxyBrand; private readonly state; constructor(identity?: string); /** Attaches a provider callback and replays compatible queued calls. */ onCall(callback: T, manualDetach?: boolean): AttachmentLease; /** Detaches one leased provider, or every provider when called without a lease. */ detach(lease?: AttachmentLease): void; /** Calls the provider selected by the current module execution context. */ call(...args: Parameters): Promise; private invoke; private replayQueue; } /** Creates an interface function backed by an asynchronous proxy. */ export declare function InterfaceFunction>>(identity?: string): (...args: Parameters) => Promise; /** Proxy for provider-aware register and unregister handlers. */ export declare class RegisteringProxy { readonly [PROXY_BRAND]: ProxyBrand; private readonly state; constructor(identity?: string); /** Attaches a register callback. */ onRegister(callback: T, manualDetach?: boolean): AttachmentLease; /** Attaches an unregister callback to the current provider route. */ onUnregister(callback: (id: RID) => void): AttachmentLease; /** Atomically attaches both registration handlers. */ onHandlers(register: T, unregister: (id: RID) => void, manualDetach?: boolean): AttachmentLease; /** Detaches one leased provider, or every provider when called without a lease. */ detach(lease?: AttachmentLease): void; /** Registers an entry with the selected provider or queues it for bootstrap. */ register(id: RID, ...args: RArgs): void; /** Unregisters an entry from the provider that accepted it. */ unregister(id: RID): void; /** Unregisters every entry owned by a destroyed module. */ unregisterModule(module: string): void; /** Unregisters every entry owned by a destroyed module generation. */ unregisterOwner(owner: string): void; private unregisterMatching; private attachRegister; private attachUnregister; private trackAttachment; private createLease; private createAttachment; private replayRegistrations; } type EventFunction = (...args: any[]) => void; /** Module-aware event handler collection. */ export declare class EventProxy { readonly [PROXY_BRAND]: ProxyBrand; private readonly state; constructor(identity?: string); /** Emits to every handler, reporting failures without aborting later handlers. */ emit(...args: Parameters): void; /** Registers a handler once. */ register(func: T): void; /** Unregisters a handler. */ unregister(fn: T): void; /** Unregisters handlers owned by a destroyed module. */ unregisterModule(module: string): void; /** Unregisters handlers owned by a destroyed module generation. */ unregisterOwner(owner: string): void; } /** Gets the responsible module from explicit async context or the call stack. */ export declare function GetResponsibleModule(startFrame?: number): string | undefined; export {};