I am not familiar with typescript. Could someone please explain what data type of typescript field selectedNames below is.
class Doit { private selectedNames : { [level: number] : {[name: string]: boolean} } = {}; }
Thank you.
selectedNames has an object type. It has a numeric index signature, whose type for convenience let's call it T. In other words, selectedNames has properties with numeric property names and T property types.
And T is also an object type. T has a string index signature, whose type is boolean. In other words, T has properties with string property names and boolean property types.
And the = {} is an initializer that assigns an empty object to the selectedNames property of class Doit.
[level: number] : {[name: string]: boolean} is the type. It describes the dictionary pattern
[level : number] is the key.
{[name: string]: boolean} are the values,
in this case another dictionary string to bool.
compare http://www.typescriptlang.org/Handbook#interfaces-array-types