TypeScript memperluas antarmuka menghapus properti
interface Person {
name: string;
age: number;
address: string;
}
// ✅ Remove 'age' property from interface
type WithoutAge = Omit<Person, 'age'>;
// ✅ Remove multiple properties from interface
type WithoutAgeAndAddress = Omit<Person, 'age' | 'address'>;
// ✅ Remove property and extend interface
interface PersonWithoutAge extends Omit<Person, 'age'> {
language: string;
}
Mysterious Mole