0

i have this module:

module Net.Server {
    var socket:dgram.Socket;

    [...]
}

and this app.ts:

var server:Net.Server = new Server();

if i write this line at the beginning of the first file:

import dgram = require("dgram")

the compiler does not found the type 'Net.Server', why?

1 Answer 1

1

It is because you have defined Net.Server as an internal module, but you are trying to load it as an external module.

To use it on Node, you would treat the file as the module:

Net.Server.ts

export var socket: dgram.Socket;
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.