///
import type { $MicroModuleManifest } from "../types.js";
import type { IpcHeaders } from "./helper/IpcHeaders.js";
import { IpcClientRequest } from "./ipc-message/IpcRequest.js";
import { IpcResponse } from "./ipc-message/IpcResponse.js";
import type { IpcPool } from "./IpcPool.js";
import type { IpcEndpoint } from "./endpoint/IpcEndpoint.js";
import type { $IpcMessage } from "./ipc-message/IpcMessage.js";
export declare class Ipc {
#private;
readonly pid: number;
readonly endpoint: IpcEndpoint;
readonly locale: $MicroModuleManifest;
readonly remote: $MicroModuleManifest;
readonly pool: IpcPool;
readonly debugId: string;
readonly console: any;
constructor(pid: number, endpoint: IpcEndpoint, locale: $MicroModuleManifest, remote: $MicroModuleManifest, pool: IpcPool, debugId?: string);
toString(): string;
onMessage(name: string): any;
readonly lifecycleLocaleFlow: any;
get lifecycle(): any;
onLifecycle: any;
readonly lifecycleRemoteFlow: any;
get isActivity(): boolean;
/**等待启动 */
awaitOpen(reason?: string): Promise;
/**
* 启动,会至少等到endpoint握手完成
*/
start(isAwait?: boolean, reason?: string): Promise;
startOnce: any;
private forkedIpcMap;
waitForkedIpc(pid: number): any;
/**
* 在现有的线路中分叉出一个ipc通道
* 如果自定义了 locale/remote,那么说明自己是帮别人代理
*/
fork(locale?: $MicroModuleManifest, remote?: $MicroModuleManifest, autoStart?: boolean, startReason?: string): Promise;
onFork(name: string): any;
onRequest(name: string): any;
onResponse(name: string): any;
onStream(name: string): any;
onEvent(name: string): any;
onError(name: string): any;
/** 发起请求并等待响应 */
request(url: IpcClientRequest): Promise;
request(url: string, init?: $IpcRequestInit): Promise;
postMessage(message: $IpcMessage): Promise;
private get _closePo();
awaitClosed(): any;
get onClosed(): any;
get isClosed(): boolean;
close(cause?: string): Promise;
prepareChannel(headers: IpcHeaders, channelIpc?: Ipc | Promise): any;
}
export type $IpcRequestInit = {
method?: string;
body?: null | string | ArrayBuffer | ArrayBufferView | Blob | ReadableStream;
headers?: IpcHeaders | HeadersInit;
};
//# sourceMappingURL=ipc.d.ts.map