react-native-firebase/lib/flow.js

94 lines
1.8 KiB
JavaScript
Raw Normal View History

2017-03-02 13:10:10 +00:00
/* eslint-disable */
2017-11-17 14:22:46 +00:00
/* Core types */
declare class FirebaseError {
message: string,
name: string,
code: string,
stack: string,
path: string,
details: string,
modifiers: string
};
declare type FirebaseOptions = {
apiKey: string,
appId: string,
databaseURL: string,
messagingSenderId: string,
projectId: string,
storageBucket: string,
}
2017-03-02 13:10:10 +00:00
2017-11-17 14:22:46 +00:00
/* Auth types */
declare type AuthResult = {
2017-03-02 13:10:10 +00:00
authenticated: boolean,
user: Object|null
2017-03-17 23:40:12 +00:00
} | null;
2017-03-02 13:10:10 +00:00
2017-11-17 14:22:46 +00:00
declare type AuthCredential = {
providerId: string,
2017-03-02 13:10:10 +00:00
token: string,
secret: string
};
2017-11-17 14:22:46 +00:00
/* Database types */
declare type DatabaseListener = {
listenerId: number;
eventName: string;
successCallback: Function;
failureCallback?: Function;
};
declare type DatabaseModifier = {
type: 'orderBy' | 'limit' | 'filter';
name?: string;
key?: string;
limit?: number;
value?: any;
valueType?: string;
};
2017-11-17 14:22:46 +00:00
/* Firestore types */
declare type FirestoreNativeDocumentChange = {
document: FirestoreNativeDocumentSnapshot,
newIndex: number,
oldIndex: number,
type: string,
}
declare type FirestoreNativeDocumentSnapshot = {
data: { [string]: FirestoreTypeMap },
metadata: FirestoreSnapshotMetadata,
path: string,
}
declare type FirestoreSnapshotMetadata = {
fromCache: boolean,
hasPendingWrites: boolean,
}
declare type FirestoreQueryDirection = 'DESC' | 'desc' | 'ASC' | 'asc';
declare type FirestoreQueryOperator = '<' | '<=' | '=' | '==' | '>' | '>=';
declare type FirestoreTypeMap = {
type: 'array' | 'boolean' | 'date' | 'fieldvalue' | 'geopoint' | 'null' | 'number' | 'object' | 'reference' | 'string',
value: any,
}
declare type FirestoreWriteOptions = {
merge?: boolean,
}
/* Util types */
2017-03-02 13:10:10 +00:00
declare type GoogleApiAvailabilityType = {
status: number,
isAvailable: boolean,
isUserResolvableError?: boolean,
hasResolution?: boolean,
2017-03-02 13:10:10 +00:00
error?: string
};