Skip to content

Conversation

@ahejlsberg
Copy link
Member

This PR adds the following predefined mapped types to lib.d.ts:

// Make all properties in T optionaltypePartial<T>={[PinkeyofT]?: T[P];};// Make all properties in T readonlytypeReadonly<T>={readonly[PinkeyofT]: T[P];};// From T pick a set of properties KtypePick<T,KextendskeyofT>={[PinK]: T[P];}// Construct a type with a set of properties K of type TtypeRecord<Kextendsstring|number,T>={[PinK]: T;}

The PR also property implements the identity relation for mapped types.

@ahejlsberg
Copy link
MemberAuthor

@mhegazy Comments?

@ahejlsbergahejlsberg merged commit 0ba2348 into masterNov 15, 2016
@ahejlsbergahejlsberg deleted the libMappedTypes branch November 15, 2016 21:19
@ahejlsbergahejlsberg mentioned this pull request Nov 15, 2016
@microsoftmicrosoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@ahejlsberg@mhegazy@msftclas