[types] Export app, auth, database and firestore types

This commit is contained in:
Chris Bianca
2018-02-14 13:00:19 +00:00
parent 1199b2bb33
commit 4e81527246
34 changed files with 246 additions and 210 deletions

View File

@@ -1,15 +1,15 @@
/**
* @flow
* Snapshot representation wrapper
* DataSnapshot representation wrapper
*/
import { isObject, deepGet, deepExists } from './../../utils';
import type Reference from './reference';
import type Reference from './Reference';
/**
* @class DataSnapshot
* @link https://firebase.google.com/docs/reference/js/firebase.database.DataSnapshot
*/
export default class Snapshot {
export default class DataSnapshot {
ref: Reference;
key: string;
@@ -50,10 +50,10 @@ export default class Snapshot {
* @link https://firebase.google.com/docs/reference/js/firebase.database.DataSnapshot#forEach
* @returns {Snapshot}
*/
child(path: string): Snapshot {
child(path: string): DataSnapshot {
const value = deepGet(this._value, path);
const childRef = this.ref.child(path);
return new Snapshot(childRef, {
return new DataSnapshot(childRef, {
value,
key: childRef.key,
exists: value !== null,

View File

@@ -1,17 +1,17 @@
/**
* @flow
* Disconnect representation wrapper
* OnDisconnect representation wrapper
*/
import { typeOf } from '../../utils';
import { getNativeModule } from '../../utils/native';
import type Database from './';
import type Reference from './reference';
import type Reference from './Reference';
/**
* @url https://firebase.google.com/docs/reference/js/firebase.database.OnDisconnect
* @class Disconnect
* @class OmDisconnect
*/
export default class Disconnect {
export default class OnDisconnect {
_database: Database;
ref: Reference;
path: string;

View File

@@ -4,12 +4,12 @@
*/
import { NativeModules } from 'react-native';
import Reference from './reference';
import Reference from './Reference';
import TransactionHandler from './transaction';
import ModuleBase from '../../utils/ModuleBase';
import { getNativeModule } from '../../utils/native';
import type App from '../core/firebase-app';
import type App from '../core/app';
const NATIVE_EVENTS = [
'database_transaction_event',