import { Datagram } from "../Independents/Datagram/datagram-types.js"; import { Host, HostExtension, NamingFn } from "./Host.js"; import { Transport } from "./communication/Transport.js"; import { CHostOwnershipRecord } from "./Host.js"; import { GatewayProxy } from "./GatewayProxy.js"; import { OpenPromise } from "../index.js"; export declare class SpawningError { name: string; msg: string; constructor(name: string, msg: string); } export declare class Gateway extends Host { getGateway(): this; addChild(name: string, secret: string, registred: boolean, gateway: "gateway" | "vagrant"): CHostOwnershipRecord; get extension(): GatewayHostExtension; getNamingFunction(): NamingFn; collectGarbage(): void; isRecipient(datagram: Datagram): boolean; onReceiveDatagram(datagram: Datagram): Promise; getDownstreamProxy(host: string): GatewayProxy | null; dbgDownstreamTransports(): string; getGatewayProxy(name: string): GatewayProxy; findGatewayProxy(name: string): GatewayProxy | null; assureUpstreamTransport(seed: string, sampleTemplate: string, secret: string): void; createClientTransport(seed: string, gw: GatewayProxy): Transport; /** * Spawns an alias for this gateway and registers it at the upstream gateway * * @param nameTemplate The host name of the new alias. May include wildcards. * @param secret This secret will be used to verify that future changes are authorized * @returns The new host name (without wildcards). */ registerAtUpstream(sampleTemplate: string): Promise; } export declare class GatewayHostExtension extends HostExtension { registration: OpenPromise | null; upstreamGateway: GatewayProxy; downstreamGateways: GatewayProxy[]; }