У меня есть функция, которая принимает объект конфигурации и должна возвращать другой объект с такими же именами свойств, но с разными значениями:
function generateTextures(config: {
default?: boolean,
multiply?: boolean,
dark?: boolean
} = {default: true, multiply: true, dark: true}) {
const textures : {[key: string]: []} = {}; // I want this object type have the same properties as config, but with type [] without duplicating all properties
const textures : { // Like this, but without write keys names again and change types.
default?: [],
multiply?: [],
dark?: []
} = {};
do something...
return textures;
}
Возможно ли это сделать? Спасибо!