import { KosFetchOptions } from '../types';

/**
 * Resolves the service URL configuration.
 * @param _service - The optional service name (not used).
 * @returns An object with `isMock` and `URL` properties.
 */
export declare const resolveBaseUrl: () => {
    isMock: boolean;
    URL: string;
};
type NonNeverKeys<T> = {
    [K in keyof T]-?: T[K] extends never | undefined ? never : K;
}[keyof T];
export type AvailableMethods<T> = Exclude<NonNeverKeys<T>, "parameters" | "requestBody">;
export type PathsByMethod<T> = {
    [Method in "get" | "put" | "post" | "delete"]: {
        [K in keyof T]: Method extends AvailableMethods<T[K]> ? K : never;
    }[keyof T & keyof {
        [K in keyof T]: Method extends keyof T[K] ? K : never;
    }];
};
type ClientGetParams<Paths extends Record<string, any>, K extends keyof Paths> = Paths[K]["get"] extends {
    parameters: infer P;
} ? P : never;
type ClientPostParams<Paths extends Record<string, any>, K extends keyof Paths> = Paths[K]["post"] extends {
    parameters: infer P;
} ? P : never;
type ClientPutParams<Paths extends Record<string, any>, K extends keyof Paths> = Paths[K]["put"] extends {
    parameters: infer P;
} ? P : never;
type ClientDeleteParams<Paths extends Record<string, any>, K extends keyof Paths> = Paths[K]["delete"] extends {
    parameters: infer P;
} ? P : never;
type ClientPostBody<Paths extends Record<string, any>, K extends keyof Paths> = Paths[K]["post"] extends {
    requestBody: {
        content: infer B;
    };
} ? B[keyof B] : never;
type ClientPutBody<Paths extends Record<string, any>, K extends keyof Paths> = Paths[K]["put"] extends {
    requestBody: {
        content: infer B;
    };
} ? B[keyof B] : never;
export type ClientResponse<Paths extends Record<string, any>, K extends keyof Paths, M extends AvailableMethods<Paths[K]> | string> = Paths[K][M] extends {
    responses: {
        200: {
            content: infer R;
        };
    };
} ? R[keyof R] : unknown;
export type ServiceResponse<T> = [string, null] | [null, T];
export type DeepRequired<T> = {
    [K in keyof T]-?: T[K] extends object ? DeepRequired<T[K]> : T[K];
};
export type ElementType<T> = T extends (infer U)[] ? U : never;
type RequestOptions = Omit<KosFetchOptions, "method" | "body">;
export declare function createClient<Paths extends Record<string, any>>(): {
    get: <K_1 extends { [K in keyof Paths]: "get" extends infer T ? T extends "get" ? T extends Exclude<NonNeverKeys<Paths[K]>, "parameters" | "requestBody"> ? K : never : never : never; }[keyof Paths]>(endpoint: K_1, params?: ClientGetParams<Paths, K_1> | undefined, options?: RequestOptions) => Promise<ServiceResponse<ClientResponse<Paths, K_1, "get">>>;
    post: <K_3 extends { [K_2 in keyof Paths]: "post" extends infer T_1 ? T_1 extends "post" ? T_1 extends Exclude<NonNeverKeys<Paths[K_2]>, "parameters" | "requestBody"> ? K_2 : never : never : never; }[keyof Paths]>(endpoint: K_3, params?: ClientPostParams<Paths, K_3> | undefined, body?: ClientPostBody<Paths, K_3> | undefined, options?: RequestOptions) => Promise<ServiceResponse<ClientResponse<Paths, K_3, "post">>>;
    put: <K_5 extends { [K_4 in keyof Paths]: "put" extends infer T_2 ? T_2 extends "put" ? T_2 extends Exclude<NonNeverKeys<Paths[K_4]>, "parameters" | "requestBody"> ? K_4 : never : never : never; }[keyof Paths]>(endpoint: K_5, params?: ClientPutParams<Paths, K_5> | undefined, body?: ClientPutBody<Paths, K_5> | undefined, options?: RequestOptions) => Promise<ServiceResponse<ClientResponse<Paths, K_5, "put">>>;
    delete: <K_7 extends { [K_6 in keyof Paths]: "delete" extends infer T_3 ? T_3 extends "delete" ? T_3 extends Exclude<NonNeverKeys<Paths[K_6]>, "parameters" | "requestBody"> ? K_6 : never : never : never; }[keyof Paths]>(endpoint: K_7, params?: ClientDeleteParams<Paths, K_7> | undefined, body?: ClientPutBody<Paths, K_7> | undefined, options?: RequestOptions) => Promise<ServiceResponse<ClientResponse<Paths, K_7, "delete">>>;
};
export {};
//# sourceMappingURL=kos-service-request.d.ts.map