Explain 'Ambient Modules' vs 'Internal Modules'.

Updated May 4, 2026

Short answer

Ambient modules describe existing JS code shapes; Internal modules (namespaces) group TS code.

Deep explanation

Ambient modules use the declare keyword to explain the shape of code not written in TS (like a .d.ts file). Internal modules are the older 'namespace' pattern for organization, now largely replaced by standard ES modules[cite: 1].

Unlock with a Pro subscription to view this section.

View pricing

Real-world example

No real-world example available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Common mistakes

No common mistakes listed yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

Follow-up questions

No follow-up questions available yet.

Unlock with a Pro subscription to view this section.

Upgrade to Pro

More TypeScript interview questions

View all →