Fix dynamic links types

This commit is contained in:
ehesp
2019-09-04 09:18:20 +01:00
parent 31202eed36
commit 011bd907dc
2 changed files with 7 additions and 5 deletions

View File

@@ -551,11 +551,11 @@ declare module '@react-native-firebase/app' {
import FirebaseModuleWithStatics = ReactNativeFirebase.FirebaseModuleWithStatics;
interface Module {
links: FirebaseModuleWithStatics<DynamicLinks.Module, DynamicLinks.Statics>;
dynamicLinks: FirebaseModuleWithStatics<DynamicLinks.Module, DynamicLinks.Statics>;
}
interface FirebaseApp {
links(): DynamicLinks.Module;
dynamicLinks(): DynamicLinks.Module;
}
}
}

View File

@@ -2,13 +2,13 @@ import firebase from '@react-native-firebase/app';
import defaultExport, { firebase as firebaseFromModule } from '@react-native-firebase/dynamic-links';
// checks module exists at root
console.log(firebase.links().app.name);
console.log(firebase.dynamicLinks().app.name);
// checks module exists at app level
console.log(firebase.app().links().app.name);
console.log(firebase.app().dynamicLinks().app.name);
// checks statics exist
console.log(firebase.links.SDK_VERSION);
console.log(firebase.dynamicLinks.SDK_VERSION);
// checks statics exist on defaultExport
console.log(defaultExport.SDK_VERSION);
@@ -24,3 +24,5 @@ console.log(firebaseFromModule.SDK_VERSION);
// checks default export supports app arg
// console.log(defaultExport(firebase.app()).app.name);
console.log(firebase.dynamicLinks().getInitialLink());