/** * @license * Copyright 2022-2026 Matter.js Authors * SPDX-License-Identifier: Apache-2.0 */ import { Environment } from "#environment/Environment.js"; import { Environmental } from "#environment/Environmental.js"; import { Bytes } from "#util/Bytes.js"; import { BasicSet } from "#util/Set.js"; import { Channel, ChannelType } from "./Channel.js"; import { ServerAddress } from "./ServerAddress.js"; /** * A local network endpoint associated with a specific {@link ServerAddress} for a connectionless protocol. */ export interface ConnectionlessTransport { onData(listener: (socket: Channel, data: Bytes) => void): ConnectionlessTransport.Listener; close(): Promise; supports(type: ChannelType, address?: string): boolean; openChannel(address: ServerAddress): Promise>; } export declare namespace ConnectionlessTransport { interface Listener { close(): Promise; } } /** * A collection of {@link ConnectionlessTransport}s managed as a unit. */ export declare class ConnectionlessTransportSet extends BasicSet { constructor(...initialInterfaces: T[]); static [Environmental.create](env: Environment): ConnectionlessTransportSet; /** * Closes all interfaces. */ close(): Promise; /** * Obtain an interface capable of routing an address. */ interfaceFor(type: ChannelType, address?: string): T | undefined; /** * Obtain an interface of specific type. */ hasInterfaceFor(type: ChannelType, address?: string): boolean; } //# sourceMappingURL=ConnectionlessTransport.d.ts.map