class declaration - Property does not exist on type in TypeScript
<p>I'm new to <code>typescript</code>, and trying to for a javascript code I've into typescript, so I ended up with the below code.
My understanding regarding the classes in typescript is the below, which may be wrong, is:
1. After defining the class, you have to declare the parameters to be used later on with <code>this</code>, the deceleration is in the form of <code>variableName:variableType</code>.
2. in the constructor, the variables can assign values as <code>this.variableName = x</code>
3. In the <code>methods</code> under the <code>class</code> the variable can be used with <code>this.</code></p>

<p>In the below code, I got the error <code>[ts] Property 'escapeRegExp' does not exist on type 'typeof Listen'.</code> as shown in the picture attached.</p>

<pre><code>namespace CORE{
    export class Listen{
         commandsList:[RegExp, string, string];
         debugStyle:string;
         optionalParam:RegExp;
         optionalRegex:RegExp;
         namedParam:RegExp;
         splatParam:RegExp;
         escapeRegExp:RegExp;
        constructor(){
            this.commandsList = [];
            this.debugStyle = 'font-weight: bold; color: #00f;';
            this.optionalParam = /\s*\((.*?)\)\s*/g;
            this.optionalRegex = /(\(\?:[^)]+\))\?/g;
            this.namedParam    = /(\(\?)?:\w+/g;
            this.splatParam    = /\*\w+/g;
            this.escapeRegExp  = /[\-{}\[\]+?.,\\\^$|#]/g;
        }

        public static commandToRegExp(command:string):RegExp{
            command = command.replace(this.escapeRegExp, '\\$&amp;')
                    .replace(this.optionalParam, '(?:$1)?')
                    .replace(this.namedParam, function(match, optional) {
                        return optional ? match : '([^\\s]+)';
                    })
                    .replace(this.splatParam, '(.*?)')
                    .replace(this.optionalRegex, '\\s*$1?\\s*');

            return new RegExp('^' + command + '$', 'i');
        }

        public static registerCommand(command:RegExp, cb:string, phrase:string):void{
            this.commandsList.push({ command: command, callback: cb, originalPhrase: phrase });
        }

        public static addCommands(commands:string[]):void{
                  var cb;
                    for (var phrase in commands) {
                        if (commands.hasOwnProperty(phrase)) {
                            cb = this[commands[phrase]] || commands[phrase];
                            if (typeof cb === 'function') {
                                // convert command to regex then register the command
                                this.registerCommand(this.commandToRegExp(phrase), cb, phrase);
                            } else if (typeof cb === 'object' &amp;&amp; cb.regexp instanceof RegExp) {
                                // register the command
                                this.registerCommand(new RegExp(cb.regexp.source, 'i'), cb.callback, phrase);
                            }
                        }
                    }
        }

        public static executeCommand(commandText:string):void{
            for (var j = 0, l = this.commandsList.length; j &lt; l; j++) {
                var result = this.commandsList[j].command.exec(commandText);
                if (result) {
                    var parameters = result.slice(1);
                    // execute the matched command
                    this.commandsList[j].callback.apply(this, parameters);
                }
            }
        }        
    }
}
</code></pre>

<p><a href="https://i.stack.imgur.com/O2tTu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/O2tTu.png" alt="enter image description here"></a></p>