arktypea
arktype10mo ago
guersam

Inferring generic types

Hi, I'm new to ArkType and have little knowledge about TypeScript generic.

I wish I had something like below:

import { type } from "arktype"

const boxOf = type("<t>", { box: "t" })

type BoxOf<t> = typeof boxOf.infer<t> // not working for Generic


Currently I've manually define the type to match the schema.

What am I missing, or is there any workaround?

Thanks in advance.
Was this page helpful?