typescript object with one key needed and other optinal code example
Example: typescript object key from other object
const object: {
[K in keyof MyInterface]: any
} = {}
const object: {
[K in keyof MyInterface]: any
} = {}