mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-09-22 10:37:06 +00:00
Adopt focused P2P service views
This commit is contained in:
@@ -1,12 +1,20 @@
|
||||
import type { RequiredServices } from "@vrtmrz/livesync-commonlib/compat/interfaces/ServiceModule";
|
||||
import type { P2PServiceViews } from "@vrtmrz/livesync-commonlib/p2p";
|
||||
import type { PeerStatus } from "@vrtmrz/livesync-commonlib/compat/replication/trystero/P2PReplicatorPaneCommon";
|
||||
import type { UseP2PReplicatorResult } from "@vrtmrz/livesync-commonlib/compat/replication/trystero/UseP2PReplicatorResult";
|
||||
|
||||
export type P2PReplicatorHandle = Pick<UseP2PReplicatorResult, "replicator">;
|
||||
/**
|
||||
* The shared pane only needs the contracts which represent its visible
|
||||
* actions. In particular, it must not receive the compatibility Replicator
|
||||
* facade, whose lifecycle methods can bypass the stable P2P service owner.
|
||||
*/
|
||||
export type P2PReplicatorPaneP2P = Pick<
|
||||
P2PServiceViews,
|
||||
"transportLifecycle" | "peerDirectory" | "peerAdmission" | "targetedTransfer" | "changeRelay" | "diagnostics"
|
||||
>;
|
||||
|
||||
/** Host capabilities consumed by the shared P2P pane. */
|
||||
export interface P2PReplicatorPaneHost {
|
||||
readonly services: RequiredServices<"API" | "config" | "setting" | "vault">;
|
||||
readonly p2p: P2PReplicatorHandle;
|
||||
readonly p2p: P2PReplicatorPaneP2P;
|
||||
readonly showPeerMenu?: (peer: PeerStatus, event: MouseEvent) => void;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user