UNPKG

@nekiro/kick-api

Version:

Efortlessly query kick.com api using easy to use interface with properly typed responses.

43 lines (42 loc) 1.88 kB
export declare class KickApiError extends Error { readonly status: number; readonly responseBody?: any; readonly headers?: Record<string, string>; readonly endpoint?: string; constructor(message: string, status: number, responseBody?: any, headers?: Record<string, string>, endpoint?: string); toJSON(): { name: string; message: string; status: number; responseBody: any; headers: Record<string, string> | undefined; endpoint: string | undefined; }; } export declare class KickOAuthError extends KickApiError { constructor(message: string, status: number, responseBody?: any); } export declare class KickBadRequestError extends KickApiError { constructor(message: string, responseBody?: any, endpoint?: string); } export declare class KickUnauthorizedError extends KickApiError { constructor(message?: string, responseBody?: any, endpoint?: string); } export declare class KickForbiddenError extends KickApiError { constructor(message?: string, responseBody?: any, endpoint?: string); } export declare class KickNotFoundError extends KickApiError { constructor(message?: string, responseBody?: any, endpoint?: string); } export declare class KickRateLimitError extends KickApiError { readonly retryAfter?: number; constructor(message?: string, responseBody?: any, retryAfter?: number, endpoint?: string); } export declare class KickServerError extends KickApiError { constructor(message?: string, status?: number, responseBody?: any, endpoint?: string); } export declare class KickNetworkError extends Error { readonly originalError: Error; constructor(message: string, originalError: Error); } export declare function createKickError(status: number, statusText: string, responseBody?: any, headers?: Record<string, string>, endpoint?: string): KickApiError;