Demo "import post-me as a script" in TypeScript.
Run tsc
each time after you changed parent.ts
/child.ts
to generate .js
/.js.map
.
Run npx serve
then open http://localhost:5000.
tsc
failed with error TS2304: Cannot find name 'PostMe'.
.
After added export_post-me.d.ts
, tsc
passed.
Fully strong typed with interface.d.ts
added.
Move export_post-me.d.ts
into post-me/dist
, and add reference in ts.