You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
My issue is with $data: Data; in interface User (found here), which uses Data directly instead of having something like "UserData" which inherits from Data, similar to the implementation of JovoData, AppData, and SessionData.
The reason this matters for me is because I'd like to use module augmentation to add fields / typing for each of theses data types (also nice for autocomplete). But when I try to do this with User data, it currently effects all the other types since user data uses just the base type, Data.
example of what I can do with SessionData but not UserData (since it doesn't exist):
optionally I'd love a built-in way to do this that also disallows using non-defined fields (so that I don't accidentally call $user.$data.foo instead of $session.$data.foo for example) as module augmentation only lets me narrow down fields, but that's not as important (and I'm not exactly sure how that could be achieved anyways, without removing [key: string]: any; which would then force everyone to use module augmentation).
The text was updated successfully, but these errors were encountered:
I'm submitting a...
Description
My issue is with
$data: Data;
ininterface User
(found here), which usesData
directly instead of having something like "UserData" which inherits fromData
, similar to the implementation of JovoData, AppData, and SessionData.The reason this matters for me is because I'd like to use module augmentation to add fields / typing for each of theses data types (also nice for autocomplete). But when I try to do this with User data, it currently effects all the other types since user data uses just the base type,
Data
.example of what I can do with SessionData but not UserData (since it doesn't exist):
optionally I'd love a built-in way to do this that also disallows using non-defined fields (so that I don't accidentally call
$user.$data.foo
instead of$session.$data.foo
for example) as module augmentation only lets me narrow down fields, but that's not as important (and I'm not exactly sure how that could be achieved anyways, without removing[key: string]: any;
which would then force everyone to use module augmentation).The text was updated successfully, but these errors were encountered: