27 lines
1001 B
TypeScript
27 lines
1001 B
TypeScript
/**
|
|
* Type stub for Pterodactyl's internal @/api/http module.
|
|
* This file exists ONLY for IDE type resolution in the standalone addon repo.
|
|
* When installed into Pterodactyl Panel, the real module is used from the panel's src.
|
|
*
|
|
* @author Ball Studios <https://git.balls.studio>
|
|
*/
|
|
|
|
export interface ApiResponse<T = unknown> {
|
|
data: T;
|
|
status: number;
|
|
statusText: string;
|
|
headers: Record<string, string>;
|
|
}
|
|
|
|
/** Minimal Axios-compatible interface sufficient for IDE resolution. */
|
|
interface HttpClient {
|
|
get<T = any>(url: string, config?: object): Promise<ApiResponse<T>>;
|
|
post<T = any>(url: string, data?: unknown, config?: object): Promise<ApiResponse<T>>;
|
|
put<T = any>(url: string, data?: unknown, config?: object): Promise<ApiResponse<T>>;
|
|
patch<T = any>(url: string, data?: unknown, config?: object): Promise<ApiResponse<T>>;
|
|
delete<T = any>(url: string, config?: object): Promise<ApiResponse<T>>;
|
|
}
|
|
|
|
declare const http: HttpClient;
|
|
export default http;
|