Endo
    Preparing search index...

    Type Alias TypeFromPattern<P>

    TypeFromPattern: P extends CastedPattern<infer Asserted>
        ? unknown extends Asserted ? TFStructuralPattern<P> : Asserted
        : TFStructuralPattern<P>

    Infer a static TypeScript type from a Pattern value. Works like Zod's z.infer<typeof schema>.

    Type Parameters

    • P
    const shape = M.splitRecord({ name: M.string(), age: M.nat() });
    type Person = TypeFromPattern<typeof shape>;
    // { name: string; age: bigint }