Interface IPeersRepository

interface IPeersRepository {
    deleteAll: (() => MaybePromise<void>);
    getById: ((id: number, allowMin: boolean) => MaybePromise<null | PeerInfo>);
    getByPhone: ((phone: string) => MaybePromise<null | PeerInfo>);
    getByUsername: ((username: string) => MaybePromise<null | PeerInfo>);
    store: ((peer: PeerInfo) => MaybePromise<void>);
}

Properties

deleteAll: (() => MaybePromise<void>)
getById: ((id: number, allowMin: boolean) => MaybePromise<null | PeerInfo>)

Find a peer by their id.

Type declaration

getByPhone: ((phone: string) => MaybePromise<null | PeerInfo>)

Find a peer by their phone. Should never return "min" peers

getByUsername: ((username: string) => MaybePromise<null | PeerInfo>)

Find a peer by their username (where usernames includes username). Should never return "min" peers

store: ((peer: PeerInfo) => MaybePromise<void>)

Store the given peer