UNPKG

@chez14/mal-api-lite

Version:
34 lines (28 loc) 917 B
/* eslint @typescript-eslint/no-explicit-any: 0 */ export interface RequestParam { [key: string]: any; } /** * Pagination parameters. Set the limit, offset, and requested fields. */ export interface PaginatableRequestParam extends RequestParam { limit?: number; offset?: number; /** * List of fields, comma separated. If this option filled with array, it will * automatically converted to comma-separated string. */ fields?: string | string[]; } export interface BaseRequester { get<T = any>(resource: string, param?: RequestParam | PaginatableRequestParam): Promise<T>; post<T = any>(resource: string, param?: RequestParam): Promise<T>; patch<T = any>(resource: string, param?: RequestParam): Promise<T>; delete<T = any>(resource: string): Promise<T>; } export interface TokenResponse { access_token: string; refresh_token: string; token_type: string; expires_in: number; }