@nostr-wot/graph 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +104 -0
- package/dist/index.cjs +754 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +413 -0
- package/dist/index.d.ts +413 -0
- package/dist/index.js +743 -0
- package/dist/index.js.map +1 -0
- package/dist/react/index.cjs +835 -0
- package/dist/react/index.cjs.map +1 -0
- package/dist/react/index.d.cts +247 -0
- package/dist/react/index.d.ts +247 -0
- package/dist/react/index.js +829 -0
- package/dist/react/index.js.map +1 -0
- package/package.json +88 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Trust-score configuration. Ported verbatim from the extension.
|
|
3
|
+
*/
|
|
4
|
+
interface ScoringConfig {
|
|
5
|
+
/** Base score per hop distance, e.g. `{ 1: 1.0, 2: 0.5, 3: 0.25, 4: 0.1 }`. */
|
|
6
|
+
distanceWeights: Record<number, number>;
|
|
7
|
+
/** Bonus per extra shortest path, keyed by hop level, e.g. `{ 2: 0.15, 3: 0.1, 4: 0.05 }`. */
|
|
8
|
+
pathBonus: Record<number, number>;
|
|
9
|
+
/** Maximum path bonus that can be added on top of the base score. */
|
|
10
|
+
maxPathBonus: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Result of a distance query: hops from root + count of shortest paths.
|
|
14
|
+
*/
|
|
15
|
+
interface DistanceInfo {
|
|
16
|
+
/** Number of hops from the root (0 = self). */
|
|
17
|
+
hops: number;
|
|
18
|
+
/** Count of shortest paths from the root (1 for self). */
|
|
19
|
+
paths: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Graph metadata persisted alongside the follow edges.
|
|
23
|
+
*/
|
|
24
|
+
interface GraphMeta {
|
|
25
|
+
/** Root pubkey the graph was last crawled from. */
|
|
26
|
+
root: string | null;
|
|
27
|
+
/** Timestamp (ms) of the last completed crawl. */
|
|
28
|
+
lastCrawl: number | null;
|
|
29
|
+
/** Max BFS depth of the last crawl. */
|
|
30
|
+
maxDepth: number | null;
|
|
31
|
+
/** Storage schema version. */
|
|
32
|
+
version: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Aggregate storage counts.
|
|
36
|
+
*/
|
|
37
|
+
interface StorageStats {
|
|
38
|
+
/** Nodes that have a stored follow list. */
|
|
39
|
+
nodes: number;
|
|
40
|
+
/** Total follow edges across all nodes. */
|
|
41
|
+
edges: number;
|
|
42
|
+
/** Distinct interned pubkeys. */
|
|
43
|
+
uniquePubkeys: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Progress emitted while crawling.
|
|
47
|
+
*/
|
|
48
|
+
interface CrawlProgress {
|
|
49
|
+
/** Current BFS depth being fetched. */
|
|
50
|
+
depth: number;
|
|
51
|
+
/** Number of pubkeys fetched so far. */
|
|
52
|
+
fetched: number;
|
|
53
|
+
/** Number of pubkeys queued for the next depth. */
|
|
54
|
+
queued: number;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Options for {@link GraphCrawler.crawl} / {@link WotGraph.crawl}.
|
|
58
|
+
*/
|
|
59
|
+
interface CrawlOptions {
|
|
60
|
+
/** Max BFS depth. Default 2. */
|
|
61
|
+
maxDepth?: number;
|
|
62
|
+
/** Progress callback. */
|
|
63
|
+
onProgress?: (p: CrawlProgress) => void;
|
|
64
|
+
/** Abort signal to cancel the crawl. */
|
|
65
|
+
signal?: AbortSignal;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Result of a crawl.
|
|
69
|
+
*/
|
|
70
|
+
interface CrawlResult {
|
|
71
|
+
/** Pubkeys whose kind:3 was successfully fetched. */
|
|
72
|
+
fetched: number;
|
|
73
|
+
/** Nodes with a stored follow list after the crawl. */
|
|
74
|
+
nodes: number;
|
|
75
|
+
/** Total follow edges after the crawl. */
|
|
76
|
+
edges: number;
|
|
77
|
+
/** Deepest BFS depth actually reached. */
|
|
78
|
+
depth: number;
|
|
79
|
+
/** Wall-clock duration in ms. */
|
|
80
|
+
durationMs: number;
|
|
81
|
+
/** True if the crawl was aborted/stopped before finishing. */
|
|
82
|
+
stoppedEarly: boolean;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Options for {@link WotGraph.filterByWoT}.
|
|
86
|
+
*/
|
|
87
|
+
interface FilterByWoTOptions {
|
|
88
|
+
/** Only keep pubkeys within this many hops. Default 2. */
|
|
89
|
+
maxHops?: number;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* A pluggable WebSocket constructor forwarded to the underlying pool
|
|
93
|
+
* (e.g. a proxy-safe implementation).
|
|
94
|
+
*/
|
|
95
|
+
type WebSocketLike = typeof WebSocket;
|
|
96
|
+
/**
|
|
97
|
+
* Local query source consumed by `@nostr-wot/wot`'s `WoT` class.
|
|
98
|
+
* Structurally shared: `@nostr-wot/wot` declares an identical interface.
|
|
99
|
+
*/
|
|
100
|
+
interface WoTLocalSource {
|
|
101
|
+
/** Distance in hops from the root, or `null` if unreached/unknown. */
|
|
102
|
+
getDistance(target: string): number | null;
|
|
103
|
+
/** Whether `target` is within `maxHops` of the root. */
|
|
104
|
+
isInMyWoT(target: string, maxHops?: number): boolean;
|
|
105
|
+
/** Trusted subset of `pubkeys`, sorted by score descending. */
|
|
106
|
+
filterByWoT(pubkeys: string[], opts?: FilterByWoTOptions): string[];
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* IndexedDB storage for the local WoT graph.
|
|
111
|
+
*
|
|
112
|
+
* Ported from the extension (`lib/storage.ts`), generalized from per-account
|
|
113
|
+
* databases to a `namespace` key and wrapped in a class so multiple graphs can
|
|
114
|
+
* coexist. Preserves the two performance-critical techniques:
|
|
115
|
+
*
|
|
116
|
+
* - **Interning**: pubkeys (64-hex) are mapped to small integer ids, so the
|
|
117
|
+
* graph is stored/traversed as numbers instead of strings.
|
|
118
|
+
* - **Delta encoding**: each node's sorted follow-id list is stored as a
|
|
119
|
+
* `Uint32Array` of deltas, which compresses well and keeps memory bounded for
|
|
120
|
+
* the 100k+ nodes a 2-hop crawl can yield.
|
|
121
|
+
*
|
|
122
|
+
* When `indexedDB` is unavailable (Node without a polyfill) the store operates
|
|
123
|
+
* in memory-only mode: crawl/query still work, nothing is persisted.
|
|
124
|
+
*/
|
|
125
|
+
|
|
126
|
+
declare function encodeFollows(followIds: ArrayLike<number>): ArrayBuffer;
|
|
127
|
+
declare function decodeFollows(buffer: ArrayBuffer | null | undefined): Uint32Array;
|
|
128
|
+
declare class GraphStorage {
|
|
129
|
+
readonly namespace: string;
|
|
130
|
+
private db;
|
|
131
|
+
private memoryOnly;
|
|
132
|
+
private opened;
|
|
133
|
+
private pubkeyToId;
|
|
134
|
+
private idToPubkey;
|
|
135
|
+
private nextId;
|
|
136
|
+
private graphCache;
|
|
137
|
+
private metaCache;
|
|
138
|
+
private dirtyFollows;
|
|
139
|
+
private dirtyPubkeys;
|
|
140
|
+
constructor(namespace: string);
|
|
141
|
+
private dbName;
|
|
142
|
+
/** Open (or create) the namespace DB and hydrate in-memory caches. */
|
|
143
|
+
open(): Promise<void>;
|
|
144
|
+
/** Hydrate the in-memory interning + follow maps + meta from the DB. */
|
|
145
|
+
loadAll(): Promise<void>;
|
|
146
|
+
private getAll;
|
|
147
|
+
/** Numeric id for a pubkey, or null if never seen. */
|
|
148
|
+
getId(pubkey: string): number | null;
|
|
149
|
+
/** Numeric id for a pubkey, minting and buffering a new one if needed. */
|
|
150
|
+
getOrCreateId(pubkey: string): number;
|
|
151
|
+
/** Batch variant of {@link getOrCreateId}. */
|
|
152
|
+
getOrCreateIds(pubkeys: string[]): number[];
|
|
153
|
+
/** Pubkey for a numeric id, or null. */
|
|
154
|
+
getHex(id: number): string | null;
|
|
155
|
+
/** Highest assigned id (for typed-array sizing). */
|
|
156
|
+
getMaxId(): number;
|
|
157
|
+
/** Store `pubkey`'s follow list. Interns everything and updates the cache. */
|
|
158
|
+
saveFollows(pubkey: string, follows: string[]): void;
|
|
159
|
+
/** Follow ids for a node id — sync, from the in-memory cache. */
|
|
160
|
+
getFollowIdsSync(id: number): Uint32Array;
|
|
161
|
+
/** Follow ids for a pubkey (interned). Empty if unknown. */
|
|
162
|
+
getFollowIds(pubkey: string): Uint32Array;
|
|
163
|
+
/** Follow list of `pubkey` as hex strings. */
|
|
164
|
+
getFollows(pubkey: string): string[];
|
|
165
|
+
setMeta(key: string, value: unknown): Promise<void>;
|
|
166
|
+
getMeta<T = unknown>(key: string): T | undefined;
|
|
167
|
+
/** Read the structured graph meta record. */
|
|
168
|
+
getGraphMeta(): GraphMeta;
|
|
169
|
+
/** Flush buffered pubkey + follow writes to IndexedDB. No-op in memory mode. */
|
|
170
|
+
flush(): Promise<void>;
|
|
171
|
+
stats(): StorageStats;
|
|
172
|
+
/** Wipe this namespace: memory caches + persisted stores. */
|
|
173
|
+
clear(): Promise<void>;
|
|
174
|
+
/** Close the underlying DB connection. */
|
|
175
|
+
close(): void;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* BFS crawler for kind:3 contact lists.
|
|
180
|
+
*
|
|
181
|
+
* Ported from the extension (`lib/sync.ts`, `GraphSync`) but with the raw
|
|
182
|
+
* `WebSocket` transport replaced by `@nostr-wot/relay`'s pool. The pool handles
|
|
183
|
+
* connection/reconnect across relays; this class keeps the proven crawl logic:
|
|
184
|
+
*
|
|
185
|
+
* - BFS by depth: fetch the root's kind:3, enqueue its follows for the next
|
|
186
|
+
* depth, and so on up to `maxDepth`.
|
|
187
|
+
* - Newest-per-author: for each pubkey, take the kind:3 event with the highest
|
|
188
|
+
* `created_at` seen across relays.
|
|
189
|
+
* - Rate limiting: a base delay between dispatches and a max-concurrent cap.
|
|
190
|
+
* - Tolerates unreachable relays; throws `CrawlError` only when zero relays are
|
|
191
|
+
* configured to connect.
|
|
192
|
+
* - Abortable via `signal` or `stop()`; a stopped crawl leaves partial data
|
|
193
|
+
* usable and reports `stoppedEarly: true`.
|
|
194
|
+
*/
|
|
195
|
+
|
|
196
|
+
interface CrawlSubCloser {
|
|
197
|
+
close(): void;
|
|
198
|
+
}
|
|
199
|
+
interface CrawlEvent {
|
|
200
|
+
created_at: number;
|
|
201
|
+
tags: string[][];
|
|
202
|
+
[key: string]: unknown;
|
|
203
|
+
}
|
|
204
|
+
interface CrawlPool {
|
|
205
|
+
subscribe(filter: {
|
|
206
|
+
kinds?: number[];
|
|
207
|
+
authors?: string[];
|
|
208
|
+
limit?: number;
|
|
209
|
+
[key: string]: unknown;
|
|
210
|
+
}, handlers: {
|
|
211
|
+
onEvent: (e: CrawlEvent) => void;
|
|
212
|
+
onEose?: () => void;
|
|
213
|
+
onStatus?: (s: string) => void;
|
|
214
|
+
}): CrawlSubCloser;
|
|
215
|
+
getConnectedCount?(): number;
|
|
216
|
+
}
|
|
217
|
+
interface GraphCrawlerOptions {
|
|
218
|
+
pool: CrawlPool;
|
|
219
|
+
storage: GraphStorage;
|
|
220
|
+
relays: string[];
|
|
221
|
+
/** Base delay (ms) between fetch dispatches. Default 50. */
|
|
222
|
+
baseDelayMs?: number;
|
|
223
|
+
/** Max concurrent in-flight fetches. Default 5. */
|
|
224
|
+
maxConcurrent?: number;
|
|
225
|
+
/** Per-pubkey response timeout (ms). Default 10000. */
|
|
226
|
+
requestTimeoutMs?: number;
|
|
227
|
+
}
|
|
228
|
+
declare class CrawlError extends Error {
|
|
229
|
+
constructor(message: string);
|
|
230
|
+
}
|
|
231
|
+
declare class GraphCrawler {
|
|
232
|
+
private pool;
|
|
233
|
+
private storage;
|
|
234
|
+
private relays;
|
|
235
|
+
private baseDelayMs;
|
|
236
|
+
private maxConcurrent;
|
|
237
|
+
private requestTimeoutMs;
|
|
238
|
+
private aborted;
|
|
239
|
+
constructor(options: GraphCrawlerOptions);
|
|
240
|
+
/** Abort an in-flight crawl. */
|
|
241
|
+
stop(): void;
|
|
242
|
+
crawl(rootPubkey: string, opts?: CrawlOptions): Promise<CrawlResult>;
|
|
243
|
+
/**
|
|
244
|
+
* Fetch a single pubkey's newest kind:3 follow list across relays.
|
|
245
|
+
* Resolves to the follow pubkeys, or `null` if no event arrived.
|
|
246
|
+
*/
|
|
247
|
+
private fetchNewest;
|
|
248
|
+
/**
|
|
249
|
+
* Run `worker` over `items` with a max-concurrency cap and a base delay
|
|
250
|
+
* before each dispatch (preserving the crawler's per-relay rate limiting
|
|
251
|
+
* intent, now applied at the pool boundary).
|
|
252
|
+
*/
|
|
253
|
+
private mapLimited;
|
|
254
|
+
}
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* `WotGraph` — the primary public entry point.
|
|
258
|
+
*
|
|
259
|
+
* Ties the four internal layers together: a namespaced {@link GraphStorage},
|
|
260
|
+
* a BFS {@link LocalGraph}, a {@link GraphCrawler}, and the pure scoring
|
|
261
|
+
* function. Consumers create one per origin/app, `load()` to rehydrate any
|
|
262
|
+
* cached graph, `crawl()` to build/refresh it, then run O(1)/O(n) queries.
|
|
263
|
+
*/
|
|
264
|
+
|
|
265
|
+
interface WotGraphOptions {
|
|
266
|
+
/** IndexedDB partition key (e.g. the app name). */
|
|
267
|
+
namespace: string;
|
|
268
|
+
/** Relay URLs to crawl. */
|
|
269
|
+
relays: string[];
|
|
270
|
+
/** Optional shared pool; if omitted one is created from `relays`. */
|
|
271
|
+
pool?: CrawlPool;
|
|
272
|
+
/** Scoring overrides merged onto {@link DEFAULT_SCORING}. */
|
|
273
|
+
scoring?: Partial<ScoringConfig>;
|
|
274
|
+
/** WebSocket implementation forwarded to the created pool. */
|
|
275
|
+
websocketImplementation?: WebSocketLike;
|
|
276
|
+
}
|
|
277
|
+
interface WotGraphStats {
|
|
278
|
+
nodes: number;
|
|
279
|
+
edges: number;
|
|
280
|
+
root: string | null;
|
|
281
|
+
lastCrawl: number | null;
|
|
282
|
+
maxDepth: number | null;
|
|
283
|
+
}
|
|
284
|
+
declare class WotGraph {
|
|
285
|
+
readonly namespace: string;
|
|
286
|
+
private relays;
|
|
287
|
+
private scoring;
|
|
288
|
+
private websocketImplementation?;
|
|
289
|
+
private storage;
|
|
290
|
+
private graph;
|
|
291
|
+
private pool;
|
|
292
|
+
private ownPool;
|
|
293
|
+
private crawler;
|
|
294
|
+
private root;
|
|
295
|
+
private inFlight;
|
|
296
|
+
private controller;
|
|
297
|
+
private listeners;
|
|
298
|
+
constructor(options: WotGraphOptions);
|
|
299
|
+
/** Hydrate any cached graph from IndexedDB (fast path). */
|
|
300
|
+
load(): Promise<void>;
|
|
301
|
+
/**
|
|
302
|
+
* Build/refresh the graph by crawling kind:3 from `rootPubkey`.
|
|
303
|
+
* Concurrent calls return the same in-flight promise (idempotent).
|
|
304
|
+
*/
|
|
305
|
+
crawl(rootPubkey: string, opts?: CrawlOptions): Promise<CrawlResult>;
|
|
306
|
+
/** Distance info from the crawled root, or `null` if unreached/unknown. */
|
|
307
|
+
getDistance(pubkey: string): DistanceInfo | null;
|
|
308
|
+
/** Trust score 0..1 via {@link calculateScore}. */
|
|
309
|
+
getScore(pubkey: string): number;
|
|
310
|
+
/** Whether `pubkey` is within `maxHops` of the root. */
|
|
311
|
+
isInWoT(pubkey: string, maxHops?: number): boolean;
|
|
312
|
+
/** Trusted subset of `pubkeys`, sorted by score descending. */
|
|
313
|
+
filterByWoT(pubkeys: string[], opts?: FilterByWoTOptions): string[];
|
|
314
|
+
/** Follow list of `pubkey` as hex strings. */
|
|
315
|
+
getFollows(pubkey: string): string[];
|
|
316
|
+
/** Aggregate stats + crawl meta. */
|
|
317
|
+
stats(): WotGraphStats;
|
|
318
|
+
/** True if the last crawl is older than `ttlMs` (or never happened). */
|
|
319
|
+
isStale(ttlMs: number): boolean;
|
|
320
|
+
/** Wipe this namespace. */
|
|
321
|
+
clear(): Promise<void>;
|
|
322
|
+
/** Abort an in-flight crawl. Partial data stays usable. */
|
|
323
|
+
stop(): void;
|
|
324
|
+
/** Adapter for `@nostr-wot/wot`'s `WoT` class. */
|
|
325
|
+
asWoTSource(): WoTLocalSource;
|
|
326
|
+
/** The root pubkey the graph is currently answering queries from. */
|
|
327
|
+
getRoot(): string | null;
|
|
328
|
+
/** Subscribe to graph changes (crawl / load / clear). Returns an unsubscribe. */
|
|
329
|
+
onChange(cb: () => void): () => void;
|
|
330
|
+
/** Release the pool/storage this instance owns. */
|
|
331
|
+
destroy(): void;
|
|
332
|
+
private notify;
|
|
333
|
+
private resolvePool;
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
/**
|
|
337
|
+
* Centralized trust score calculation.
|
|
338
|
+
*
|
|
339
|
+
* Formula: score = base + pathBonus (capped at maxPathBonus)
|
|
340
|
+
*
|
|
341
|
+
* Where:
|
|
342
|
+
* - base: base score per hop distance (1 hop = 100%, 2 hops = 50%, etc.)
|
|
343
|
+
* - pathBonus: bonus based on number of shortest paths, capped at maxPathBonus
|
|
344
|
+
*
|
|
345
|
+
* Ported verbatim from the extension (`lib/scoring.ts`).
|
|
346
|
+
*/
|
|
347
|
+
|
|
348
|
+
declare const DEFAULT_SCORING: ScoringConfig;
|
|
349
|
+
/**
|
|
350
|
+
* Calculate trust score from hops and path count.
|
|
351
|
+
*
|
|
352
|
+
* @param hops - Number of hops (0 = self, 1 = direct follow, etc.)
|
|
353
|
+
* @param paths - Number of shortest paths (null if unknown)
|
|
354
|
+
* @param scoring - Scoring configuration
|
|
355
|
+
* @returns Score between 0 and 1
|
|
356
|
+
*/
|
|
357
|
+
declare function calculateScore(hops: number | null | undefined, paths: number | null, scoring?: ScoringConfig): number;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* In-memory BFS over the hydrated follow graph.
|
|
361
|
+
*
|
|
362
|
+
* Ported from the extension (`lib/graph.ts`, `LocalGraph`). Given the interned
|
|
363
|
+
* follow map (from {@link GraphStorage}) and a root pubkey, a single BFS pass
|
|
364
|
+
* fills two typed arrays indexed by node id:
|
|
365
|
+
*
|
|
366
|
+
* - `hops` (`Uint8Array`) — distance from root, stored as `hop + 1` so `0`
|
|
367
|
+
* means "not reached" (255 max).
|
|
368
|
+
* - `paths` (`Uint32Array`) — count of shortest paths to each node.
|
|
369
|
+
*
|
|
370
|
+
* The cache is keyed by root and invalidated on crawl / root change / clear.
|
|
371
|
+
*/
|
|
372
|
+
|
|
373
|
+
declare class LocalGraph {
|
|
374
|
+
private storage;
|
|
375
|
+
private cache;
|
|
376
|
+
private cachedRoot;
|
|
377
|
+
constructor(storage: GraphStorage);
|
|
378
|
+
/** Invalidate the precomputed cache (called on crawl / root change / clear). */
|
|
379
|
+
invalidateCache(): void;
|
|
380
|
+
/**
|
|
381
|
+
* Precompute hops and paths from a root pubkey using a single BFS pass.
|
|
382
|
+
* Results stored in typed arrays indexed by node id for O(1) lookup.
|
|
383
|
+
*/
|
|
384
|
+
private buildCache;
|
|
385
|
+
/** Ensure the cache is built for `root`. */
|
|
386
|
+
private ensureCache;
|
|
387
|
+
/**
|
|
388
|
+
* Distance info from `root` to `pubkey`. Returns `{ hops, paths }`, or `null`
|
|
389
|
+
* when unreached / unknown. Self → `{ hops: 0, paths: 1 }`.
|
|
390
|
+
*/
|
|
391
|
+
getDistance(root: string, pubkey: string, maxHops?: number): DistanceInfo | null;
|
|
392
|
+
/** Follow list of `pubkey` as hex strings. */
|
|
393
|
+
getFollows(pubkey: string): string[];
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Adapter turning a {@link WotGraph} into the small `WoTLocalSource` shape that
|
|
398
|
+
* `@nostr-wot/wot`'s `WoT` class can consume as a local query source instead of
|
|
399
|
+
* the remote Oracle.
|
|
400
|
+
*/
|
|
401
|
+
|
|
402
|
+
/** Minimal surface {@link createWoTSource} needs from a graph. */
|
|
403
|
+
interface WoTSourceGraph {
|
|
404
|
+
getDistance(pubkey: string): {
|
|
405
|
+
hops: number;
|
|
406
|
+
paths: number;
|
|
407
|
+
} | null;
|
|
408
|
+
isInWoT(pubkey: string, maxHops?: number): boolean;
|
|
409
|
+
filterByWoT(pubkeys: string[], opts?: FilterByWoTOptions): string[];
|
|
410
|
+
}
|
|
411
|
+
declare function createWoTSource(graph: WoTSourceGraph): WoTLocalSource;
|
|
412
|
+
|
|
413
|
+
export { CrawlError, type CrawlEvent, type CrawlOptions, type CrawlPool, type CrawlProgress, type CrawlResult, type CrawlSubCloser, DEFAULT_SCORING, type DistanceInfo, type FilterByWoTOptions, GraphCrawler, type GraphCrawlerOptions, type GraphMeta, GraphStorage, LocalGraph, type ScoringConfig, type StorageStats, type WebSocketLike, type WoTLocalSource, type WoTSourceGraph, WotGraph, type WotGraphOptions, type WotGraphStats, calculateScore, createWoTSource, decodeFollows, encodeFollows };
|