UNPKG

24.9 kBTypeScriptView Raw
1/**
2 * The allowed values for LoginOptions.type.
3 */
4export enum LoginType {
5 /**
6 * No further data is required.
7 */
8 ANONYMOUS,
9 /**
10 * This requires you to pass in the 'passwordOptions' as well.
11 */
12 PASSWORD,
13 /**
14 * This requires you to add the 'phoneOptions' as well.
15 */
16 PHONE,
17 /**
18 * This requires you to pass either an authentication token generated by your backend server
19 * or the tokenProviderFn function that returns a promise to provide the token (see 'customOptions').
20 * See: https://firebase.google.com/docs/auth/server
21 */
22 CUSTOM,
23 /**
24 * This requires you to setup Facebook Auth in the Firebase console,
25 * as well as uncommenting the SDK includes in include.gradle (Android) and Podfile (iOS).
26 * You can pass in an optional 'facebookOptions' object to override the default scopes.
27 */
28 FACEBOOK,
29 /**
30 * This requires you to setup Google Sign In in the Firebase console,
31 * as well as uncommenting the SDK includes in include.gradle (Android) and Podfile (iOS).
32 * You can pass in an optional 'googleOptions' object to set a 'hostedDomain'.
33 */
34 GOOGLE,
35 /**
36 * This requires you to pass in the 'emailLinkOptions' as well.
37 * Note that 'Firebase Dynamic Links' must be enabled for this login type to work.
38 */
39 EMAIL_LINK
40}
41
42/**
43 * The allowed values for QueryOptions.orderBy.type.
44 */
45export enum QueryOrderByType {
46 KEY,
47 VALUE,
48 CHILD,
49 PRIORITY
50}
51
52/**
53 * The allowed values for QueryOptions.range.type.
54 */
55export enum QueryRangeType {
56 START_AT,
57 END_AT,
58 EQUAL_TO
59}
60
61/**
62 * The allowed values for QueryOptions.limit.type.
63 */
64export enum QueryLimitType {
65 FIRST,
66 LAST
67}
68
69export enum ServerValue {
70 /**
71 * When for instance using setValue you can set a timestamp property to this placeholder value.
72 * Example:
73 * updateTs: firebase.ServerValue.TIMESTAMP
74 */
75 TIMESTAMP
76}
77
78export interface MessagingOptions {
79 /**
80 * For Messaging, either pass in this callback function here, or use addOnMessageReceivedCallback.
81 */
82 onPushTokenReceivedCallback?: (token: string) => void;
83
84 /**
85 * For Messaging, either pass in this callback function here, or use addOnPushTokenReceivedCallback.
86 */
87 onMessageReceivedCallback?: (message: Message) => void;
88
89 /**
90 * For Messaging (Push Notifications). Whether you want this plugin to automatically display the notifications or just notify the callback.
91 * Currently used on iOS only. Default true.
92 */
93 showNotifications?: boolean;
94
95 /**
96 * For Messaging (Push Notifications). Whether you want this plugin to always handle the notifications when the app is in foreground.
97 * Currently used on iOS only. Default false.
98 */
99 showNotificationsWhenInForeground?: boolean;
100}
101
102/**
103 * The options object passed into the init function.
104 */
105export interface InitOptions extends MessagingOptions {
106 /**
107 * Allow the app to send analytics data to Firebase.
108 * Can also be set later with analytics.setAnalyticsCollectionEnabled.
109 * Default true.
110 */
111 analyticsCollectionEnabled?: boolean;
112 /**
113 * Allow disk persistence. Default true for Firestore, false for regular Firebase DB.
114 */
115 persist?: boolean;
116 /**
117 * Get notified when the user is logged in.
118 */
119 onAuthStateChanged?: (data: AuthStateData) => void;
120 /**
121 * Attempt to sign out before initializing, useful in case previous
122 * project token is cached which leads to following type of error:
123 * "[FirebaseDatabase] Authentication failed: invalid_token ..."
124 * Default false.
125 */
126 iOSEmulatorFlush?: boolean;
127 /**
128 * For Firebase Storage you can pass in something like 'gs://n-plugin-test.appspot.com'
129 * here so we can cache it. Otherwise pass in the 'bucket' param when using Storage features.
130 * Can be found in the firebase console.
131 */
132 storageBucket?: string;
133
134 /**
135 * Get notified when a dynamic link was used to launch the app. Alternatively use addOnDynamicLinkReceivedCallback.
136 * TODO iOS seems to return an object; not a string
137 */
138 onDynamicLinkCallback?: (data: DynamicLinkData) => void;
139}
140
141export interface QueryRangeOption {
142 type: QueryRangeType;
143 value: any;
144}
145
146/**
147 * The options object passed into the query function.
148 */
149export interface QueryOptions {
150 /**
151 * How you'd like to sort the query result.
152 */
153 orderBy: {
154 type: QueryOrderByType;
155 /**
156 * mandatory when type is QueryOrderByType.CHILD
157 */
158 value?: string;
159 };
160
161 /**
162 * You can further restrict the returned results by specifying restrictions.
163 * Need more than one range restriction? Use 'ranges' instead.
164 */
165 range?: QueryRangeOption;
166
167 /**
168 * Same as 'range', but for a 'chain of ranges'.
169 * You can further restrict the returned results by specifying restrictions.
170 */
171 ranges?: QueryRangeOption[];
172
173 /**
174 * You can limit the number of returned rows if you want to.
175 */
176 limit?: {
177 type: QueryLimitType;
178 value: number;
179 };
180
181 /**
182 * Set this to true if you don't want to listen for any future updates,
183 * but just want to retrieve the current value.
184 * You can also use this to check if certain data is in the database.
185 * Default false.
186 */
187 singleEvent?: boolean;
188}
189
190export interface GetAuthTokenOptions {
191 /**
192 * Default false.
193 */
194 forceRefresh?: boolean;
195}
196
197export interface Provider {
198 id: string;
199}
200
201export interface FirebasePasswordLoginOptions {
202 email: string;
203 password: string;
204}
205
206export interface FirebaseEmailLinkActionCodeSettings {
207 url: string;
208 iOS?: {
209 bundleId: string;
210 };
211 android?: {
212 packageName: string;
213 installApp?: false;
214 minimumVersion?: string;
215 };
216}
217
218export interface FirebaseEmailLinkLoginOptions extends FirebaseEmailLinkActionCodeSettings {
219 email: string;
220}
221
222export interface FirebasePhoneLoginOptions {
223 phoneNumber: string;
224 /**
225 * The message show to the user that prompts him to enter the received verification code.
226 * Default: "Verification code".
227 */
228 verificationPrompt?: string;
229}
230
231export interface FirebaseGoogleLoginOptions {
232 hostedDomain?: string;
233}
234
235export interface FirebaseFacebookLoginOptions {
236 /**
237 * Default: ["public_profile", "email"]
238 */
239 scope?: string[];
240}
241
242export interface FirebaseCustomLoginOptions {
243 /**
244 * The JSON Web Token (JWT) to use for authentication.
245 * Either specify this, or 'tokenProviderFn'.
246 * See: https://firebase.google.com/docs/auth/server
247 */
248 token?: string;
249 /**
250 * A function that returns a promise with the JSON Web Token (JWT) to use for authentication.
251 * Either specify this, or 'token'.
252 * See: https://firebase.google.com/docs/auth/server
253 */
254 tokenProviderFn?: () => Promise<String>;
255}
256
257export interface LoginIOSOptions {
258 controller?: any;
259}
260
261/**
262 * The options object passed into the login function.
263 */
264export interface LoginOptions {
265 type: LoginType;
266 passwordOptions?: FirebasePasswordLoginOptions;
267 emailLinkOptions?: FirebaseEmailLinkLoginOptions;
268 phoneOptions?: FirebasePhoneLoginOptions;
269 googleOptions?: FirebaseGoogleLoginOptions;
270 facebookOptions?: FirebaseFacebookLoginOptions;
271 customOptions?: FirebaseCustomLoginOptions;
272 ios?: LoginIOSOptions;
273
274 /**
275 * @deprecated Please use the 'passwordOptions?: FirebasePasswordLoginOptions' object instead.
276 */
277 email?: string;
278 /**
279 * @deprecated Please use the 'passwordOptions?: FirebasePasswordLoginOptions' object instead.
280 */
281 password?: string;
282 /**
283 * @deprecated Please use the 'customOptions?: FirebaseCustomLoginOptions' object instead.
284 */
285 token?: string;
286 /**
287 * @deprecated Please use the 'customOptions?: FirebaseCustomLoginOptions' object instead.
288 */
289 tokenProviderFn?: () => Promise<String>;
290 /**
291 * @deprecated Please use the 'facebookOptions?: FirebaseFacebookLoginOptions' object instead.
292 */
293 scope?: string[];
294}
295
296export interface ReauthenticateOptions {
297 type: LoginType;
298 passwordOptions?: FirebasePasswordLoginOptions;
299 /**
300 * @deprecated Please use the 'passwordOptions?: FirebasePasswordLoginOptions' object instead.
301 */
302 email?: string;
303 /**
304 * @deprecated Please use the 'passwordOptions?: FirebasePasswordLoginOptions' object instead.
305 */
306 password?: string;
307}
308
309/**
310 * The returned object from the login function.
311 */
312export interface User {
313 uid: string;
314 email?: string;
315 emailVerified: boolean;
316 name?: string;
317 phoneNumber?: string;
318 anonymous: boolean;
319 isAnonymous: boolean; // This is used by the web API
320 providers: Array<Provider>;
321 profileImageURL?: string;
322 metadata: UserMetadata;
323 additionalUserInfo?: AdditionalUserInfo;
324 /** iOS only */
325 refreshToken?: string;
326}
327
328/**
329 * The metadata of the user
330 */
331export interface UserMetadata {
332 creationTimestamp: Date;
333 lastSignInTimestamp: Date;
334}
335
336/**
337 * Contains additional user information
338 */
339export interface AdditionalUserInfo {
340 profile: Map<string, any>;
341 providerId: string;
342 username: string;
343 isNewUser: boolean;
344}
345
346/**
347 * The returned object from the push function.
348 */
349export interface PushResult {
350 key: string;
351}
352
353/**
354 * The returned object from the addEventListener functions.
355 */
356export interface AddEventListenerResult {
357 path: string;
358 listeners: Array<any>;
359}
360
361/**
362 * The options object passed into the createUser function.
363 */
364export interface CreateUserOptions {
365 email: string;
366 password: string;
367}
368
369/**
370 * The options object passed into the updateProfile function.
371 */
372export interface UpdateProfileOptions {
373 displayName?: string;
374 photoURL?: string;
375}
376
377/**
378 * The options object passed into the resetPassword function.
379 */
380export interface ResetPasswordOptions {
381 email: string;
382}
383
384/**
385 * The returned object in the callback handlers
386 * of the addChildEventListener and addValueEventListener functions.
387 */
388export interface FBData {
389 type: string;
390 key: string;
391 value: any;
392}
393
394/**
395 * The options object passed into the changePassword function.
396 */
397export interface ChangePasswordOptions {
398 email: string;
399 oldPassword: string;
400 newPassword: string;
401}
402
403export interface AuthStateData {
404 loggedIn?: boolean;
405 user?: User;
406}
407
408export interface AuthStateChangeListener {
409 onAuthStateChanged: (data: AuthStateData) => void;
410 thisArg?: any;
411}
412
413export interface RemoteConfigProperty {
414 key: string;
415 default: any;
416}
417
418export interface GetRemoteConfigOptions {
419 /**
420 * Fetch new results from the server more often.
421 * Default false.
422 */
423 developerMode?: boolean;
424 /**
425 * The number of seconds before retrieving fresh state from the server.
426 * Default 12 hours.
427 */
428 cacheExpirationSeconds?: number;
429 /**
430 * The configuration properties to retrieve for your app. Specify as:
431 * properties: [{
432 * key: "holiday_promo_enabled",
433 * default: false
434 * }, ..]
435 */
436 properties: Array<RemoteConfigProperty>;
437}
438
439/**
440 * The returned object from the getRemoteConfig function.
441 */
442export interface GetRemoteConfigResult {
443 /**
444 * The date the data was last refreshed from the server.
445 * Should honor the 'cacheExpirationSeconds' you passed in previously.
446 */
447 lastFetch: Date;
448 /**
449 * The result may be throttled when retrieved from the server.
450 * Even when the cache has expired. And it's just FYI really.
451 */
452 throttled: boolean;
453 /**
454 * A JS Object with properties and values.
455 * If you previously requested keys ["foo", "is_enabled"] then this will be like:
456 * properties: {
457 * foo: "bar",
458 * is_enabled: true
459 * }
460 */
461 properties: Object;
462}
463
464export interface DynamicLinkData {
465 url: string;
466 minimumAppVersion: string;
467}
468
469/**
470 * The returned object in the callback handler of the addOnMessageReceivedCallback function.
471 *
472 * Note that any custom data you send from your server will be available as
473 * key/value properties on the Message object as well.
474 */
475export interface Message {
476 /**
477 * Indicated whether or not the notification was received while the app was in the foreground.
478 */
479 foreground: boolean;
480 /**
481 * The main text shown in the notificiation.
482 * Not available on Android when the notification was received in the background.
483 */
484 body?: string;
485 /**
486 * Optional title, shown above the body in the notification.
487 * Not available on Android when the notification was received in the background.
488 */
489 title?: string;
490 /**
491 * Any other data you may have added to the notification.
492 */
493 data: any;
494}
495
496export interface SendCrashLogOptions {
497 /**
498 * Any custom logging you want to send to Firebase.
499 */
500 message: string;
501
502 /**
503 * Also log to the device console. Default false.
504 */
505 showInConsole: boolean;
506}
507
508export function init(options?: InitOptions): Promise<any>;
509
510// Database
511export function push(path: string, value: any): Promise<PushResult>;
512
513export function getValue(path: string): Promise<any>;
514
515export function setValue(path: string, value: any): Promise<any>;
516
517export function update(path: string, value: any): Promise<any>;
518
519export function remove(path: string): Promise<any>;
520
521export function query(onValueEvent: (data: FBData) => void, path: string, options: QueryOptions): Promise<any>;
522
523export function addChildEventListener(onChildEvent: (data: FBData) => void, path: string): Promise<AddEventListenerResult>;
524
525export function addValueEventListener(onValueEvent: (data: FBData) => void, path: string): Promise<AddEventListenerResult>;
526
527export function removeEventListeners(listeners: Array<any>, path: string): Promise<any>;
528
529/**
530 * Tells the client to keep its local cache in sync with the server automatically.
531 */
532export function keepInSync(path: string, switchOn: boolean): Promise<any>;
533
534// AdMob module
535export namespace admob {
536
537 /**
538 * The allowed values for AD_SIZE.
539 */
540 export enum AD_SIZE {
541 SMART_BANNER,
542 LARGE_BANNER,
543 BANNER,
544 MEDIUM_RECTANGLE,
545 FULL_BANNER,
546 LEADERBOARD
547 }
548
549 /**
550 * The possible error codes (see https://developers.google.com/android/reference/com/google/android/gms/ads/AdRequest#ERROR_CODE_INTERNAL_ERROR).
551 */
552 export enum ERROR_CODES {
553 ERROR_CODE_INTERNAL_ERROR,
554 ERROR_CODE_INVALID_REQUEST,
555 ERROR_CODE_NETWORK_ERROR,
556 ERROR_CODE_NO_FILL
557 }
558
559 export interface ShowBannerOptions {
560 /**
561 * The layout of the banner.
562 * Default AD_SIZE.SMART_BANNER
563 */
564 size?: AD_SIZE;
565
566 /**
567 * When false (default) you'll get real banners.
568 */
569 testing?: boolean;
570
571 /**
572 * Something like "ca-app-pub-AAAAAAAA/BBBBBBB".
573 */
574 androidBannerId?: string;
575
576 /**
577 * Something like "ca-app-pub-XXXXXX/YYYYYY".
578 */
579 iosBannerId?: string;
580
581 /**
582 * If testing is true, the simulator is allowed to receive test banners.
583 * Android automatically add the connceted device as test device, but iOS does not.
584 * If you also want to test on real devices, add it here like this:
585 * ["ce97330130c9047ce0d4430d37d713b1", ".."]
586 */
587 iosTestDeviceIds?: string[];
588
589 /**
590 * The number of pixels from the top/bottom of the view.
591 * The plugin corrects for display density, so don't worry about that.
592 *
593 * If both are set, top wins.
594 */
595 margins?: {
596 /**
597 * Default: -1 (ignored).
598 */
599 top?: number;
600
601 /**
602 * Default: -1 (ignored).
603 */
604 bottom?: number;
605 };
606
607 /**
608 * Specify keywords for ad targeting
609 */
610 keywords?: string[];
611 }
612
613 export interface ShowInterstitialOptions {
614 /**
615 * When false (default) you'll get real banners.
616 */
617 testing?: boolean;
618
619 /**
620 * Something like "ca-app-pub-AAAAAAAA/BBBBBBB".
621 */
622 androidInterstitialId?: string;
623
624 /**
625 * Something like "ca-app-pub-XXXXXX/YYYYYY".
626 */
627 iosInterstitialId?: string;
628
629 /**
630 * If testing is true, the simulator is allowed to receive test banners.
631 * Android automatically add the connceted device as test device, but iOS does not.
632 * If you also want to test on real devices, add it here like this:
633 * ["ce97330130c9047ce0d4430d37d713b1", ".."]
634 */
635 iosTestDeviceIds?: string[];
636 }
637
638 function showBanner(options: ShowBannerOptions): Promise<any>;
639
640 function showInterstitial(options: ShowInterstitialOptions): Promise<any>;
641
642 function hideBanner(): Promise<any>;
643}
644
645// Invites module
646export namespace invites {
647
648 export enum MATCH_TYPE {
649 WEAK,
650 STRONG
651 }
652
653 export interface SendInvitationOptions {
654 /**
655 * Invitation title you want to send.
656 */
657 title: string;
658
659 /**
660 * Sets the default message sent with invitations.
661 */
662 message: string;
663
664 /**
665 * Sets the link into your app that is sent with invitations.
666 */
667 deepLink?: string;
668
669 /**
670 * Sets the call-to-action text of the button rendered in email invitations. Cannot exceed 32 characters.
671 */
672 callToActionText?: string;
673
674 /**
675 * Sets the URL of a custom image to include in email invitations. The image must be square and around 600x600 pixels. The image can be no larger than 4000x4000 pixels.
676 */
677 customImage?: string;
678
679 /**
680 * If you have an Android version of your app and you want to send an invitation that can be opened on Android in addition to iOS.
681 */
682 androidClientID?: string;
683
684 /**
685 * You can find your iOS app's client ID in the GoogleService-Info.plist file you downloaded from the Firebase console.
686 */
687 iosClientID?: string;
688 }
689
690 export interface SendInvitationResult {
691 count: number;
692 invitationIds: any;
693 }
694
695 export interface GetInvitationResult {
696 deepLink: string;
697 matchType?: MATCH_TYPE;
698 invitationId: string;
699 }
700
701 function sendInvitation(options: SendInvitationOptions): Promise<SendInvitationResult>;
702
703 function getInvitation(): Promise<GetInvitationResult>;
704}
705
706export namespace dynamicLinks {
707 export enum MATCH_CONFIDENCE {
708 WEAK,
709 STRONG
710 }
711
712 export interface DynamicLinkCallbackData {
713 url: string;
714 matchConfidence?: MATCH_CONFIDENCE;
715 minimumAppVersion?: string;
716 }
717}
718
719export namespace firestore {
720 export type DocumentData = { [field: string]: any };
721 export type WhereFilterOp = '<' | '<=' | '==' | '>=' | '>' | 'array-contains';
722 export type OrderByDirection = 'desc' | 'asc';
723
724 export interface GeoPoint {
725 longitude: number;
726 latitude: number;
727 }
728
729 export function GeoPoint(latitude: number, longitude: number): GeoPoint;
730
731 export interface SetOptions {
732 merge?: boolean;
733 }
734
735 export interface DocumentSnapshot {
736 ios?: any;
737 /* FIRDocumentSnapshot */
738 android?: any;
739 /* com.google.firebase.firestore.DocumentSnapshot */
740 id: string;
741 exists: boolean;
742
743 data(): DocumentData;
744 }
745
746 export interface DocumentReference {
747 discriminator: "docRef";
748 id: string;
749 collection: (collectionPath: string) => CollectionReference;
750 set: (document: any, options?: SetOptions) => Promise<void>;
751 get: () => Promise<DocumentSnapshot>;
752 update: (document: any) => Promise<void>;
753 delete: () => Promise<void>;
754
755 onSnapshot(callback: (doc: DocumentSnapshot) => void): () => void;
756
757 android?: any;
758 ios?: any;
759 }
760
761 export interface Query {
762 get(): Promise<QuerySnapshot>;
763
764 where(fieldPath: string, opStr: WhereFilterOp, value: any): Query;
765
766 orderBy(fieldPath: string, directionStr: firestore.OrderByDirection): Query;
767
768 limit(limit: number): Query;
769
770 onSnapshot(callback: (snapshot: QuerySnapshot) => void): () => void;
771
772 startAt(snapshot: DocumentSnapshot): Query;
773
774 startAfter(snapshot: DocumentSnapshot): Query;
775
776 endAt(snapshot: DocumentSnapshot): Query;
777
778 endBefore(snapshot: DocumentSnapshot): Query;
779 }
780
781 export interface CollectionReference extends Query {
782 id: string;
783
784 doc(documentPath?: string): DocumentReference;
785
786 add(data: DocumentData): Promise<DocumentReference>;
787 }
788
789 export type UpdateData = { [fieldPath: string]: any };
790
791 export class FieldPath {
792 /**
793 * Creates a FieldPath from the provided field names. If more than one field
794 * name is provided, the path will point to a nested field in a document.
795 *
796 * @param fieldNames A list of field names.
797 */
798 constructor(...fieldNames: string[]);
799
800 /**
801 * Returns a special sentinel FieldPath to refer to the ID of a document.
802 * It can be used in queries to sort or filter by the document ID.
803 */
804 static documentId(): FieldPath;
805 }
806
807 export interface Transaction {
808 get(documentRef: DocumentReference): DocumentSnapshot;
809
810 set(documentRef: DocumentReference, data: DocumentData, options?: SetOptions): Transaction;
811
812 update(documentRef: DocumentReference, data: UpdateData): Transaction;
813
814 update(documentRef: DocumentReference, field: string | FieldPath, value: any, ...moreFieldsAndValues: any[]): Transaction;
815
816 delete(documentRef: DocumentReference): Transaction;
817 }
818
819 export interface WriteBatch {
820 set(documentRef: DocumentReference, data: DocumentData, options?: SetOptions): WriteBatch;
821
822 update(documentRef: DocumentReference, data: UpdateData): WriteBatch;
823
824 update(documentRef: DocumentReference, field: string | FieldPath, value: any, ...moreFieldsAndValues: any[]): WriteBatch;
825
826 delete(documentRef: DocumentReference): WriteBatch;
827
828 commit(): Promise<void>;
829 }
830
831 export type FieldValueType = "ARRAY_UNION" | "ARRAY_REMOVE";
832
833 export class FieldValue {
834 constructor(type: FieldValueType, value: any);
835
836 static serverTimestamp: () => "SERVER_TIMESTAMP";
837 static arrayUnion: (fields: Array<any>) => FieldValue;
838 static arrayRemove: (fields: Array<any>) => FieldValue;
839 }
840
841 export interface QuerySnapshot {
842 docSnapshots: firestore.DocumentSnapshot[];
843
844 forEach(callback: (result: DocumentSnapshot) => void, thisArg?: any): void;
845 }
846
847 function collection(collectionPath: string): CollectionReference;
848
849 function doc(collectionPath: string, documentPath?: string): DocumentReference;
850
851 function add(collectionPath: string, documentData: any): Promise<DocumentReference>;
852
853 function set(collectionPath: string, documentPath: string, document: any, options?: any): Promise<void>;
854
855 function getCollection(collectionPath: string): Promise<QuerySnapshot>;
856
857 function getDocument(collectionPath: string, documentPath: string): Promise<DocumentSnapshot>;
858
859 function update(collectionPath: string, documentPath: string, document: any): Promise<void>;
860
861 function runTransaction(updateFunction: (transaction: firestore.Transaction) => Promise<any>): Promise<void>;
862
863 function batch(): firestore.WriteBatch;
864}
865
866export namespace functions {
867 export type HttpsCallable<I, O> = (callableData: I) => Promise<O>;
868
869 export function httpsCallable<I, O>(callableFunctionName: string): HttpsCallable<I, O>;
870}
871
872// Auth
873export function login(options: LoginOptions): Promise<User>;
874
875export function reauthenticate(options: ReauthenticateOptions): Promise<any>;
876
877export function reloadUser(): Promise<void>;
878
879export function getAuthToken(option: GetAuthTokenOptions): Promise<string>;
880
881export function logout(): Promise<any>;
882
883export function fetchProvidersForEmail(email: string): Promise<Array<string>>;
884
885export function fetchSignInMethodsForEmail(email: string): Promise<Array<string>>;
886
887export function sendEmailVerification(): Promise<any>;
888
889export function createUser(options: CreateUserOptions): Promise<User>;
890
891export function deleteUser(): Promise<any>;
892
893export function updateProfile(options: UpdateProfileOptions): Promise<any>;
894
895export function resetPassword(options: ResetPasswordOptions): Promise<any>;
896
897export function changePassword(options: ChangePasswordOptions): Promise<any>;
898
899export function addAuthStateListener(listener: AuthStateChangeListener): boolean;
900
901export function removeAuthStateListener(listener: AuthStateChangeListener): boolean;
902
903export function hasAuthStateListener(listener: AuthStateChangeListener): boolean;
904
905export function getCurrentUser(): Promise<User>;
906
907// Messaging
908export function addOnMessageReceivedCallback(onMessageReceived: (data: Message) => void): Promise<any>;
909
910export function addOnPushTokenReceivedCallback(onPushTokenReceived: (data: string) => void): Promise<any>;
911
912export function registerForInteractivePush(model: any): void;
913
914export function getCurrentPushToken(): Promise<string>;
915
916export function registerForPushNotifications(): Promise<void>;
917
918export function unregisterForPushNotifications(): Promise<void>;
919
920export function subscribeToTopic(topicName): Promise<any>;
921
922export function unsubscribeFromTopic(topicName): Promise<any>;
923
924export function areNotificationsEnabled(): boolean;
925
926// dynamic links
927export function addOnDynamicLinkReceivedCallback(onDynamicLinkReceived: (callBackData: dynamicLinks.DynamicLinkCallbackData) => void): Promise<any>;
928
929// remote config
930export function getRemoteConfig(options: GetRemoteConfigOptions): Promise<GetRemoteConfigResult>;
931
932// crash logging
933export function sendCrashLog(options: SendCrashLogOptions): Promise<any>;