[types]: Format typings and export new additions

This commit is contained in:
Andrew Crites 2018-05-22 10:31:29 -04:00
parent c61f860d67
commit 1d91cad542
No known key found for this signature in database
GPG Key ID: B6AFFDD883E2E527
2 changed files with 68 additions and 32 deletions

68
src/index.d.ts vendored
View File

@ -2400,8 +2400,8 @@ declare module 'react-native-firebase' {
} }
} }
declare module "react-native-firebase/storage" { declare module 'react-native-firebase/storage' {
import { RNFirebase } from "react-native-firebase"; import { RNFirebase } from 'react-native-firebase';
export type StorageTask<T> = RNFirebase.storage.StorageTask<T>; export type StorageTask<T> = RNFirebase.storage.StorageTask<T>;
export type RNStorage = RNFirebase.storage.RNStorage; export type RNStorage = RNFirebase.storage.RNStorage;
export type Storage = RNFirebase.storage.Storage; export type Storage = RNFirebase.storage.Storage;
@ -2416,8 +2416,8 @@ declare module "react-native-firebase/storage" {
export type TaskState = RNFirebase.storage.TaskState; export type TaskState = RNFirebase.storage.TaskState;
} }
declare module "react-native-firebase/database" { declare module 'react-native-firebase/database' {
import { RNFirebase } from "react-native-firebase"; import { RNFirebase } from 'react-native-firebase';
export type Database = RNFirebase.database.Database; export type Database = RNFirebase.database.Database;
export type RnReference = RNFirebase.database.RnReference; export type RnReference = RNFirebase.database.RnReference;
export type QueryEventType = RNFirebase.database.QueryEventType; export type QueryEventType = RNFirebase.database.QueryEventType;
@ -2427,40 +2427,70 @@ declare module "react-native-firebase/database" {
export type DataSnapshot = RNFirebase.database.DataSnapshot; export type DataSnapshot = RNFirebase.database.DataSnapshot;
export type Reference = RNFirebase.database.Reference; export type Reference = RNFirebase.database.Reference;
export type DatabaseStatics = RNFirebase.database.DatabaseStatics; export type DatabaseStatics = RNFirebase.database.DatabaseStatics;
interface ThenableReference<T> extends Promise<T> { interface ThenableReference<T> extends Promise<T> {}
} interface ThenableReference<T> extends RNFirebase.database.Reference {}
interface ThenableReference<T> extends RNFirebase.database.Reference {
}
} }
declare module "react-native-firebase/auth" { declare module 'react-native-firebase/auth' {
import { RNFirebase } from "react-native-firebase"; import { RNFirebase } from 'react-native-firebase';
export type AuthResult = RNFirebase.auth.AuthResult; export type AuthResult = RNFirebase.auth.AuthResult;
export type AuthProvider = RNFirebase.auth.AuthProvider; export type AuthProvider = RNFirebase.auth.AuthProvider;
export type Auth = RNFirebase.auth.Auth; export type Auth = RNFirebase.auth.Auth;
export type AuthStatics = RNFirebase.auth.AuthStatics; export type AuthStatics = RNFirebase.auth.AuthStatics;
} }
declare module "react-native-firebase/messaging" { declare module 'react-native-firebase/messaging' {
import { RNFirebase } from "react-native-firebase"; import { RNFirebase } from 'react-native-firebase';
export type Messaging = RNFirebase.messaging.Messaging; export type Messaging = RNFirebase.messaging.Messaging;
export type RemoteMessage = RNFirebase.messaging.RemoteMessage; export type RemoteMessage = RNFirebase.messaging.RemoteMessage;
} }
declare module 'react-native-firebase/iid' {
import { RNFirebase } from 'react-native-firebase';
export type InstanceId = RNFirebase.iid.InstanceId;
}
declare module "react-native-firebase/crashlytics" { declare module 'react-native-firebase/notifications' {
import { RNFirebase } from "react-native-firebase"; import { RNFirebase } from 'react-native-firebase';
export type AndroidNotifications = RNFirebase.notifications.AndroidNotifications;
export type Notifications = RNFirebase.notifications.Notifications;
export type Notification = RNFirebase.notifications.Notification;
export type NotificationOpen = RNFirebase.notifications.NotificationOpen;
export type AndroidNotification = RNFirebase.notifications.AndroidNotification;
export type IOSNotification = RNFirebase.notifications.IOSNotification;
export type IOSAttachment = RNFirebase.notifications.IOSAttachment;
export type IOSAttachmentOptions = RNFirebase.notifications.IOSAttachmentOptions;
}
declare module 'react-native-firebase/crashlytics' {
import { RNFirebase } from 'react-native-firebase';
export type Crashlytics = RNFirebase.crashlytics.Crashlytics; export type Crashlytics = RNFirebase.crashlytics.Crashlytics;
} }
declare module "react-native-firebase/links" { declare module 'react-native-firebase/links' {
import { RNFirebase } from "react-native-firebase"; import { RNFirebase } from 'react-native-firebase';
export type Links = RNFirebase.links.Links; export type Links = RNFirebase.links.Links;
export type DynamicLink = RNFirebase.links.DynamicLink;
export type AnalyticsParameters = RNFirebase.links.AnalyticsParameters;
export type AndroidParameters = RNFirebase.links.AndroidParameters;
export type IOSParameters = RNFirebase.links.IOSParameters;
export type ITunesParameters = RNFirebase.links.ITunesParameters;
export type NavigationParameters = RNFirebase.links.NavigationParameters;
export type SocialParameters = RNFirebase.links.SocialParameters;
} }
declare module "react-native-firebase/firestore" { declare module 'react-native-firebase/functions' {
import { RNFirebase } from "react-native-firebase"; import { RNFirebase } from 'react-native-firebase';
export type HttpsErrorCode = RNFirebase.functions.HttpsErrorCode;
export type FunctionsErrorCode = RNFirebase.functions.FunctionsErrorCode;
export type HttpsCallableResult = RNFirebase.functions.HttpsCallableResult;
export type Funtions = RNFirebase.functions.Functions;
export type HttpsError = RNFirebase.functions.HttpsError;
}
declare module 'react-native-firebase/firestore' {
import { RNFirebase } from 'react-native-firebase';
export type FireStore = RNFirebase.firestore.Firestore; export type FireStore = RNFirebase.firestore.Firestore;
export type FirestoreStatics = RNFirebase.firestore.FirestoreStatics; export type FirestoreStatics = RNFirebase.firestore.FirestoreStatics;
export type CollectionReference = RNFirebase.firestore.CollectionReference; export type CollectionReference = RNFirebase.firestore.CollectionReference;

View File

@ -242,16 +242,22 @@ class Firebase {
const firebaseApp = new Firebase(); const firebaseApp = new Firebase();
export default firebaseApp; export default firebaseApp;
export const admob = firebaseApp.admob; export const {
export const analytics = firebaseApp.analytics; admob,
export const auth = firebaseApp.auth; analytics,
export const config = firebaseApp.config; auth,
export const crash = firebaseApp.crash; config,
export const database = firebaseApp.database; crash,
export const fabric = firebaseApp.fabric; crashlytics,
export const firestore = firebaseApp.firestore; database,
export const links = firebaseApp.links; firestore,
export const messaging = firebaseApp.messaging; functions,
export const perf = firebaseApp.perf; iid,
export const storage = firebaseApp.storage; invites,
export const utils = firebaseApp.utils; links,
messaging,
notifications,
perf,
storage,
utils,
} = firebaseApp;