This repository was archived by the owner on Sep 20, 2024. It is now read-only.
feat(types): add type exports for color mode & theme providers #492
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Added type export declarations for the CColorModeProvider and CThemeProvider components, for use with TypeScript environments. Rather than declaring them on the central Vue object, the provided types can be imported; an example is below.
For consistency, I have taken the properties
chakraColorMode
andchakraToggleColorMode
out of the Vue interface declaration. They are not injected or set on the main Vue instance, so they shouldn't be declared on it either.Motivation and Context
A while ago I submitted a PR (#473) adding type declarations for chakra to the main Vue object. This PR is aimed at also providing types for the provided items from the
CColorModeProvider
andCThemeProvider
components, so this package can be used without issue by Vue/Nuxt + TS users.This PR fixes the last issues of #469 left over after #473.
How Has This Been Tested?
The pre-push tests are failing on the develop branch anyways, so hard to check.
Screenshots (if appropriate):
Types of changes
Checklist: