In this module, user props when accessed through this.$auth.user have this type get user(): Record<string, unknown> | null;. I want to change this, so user object is typed with my interface, let say interface User {name:string, phone: string}. Also i want to force that this user property is not nullable, so i want to use directly for example this.$auth.user.name without checking for null.
What i have been tried:
Override $auth in index.d.ts in my ./types folder, but produce this error Subsequent property declarations must have the same type. and the new custom interface doesnt work.
Disable types in tsconfig which point to @nuxtjs/auth-next but it also doesnt work. When i call this.$auth it still using built-in interfaces.
So, how to override built in interface from module? If not applicable, then how to disable load interface from module, so i can use custom interface on my own?
In this module,
user
props when accessed throughthis.$auth.user
have this typeget user(): Record<string, unknown> | null;
. I want to change this, so user object is typed with my interface, let sayinterface User {name:string, phone: string}
. Also i want to force that this user property is not nullable, so i want to use directly for examplethis.$auth.user.name
without checking for null.What i have been tried:
$auth
inindex.d.ts
in my./types
folder, but produce this errorSubsequent property declarations must have the same type.
and the new custom interface doesnt work.@nuxtjs/auth-next
but it also doesnt work. When i callthis.$auth
it still using built-in interfaces.So, how to override built in interface from module? If not applicable, then how to disable load interface from module, so i can use custom interface on my own?
"@nuxtjs/auth-next": "5.0.0-1667386184.dfbbb54"