dump of current js files
This commit is contained in:
parent
8d84622228
commit
7e8dbcbb35
|
@ -2,7 +2,7 @@
|
|||
import { NativeModules } from 'react-native';
|
||||
import { Base } from './../base';
|
||||
|
||||
const FirebaseAnalytics = NativeModules.FirebaseAnalytics;
|
||||
const FirebaseAnalytics = NativeModules.RNFirebaseAnalytics;
|
||||
const AlphaNumericUnderscore = /^[a-zA-Z0-9_]+$/;
|
||||
|
||||
const ReservedEventNames = [
|
||||
|
|
|
@ -6,12 +6,9 @@ import { Base } from './../base';
|
|||
import EmailAuthProvider from './Email';
|
||||
import { promisify } from './../../utils';
|
||||
|
||||
const FirebaseAuth = NativeModules.FirebaseAuth;
|
||||
const FirebaseAuth = NativeModules.RNFirebaseAuth;
|
||||
const FirebaseAuthEvt = new NativeEventEmitter(FirebaseAuth);
|
||||
|
||||
type AuthResultType = { authenticated: boolean, user: Object|null };
|
||||
type CredentialType = { provider: string, token: string, secret: string };
|
||||
|
||||
// TODO move user methods to user class
|
||||
export default class Auth extends Base {
|
||||
_user: User|null;
|
||||
|
|
|
@ -1,6 +1,19 @@
|
|||
import { NativeModules, NativeEventEmitter } from 'react-native';
|
||||
|
||||
const FirebaseAuth = NativeModules.RNFirebaseAuth;
|
||||
|
||||
// TODO refreshToken property
|
||||
// TODO reload() method
|
||||
|
||||
/**
|
||||
* @url https://firebase.google.com/docs/reference/js/firebase.User
|
||||
*/
|
||||
export default class User {
|
||||
/**
|
||||
*
|
||||
* @param authClass Instance of Authentication class
|
||||
* @param authObj authentication result object from native
|
||||
*/
|
||||
constructor(authClass, authObj) {
|
||||
this._auth = authClass;
|
||||
this._user = null;
|
||||
|
|
|
@ -4,7 +4,7 @@ import { NativeModules } from 'react-native';
|
|||
import { promisify, typeOf } from './../../utils';
|
||||
import Reference from './reference';
|
||||
|
||||
const FirebaseDatabase = NativeModules.FirebaseDatabase;
|
||||
const FirebaseDatabase = NativeModules.RNFirebaseDatabase;
|
||||
|
||||
/**
|
||||
* @url https://firebase.google.com/docs/reference/js/firebase.database.OnDisconnect
|
||||
|
|
|
@ -9,7 +9,7 @@ import Snapshot from './snapshot.js';
|
|||
import Reference from './reference.js';
|
||||
import { promisify } from './../../utils';
|
||||
|
||||
const FirebaseDatabase = NativeModules.FirebaseDatabase;
|
||||
const FirebaseDatabase = NativeModules.RNFirebaseDatabase;
|
||||
const FirebaseDatabaseEvt = new NativeEventEmitter(FirebaseDatabase);
|
||||
|
||||
/**
|
||||
|
|
|
@ -9,7 +9,7 @@ import Disconnect from './disconnect';
|
|||
import { ReferenceBase } from './../base';
|
||||
import { promisify, isFunction, isObject, tryJSONParse, tryJSONStringify, generatePushID } from './../../utils';
|
||||
|
||||
const FirebaseDatabase = NativeModules.FirebaseDatabase;
|
||||
const FirebaseDatabase = NativeModules.RNFirebaseDatabase;
|
||||
|
||||
// https://firebase.google.com/docs/reference/js/firebase.database.Reference
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ import { NativeModules, NativeEventEmitter } from 'react-native';
|
|||
import { Base } from './../base';
|
||||
import StorageRef from './reference';
|
||||
|
||||
const FirebaseStorage = NativeModules.FirebaseStorage;
|
||||
const FirebaseStorage = NativeModules.RNFirebaseStorage;
|
||||
const FirebaseStorageEvt = new NativeEventEmitter(FirebaseStorage);
|
||||
|
||||
type StorageOptionsType = {
|
||||
|
|
|
@ -6,7 +6,7 @@ import { ReferenceBase } from './../base';
|
|||
import StorageTask, { UPLOAD_TASK, DOWNLOAD_TASK } from './task';
|
||||
import Storage from './';
|
||||
|
||||
const FirebaseStorage = NativeModules.FirebaseStorage;
|
||||
const FirebaseStorage = NativeModules.RNFirebaseStorage;
|
||||
|
||||
/**
|
||||
* @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference
|
||||
|
@ -49,7 +49,7 @@ export default class StorageReference extends ReferenceBase {
|
|||
* @url https://firebase.google.com/docs/reference/js/firebase.storage.Reference#delete
|
||||
* @returns {Promise.<T>|*}
|
||||
*/
|
||||
delete(): Promise {
|
||||
delete(): Promise<*> {
|
||||
return promisify('delete', FirebaseStorage)(this.path)
|
||||
.catch((error) => {
|
||||
this.log.error('Error deleting reference ', this.path, '. Error: ', error);
|
||||
|
|
|
@ -38,7 +38,7 @@ export function deepGet(object, path, joiner = '/') {
|
|||
const len = keys.length;
|
||||
|
||||
while (i < len) {
|
||||
const key = keys[i += 1];
|
||||
const key = keys[i++];
|
||||
if (!tmp || !hasOwnProperty.call(tmp, key)) return null;
|
||||
tmp = tmp[key];
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ export function deepExists(object, path, joiner = '/') {
|
|||
const len = keys.length;
|
||||
|
||||
while (i < len) {
|
||||
const key = keys[i += 1];
|
||||
const key = keys[i++];
|
||||
if (!tmp || !hasOwnProperty.call(tmp, key)) return false;
|
||||
tmp = tmp[key];
|
||||
}
|
||||
|
@ -205,8 +205,9 @@ export function each(array: Array, chunkSize?: number, iterator: Function, cb: F
|
|||
}
|
||||
|
||||
export function typeOf(value) {
|
||||
if (value === null) return 'null';
|
||||
if (Array.isArray(value)) return 'array';
|
||||
return value === null ? 'null' : typeof value;
|
||||
return typeof value;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue