-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add: types.ts #725
Add: types.ts #725
Conversation
✔️ Deploy Preview for ingred-ui ready! 🔨 Explore the source changes: 93cfe69 🔍 Inspect the deploy log: https://app.netlify.com/sites/ingred-ui/deploys/623298ec47191d0008a8cf15 😎 Browse the preview: https://deploy-preview-725--ingred-ui.netlify.app |
|
src/types/types.ts
Outdated
@@ -0,0 +1,4 @@ | |||
// MEMO: from Redux | |||
export type DeepPartial<T> = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DeepPartial.d.ts
みたいなファイル名の方が良いかな?(とにかく型はこのファイルに突っ込んでください!みたいなやり方を見たことがない)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MUI は index.d.ts
にしてるっぽいですね。
MUI に合わせます。
https://github.com/mui/material-ui/blob/master/packages/mui-types/index.d.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(別パッケージとして分離はしてるっぽいですが)
@takurinton |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#725 (comment)
↑気づくの遅くて恐縮だけどみていただけると
@youchann 補足ですが、個人的にはユーザー側で定義すればいいと思っていましたが、どうせ定義してるなら使えた方がいいのかなとかも思ったりしました。 |
内部で使っているreact-selectなどなどは、型もexportしてる(ingred-uiもpropsは全部exportしてる)から、まぁしてもよさそう |
d.ts が読めない。 |
MUI を参考にしようと思ったけど、あれはあれ自体がパッケージだからできてたけど、これをバンドルしようとすると rollup-plugin-dts あたりでうまく分割しないといけないっぽいので一旦スルー。 |
ref #716 (comment)
tsconfig の
skipLibCheck
の対応として、DeepPartial
を export する。現状、共通の型を置いておく場所がないので
types/types.ts
を追加した。