UNPKG

convex

Version:

Client for the Convex Cloud

41 lines 2.14 kB
import { GenericAPI } from "../../api/index.js"; import { GenericDataModel } from "../data_model.js"; import { ActionCtx, MutationCtx, PublicMutation, PublicAction, PublicQuery, QueryCtx } from "../registration.js"; /** * Define a mutation in this Convex app's public API. * * This function will be allowed to modify your Convex database and will be accessible from the client. * * If you're using code generation, use the `mutation` function in * `convex/_generated/server.d.ts` which is typed for your data model. * * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. * * @public */ export declare const mutationGeneric: <DataModel extends GenericDataModel, Args extends any[], Output>(func: (ctx: MutationCtx<DataModel>, ...args: Args) => Output) => PublicMutation<DataModel, Args, Output>; /** * Define a query in this Convex app's public API. * * This function will be allowed to read your Convex database and will be accessible from the client. * * If you're using code generation, use the `query` function in * `convex/_generated/server.d.ts` which is typed for your data model. * * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. * * @public */ export declare const queryGeneric: <DataModel extends GenericDataModel, Args extends any[], Output>(func: (ctx: QueryCtx<DataModel>, ...args: Args) => Output) => PublicQuery<DataModel, Args, Output>; /** * Define function in this Convex app's public API. * * @param func - The function. It receives a {@link ActionCtx} as its first argument. * @returns The wrapped function. Include this as an `export` to name it and make it accessible. * * @public */ export declare const actionGeneric: <API extends GenericAPI, Args extends any[], Output>(func: (ctx: ActionCtx<API>, ...args: Args) => Output) => PublicAction<API, Args, Output>; //# sourceMappingURL=registration_impl.d.ts.map