import type { FetchResponse, FetchErrorResponse, Headers, AdapterErrorResponse, NetworkAdapterErrorResponse } from '@luvio/engine';
import { HttpStatusCode } from '@luvio/engine';
export declare const NATIVE_ERROR_CODE = "NATIVE_ERROR";
export declare const NON_MUTATING_ADAPTER_MESSAGE = "adapterId must be a mutating adapter";
export declare const NO_DRAFT_CREATED_MESSAGE = "the adapter did not generate a draft";
export declare const DRAFT_DOESNT_EXIST_MESSAGE = "the specified draft does not exist";
/**
 * Error objects don't serialize well over the js-native wire, so our class turns
 * an Error into an object that serializes real nice
 */
export declare class NativeNetworkAdapterErrorResponse implements NetworkAdapterErrorResponse {
    message: string;
    name: string;
    errorType: NetworkAdapterErrorResponse['errorType'];
    constructor(error: NetworkAdapterErrorResponse);
}
export declare class NativeAdapterErrorResponse implements AdapterErrorResponse {
    errorType: AdapterErrorResponse['errorType'];
    error: unknown;
    constructor(error: AdapterErrorResponse);
}
/**
 * NativeErrorResponse is the native version of Luvio's ErrorResponse type.
 *
 * It is either a non-ok http response or an Error.  It has a discriminator property
 * "errorType" to distinguish between the two types of errors.
 */
export type NativeErrorResponse = NativeFetchErrorResponse | NativeNetworkAdapterErrorResponse | NativeAdapterErrorResponse;
export declare class NativeFetchResponse<T> implements FetchResponse<T> {
    status: HttpStatusCode;
    body: T;
    headers: Headers;
    constructor(status: HttpStatusCode, body: T);
    get statusText(): string;
    get ok(): boolean;
}
export declare class NativeFetchErrorResponse extends NativeFetchResponse<unknown> implements FetchErrorResponse {
    errorType: FetchErrorResponse['errorType'];
}
export declare function createNativeFetchErrorResponse(message: string): NativeFetchErrorResponse;
/**
 * This function takes an unknown error and normalizes it to an Error object
 */
export declare function normalizeError(error: unknown): Error;
