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
GlobalQuasarLanguage
gets augmented correctly. But theprops
insideLang
does not.Taking a look at
quasar's index.d.ts
I found that the produced interface forLang
has theprops
field typed inline(And typescript does not play well with augmenting inline typed fields).If an extra interface called
LangProps
for example would exist, I could augment that instead. Using this interface would remove duplication of typing, because insideset()
of theLang
interface, thequasarLanguagePack
argument is of the same exact type asprops
.As
Lang.props
is 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