jovo-framework
jovo-framework copied to clipboard
Add type checking for request, session and user data
I'm submitting a...
- [ ] Bug report
- [x] Feature request
- [ ] Documentation issue or request
- [ ] Other... Please describe:
Expected Behavior
I would find really useful the ability to define custom types/interfaces for this.$data
, this.$session.data
and this.$user.data
that can be set while instanciating the App (or platform) object, similarly to what happens with output and component classes, where you can set config and data interfaces.
Something like this:
interface SessionData {
isLogged: boolean;
}
const app = new App<SessionData>({...});
Hey @acerbisgianluca We had this on our list a few months ago and it's still a valid feature request.
Here's a workaround for now:
declare module '@jovotech/framework/dist/types/interfaces' {
interface SessionData {
isLogged: boolean;
}
}