arktypea
arktype11mo ago
Micha

What is the arktype 2 syntax for inferring classes with a private constructor?

In Arktype 1.x I was writing:

import { type, Infer } from 'arktype';

const document = type({
    "ttl?": ["instanceof", TimeStub] as Infer<TimeStub>,
})

But the Infer import is not more available in arktype 2, so I'm wondering how to achieve it now?

Maybe the answer could be also added to the docs 🙂 https://arktype.io/docs/objects#instanceof
Was this page helpful?