UNPKG

@uipath/robot

Version:

UiPath Robot javascript SDK enabling web pages to interact with UiPath Robots

31 lines (30 loc) 1.13 kB
import { Deferred } from '../utils'; /** * Generic response model */ export declare class Response<T> { private httpStatus; statusText: string; isDomainAllowed: boolean; data?: T | undefined; error?: string | undefined; /** * * @param httpStatus Http status of the response * @param statusText Http status text of the response * @param isDomainAllowed Flag returned by the Server, saying if the domain is allowed by configuration * @param data Response data if any * @param error Handled error response if any */ constructor(httpStatus: number, statusText: string, isDomainAllowed: boolean, data?: T | undefined, error?: string | undefined); get isSuccess(): boolean; get isUnauthorized(): boolean; get isForbidden(): boolean; get isEmpty(): boolean; get isNotFound(): boolean; /** * Resolve promise if its a successful response. Throws error if response was unsuccessful. * @param promise promise which will be resolved if response was successful. */ resolve: (promise: Deferred<T>) => void; }