@tdb/util
Version:
Shared helpers and utilities.
24 lines (20 loc) • 418 B
text/typescript
export type HttpMethod = 'GET' | 'POST';
export type IHttpResponse<T> = {
ok: boolean;
status: number;
statusText: string;
elapsed: number; // Milliseconds.
data: T;
};
export type IHttpHeaders = {
[key: string]: string;
};
export type IHttpEvent = {
id: string;
stage: 'START' | 'COMPLETE';
method: HttpMethod;
headers: Headers;
url: string;
data?: any;
response?: IHttpResponse<any>;
};