import type { PeerId } from "@libp2p/interface-peer-id"; import type { Peer } from "@libp2p/interface-peer-store"; import { Libp2p } from "libp2p"; import { PushResponse } from "../../proto/light_push"; import { Encoder, Message, SendResult } from "../interfaces"; export declare const LightPushCodec = "/vac/waku/lightpush/2.0.0-beta1"; export { PushResponse }; export interface CreateOptions { /** * The PubSub Topic to use. Defaults to {@link DefaultPubSubTopic}. * * The usage of the default pubsub topic is recommended. * See [Waku v2 Topic Usage Recommendations](https://rfc.vac.dev/spec/23/) for details. * * @default {@link DefaultPubSubTopic} */ pubSubTopic?: string; } export interface PushOptions { peerId?: PeerId; pubSubTopic?: string; } /** * Implements the [Waku v2 Light Push protocol](https://rfc.vac.dev/spec/19/). */ export declare class WakuLightPush { libp2p: Libp2p; pubSubTopic: string; constructor(libp2p: Libp2p, options?: CreateOptions); push(encoder: Encoder, message: Partial, opts?: PushOptions): Promise; /** * Returns known peers from the address book (`libp2p.peerStore`) that support * light push protocol. Waku may or may not be currently connected to these * peers. */ peers(): Promise; /** * Returns a random peer that supports light push protocol from the address * book (`libp2p.peerStore`). Waku may or may not be currently connected to * this peer. */ randomPeer(): Promise; }