A jak zaimportować typ Document
z "typescript"
?
ekhm... no dosłownie:
import Document from 'typescript';
No coś nie bardzo. Może coś robię źle?
tsconfig.json
:
{
"compilerOptions": {
"lib": ["DOM"],
"allowImportingTsExtensions": true
}
}
TSError: ⨯ Unable to compile TypeScript:
render/unit/render.ts(8,9): error TS2305: Module '"typescript"' has no exported member 'Document'.
at createTSError (C:\Users\riddle\WebstormProjects\4play.v2\test\node_modules\ts-node\src\index.ts:859:12)
at reportTSError (C:\Users\riddle\WebstormProjects\4play.v2\test\node_modules\ts-node\src\index.ts:863:19)
Zarówno import z "typescript"
jak i "ts-node"
mówi że nie ma Document
. Jak odpalam kod i piszę typ Document
, nigdzie go nie deklarując to działa normalnie, tylko problem jest taki że to jest implicit.
A ja chciałbym wskazać explicit skąd ten typ jest. Tylko właśnie problem jest taki że nie wiem skąd jest :D