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

Properties

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

Find a peer by their id.

Type declaration

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