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

fix: improve IVueI18n interface #917

Merged
merged 1 commit into from Jun 8, 2020
Merged

fix: improve IVueI18n interface #917

merged 1 commit into from Jun 8, 2020

Conversation

kazupon
Copy link
Owner

@kazupon kazupon commented Jun 8, 2020

No description provided.

@kazupon kazupon added the Type: Improvement Includes backwards-compatible fixes label Jun 8, 2020
@kazupon kazupon merged commit e7cab93 into v8.x Jun 8, 2020
@kazupon kazupon deleted the fix/typing branch June 8, 2020 15:21
@rchl
Copy link
Contributor

rchl commented Jun 8, 2020

I have some more potential improvements:

  • make declare class VueI18n extend the interface to avoid having to duplicate the same properties/methods twice
  • change readonly $i18n: VueI18n & IVueI18n; in Vue interface augmentation to just readonly $i18n: IVueI18n; since the interface should have everything needed now.

I'm not 100% sure that it's safe to do that. At least for nuxt-i18n it would be a breaking change and I would have to align with it. But I think it's the right thing to do.

@kazupon
Copy link
Owner Author

kazupon commented Jun 9, 2020

well, vue-i18n typing interface need to more improve.
perhaps, it is made breaking change.
I think that we need to more testing with using tsd.
https://github.com/SamVerschueren/tsd

@rchl
Copy link
Contributor

rchl commented Jun 9, 2020

For nuxt-i18n I just have a test source file that uses types and is compiled by tsc. If it fails then something is wrong with types. Not as fancy and explicit as that testing framework but should be enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: merged Type: Improvement Includes backwards-compatible fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants