type PickByValueType = { [K in keyof T as T[K] extends ValueType ? K : never]: T[K]; }; interface UserProfile { id: string; name: string; age: number; isActive: boolean; lastLogin: Date; tags: string[]; settings: { theme: string; notifications: boolean }; getDisplayName(): string; } // Example Usage: type StringProperties = PickByValueType; // Expected: { id: string; name: string; } const stringProps: StringProperties = { id: "user-456", name: "Alice", }; type BooleanProperties = PickByValueType; // Expected: { isActive: boolean; } const booleanProps: BooleanProperties = { isActive: true, }; type NumberProperties = PickByValueType; // Expected: { age: number; } type ArrayProperties = PickByValueType; // Expected: { tags: string[]; } type ObjectProperties = PickByValueType; // Expected: { lastLogin: Date; tags: string[]; settings: { theme: string; notifications: boolean }; } // Note: Date and arrays are technically objects in JavaScript.