UNPKG

starchild-widget

Version:

Starchild Widget

39 lines 1.18 kB
import { ApiConfig, RequestOptions, ApiResponse } from '../../types'; export declare const API_LANG_MAP: { [lang: string]: string; }; export declare class ApiClient { private config; constructor(config: ApiConfig); /** * GET request */ get<T = any>(endpoint: string, options?: RequestOptions): Promise<ApiResponse<T>>; /** * POST request */ post<T = any>(endpoint: string, data?: any, options?: RequestOptions): Promise<ApiResponse<T>>; /** * DELETE request */ delete<T = any>(endpoint: string, data?: any, options?: RequestOptions): Promise<ApiResponse<T>>; /** * PUT request */ put<T = any>(endpoint: string, data?: any, options?: RequestOptions): Promise<ApiResponse<T>>; setAccountId(accountId: string): void; setAiChatKey(aiChatKey: string): void; setLanguage(language: string): void; clearAccountId(): void; clearAiChatKey(): void; /** * Base request method */ private request; /** * Build complete URL */ private buildUrl; } export declare function createApiClient(config: ApiConfig): ApiClient; //# sourceMappingURL=client.d.ts.map