import firebase from 'firebase'
import Vue from 'vue'
/* This file simply imports the needed types from firebase and forwards them */
declare module 'vue/types/vue' {
interface Vue {
$fireStore: firebase.firestore.Firestore
$fireDb: firebase.database.Database
$fireFunc: firebase.functions.Functions
$fireStorage: firebase.storage.Storage
$fireAuth: firebase.auth.Auth
$fireMess: firebase.messaging.Messaging
}
}
In normal typescript project with Vue 2, we can do this. But when use Composition API, how I can inject the properties like this in root
on function setup(_, { root})
?
So I cant use with root.$fireStore
...
Now, I must use it with the any
type like (root as any).$fireStore
. So hope anyone can help my team. We are working on a project with Nuxt Composition now.
Yes, after a few days, I reached out the temporary solution for this. Just add a
nuxt.d.ts
or yourtypes
folder like this. So you can use$apolloHelpers
in your Vue Instances and Middleware...