@aurigma/design-atoms
Version:
Design Atoms is a part of Customer's Canvas SDK which allows for manipulating individual design elements through your code.
46 lines (45 loc) • 1.18 kB
TypeScript
export declare const request: (parameters: IRequestParameters) => Promise<IResponse>;
export declare const getJson: (url: string) => Promise<IResponse>;
export declare const postJson: (url: string, data: string) => Promise<IResponse>;
export declare enum StatusCode {
Ok = 200,
NoContent = 204,
NotFound = 404,
InternalServerError = 500
}
export interface IRequestParameters {
type: string;
url: string;
headers?: {
name: string;
value: string;
}[];
responseType?: XMLHttpRequestResponseType;
data?: string;
}
export interface IResponse {
value: string;
status: number;
contentType: string;
xhr: XMLHttpRequest;
}
export declare class Exception {
response: IResponse;
constructor(response: IResponse);
}
export declare module RequestType {
const post = "POST";
const get = "GET";
const Delete = "DELETE";
}
export declare module ContentType {
function isJsonContentType(contentType: string): boolean;
const json: {
name: string;
value: string;
};
const text: {
name: string;
value: string;
};
}