Closed NullVoxPopuli closed 6 months ago
Same here.
AFAIK TS looks for node_modules/ember-cli-flash/services/flash-messages.d.ts
when trying to resolve the types for this module. But this does not exist. For the declare module
statements to work, you need to explicitly make TS aware of the index.d.ts
. I managed to do that by adding this to the paths
section of my tsconfig.json
:
"ember-cli-flash/*": [
"node_modules/ember-cli-flash"
],
That's ok as a workaround for now, but types working properly out of the box would be nice!
This seems to be fixed for me in ember-cli-flash@5.0.0
. However the FlashMessage
component is still not detected/not exported from this addon's TS declarations.
This seems to be fixed for me in ember-cli-flash@5.0.0. However the FlashMessage component is still not detected/not exported from this addon's TS declarations.
I've hit the same. declarations
dir seems to be missing components
. The other items (flash and services) are fine for types
Components exist in 5.1
I'm on 5.1.0 - that's the dist folder, the declarations for components don't show up in the published output
what's supposed to be in this folder?
Oops! You're totally correct. I initially checked on an outdated branch that was v5.0.0, and then when I went to verify again an hour ago the ember-cli-flash version, I was on my main branch which renovate just updated to 5.1.0 overnight 😅
I can indeed see the ember-cli-flash declarations for component in the published output, and they work as I was expecting 🎉
Also, didn't know could check published output via NPM page! That is handy
woo woo! I'll close this issue!
Repro steps:
type MyOptions = Parameters<FlashService['add']>[0] & { buttons?: string[]; }
export default class FalconFlashService extends FlashService { add(options: MyOptions) { // custom stuff // // ... return super.add(options); } }
app/services/flash-messages.ts:1:26 - error TS2307: Cannot find module 'ember-cli-flash/services/flash-messages' or its corresponding type declarations.
1 import FlashService from 'ember-cli-flash/services/flash-messages';