How can I create a new interface based on optionals from another interface and make them required?
Say I have an interface like this:
interface Foo {
test1: string;
test2?: string;
}
from this I'm looking to create a new interface that looks like this:
interface FooDefaults {
test2: string;
}
Then I can use that for my default values like this:
const defaults: FooDefaults = {
test2: 'bar'
}