@basetime/a2w-api-ts
Version:
Client library that communicates with the addtowallet API.
33 lines (32 loc) • 844 B
TypeScript
import { Requester } from '../types/Requester';
/**
* Parent class for other endpoints.
*/
export default abstract class Endpoint {
protected req: Requester;
/**
* Constructor.
*
* @param req The object to use to make requests.
*/
constructor(req: Requester);
/**
* Makes a GET request.
*
* @param url The url to fetch.
*/
protected doGet: <T>(url: string, authenticate?: boolean) => Promise<T>;
/**
* Makes a POST request.
*
* @param url The url to fetch.
* @param body The body to send.
*/
protected doPost: <T>(url: string, body: any, authenticate?: boolean) => Promise<T>;
/**
* Makes a DELETE request.
*
* @param url The url to fetch.
*/
protected doDelete: <T>(url: string, authenticate?: boolean) => Promise<T>;
}