typed-tasks
Version:
A type-safe abstraction for Google Cloud Tasks
22 lines • 660 B
TypeScript
import { z } from "zod";
/** Define task schemas with type safety */
export declare const taskSchemas: {
/** Example task schema - replace with your own */
readonly example_task: z.ZodObject<{
id: z.ZodString;
data: z.ZodAny;
}, "strip", z.ZodTypeAny, {
id: string;
data?: any;
}, {
id: string;
data?: any;
}>;
};
/** Type representing valid task names */
export type TaskName = keyof typeof taskSchemas;
/** Type mapping task names to their payload types */
export type TaskPayloadTypes = {
[K in TaskName]: z.infer<(typeof taskSchemas)[K]>;
};
//# sourceMappingURL=task-schemas.d.ts.map