The number is a very loose representation which sometimes is required to be tighten. In my case I wish a variable was only able to take non-negative integers. Is there a way to enforce this constraint in TypeScript?
No, this is not possible; there is no* uint
or similar in JavaScript, so no corresponding type in TypeScript. There is a open feature request for Contracts which would allow you to provide more robust assertions like these, if it is ever implemented.
* Such data types exist in the Typed Array specification, but these are extensions designed primarily for WebGL, not part of the core language.