Skip to content
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

[path parameter] interface ... extends ... が利用できない #111

Open
LumaKernel opened this issue Feb 21, 2022 · 4 comments
Open

[path parameter] interface ... extends ... が利用できない #111

LumaKernel opened this issue Feb 21, 2022 · 4 comments

Comments

@LumaKernel
Copy link
Contributor

export interface Query {
  id: number
}

(上の例はいずれにせよ ParsedUrlQueryInput に代入不可と言われてしまう)

import { ParsedUrlQueryInput } from 'querystring'

export interface Query extends ParsedUrlQueryInput {
  id: number
}

利用できても良いかな、ぐらいに思った。

@LumaKernel
Copy link
Contributor Author

上のパターンは検知はされるが、next.jsの型定義の更新で使えなくなったというほうが正しそう。

@LumaKernel
Copy link
Contributor Author

下は検知されない。

@LumaKernel LumaKernel changed the title [path parameter] interface が利用できない [path parameter] interface ... extends ... が利用できない Feb 21, 2022
@LumaKernel
Copy link
Contributor Author

単純な type export の網羅度の話になりそうか。

  • export type Query
  • export interface Query { /* ... */ }
  • export interface Query extends ... { /* ... */ }
  • export { Query }
  • export type { Query }
  • export { type Query }
  • export { A as Query }
  • export type { A as Query }
  • export { type A as Query }
  • export { Others, Query }

@LumaKernel
Copy link
Contributor Author

  • export ... from ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant