-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Hey there,
for my use case it would be nice, if the yaml could be imported "as const" so that typescript would make literal types e.g.
test:
one: one
two: twoimport test from "./test.yaml";
// currently:
typeof test // -> { test: { one: string, two: string } }
// as const
typeof test // -> { test: { one: "one", two: "two" } }this would be beneficial to mapped types since we can then narrow the inference:
type Keys = keyof typeof test['test']; // is "one" | "two"
type Values = typeof test['test'][Keys]; // is string but could be "one" | "two" Metadata
Metadata
Assignees
Labels
No labels