#TS error duplicate index signature for type 'string'

3 messages · Page 1 of 1 (latest)

crimson drum
#

i have an interface and am trying to set up a index signature but am running into the above error, from the articles i found online im not sure what im doing wrong here

interface ToolsLevel {
  [toolName: string]: ToolLevel; // error here 
}

interface ToolLevel {
  value: number;
  ability: string;
  roll: {
    min: number | null;
    max: number | null;
    mode: number;
  },
  bonuses: {
    check: string;
  }
}
real anchor
#

interfaces can be merged into by declaring another interface of the same name. you probably have another interface ToolsLevel somewhere else with another index signature

crimson drum