Reputation: 632
I'm want to protect a Route in my project throwing people out if they are not logged in. I'm trying to access the UserInfo
property but I'm getting this error:
/node_modules/firebase/app/dist/app/index"' has no exported member 'UserInfo'.ts(2694)
my code (svelte):
import { writable } from "svelte/store";
import type firebase from "firebase/app";
const authStore = writable<{
isLoggedIn: boolean;
user?: firebase.UserInfo;
firebaseControlled: boolean;
}>({
isLoggedIn: false,
firebaseControlled: false,
});
export default {
subscribe: authStore.subscribe,
set: authStore.set,
};
Upvotes: 1
Views: 152
Reputation: 58
This is a bit of a late response but I just came across the same issue myself. I couldn't seem to find documentation anywhere for this but here's how I retrieved the type:
import { writable } from 'svelte/store';
import type { UserInfo } from 'firebase/auth';
const authStore = writable<{
isLoggedIn: boolean;
user: UserInfo | null;
firebaseControlled: boolean;
}>({
isLoggedIn: false,
user: null,
firebaseControlled: false
});
export default {
subscribe: authStore.subscribe,
set: authStore.set
};
Upvotes: 2