import { n as TanstackQueryOptionsProxy, t as SubscriptionOptions } from "./types-CBIv8Q6_.mjs"; import { Service } from "effect/Context"; import { ManagedRuntime } from "effect/ManagedRuntime"; //#region src/create-proxy.d.ts /** * Creates a type-safe proxy that bridges Effect `HttpApiClient` endpoints * with TanStack Query options (`queryOptions`, `subscriptionOptions`, `mutationOptions`, and `getQueryKey`). * * @param tag - The Effect `Service` tag used to locate the client implementation within the Context. * @param runtime - The Effect `ManagedRuntime` used to execute effects as promises. * * @returns A proxy object structured like the target API client, providing TanStack Query helpers for each endpoint. * * @example * ```ts * class ApiGroup extends HttpApiGroup.make('ApiGroup') * .add(HttpApiEndpoint.get('hello', '/hello', { success: Schema.String, query: Schema.Struct({ name: Schema.String }) })) * .add(HttpApiEndpoint.post('bye', '/bye', { success: Schema.String, payload: Schema.Struct({ name: Schema.String }) })) * .add(HttpApiEndpoint.get('stream', '/stream', { success: HttpApiSchema.StreamSse({ data: Schema.String }) })) {} * * class Api extends HttpApi.make('Api').add(ApiGroup) {} * * class ApiClient extends Context.Service>()('ApiClient') { * public static layer = Layer.effect(this, HttpApiClient.make(Api)).pipe(Layer.provide(FetchHttpClient.layer)) * } * * const runtime = ManagedRuntime.make(ApiClient.layer) * const api = createTanstackQueryOptionsProxy(ApiClient, runtime); * * // Example usage in a React component with TanStack Query * const { data } = useQuery(api.hello.queryOptions({ query: { name: 'World' } })) * ^? const data: string = "Hello, World!" * * const { mutate, data } = useMutation(api.bye.mutationOptions()) * ^? const data: string = "Goodbye, World!" * mutate({ name: 'World' }) * * useSubscription(api.stream.subscriptionOptions({ * onData: (data) => console.log(data), * ^? const data: string = "Never gonna give you up, never gonna let you down..." * })) * ``` */ declare function createTanstackQueryOptionsProxy(tag: Service, runtime: ManagedRuntime): TanstackQueryOptionsProxy; //#endregion export { type SubscriptionOptions, type TanstackQueryOptionsProxy, createTanstackQueryOptionsProxy };