[typescript]advanced index signature

Wed Apr 16

typescript

Author:Noritaka

Astro
interface Designer {
  name: string;
  [index: string]: string;
}
const designer: Designer = {
  name: 'Quil',
  role: 'designer',
  sex: 'man',
  region: 'Japan',
}
designer.regison = 'USA';
//You can set key's type and vlue's type when you can define these names.

typescript