Import packages/plugin/src/types.ts

This commit is contained in:
QQ 2026-11-14 14:58:12 +08:00
parent 26b4ba7807
commit 951290d47f
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
import type { RemoteMessage } from '@dsh-remote/protocol'
export interface AuthenticatedPeerChannel {
/**
* Attestation supplied by the Noise/control-plane integration. Implementors
* must expose this channel only after both the Noise IK transcript and the
* Server membership for this exact connection have been verified.
*/
readonly security: {
protocol: 'Noise_IK_25519_ChaChaPoly_SHA256'
connectionId: string
membershipId: string
}
readonly peerDeviceId: string
readonly peerIdentityKey: string
readonly mode?: 'LAN' | 'P2P' | 'TURN' | 'Relay'
send(message: RemoteMessage): Promise<void>
onMessage(handler: (message: RemoteMessage) => void): () => void
close(code?: string): Promise<void>
}