Skip to content

Type Utilities

Extracts the input type from a job definition’s Zod schema.

import type { InferJobInput } from "@queuebase/nextjs";
type EmailInput = InferJobInput<typeof jobs.sendEmail>;
// { to: string; subject: string; body: string }

Extracts the return type from a job definition’s handler.

import type { InferJobOutput } from "@queuebase/nextjs";
type EmailOutput = InferJobOutput<typeof jobs.sendEmail>;
// { sent: boolean }

These are useful when you need to reference job types outside the router, for example in shared types or API response types.