mirror of
https://github.com/zhigang1992/react-native-firebase.git
synced 2026-05-07 00:42:37 +08:00
[types] Export app, auth, database and firestore types
This commit is contained in:
@@ -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,
|
||||
@@ -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;
|
||||
@@ -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',
|
||||
|
||||
Reference in New Issue
Block a user