import * as Effect from "effect/Effect";
import * as ParseResult from "effect/ParseResult";
import type { Simplify } from "effect/Types";
import * as HttpApi from "./HttpApi.js";
import type { HttpApiEndpoint } from "./HttpApiEndpoint.js";
import type { HttpApiGroup } from "./HttpApiGroup.js";
import * as HttpClient from "./HttpClient.js";
import * as HttpClientError from "./HttpClientError.js";
import * as HttpClientResponse from "./HttpClientResponse.js";
import type { HttpApiMiddleware } from "./index.js";
/**
 * @since 1.0.0
 * @category models
 */
export type Client<Groups extends HttpApiGroup.Any, ApiError> = Simplify<{
    readonly [Group in Extract<Groups, {
        readonly topLevel: false;
    }> as HttpApiGroup.Name<Group>]: Client.Group<Group, Group["identifier"], ApiError>;
} & {
    readonly [Method in Client.TopLevelMethods<Groups, ApiError> as Method[0]]: Method[1];
}>;
/**
 * @since 1.0.0
 * @category models
 */
export declare namespace Client {
    /**
     * @since 1.0.0
     * @category models
     */
    type Group<Groups extends HttpApiGroup.Any, GroupName extends Groups["identifier"], ApiError> = [
        HttpApiGroup.WithName<Groups, GroupName>
    ] extends [
        HttpApiGroup<infer _GroupName, infer _Endpoints, infer _GroupError, infer _GroupErrorR>
    ] ? {
        readonly [Endpoint in _Endpoints as HttpApiEndpoint.Name<Endpoint>]: Method<Endpoint, ApiError, _GroupError>;
    } : never;
    /**
     * @since 1.0.0
     * @category models
     */
    type Method<Endpoint, ApiError, GroupError> = [Endpoint] extends [
        HttpApiEndpoint<infer _Name, infer _Method, infer _Path, infer _UrlParams, infer _Payload, infer _Headers, infer _Success, infer _Error, infer _R, infer _RE>
    ] ? <WithResponse extends boolean = false>(request: Simplify<HttpApiEndpoint.ClientRequest<_Path, _UrlParams, _Payload, _Headers, WithResponse>>) => Effect.Effect<WithResponse extends true ? [_Success, HttpClientResponse.HttpClientResponse] : _Success, _Error | GroupError | ApiError | HttpClientError.HttpClientError | ParseResult.ParseError> : never;
    /**
     * @since 1.0.0
     * @category models
     */
    type TopLevelMethods<Groups extends HttpApiGroup.Any, ApiError> = Extract<Groups, {
        readonly topLevel: true;
    }> extends HttpApiGroup<infer _Id, infer _Endpoints, infer _Error, infer _ErrorR, infer _TopLevel> ? _Endpoints extends infer Endpoint ? [HttpApiEndpoint.Name<Endpoint>, Method<Endpoint, ApiError, _Error>] : never : never;
}
/**
 * @since 1.0.0
 * @category constructors
 */
export declare const make: <ApiId extends string, Groups extends HttpApiGroup.Any, ApiError, ApiR>(api: HttpApi.HttpApi<ApiId, Groups, ApiError, ApiR>, options?: {
    readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined;
    readonly transformResponse?: ((effect: Effect.Effect<unknown, unknown>) => Effect.Effect<unknown, unknown>) | undefined;
    readonly baseUrl?: string | undefined;
}) => Effect.Effect<Simplify<Client<Groups, ApiError>>, never, HttpApiMiddleware.HttpApiMiddleware.Without<ApiR | HttpApiGroup.ClientContext<Groups>> | HttpClient.HttpClient>;
/**
 * @since 1.0.0
 * @category constructors
 */
export declare const group: <ApiId extends string, Groups extends HttpApiGroup.Any, ApiError, ApiR, const GroupName extends Groups["identifier"]>(api: HttpApi.HttpApi<ApiId, Groups, ApiError, ApiR>, groupId: GroupName, options?: {
    readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined;
    readonly transformResponse?: ((effect: Effect.Effect<unknown, unknown>) => Effect.Effect<unknown, unknown>) | undefined;
    readonly baseUrl?: string | undefined;
}) => Effect.Effect<Client.Group<Groups, GroupName, ApiError>, never, HttpApiMiddleware.HttpApiMiddleware.Without<ApiR | HttpApiGroup.ClientContext<HttpApiGroup.WithName<Groups, GroupName>>> | HttpClient.HttpClient>;
/**
 * @since 1.0.0
 * @category constructors
 */
export declare const endpoint: <ApiId extends string, Groups extends HttpApiGroup.Any, ApiError, ApiR, const GroupName extends HttpApiGroup.Name<Groups>, const EndpointName extends HttpApiEndpoint.Name<HttpApiGroup.EndpointsWithName<Groups, GroupName>>>(api: HttpApi.HttpApi<ApiId, Groups, ApiError, ApiR>, groupName: GroupName, endpointName: EndpointName, options?: {
    readonly transformClient?: ((client: HttpClient.HttpClient) => HttpClient.HttpClient) | undefined;
    readonly transformResponse?: ((effect: Effect.Effect<unknown, unknown>) => Effect.Effect<unknown, unknown>) | undefined;
    readonly baseUrl?: string | undefined;
}) => Effect.Effect<Client.Method<HttpApiEndpoint.WithName<HttpApiGroup.Endpoints<HttpApiGroup.WithName<Groups, GroupName>>, EndpointName>, HttpApiGroup.Error<HttpApiGroup.WithName<Groups, GroupName>>, ApiError>, never, HttpApiMiddleware.HttpApiMiddleware.Without<ApiR | HttpApiGroup.Context<HttpApiGroup.WithName<Groups, GroupName>> | HttpApiEndpoint.ContextWithName<HttpApiGroup.EndpointsWithName<Groups, GroupName>, EndpointName> | HttpApiEndpoint.ErrorContextWithName<HttpApiGroup.EndpointsWithName<Groups, GroupName>, EndpointName>> | HttpClient.HttpClient>;
//# sourceMappingURL=HttpApiClient.d.ts.map