A
arktype2mo ago
log1st

Is it possible to inferOut generics?

export const tableWidgetSchema = type("<t>", {
records: "t[]",
});

export type TableWidgetProps = typeof tableWidgetSchema.inferOut; // ?
export const tableWidgetSchema = type("<t>", {
records: "t[]",
});

export type TableWidgetProps = typeof tableWidgetSchema.inferOut; // ?
2 Replies
log1st
log1stOP2mo ago
I mean, I want to make this type abstract. I understand that it's possible to do things like tableWidgetSchema('string').inferOut, but is it possible to keep Typescript usage of those generics?
Dimava
Dimava2mo ago
Generics are HKTs you should use them as one (not sure about <t> ones but customs are literally extends class Hkt)

Did you find this page helpful?