fryorcraken.eth cc691e26ce
feat: added I prefix to message/codec interfaces
To make it easier to differentiate with their implementations.
2022-12-12 22:13:46 +11:00

19 lines
479 B
TypeScript

import type { GossipSub } from "@chainsafe/libp2p-gossipsub";
import type {
IDecodedMessage,
IDecoder,
IEncoder,
IMessage,
} from "./message.js";
import type { Callback, SendResult } from "./protocols.js";
export interface Relay extends GossipSub {
send: (encoder: IEncoder, message: IMessage) => Promise<SendResult>;
addObserver: <T extends IDecodedMessage>(
decoder: IDecoder<T>,
callback: Callback<T>
) => () => void;
getMeshPeers: () => string[];
}