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