import * as z from 'zod'; import { type SatelliteEnv } from '../schemas/satellite.env'; import { JUNO_FUNCTION_TYPE } from './constants'; import { type CustomFunctionWithArgs, type CustomFunctionWithArgsAndResult, type CustomFunctionWithoutArgsAndResult, type CustomFunctionWithResult } from './schemas/function'; /** * @see Query */ export declare const QuerySchema: z.ZodUnion; args: z.ZodCustom, z.ZodObject>; result: z.ZodCustom, z.ZodObject>; handler: z.ZodCustom, z.ZodUnion]>>, z.core.$InferInnerFunctionType, z.ZodUnion]>>>; guard: z.ZodOptional, z.core.$InferInnerFunctionType>>; hidden: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"__juno_function_query">; args: z.ZodCustom, z.ZodObject>; handler: z.ZodCustom, z.ZodUnion]>>, z.core.$InferInnerFunctionType, z.ZodUnion]>>>; guard: z.ZodOptional, z.core.$InferInnerFunctionType>>; hidden: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"__juno_function_query">; result: z.ZodCustom, z.ZodObject>; handler: z.ZodCustom, z.ZodUnion]>>, z.core.$InferInnerFunctionType, z.ZodUnion]>>>; guard: z.ZodOptional, z.core.$InferInnerFunctionType>>; hidden: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ type: z.ZodLiteral<"__juno_function_query">; handler: z.ZodCustom, z.ZodUnion]>>, z.core.$InferInnerFunctionType, z.ZodUnion]>>>; guard: z.ZodOptional, z.core.$InferInnerFunctionType>>; hidden: z.ZodOptional; }, z.core.$strict>]>; /** * The input shape for defining a query serverless function. * Does not include `type`, which is injected by `defineQuery`. */ export type Query = Omit, 'type'> | Omit, 'type'> | Omit, 'type'> | Omit; /** * A query function definition with `type` injected by `defineQuery`. * Queries are read-only functions that do not modify state. */ export type QueryDefinition = Query & { type: typeof JUNO_FUNCTION_TYPE.QUERY; }; export declare const QueryFnSchema: (querySchema: T) => z.ZodFunction], null>, T>; /** * A factory function that receives the satellite environment and returns a query definition. */ export type QueryFn = (env: SatelliteEnv) => Query; export declare const QueryFnOrObjectSchema: (querySchema: T) => z.ZodUnion], null>, T>, z.core.$InferInnerFunctionType], null>, T>>]>; /** * A query definition or a factory function that returns one. */ export type QueryFnOrObject = Query | QueryFn; export declare function defineQuery(query: Query): QueryDefinition; export declare function defineQuery(query: QueryFn): (env: SatelliteEnv) => QueryDefinition; export declare function defineQuery(query: QueryFnOrObject): QueryDefinition | ((env: SatelliteEnv) => QueryDefinition);