I have the following class:
export class User {
id: string;
updatedAt?: Date;
createdAt: Date;
email: string;
emailVerified: boolean;
firstName?: string;
lastName?: string;
dateOfBirth?: Date;
}
And I now want to create another type that picks a few properties and has FieldValue as a type Union on every property:
export type UpdateUser = {
email?: string | FieldValue;
emailVerified?: boolean | FieldValue;
firstName?: string | FieldValue;
lastName?: string | FieldValue;
dateOfBirth?: Date | FieldValue;
};
Is there any way to do this other than to manually define the type unions on every property?
Best Philipp