1
type Identification =
    {
            readonly isIdentified: false;
      }
    | {
            readonly isIdentified: true;
            readonly phoneNumber: string;
            readonly birth: Date;
            readonly gender: boolean;
      };
type propertyName = keyof Identification;
var name: propertyName = "gender"; // Type '"gender"' is not assignable to type '"isIdentified"'

How can I specify one of union type which has gender property?

0 Answers0