Object type with selected properties made required.
Source object type.
Properties made required.
type Options = RequiredKeys<{ host?: string; port: number }, 'host'>;const options: Options = { host: 'localhost', port: 8080 }; Copy
type Options = RequiredKeys<{ host?: string; port: number }, 'host'>;const options: Options = { host: 'localhost', port: 8080 };
Object type with selected properties made required.