2017-11-23 17:29:40 +00:00
|
|
|
/* @flow */
|
|
|
|
import type AdMob from '../modules/admob';
|
|
|
|
import { typeof statics as AdMobStatics } from '../modules/admob';
|
|
|
|
import type Analytics from '../modules/analytics';
|
|
|
|
import { typeof statics as AnalyticsStatics } from '../modules/analytics';
|
|
|
|
import type Auth from '../modules/auth';
|
|
|
|
import { typeof statics as AuthStatics } from '../modules/auth';
|
|
|
|
import type Config from '../modules/config';
|
|
|
|
import { typeof statics as ConfigStatics } from '../modules/config';
|
|
|
|
import type Crash from '../modules/crash';
|
|
|
|
import { typeof statics as CrashStatics } from '../modules/crash';
|
2018-04-03 15:51:05 +00:00
|
|
|
import type Crashlytics from '../modules/crashlytics';
|
|
|
|
import { typeof statics as CrashlyticsStatics } from '../modules/crashlytics';
|
2017-11-23 17:29:40 +00:00
|
|
|
import type Database from '../modules/database';
|
|
|
|
import { typeof statics as DatabaseStatics } from '../modules/database';
|
|
|
|
import type Firestore from '../modules/firestore';
|
|
|
|
import { typeof statics as FirestoreStatics } from '../modules/firestore';
|
2018-05-04 15:33:59 +00:00
|
|
|
import type Functions from '../modules/functions';
|
|
|
|
import { typeof statics as FunctionsStatics } from '../modules/functions';
|
2018-03-23 14:59:00 +00:00
|
|
|
import type InstanceId from '../modules/iid';
|
|
|
|
import { typeof statics as InstanceIdStatics } from '../modules/iid';
|
2018-03-22 12:46:37 +00:00
|
|
|
import type Invites from '../modules/invites';
|
|
|
|
import { typeof statics as InvitesStatics } from '../modules/invites';
|
2017-11-23 17:29:40 +00:00
|
|
|
import type Links from '../modules/links';
|
|
|
|
import { typeof statics as LinksStatics } from '../modules/links';
|
|
|
|
import type Messaging from '../modules/messaging';
|
|
|
|
import { typeof statics as MessagingStatics } from '../modules/messaging';
|
2018-02-02 08:40:48 +00:00
|
|
|
import type Notifications from '../modules/notifications';
|
|
|
|
import { typeof statics as NotificationsStatics } from '../modules/notifications';
|
2017-11-23 17:29:40 +00:00
|
|
|
import type ModuleBase from '../utils/ModuleBase';
|
|
|
|
import type Performance from '../modules/perf';
|
|
|
|
import { typeof statics as PerformanceStatics } from '../modules/perf';
|
|
|
|
import type Storage from '../modules/storage';
|
|
|
|
import { typeof statics as StorageStatics } from '../modules/storage';
|
|
|
|
import type Utils from '../modules/utils';
|
|
|
|
import { typeof statics as UtilsStatics } from '../modules/utils';
|
|
|
|
|
|
|
|
/* Core types */
|
|
|
|
export type FirebaseError = {
|
|
|
|
message: string,
|
|
|
|
name: string,
|
|
|
|
code: string,
|
|
|
|
stack: string,
|
|
|
|
path: string,
|
|
|
|
details: string,
|
2018-01-25 18:25:39 +00:00
|
|
|
modifiers: string,
|
|
|
|
};
|
2017-11-23 17:29:40 +00:00
|
|
|
|
|
|
|
export type FirebaseModule = $Subtype<ModuleBase>;
|
|
|
|
|
2018-01-03 20:00:38 +00:00
|
|
|
export type FirebaseModuleConfig = {
|
|
|
|
events?: string[],
|
|
|
|
moduleName: FirebaseModuleName,
|
2018-01-09 17:31:00 +00:00
|
|
|
multiApp: boolean,
|
2017-11-21 23:37:05 +00:00
|
|
|
hasShards: boolean,
|
2018-01-03 20:00:38 +00:00
|
|
|
namespace: FirebaseNamespace,
|
2018-01-25 18:25:39 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
export type FirebaseModuleName =
|
2018-01-31 15:28:20 +00:00
|
|
|
| 'RNFirebaseAdMob'
|
2018-01-25 18:25:39 +00:00
|
|
|
| 'RNFirebaseAnalytics'
|
|
|
|
| 'RNFirebaseAuth'
|
|
|
|
| 'RNFirebaseRemoteConfig'
|
|
|
|
| 'RNFirebaseCrash'
|
|
|
|
| 'RNFirebaseCrashlytics'
|
|
|
|
| 'RNFirebaseDatabase'
|
|
|
|
| 'RNFirebaseFirestore'
|
2018-05-04 15:33:59 +00:00
|
|
|
| 'RNFirebaseFunctions'
|
2018-02-02 08:40:48 +00:00
|
|
|
| 'RNFirebaseInstanceId'
|
2018-03-22 12:46:37 +00:00
|
|
|
| 'RNFirebaseInvites'
|
2018-01-25 18:25:39 +00:00
|
|
|
| 'RNFirebaseLinks'
|
|
|
|
| 'RNFirebaseMessaging'
|
2018-01-30 11:15:59 +00:00
|
|
|
| 'RNFirebaseNotifications'
|
2018-01-25 18:25:39 +00:00
|
|
|
| 'RNFirebasePerformance'
|
|
|
|
| 'RNFirebaseStorage'
|
|
|
|
| 'RNFirebaseUtils';
|
|
|
|
|
|
|
|
export type FirebaseNamespace =
|
|
|
|
| 'admob'
|
|
|
|
| 'analytics'
|
|
|
|
| 'auth'
|
|
|
|
| 'config'
|
|
|
|
| 'crash'
|
|
|
|
| 'crashlytics'
|
|
|
|
| 'database'
|
|
|
|
| 'firestore'
|
2018-05-05 18:25:52 +00:00
|
|
|
| 'functions'
|
2018-03-23 14:59:00 +00:00
|
|
|
| 'iid'
|
2018-03-22 12:46:37 +00:00
|
|
|
| 'invites'
|
2018-01-25 18:25:39 +00:00
|
|
|
| 'links'
|
|
|
|
| 'messaging'
|
2018-01-30 11:15:59 +00:00
|
|
|
| 'notifications'
|
2018-01-25 18:25:39 +00:00
|
|
|
| 'perf'
|
|
|
|
| 'storage'
|
2017-12-06 17:25:17 +00:00
|
|
|
| 'utils';
|
2017-11-23 17:29:40 +00:00
|
|
|
|
|
|
|
export type FirebaseOptions = {
|
|
|
|
apiKey: string,
|
|
|
|
appId: string,
|
|
|
|
databaseURL: string,
|
|
|
|
messagingSenderId: string,
|
|
|
|
projectId: string,
|
|
|
|
storageBucket: string,
|
2018-01-25 18:25:39 +00:00
|
|
|
};
|
2017-11-23 17:29:40 +00:00
|
|
|
|
|
|
|
export type FirebaseModuleAndStatics<M: FirebaseModule, S: FirebaseStatics> = {
|
|
|
|
(): M,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & S;
|
|
|
|
|
|
|
|
export type FirebaseStatics = $Subtype<Object>;
|
|
|
|
|
|
|
|
/* Admob types */
|
|
|
|
|
|
|
|
export type AdMobModule = {
|
|
|
|
(): AdMob,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & AdMobStatics;
|
|
|
|
|
|
|
|
/* Analytics types */
|
|
|
|
|
|
|
|
export type AnalyticsModule = {
|
|
|
|
(): Analytics,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & AnalyticsStatics;
|
|
|
|
|
|
|
|
/* Remote Config types */
|
|
|
|
|
|
|
|
export type ConfigModule = {
|
|
|
|
(): Config,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & ConfigStatics;
|
|
|
|
|
2018-01-19 16:19:08 +00:00
|
|
|
/* Auth types */
|
|
|
|
|
2017-11-23 17:29:40 +00:00
|
|
|
export type AuthModule = {
|
|
|
|
(): Auth,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & AuthStatics;
|
|
|
|
|
|
|
|
/* Crash types */
|
|
|
|
|
|
|
|
export type CrashModule = {
|
|
|
|
(): Crash,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & CrashStatics;
|
|
|
|
|
2018-04-03 15:51:05 +00:00
|
|
|
/* Crashlytics types */
|
|
|
|
export type CrashlyticsModule = {
|
|
|
|
(): Crashlytics,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & CrashlyticsStatics;
|
|
|
|
|
2017-11-23 17:29:40 +00:00
|
|
|
/* Database types */
|
|
|
|
|
|
|
|
export type DatabaseModule = {
|
|
|
|
(): Database,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & DatabaseStatics;
|
|
|
|
|
|
|
|
export type DatabaseModifier = {
|
2018-01-25 18:25:39 +00:00
|
|
|
id: string,
|
|
|
|
type: 'orderBy' | 'limit' | 'filter',
|
|
|
|
name?: string,
|
|
|
|
key?: string,
|
|
|
|
limit?: number,
|
|
|
|
value?: any,
|
|
|
|
valueType?: string,
|
|
|
|
};
|
2017-11-23 17:29:40 +00:00
|
|
|
|
|
|
|
/* Firestore types */
|
|
|
|
|
|
|
|
export type FirestoreModule = {
|
|
|
|
(): Firestore,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & FirestoreStatics;
|
|
|
|
|
2018-05-04 15:33:59 +00:00
|
|
|
/* Functions types */
|
|
|
|
|
|
|
|
export type FunctionsModule = {
|
|
|
|
(): Functions,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & FunctionsStatics;
|
|
|
|
|
2018-02-02 08:40:48 +00:00
|
|
|
/* InstanceId types */
|
|
|
|
|
|
|
|
export type InstanceIdModule = {
|
2018-03-22 12:46:37 +00:00
|
|
|
(): InstanceId,
|
|
|
|
nativeModuleExists: boolean,
|
2018-02-02 08:40:48 +00:00
|
|
|
} & InstanceIdStatics;
|
|
|
|
|
2018-03-22 12:46:37 +00:00
|
|
|
/* Invites types */
|
|
|
|
|
|
|
|
export type InvitesModule = {
|
|
|
|
(): Invites,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & InvitesStatics;
|
|
|
|
|
2017-11-23 17:29:40 +00:00
|
|
|
/* Links types */
|
|
|
|
|
|
|
|
export type LinksModule = {
|
|
|
|
(): Links,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & LinksStatics;
|
|
|
|
|
|
|
|
/* Messaging types */
|
|
|
|
|
|
|
|
export type MessagingModule = {
|
|
|
|
(): Messaging,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & MessagingStatics;
|
|
|
|
|
2018-02-02 08:40:48 +00:00
|
|
|
/* Notifications types */
|
|
|
|
|
|
|
|
export type NotificationsModule = {
|
|
|
|
(): Notifications,
|
2018-01-30 11:15:59 +00:00
|
|
|
nativeModuleExists: boolean,
|
2018-02-02 08:40:48 +00:00
|
|
|
} & NotificationsStatics;
|
2018-01-30 11:15:59 +00:00
|
|
|
|
2017-11-23 17:29:40 +00:00
|
|
|
/* Performance types */
|
|
|
|
|
|
|
|
export type PerformanceModule = {
|
|
|
|
(): Performance,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & PerformanceStatics;
|
|
|
|
|
|
|
|
/* Storage types */
|
|
|
|
|
|
|
|
export type StorageModule = {
|
|
|
|
(): Storage,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & StorageStatics;
|
|
|
|
|
|
|
|
/* Utils types */
|
|
|
|
|
|
|
|
export type UtilsModule = {
|
|
|
|
(): Utils,
|
|
|
|
nativeModuleExists: boolean,
|
|
|
|
} & UtilsStatics;
|