import { type DefaultFunctionArgs, type FunctionVisibility, type GenericMutationCtx, type GenericQueryCtx } from "convex/server"; import type { Value } from "convex/values"; import * as Data from "effect/Data"; import * as Duration from "effect/Duration"; import * as Effect from "effect/Effect"; import * as Layer from "effect/Layer"; import * as Schema from "effect/Schema"; import * as Auth from "./Auth"; import * as DatabaseReader from "./DatabaseReader"; import type * as DatabaseSchema from "./DatabaseSchema"; import * as DatabaseWriter from "./DatabaseWriter"; import type * as DataModel from "./DataModel"; import * as ExecutionMetadata from "./ExecutionMetadata"; import * as RequestMetadata from "./RequestMetadata"; import * as TransactionMetadata from "./TransactionMetadata"; import * as MutationCtx from "./MutationCtx"; import * as MutationRunner from "./MutationRunner"; import * as MutationTransactionContext from "./MutationTransactionContext"; import * as QueryCtx from "./QueryCtx"; import * as QueryRunner from "./QueryRunner"; import * as QueryTransactionContext from "./QueryTransactionContext"; import * as RegisteredFunction from "./RegisteredFunction"; import type * as FunctionRegistryItem from "./FunctionRegistryItem"; import type * as ResolvedMiddleware from "./ResolvedMiddleware"; import * as Scheduler from "./Scheduler"; import * as Storage from "./Storage"; import type { StorageReader } from "./StorageReader"; import { StorageWriter } from "./StorageWriter"; export type Definition = Data.TaggedEnum<{ PublicQuery: ReturnType; InternalQuery: ReturnType; PublicMutation: ReturnType; InternalMutation: ReturnType; PublicAction: ReturnType; InternalAction: ReturnType; Registered: { readonly handler: RegisteredFunction.Any; }; }>; export declare const Definition: { readonly $is: (tag: Tag) => (u: unknown) => u is Extract<{ readonly _tag: "InternalAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, { readonly _tag: Tag; }> | Extract<{ readonly _tag: "InternalMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, { readonly _tag: Tag; }> | Extract<{ readonly _tag: "InternalQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, { readonly _tag: Tag; }> | Extract<{ readonly _tag: "PublicAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, { readonly _tag: Tag; }> | Extract<{ readonly _tag: "PublicMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, { readonly _tag: Tag; }> | Extract<{ readonly _tag: "PublicQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, { readonly _tag: Tag; }> | Extract<{ readonly _tag: "Registered"; readonly handler: RegisteredFunction.Any; }, { readonly _tag: Tag; }>; readonly $match: { ; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "Registered"; readonly handler: RegisteredFunction.Any; }, { readonly _tag: Tag; }>) => any; }>(cases: Cases): (value: { readonly _tag: "InternalAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "Registered"; readonly handler: RegisteredFunction.Any; }) => import("effect/Unify").Unify>; ; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "Registered"; readonly handler: RegisteredFunction.Any; }, { readonly _tag: Tag; }>) => any; }>(value: { readonly _tag: "InternalAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "Registered"; readonly handler: RegisteredFunction.Any; }, cases: Cases): import("effect/Unify").Unify>; }; readonly InternalAction: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "InternalAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, "_tag">; readonly InternalMutation: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "InternalMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, "_tag">; readonly InternalQuery: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "InternalQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, "_tag">; readonly PublicAction: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "PublicAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, "_tag">; readonly PublicMutation: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "PublicMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, "_tag">; readonly PublicQuery: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "PublicQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }, "_tag">; readonly Registered: Data.TaggedEnum.ConstructorFrom<{ readonly _tag: "Registered"; readonly handler: RegisteredFunction.Any; }, "_tag">; }; export declare const prepare: (databaseSchema: DatabaseSchema.AnyWithProps, item: FunctionRegistryItem.ConfectFunctionRegistryItem, resolvedMiddlewares?: ReadonlyArray) => { readonly _tag: "InternalAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "InternalQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicAction"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicMutation"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericMutationCtx>>, actualArgs: DefaultFunctionArgs) => Promise; } | { readonly _tag: "PublicQuery"; readonly args: import("convex/values").PropertyValidators; readonly returns: import("convex/values").Validator; readonly handler: (ctx: GenericQueryCtx>>, actualArgs: DefaultFunctionArgs) => Promise; }; export declare const make: (databaseSchema: DatabaseSchema.AnyWithProps, item: FunctionRegistryItem.ConfectFunctionRegistryItem, resolvedMiddlewares?: ReadonlyArray) => RegisteredFunction.Any; export declare const register: (self: Definition) => RegisteredFunction.Any; declare const queryFunction: ({ databaseSchema, name, functionVisibility, args, returns, error, handler, resolvedMiddlewares, }: { databaseSchema: DatabaseSchema_; name: string; functionVisibility: FunctionVisibility; args: Schema.Codec; returns: Schema.Codec; error: Schema.Codec | undefined; handler: (a: Args) => Effect.Effect | Auth.Auth | ExecutionMetadata.ExecutionMetadata | TransactionMetadata.TransactionMetadata | Storage.Storage | StorageReader | QueryRunner.QueryRunner | QueryTransactionContext.QueryTransactionContext | QueryCtx.QueryCtx>>>; resolvedMiddlewares: ReadonlyArray; }) => { args: import("convex/values").PropertyValidators; returns: import("convex/values").Validator; handler: (ctx: GenericQueryCtx>>, actualArgs: ConvexArgs) => Promise; }; export declare const mutationLayer: (schema: Schema, ctx: GenericMutationCtx>>) => Layer.Layer | DatabaseWriter.DatabaseWriterService | ExecutionMetadata.ExecutionMetadata | GenericMutationCtx>> | MutationTransactionContext.MutationTransactionContext | QueryTransactionContext.QueryTransactionContext | RequestMetadata.RequestMetadata | Storage.Storage | StorageReader | StorageWriter | TransactionMetadata.TransactionMetadata | { runMutation: { (mutation: Mutation, ...args: [...import("@confect/core/Ref").OptionalArgs, options?: undefined]): Effect.Effect, import("@confect/core/Ref").Error | Schema.SchemaError>; (mutation: Mutation, args: import("@confect/core/Ref").Args, options: MutationRunner.Options | undefined): Effect.Effect, import("@confect/core/Ref").Error | Schema.SchemaError, MutationTransactionContext.MutationTransactionContext>; }; } | { runQuery: { (query: Query, ...args: [...import("@confect/core/Ref").OptionalArgs, options?: undefined]): Effect.Effect, import("@confect/core/Ref").Error | Schema.SchemaError>; (query: Query, args: import("@confect/core/Ref").Args, options: (QueryTransactionContext.Options & { readonly useStaleSnapshot?: never; }) | undefined): Effect.Effect, import("@confect/core/Ref").Error | Schema.SchemaError, QueryTransactionContext.QueryTransactionContext>; (query: Query, args: import("@confect/core/Ref").Args, options: QueryRunner.Options & { readonly useStaleSnapshot: boolean; }): Effect.Effect, import("@confect/core/Ref").Error | Schema.SchemaError, MutationTransactionContext.MutationTransactionContext>; (query: Query, args: import("@confect/core/Ref").Args, options: QueryRunner.Options | undefined): Effect.Effect, import("@confect/core/Ref").Error | Schema.SchemaError, QueryTransactionContext.QueryTransactionContext | MutationTransactionContext.MutationTransactionContext>; }; } | { cancel: (id: import("convex/values").GenericId<"_scheduled_functions">) => Effect.Effect; runAfter: (delay: Duration.Duration, ref: Ref_, ...args: import("@confect/core/Ref").OptionalArgs) => Effect.Effect, never, never>; runAt: (dateTime: import("effect/DateTime").DateTime, ref: Ref_, ...args: import("@confect/core/Ref").OptionalArgs) => Effect.Effect, never, never>; }, never, never>; export type MutationServices = DatabaseReader.DatabaseReader | DatabaseWriter.DatabaseWriter | Auth.Auth | ExecutionMetadata.ExecutionMetadata | RequestMetadata.RequestMetadata | TransactionMetadata.TransactionMetadata | Scheduler.Scheduler | Storage.Storage | StorageReader | StorageWriter | QueryRunner.QueryRunner | MutationRunner.MutationRunner | QueryTransactionContext.QueryTransactionContext | MutationTransactionContext.MutationTransactionContext | MutationCtx.MutationCtx>>; declare const mutationFunction: ({ databaseSchema, name, functionVisibility, args, returns, error, handler, resolvedMiddlewares, }: { databaseSchema: DatabaseSchema_; name: string; functionVisibility: FunctionVisibility; args: Schema.Codec; returns: Schema.Codec; error: Schema.Codec | undefined; handler: (a: Args) => Effect.Effect>; resolvedMiddlewares: ReadonlyArray; }) => { args: import("convex/values").PropertyValidators; returns: import("convex/values").Validator; handler: (ctx: GenericMutationCtx>>, actualArgs: ConvexArgs) => Promise; }; declare const convexActionFunction: (schema: DatabaseSchema_, { name, functionVisibility, args, returns, error, handler, resolvedMiddlewares, }: { name: string; functionVisibility: FunctionVisibility; args: Schema.Codec; returns: Schema.Codec; error: Schema.Codec | undefined; handler: (a: Args) => Effect.Effect>; resolvedMiddlewares: ReadonlyArray; }) => { args: import("convex/values").PropertyValidators; returns: import("convex/values").Validator; handler: (ctx: import("convex/server").GenericActionCtx>>, actualArgs: ConvexArgs) => Promise; }; export {}; //# sourceMappingURL=RegisteredConvexFunction.d.ts.map