UNPKG

livelists-node-js

Version:
22 lines (21 loc) 805 B
import { AxiosInstance } from 'axios'; import { ITwirpArgs, IReqArgs } from '../types/twirp.types'; import { RPCPackages } from './const/RPCPackages'; import { CreateChannelResponse } from "../proto/channel"; import { AddParticipantToChannelRes, GetParticipantAccessTokenRes } from "../proto/participant"; type ServicesResponses = CreateChannelResponse | AddParticipantToChannelRes | GetParticipantAccessTokenRes; export interface Rpc { request(data: IReqArgs): Promise<ServicesResponses>; } /** * JSON based Twirp V7 RPC */ export declare class TwirpRpc { host: string; pkg: RPCPackages; prefix: string; instance: AxiosInstance; constructor({ host, pkg, prefix }: ITwirpArgs); request({ service, method, data, headers, }: IReqArgs): Promise<ServicesResponses>; } export {};