-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't resolve types #6022
Comments
I am not sure if I understood your problem. But there are several unit tests that ensure these things work. For example in the angular RxDB example. |
Can you make a PR with a proposed fix? |
OK, I think for now, the most cost-effective solution is to directly replace the content of // scripts/fix-type.mjs
import { promises as fs } from 'node:fs'
async function main () {
const file = './dist/types/index.d.ts'
try {
let content = await fs.readFile(file, { encoding: 'utf-8' })
content = content.replaceAll('export *', 'export type *').replaceAll('.ts', '.d.ts')
await fs.writeFile(file, content)
} catch (err) {
console.log(`Fix type error:${err.message}`)
}
}
main() package.json {
"scripts": {
- "build:types": "npm run build:version && rimraf -rf --max-retries=3 ./dist/types && tsc --project ./config/tsconfig.types.json && cp -r ./src/types ./dist/types/types",
+ "build:types": "npm run build:version && rimraf -rf --max-retries=3 ./dist/types && tsc --project ./config/tsconfig.types.json && cp -r ./src/types ./dist/types/types && node ./scripts/fix-type.mjs",
}
} |
Does your webstorm auto import work correctly with this? |
@dongnaebi Thank you for the screenshot. |
I'd be pleased to do this. |
I am using RxDB in TypeScript, but I'm not getting any type hints. I looked in
dist/types/index.d.ts
and found this code:It seems that the file names are incorrect. They should be
xxx.d.ts
?The text was updated successfully, but these errors were encountered: