UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

24 lines 633 B
/** * Makes fields for a type required. * For example: * * type FooBarBaz = { * foo: string * bar?: string * baz?: string * } * * To require the 'baz' property * type RequireBar = RequiredProperties<FooBarBaz, 'baz'> * Would result in : * RequireBar === { * foo: string * bar?: string * baz: string // this is now required * } * * To require multiple properties, use a String Literal union: * type RequireBarBaz = RequiredProperties<FooBarBaz, 'bar' | 'baz'> */ export type RequiredProperties<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>; //# sourceMappingURL=RequiredProperties.d.ts.map