@convex-dev/workpool
Version:
A Convex component for managing async work.
16 lines • 886 B
TypeScript
import { Expand, FunctionReference, GenericMutationCtx, GenericQueryCtx } from "convex/server";
import { GenericId } from "convex/values";
import { GenericDataModel } from "convex/server";
export type RunQueryCtx = {
runQuery: GenericQueryCtx<GenericDataModel>["runQuery"];
};
export type RunMutationCtx = {
runMutation: GenericMutationCtx<GenericDataModel>["runMutation"];
};
export type OpaqueIds<T> = T extends GenericId<infer _T> ? string : T extends (infer U)[] ? OpaqueIds<U>[] : T extends object ? {
[K in keyof T]: OpaqueIds<T[K]>;
} : T;
export type UseApi<API> = Expand<{
[mod in keyof API]: API[mod] extends FunctionReference<infer FType, "public", infer FArgs, infer FReturnType, infer FComponentPath> ? FunctionReference<FType, "internal", OpaqueIds<FArgs>, OpaqueIds<FReturnType>, FComponentPath> : UseApi<API[mod]>;
}>;
//# sourceMappingURL=utils.d.ts.map