TypeScript inheritance with exported class and modules

I'm crazy about inheritance using typescript. I do not know why, but he cannot solve the class that I want to inherit.

Library / classes / Message.class. c

///<reference path='./def/lib.d.ts'/>
///<reference path='./def/node.d.ts'/>

export module SharedCommunication {
    export class Message{
         // Stuff
    }
}

Library / classes / ValidatorMessage.class. c

///<reference path='./def/lib.d.ts'/>
///<reference path='./def/node.d.ts'/>
///<reference path='Message.class.ts'/>

export module SharedCommunication { 
    export class ValidatorMessage extends Message{
        private  _errors;
    }    
}

Message cannot be allowed. I tried SharedCommunication.Message too, but it is the same. I refer to the class, so I totally don’t understand what is going on. Do you have any ideas?

I tried without a module (two classes without any module), but it is the same. I need to export the class (and the module if I use it) to get them from another node_module: typescript.api, which I use to load the class and use it in node.

Library / message.js

var Message = require('./classes/Message.class.ts');

module.exports = Message.SharedCommunication.Message;

? , , . .

+4
2

ValidatorMessage.class.ts :

///<reference path='./def/lib.d.ts'/>
///<reference path='./def/node.d.ts'/>

import message = require('./Message.class');

export module SharedCommunication { 
    export class ValidatorMessage extends message.SharedCommunication.Message {
        private  _errors;
    }
}

export module , .

, , TypeScript - , , .

+4

:

module SharedCommunication 
{ 
    export class ValidatorMessage extends message.SharedCommunication.Message 
    {
        private  _errors;
    }
}
+1

All Articles