bugfix
This commit is contained in:
26
resources/scripts/api/http.ts
Normal file
26
resources/scripts/api/http.ts
Normal file
@@ -0,0 +1,26 @@
|
||||
/**
|
||||
* 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;
|
||||
Reference in New Issue
Block a user