-
-
Notifications
You must be signed in to change notification settings - Fork 140
Open
Description
Request a feature
🤷 Motivation
If I have a big scope/module I don't want to have to pull out all the types one by one an refer to them
💡 Solution
This works:
type InferModule<M> = {
[K in keyof M]: M[K] extends { infer: infer O } ? O : never;
};used like:
const MlflowSchema = type.module({
SearchExperimentsResponse: {
experiments: "Experiment[]",
next_page_token: "string?",
},
Experiment: {
experiment_id: "string"
},
});
type MlflowSchema = InferScope<typeof MlflowSchema>;If this is already "built-in" I could not find it in the docs.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
To do