Roamin
Aarktype
•Created by Roamin on 9/1/2024 in #questions
Best way to pass `Type` around
I changed it to
run: (args: Type<inferAmbient<def>>["infer"]) => void;
and it's working perfectly! Thanks for your help 😉9 replies
Aarktype
•Created by Roamin on 9/1/2024 in #questions
Best way to pass `Type` around
Thanks! If I were to change your defineCommand definiton to the one below, how would you define
args
so that its props types all have the inferred types?
I tried using inferAmbient
, but narrows/morphs don't get "fully" inferred:
9 replies
Aarktype
•Created by Roamin on 9/1/2024 in #questions
Best way to pass `Type` around
The first version of the
ArkType
type's definition was actually type ArkType = Type
, but for some reason narrows
and morphs
weren't passing the check T extends Type
, so I had to use type ArkType = Type | Type<(_: any) => any>;
I guess my question is about what would be the best way to pass Type
around and extract the out
/infer
type? I'm fairly new to arktype and I may not have made the best choice here 🙂9 replies