Converting javascript associative array to typescript
<p>In one of our systems, we have a lot of UI related javascript that handles menu actions and that look like below</p>

<pre><code>var menuActions = {
    "edit-profile": {
        Title: "rs_edit_profile",
        Action: function(callback){
            //some logic here to handle the UI
        },
        HasPermission: true
    },
    "delete-profile": {
        Title: "rs_edit_profile",
        Action: function(callback){
            //some logic here to handle the UI
        },
        HasPermission: true
    },
    "create-profile": {
        Title: "rs_edit_profile",
        Action: function(callback){
            //some logic here to handle the UI
        },
        HasPermission: false
    }
</code></pre>

<p>}</p>

<p>and that is used with <code>switch</code>/<code>if</code> cases like 
<code>if(menuAction[actionName] === "edit profile")...</code> which then calls the <code>menuActions[actionName].Action()</code>.</p>

<p>We're converting the system to TypeScript right now, which is all new for us, and I'm stuck on how I best should re-organize and convert this specific piece of code.</p>

<p>I don't like how it's done with javascript right now, so if possible, I would like to take the opportunity to change it to something better while doing the conversion to typescript.</p>

<p>My intuition says I should have a collection of <code>MenuAction</code> instances from a class, but I'm not sure as to how I would implement that and then use it. </p>

<p>Should I completely omit the use of a class and instead just use normal objects in an array?</p>

<p>(It might help to know that this is code for an Angular 1.X view controller).</p>