openblox
Version:
Roblox API Wrapper For Both Classic And OpenCloud APIs.
43 lines (42 loc) • 1.39 kB
TypeScript
import type { ObjectPrettify, Prettify, UrlSecure } from "typeforge";
import type { AnyError as AnyRobloxError } from "parse-roblox-errors";
import type { RestMethod } from "../utils/utils.types";
export type RobloxCookie = `_|WARNING:-DO-NOT-SHARE-THIS.--Sharing-this-will-allow-someone-to-log-in-as-you-and-to-steal-your-ROBUX-and-items.|${string}`;
export type HttpHandlerProps = {
url: UrlSecure;
method: RestMethod;
headers?: Record<string, any>;
body?: any;
formData?: Record<string, any>;
};
export type Credentials = {
cookie?: RobloxCookie;
cloudKey?: string;
oauthToken?: string;
};
export type HttpResponseProps<Body extends any = any> = ObjectPrettify<{
fullResponse: any;
url: UrlSecure;
method: RestMethod;
success: boolean;
statusCode: number;
headers: Headers;
body: Body;
}>;
export declare class HttpResponse<Body extends any = any> {
fullResponse: unknown;
url: UrlSecure;
method: RestMethod;
success: boolean;
statusCode: number;
headers: Headers;
body: Prettify<Body>;
constructor(props: HttpResponseProps);
}
export declare class HttpError {
type: "Csrf" | "Generic";
errors: AnyRobloxError[];
response: HttpResponse;
constructor(type: "Csrf" | "Generic", response: HttpResponse, errors: AnyRobloxError[]);
}
export type { HttpAdapter } from "./httpAdapters";