Proper way of typing
Whats the proper way of typing this?
nuxtApp.payload.serverState = {
isAndroid,
isTWA,
approximateWidth,
isLoadingRedirect,
isInAppBrowser,
} ?
Type casting it using
nuxtApp.payload.serverState = {
isAndroid,
isTWA,
approximateWidth,
isLoadingRedirect,
isInAppBrowser,
} as MyServerState;
Seems to work in my editor, but when runing nuxi typecheck it will still flag as a type error:
error TS2339: Property 'approximateWidth' does not exist on type '{}'.
nuxtApp.payload.serverState = {
isAndroid,
isTWA,
approximateWidth,
isLoadingRedirect,
isInAppBrowser,
} ?
Type casting it using
nuxtApp.payload.serverState = {
isAndroid,
isTWA,
approximateWidth,
isLoadingRedirect,
isInAppBrowser,
} as MyServerState;
Seems to work in my editor, but when runing nuxi typecheck it will still flag as a type error:
error TS2339: Property 'approximateWidth' does not exist on type '{}'.
