You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be great if the TSX output would automatically type Astro.props with the types from the user's Props interface. This is a feature we always wanted to do and it's finally possible, so why not
In the file should do the trick. It does create a weird Go To Definition behaviour, but GTD's behaviour on the Astro global is already weird because it goes into env.d.ts and not astro.d.ts like you'd expect. That's something we could fix in the language server manually or make it point to the Props interface etc
(Mainly making an issue for myself to remember, I can implement this)
Link to Minimal Reproducible Example
N/A
The text was updated successfully, but these errors were encountered:
Princesseuh
changed the title
馃悰 BUG: TSX output should type Astro.props automatically
馃悰 BUG: TSX output could type Astro.props automatically
Aug 12, 2022
What version of
@astrojs/compiler
are you using?N/A
What package manager are you using?
N/A
What operating system are you using?
N/A
Describe the Bug
It'd be great if the TSX output would automatically type
Astro.props
with the types from the user's Props interface. This is a feature we always wanted to do and it's finally possible, so why notSomething like
declare const Astro: { props: Props } & Omit<import('astro').AstroGlobal, 'props'>
In the file should do the trick. It does create a weird Go To Definition behaviour, but GTD's behaviour on the Astro global is already weird because it goes into
env.d.ts
and notastro.d.ts
like you'd expect. That's something we could fix in the language server manually or make it point to the Props interface etc(Mainly making an issue for myself to remember, I can implement this)
Link to Minimal Reproducible Example
N/A
The text was updated successfully, but these errors were encountered: