What is the difference between internal modules and external modules in typescript? Use module or namespace? when writing declaration files to three-party libraries

recently, after learning ts, to see changes in modules about the ts1.5 version,

  • doesn"t quite understand how to distinguish internal modules from external modules.
  • I write declaration files for npm packages installed from npm that are not written in ts.
    this is how I introduced the three-party library

import * as Orientation from "react-native-orientation";

this is what the declaration file says

declare namespace Orientation {
...
}

this will prompt you that there is no declaration

but if I write this, ok

declare module "react-native-orientation"{
...
}

Why is this? Isn"t module not recommended after 1.5? How on earth should I write a declaration document for the three parties?
in addition, the three-party library I used has been defined in the official types warehouse. I didn"t install it directly. I just want to learn how to write it. I think they are written in namespace. Later, I installed it and found that it was not wrong. Why do I have a problem writing with namespace?

Jul.29,2021
Menu