mirror of
https://github.com/logos-messaging/logos-delivery-js.git
synced 2026-03-10 03:33:41 +00:00
* move protocol result type to interfaces * chore: update type names for verbosity * feat(filter-core): convert error throws to return types * chore: update types & imports * update Filter API * chore: update createSubscription * chore: update imports & rename * chore: update all tests * chore: resolve conflicts & merge (2/n) * chore: resolve conflicts & merge (3/n) * chore: resolve conflicts & merge (4/n) * chore: resolve conflicts & merge (5/n) * chore: resolve conflicts & merge (6/n) * chore: use idiomatic approach * chore: fix tests * chore: address comments * chore: fix test * rm: only
15 lines
605 B
TypeScript
15 lines
605 B
TypeScript
import type { PeerId } from "@libp2p/interface";
|
|
|
|
import { type ShardInfo } from "./enr.js";
|
|
import { ThisOrThat } from "./misc.js";
|
|
import type { IBaseProtocolCore, ShardingParams } from "./protocols.js";
|
|
|
|
export type MetadataQueryResult = ThisOrThat<"shardInfo", ShardInfo>;
|
|
|
|
// IMetadata always has shardInfo defined while it is optionally undefined in IBaseProtocol
|
|
export interface IMetadata extends Omit<IBaseProtocolCore, "shardInfo"> {
|
|
shardInfo: ShardingParams;
|
|
confirmOrAttemptHandshake(peerId: PeerId): Promise<MetadataQueryResult>;
|
|
query(peerId: PeerId): Promise<MetadataQueryResult>;
|
|
}
|