customerio-gist-web
Version:
Build beautiful in-app flows with no code and deliver them instantly to your app. http://customer.io
21 lines (20 loc) • 724 B
TypeScript
export interface NetworkResponse {
status: number;
headers: Record<string, string>;
data: unknown;
}
export interface NetworkError extends Error {
response: NetworkResponse;
}
export declare function getNetworkErrorResponse(error: unknown): NetworkResponse | undefined;
export interface RequestOptions {
method?: string;
headers?: Record<string, string>;
body?: string;
}
export type UserNetworkRequest = ((path: string, options?: RequestOptions) => Promise<NetworkResponse>) & {
post: (path: string, data?: Record<string, unknown>, config?: {
headers?: Record<string, string>;
}) => Promise<NetworkResponse>;
};
export declare function UserNetworkInstance(): UserNetworkRequest;