/** * React Context & Provider for Eden TanStack Query * * Provides React context and hooks for sharing Eden client across components. * Following tRPC's pattern of factory functions for type safety. */ import type { Treaty } from "@elysiajs/eden"; import type { QueryClient } from "@tanstack/react-query"; import type { AnyElysia } from "elysia"; import * as React from "react"; import type { EdenOptionsProxy } from "./types/decorators"; /** Props for EdenProvider component */ export interface EdenProviderProps { /** Eden Treaty client instance */ client: Treaty.Create; /** TanStack QueryClient instance */ queryClient: QueryClient; /** React children */ children: React.ReactNode; } /** Result of createEdenContext */ export interface CreateEdenContextResult { /** Provider component for wrapping app */ EdenProvider: React.FC>; /** Hook to get the options proxy */ useEden: () => EdenOptionsProxy; /** Hook to get the raw Eden client */ useEdenClient: () => Treaty.Create; } /** * Creates a set of type-safe provider and consumer hooks for Eden. * * @example * ```tsx * import { createEdenContext } from 'eden-tanstack-react-query' * import type { App } from './server' * * const { EdenProvider, useEden, useEdenClient } = createEdenContext() * * function App() { * return ( * * * * * * ) * } * * function UserList() { * const eden = useEden() * const { data } = useQuery(eden.api.users.get.queryOptions()) * return
    {data?.map(u =>
  • {u.name}
  • )}
* } * ``` */ export declare function createEdenContext(): CreateEdenContextResult; //# sourceMappingURL=context.d.ts.map