Object literal may only specify known properties, and 'key' does not exist in type 'SetStateAction<DetailsDict>'.
type Employee = {
id: number;
[key: string]: string | number | number[]; //try this part to indicate return type
years: number[];
};
const emp: Employee = {
id: 1,
name: 'Alice',
department: 'accounting',
salary: 100,
years: [2022, 2023],
};