Using an ArkType Generic within TS types.

How can I convert an ArkType generic to a TS generic? Something like:
export const SuccessResponse = type("<T>", { data: "T" });
export type SuccessResponse<T> = ??? // Goal: { data: T }

In Zod I would do something like this:
export const SuccessResponse = <T extends AnyZodType>(data: T) => z.object({ data })
export type SuccessResponse<T> = z.infer<ReturnType<typeof SuccessResponse<T>>>

I think I've missed a ZodType or two somewhere in there, but thats the general idea. I have dont it before.

What would be the ArkType equivalent? Thanks!
Was this page helpful?