ts-mailcow-api
Version:
TypeScript wrapper for the mailcow API.
27 lines (26 loc) • 798 B
TypeScript
import MailcowClient from './index';
/**
* Function that wraps T | T[] to T[]
* @internal
* @param promise - The promise of which the output to wrap.
*/
export declare function wrapPromiseToArray<T>(promise: Promise<T | T[]>): Promise<T[]>;
/**
* Factory method patterns for creating Axios Requests.
* @internal
*/
export default class RequestFactory {
private ctx;
constructor(ctx: MailcowClient);
/**
* POST Request Factory
* @param route - The route to which to send the request.
* @param payload - The payload to send with the request.
*/
post<T, P extends object>(route: string, payload: P): Promise<T>;
/**
* GET Request Factory
* @param route - The route to which to send the request.
*/
get<T>(route: string): Promise<T>;
}