TypeScript · Classes and modules
Namespace import
Imports all named exports as a single object.
Syntax
import * as api from "./api"Example
Example
// import * as api from "./api.js";
// api.load();
console.log("Namespaces keep a module’s exports under one name.");More in this group
Learn this in the course
Reference pages are the quick answer. The course explains the why, shows the full example and ends with a challenge.