interface Entity {
id: string;
filename: string;
}
type EntityReturn = {
filename: string;
}
const entities: Entity[] = [{
id: "1",
filename: ""
}];
const views: EntityReturn[] = entities.map(
(viewEntity: Entity): EntityReturn => ({
...viewEntity
}),
);
Должно выдать ошибку на наличия поля id
interface ITestA {
id: number
name: string
}
interface ITestB {
name: string
}
const test = {
id: 1,
name: "test"
};