integreat-transporter-http
Version:
HTTP transporter for Integreat
9 lines (8 loc) • 673 B
TypeScript
import type { Action, Response, Headers } from 'integreat';
export declare const dataFromResponse: (response: Response) => string | undefined;
export declare function statusCodeFromResponse(response: Response): 200 | 201 | 400 | 401 | 403 | 404 | 408 | 429 | 500;
export declare const normalizeHeaders: (headers?: Record<string, string | string[] | undefined>) => {
[k: string]: string | string[] | undefined;
} | undefined;
export declare const createResponse: (action: Action, status: string, data: unknown, error?: string, headers?: Headers) => Response;
export declare function createResponseWithError(action: Action, url: string, err: unknown): Response<unknown>;