import { RPCSource } from './index.js'; import { MetaScope, EventPathArgs, EventPath } from './type-utils.js'; type RPCSourceChannelEvents = { ready: []; error: [reason?: any]; close: [reason?: any]; }; export default class RPCSourceChannel> { #private; [Symbol.unscopables]: S extends MetaScope ? S[typeof Symbol.unscopables] : never; constructor(source: S & RPCSource); get promise(): Promise; get context(): any; get ready(): boolean; get closed(): boolean; get source(): S; emit: S extends MetaScope ? (

>(event: P, ...args: 0 extends (1 & EVENTS) ? any[] : EventPathArgs) => this) : never; close(reason?: any): void; on(eventName: E, listener: (...args: RPCSourceChannelEvents[E]) => void): any; once(eventName: E, listener: (...args: RPCSourceChannelEvents[E]) => void): any; off(eventName: E, listener: (...args: RPCSourceChannelEvents[E]) => void): any; } export {};