I'm trying to create an object type that can only accept a defined set of keys. In the example below, `'1.1.1' | '1.1.2' | '1.1.3'`. 

Assume that `levelNum, subLevelNum and problemNum` are valid strings within the set.

```
type AllowedIndexes = '1.1.1' | '1.1.2' | '1.1.3';
type ProblemType = { [index in AllowedIndexes]?: Problem };

let problems: ProblemType = {};

// --> the following line gives the error <--
// `TS2322: Type 'string' is not assignable to type AllowedIndex.`
let ix:AllowedIndexes = `${levelNum}.${subLevelNum}.${problemNum}`;

problems[ix] = new Problem(....)

```

However, if I write the faulty line as below, it works :

```
let ix:AllowedIndexes = `${levelNum}.${subLevelNum}.${problemNum}` as AllowedIndexes;

```

Am I going the right way, or am I totally off to make sure the object key belongs to a defined set?