Skip to content

Latest commit

 

History

History
27 lines (16 loc) · 2.22 KB

types.interfacetype.mergewith.md

File metadata and controls

27 lines (16 loc) · 2.22 KB

Home > @skunkteam/types > InterfaceType > mergeWith

InterfaceType.mergeWith() method

Create a new type by merging all properties of the given type into the properties of this type.

Signature:

mergeWith<OtherProps extends Properties, OtherType extends unknownRecord>(...args: [type: InterfaceType<OtherProps, OtherType>] | [name: string, type: InterfaceType<OtherProps, OtherType>] | [options: InterfaceMergeOptions, type: InterfaceType<OtherProps, OtherType>]): MergeType<Props, ResultType, OtherProps, OtherType>;

Parameters

Parameter Type Description
args [type: InterfaceType<OtherProps, OtherType>] | [name: string, type: InterfaceType<OtherProps, OtherType>] | [options: InterfaceMergeOptions, type: InterfaceType<OtherProps, OtherType>]

Returns:

MergeType<Props, ResultType, OtherProps, OtherType>

Remarks

Keys of the given (right hand side) type override keys of this type (left hand side). Any options such as strictMissingKeys and custom names are inherited from the left hand side type, but custom parsers and validators are dropped.