Add interface for Lang['props'] and quasarLanguagePack #17975
Unanswered
Dtsiantaris
asked this question in
Ideas / Proposals
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
While developing an app-extension, having custom components with labels,text etc. required to extend the
Quasar Language Pack. This is fairly easy to do as you can do this:And then you can access these custom values in your template with
$q.lang.customProp.Typescript throws errors because of this so I tried to augment these interfaces:
The
GlobalQuasarLanguagegets augmented correctly. But thepropsinsideLangdoes not.Taking a look at
quasar's index.d.tsI found that the produced interface forLanghas thepropsfield typed inline(And typescript does not play well with augmenting inline typed fields).If an extra interface called
LangPropsfor example would exist, I could augment that instead. Using this interface would remove duplication of typing, because insideset()of theLanginterface, thequasarLanguagePackargument is of the same exact type asprops.As
Lang.propsis something that CAN be extended, I think it would be more powerful if also typed more conveniently.Beta Was this translation helpful? Give feedback.
All reactions