- mod.js
module.exports = {
log: console.log,
hello: "Hello, World!"
};
- index.ts
import * as con from "./mod.js";
con.log(con.hello);
- @types/mod.d.ts
declare module "*/mod.js" {
export function log(...p: any[]): void;
export const hello: string;
}