What this snippet does
Because 'import type' is erased at runtime, using it as a value (like instantiating a class) causes a runtime ReferenceError or compile error.
Expected output
Compile Error: 'Config' cannot be used as a value because it was imported using 'import type'.
Why practise typing this
Typing advanced modules code builds muscle memory for the symbols and indentation TypeScript uses most, which prose-based typing tests never cover. DevType measures your words per minute and accuracy on this snippet and tracks the individual characters you mistype, so later lessons can target them.
More TypeScript practice
- Typing a dynamic importAdvanced Modules · advanced
- Conditionally loading an analytics moduleAdvanced Modules · advanced
- Accessing non-existent exports from a dynamic importAdvanced Modules · advanced
- Using import type for interfacesAdvanced Modules · advanced
- Mixing type and value imports inlineAdvanced Modules · advanced
- Default importing a CommonJS moduleAdvanced Modules · advanced