refactoring from previous pr

This commit is contained in:
ennmichael
2023-02-27 00:00:08 +01:00
parent 408be48082
commit fe45cb4beb
2 changed files with 23 additions and 24 deletions

View File

@ -12,24 +12,7 @@ export class Nostr {
/**
* Open connections to relays.
*/
readonly #conns: Map<
string,
{
conn: Conn
/**
* Has this connection been authenticated via NIP-44 AUTH?
*/
auth: boolean
/**
* Should this connection be used for receiving messages?
*/
read: boolean
/**
* Should this connection be used for publishing events?
*/
write: boolean
}
> = new Map()
readonly #conns: Map<string, ConnState> = new Map()
/**
* Mapping of subscription IDs to corresponding filters.
@ -236,6 +219,22 @@ export class Nostr {
}
}
interface ConnState {
conn: Conn
/**
* Has this connection been authenticated via NIP-44 AUTH?
*/
auth: boolean
/**
* Should this connection be used for receiving messages?
*/
read: boolean
/**
* Should this connection be used for publishing events?
*/
write: boolean
}
/**
* A string uniquely identifying a client subscription.
*/