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

Implemented by

Properties

deleteAll: () => MaybePromise<void>
getById: (id: number) => MaybePromise<null | IPeersRepository.PeerInfo>

Find a peer by their id. Should return a "min" peer if one is available.

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

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

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

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

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

Store the given peer