Define type for WakuRelay create options

This commit is contained in:
Franck Royer 2021-06-08 22:02:22 +10:00
parent f17a008278
commit d8629b7fbc
No known key found for this signature in database
GPG Key ID: A82ED75A8DFC50A4
1 changed files with 5 additions and 2 deletions

View File

@ -36,7 +36,8 @@ interface GossipOptions {
doPX: boolean;
msgIdFn: MessageIdFunction;
messageCache: MessageCache;
globalSignaturePolicy: string;
// This option is always overridden
// globalSignaturePolicy: string;
scoreParams: Partial<PeerScoreParams>;
scoreThresholds: Partial<PeerScoreThresholds>;
directPeers: AddrInfo[];
@ -48,6 +49,8 @@ interface GossipOptions {
Dlazy: number;
}
export type WakuRelayOptions = GossipOptions;
/**
* Implements the [Waku v2 Relay protocol]{@link https://rfc.vac.dev/spec/11/}.
* Must be passed as a `pubsub` module to a {Libp2p} instance.
@ -70,7 +73,7 @@ export class WakuRelay extends Gossipsub implements Pubsub {
* @param {Libp2p} libp2p
* @param {Partial<GossipOptions>} [options]
*/
constructor(libp2p: Libp2p, options?: Partial<GossipOptions>) {
constructor(libp2p: Libp2p, options?: Partial<WakuRelayOptions>) {
super(
libp2p,
Object.assign(options, {