///
import { Response } from 'node-fetch';
import { EventEmitter } from 'events';
export declare type AllowedAlgorithms = 'sha1' | 'sha256';
export declare type RequestMethod = 'DELETE' | 'GET' | 'PATCH' | 'POST' | 'PUT' | string;
export interface AppTicket {
app?: string;
id: string;
key: string;
exp?: number;
scope?: string[];
algorithm: AllowedAlgorithms;
}
export interface RsvpPayload {
app: string;
returnUrl?: string;
UID?: string;
UIDSignature?: string;
signatureTimestamp?: string;
id_token?: string;
access_token?: string;
}
export interface Rsvp {
rsvp: string;
}
export interface BpcRequestOptions {
host?: string;
hostname?: string;
href?: string;
method?: RequestMethod;
origin?: string;
path?: string;
pathname?: string;
port?: string;
protocol?: string;
payload?: string | unknown;
headers?: object;
}
export interface BpcClientInterface {
events: EventEmitter;
app: AppTicket;
url: string;
appTicket: AppTicket | null;
request: (options: BpcRequestOptions, credentials?: AppTicket) => Promise;
requestFullResponse: (options: BpcRequestOptions, credentials?: AppTicket) => Promise;
getAppTicket: () => Promise;
reissueAppTicket: () => Promise;
connect: (app?: AppTicket, url?: string) => Promise;
}
export declare class BpcClient implements BpcClientInterface {
private readonly ticketBuffer;
private readonly errorTimeout;
private readonly requestTimeout;
app: AppTicket;
appTicket: AppTicket | null;
events: EventEmitter;
url: string;
constructor(ticketBuffer?: number, errorTimeout?: number, requestTimeout?: number);
request: (options: BpcRequestOptions, credentials?: AppTicket | null | undefined) => Promise;
requestFullResponse: (options: BpcRequestOptions, credentials?: AppTicket | null | undefined) => Promise;
getAppTicket: () => Promise;
reissueAppTicket: () => Promise;
connect: (app?: AppTicket | undefined, url?: string | undefined) => Promise;
getRsvp: (payload: RsvpPayload) => Promise;
getUserTicket: (payload: Rsvp) => Promise;
getReissuedTicket: (oldTicket: AppTicket) => Promise;
}
declare const client: BpcClient;
export default client;