From b65ab17cb935305d862035c31a22e21da553e54f Mon Sep 17 00:00:00 2001 From: Franck Royer Date: Thu, 13 Jan 2022 16:09:01 +1100 Subject: [PATCH] Expose types to ensure documentation is complete --- src/lib/discovery/dns.ts | 2 +- src/lib/discovery/enrtree.ts | 4 ++-- src/lib/discovery/index.ts | 4 ++-- src/lib/enr/index.ts | 1 + 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/lib/discovery/dns.ts b/src/lib/discovery/dns.ts index ba3efd00f6..34f4b2b10a 100644 --- a/src/lib/discovery/dns.ts +++ b/src/lib/discovery/dns.ts @@ -9,7 +9,7 @@ import { ENRTree } from './enrtree'; const dbg = debug('waku:discovery:dns'); -type SearchContext = { +export type SearchContext = { domain: string; publicKey: string; visits: { [key: string]: boolean }; diff --git a/src/lib/discovery/enrtree.ts b/src/lib/discovery/enrtree.ts index 369b294c02..718dad922b 100644 --- a/src/lib/discovery/enrtree.ts +++ b/src/lib/discovery/enrtree.ts @@ -7,14 +7,14 @@ import { ecdsaVerify } from 'secp256k1'; import { ENR } from '../enr'; import { keccak256Buf } from '../utils'; -type ENRRootValues = { +export type ENRRootValues = { eRoot: string; lRoot: string; seq: number; signature: string; }; -type ENRTreeValues = { +export type ENRTreeValues = { publicKey: string; domain: string; }; diff --git a/src/lib/discovery/index.ts b/src/lib/discovery/index.ts index d18088a0d4..5ca9251fa9 100644 --- a/src/lib/discovery/index.ts +++ b/src/lib/discovery/index.ts @@ -2,9 +2,9 @@ import { shuffle } from 'libp2p-gossipsub/src/utils'; export { getNodesFromHostedJson } from './hosted_json'; export { Bootstrap, BootstrapOptions } from './bootstrap'; -export { DnsClient, DnsNodeDiscovery } from './dns'; +export { DnsClient, DnsNodeDiscovery, SearchContext } from './dns'; export { Endpoints, DnsOverHttps } from './dns_over_https'; -export { ENRTree } from './enrtree'; +export { ENRTree, ENRTreeValues, ENRRootValues } from './enrtree'; export function getPseudoRandomSubset( values: T[], diff --git a/src/lib/enr/index.ts b/src/lib/enr/index.ts index 79f8330afc..8dc9b8c077 100644 --- a/src/lib/enr/index.ts +++ b/src/lib/enr/index.ts @@ -4,3 +4,4 @@ export * from './constants'; export * from './enr'; export * from './types'; export * from './create'; +export * from './keypair';