1 | import { ɵgetAllInstancesOf, ɵgetDefaultInstanceOf, VERSION, ɵAngularFireSchedulers, ɵzoneWrap } from '@angular/fire';
|
2 | import { timer, from } from 'rxjs';
|
3 | import { concatMap, distinct } from 'rxjs/operators';
|
4 | import * as i0 from '@angular/core';
|
5 | import { InjectionToken, Optional, NgModule, NgZone, Injector } from '@angular/core';
|
6 | import { AuthInstances } from '@angular/fire/auth';
|
7 | import { FirebaseApp, FirebaseApps } from '@angular/fire/app';
|
8 | import { registerVersion } from 'firebase/app';
|
9 | import { AppCheckInstances } from '@angular/fire/app-check';
|
10 | import { fromRef as fromRef$1, stateChanges as stateChanges$1, list as list$1, listVal as listVal$1, auditTrail as auditTrail$1, object as object$1, objectVal as objectVal$1, changeToData as changeToData$1 } from 'rxfire/database';
|
11 | export { ListenEvent, ListenerMethods } from 'rxfire/database';
|
12 | import { child as child$1, connectDatabaseEmulator as connectDatabaseEmulator$1, enableLogging as enableLogging$1, endAt as endAt$1, endBefore as endBefore$1, equalTo as equalTo$1, get as get$1, getDatabase as getDatabase$1, goOffline as goOffline$1, goOnline as goOnline$1, increment as increment$1, limitToFirst as limitToFirst$1, limitToLast as limitToLast$1, off as off$1, onChildAdded as onChildAdded$1, onChildChanged as onChildChanged$1, onChildMoved as onChildMoved$1, onChildRemoved as onChildRemoved$1, onDisconnect as onDisconnect$1, onValue as onValue$1, orderByChild as orderByChild$1, orderByKey as orderByKey$1, orderByPriority as orderByPriority$1, orderByValue as orderByValue$1, push as push$1, query as query$1, ref as ref$1, refFromURL as refFromURL$1, remove as remove$1, runTransaction as runTransaction$1, serverTimestamp as serverTimestamp$1, set as set$1, setPriority as setPriority$1, setWithPriority as setWithPriority$1, startAfter as startAfter$1, startAt as startAt$1, update as update$1 } from 'firebase/database';
|
13 | export * from 'firebase/database';
|
14 |
|
15 | class Database {
|
16 | constructor(database) {
|
17 | return database;
|
18 | }
|
19 | }
|
20 | const DATABASE_PROVIDER_NAME = 'database';
|
21 | class DatabaseInstances {
|
22 | constructor() {
|
23 | return ɵgetAllInstancesOf(DATABASE_PROVIDER_NAME);
|
24 | }
|
25 | }
|
26 | const databaseInstance$ = timer(0, 300).pipe(concatMap(() => from(ɵgetAllInstancesOf(DATABASE_PROVIDER_NAME))), distinct());
|
27 |
|
28 | const PROVIDED_DATABASE_INSTANCES = new InjectionToken('angularfire2.database-instances');
|
29 | function defaultDatabaseInstanceFactory(provided, defaultApp) {
|
30 | const defaultDatabase = ɵgetDefaultInstanceOf(DATABASE_PROVIDER_NAME, provided, defaultApp);
|
31 | return defaultDatabase && new Database(defaultDatabase);
|
32 | }
|
33 | function databaseInstanceFactory(fn) {
|
34 | return (zone, injector) => {
|
35 | const database = zone.runOutsideAngular(() => fn(injector));
|
36 | return new Database(database);
|
37 | };
|
38 | }
|
39 | const DATABASE_INSTANCES_PROVIDER = {
|
40 | provide: DatabaseInstances,
|
41 | deps: [
|
42 | [new Optional(), PROVIDED_DATABASE_INSTANCES],
|
43 | ]
|
44 | };
|
45 | const DEFAULT_DATABASE_INSTANCE_PROVIDER = {
|
46 | provide: Database,
|
47 | useFactory: defaultDatabaseInstanceFactory,
|
48 | deps: [
|
49 | [new Optional(), PROVIDED_DATABASE_INSTANCES],
|
50 | FirebaseApp,
|
51 | ]
|
52 | };
|
53 | class DatabaseModule {
|
54 | constructor() {
|
55 | registerVersion('angularfire', VERSION.full, 'rtdb');
|
56 | }
|
57 | }
|
58 | DatabaseModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: DatabaseModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
59 | DatabaseModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: DatabaseModule });
|
60 | DatabaseModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: DatabaseModule, providers: [
|
61 | DEFAULT_DATABASE_INSTANCE_PROVIDER,
|
62 | DATABASE_INSTANCES_PROVIDER,
|
63 | ] });
|
64 | i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.1.3", ngImport: i0, type: DatabaseModule, decorators: [{
|
65 | type: NgModule,
|
66 | args: [{
|
67 | providers: [
|
68 | DEFAULT_DATABASE_INSTANCE_PROVIDER,
|
69 | DATABASE_INSTANCES_PROVIDER,
|
70 | ]
|
71 | }]
|
72 | }], ctorParameters: function () { return []; } });
|
73 | function provideDatabase(fn, ...deps) {
|
74 | return {
|
75 | ngModule: DatabaseModule,
|
76 | providers: [{
|
77 | provide: PROVIDED_DATABASE_INSTANCES,
|
78 | useFactory: databaseInstanceFactory(fn),
|
79 | multi: true,
|
80 | deps: [
|
81 | NgZone,
|
82 | Injector,
|
83 | ɵAngularFireSchedulers,
|
84 | FirebaseApps,
|
85 |
|
86 | [new Optional(), AuthInstances],
|
87 | [new Optional(), AppCheckInstances],
|
88 | ...deps,
|
89 | ]
|
90 | }]
|
91 | };
|
92 | }
|
93 |
|
94 |
|
95 | const fromRef = ɵzoneWrap(fromRef$1, true);
|
96 | const stateChanges = ɵzoneWrap(stateChanges$1, true);
|
97 | const list = ɵzoneWrap(list$1, true);
|
98 | const listVal = ɵzoneWrap(listVal$1, true);
|
99 | const auditTrail = ɵzoneWrap(auditTrail$1, true);
|
100 | const object = ɵzoneWrap(object$1, true);
|
101 | const objectVal = ɵzoneWrap(objectVal$1, true);
|
102 | const changeToData = ɵzoneWrap(changeToData$1, true);
|
103 |
|
104 |
|
105 | const child = ɵzoneWrap(child$1, true);
|
106 | const connectDatabaseEmulator = ɵzoneWrap(connectDatabaseEmulator$1, true);
|
107 | const enableLogging = ɵzoneWrap(enableLogging$1, true);
|
108 | const endAt = ɵzoneWrap(endAt$1, true);
|
109 | const endBefore = ɵzoneWrap(endBefore$1, true);
|
110 | const equalTo = ɵzoneWrap(equalTo$1, true);
|
111 | const get = ɵzoneWrap(get$1, true);
|
112 | const getDatabase = ɵzoneWrap(getDatabase$1, true);
|
113 | const goOffline = ɵzoneWrap(goOffline$1, true);
|
114 | const goOnline = ɵzoneWrap(goOnline$1, true);
|
115 | const increment = ɵzoneWrap(increment$1, true);
|
116 | const limitToFirst = ɵzoneWrap(limitToFirst$1, true);
|
117 | const limitToLast = ɵzoneWrap(limitToLast$1, true);
|
118 | const off = ɵzoneWrap(off$1, true);
|
119 | const onChildAdded = ɵzoneWrap(onChildAdded$1, true);
|
120 | const onChildChanged = ɵzoneWrap(onChildChanged$1, true);
|
121 | const onChildMoved = ɵzoneWrap(onChildMoved$1, true);
|
122 | const onChildRemoved = ɵzoneWrap(onChildRemoved$1, true);
|
123 | const onDisconnect = ɵzoneWrap(onDisconnect$1, true);
|
124 | const onValue = ɵzoneWrap(onValue$1, true);
|
125 | const orderByChild = ɵzoneWrap(orderByChild$1, true);
|
126 | const orderByKey = ɵzoneWrap(orderByKey$1, true);
|
127 | const orderByPriority = ɵzoneWrap(orderByPriority$1, true);
|
128 | const orderByValue = ɵzoneWrap(orderByValue$1, true);
|
129 | const push = ɵzoneWrap(push$1, true);
|
130 | const query = ɵzoneWrap(query$1, true);
|
131 | const ref = ɵzoneWrap(ref$1, true);
|
132 | const refFromURL = ɵzoneWrap(refFromURL$1, true);
|
133 | const remove = ɵzoneWrap(remove$1, true);
|
134 | const runTransaction = ɵzoneWrap(runTransaction$1, true);
|
135 | const serverTimestamp = ɵzoneWrap(serverTimestamp$1, true);
|
136 | const set = ɵzoneWrap(set$1, true);
|
137 | const setPriority = ɵzoneWrap(setPriority$1, true);
|
138 | const setWithPriority = ɵzoneWrap(setWithPriority$1, true);
|
139 | const startAfter = ɵzoneWrap(startAfter$1, true);
|
140 | const startAt = ɵzoneWrap(startAt$1, true);
|
141 | const update = ɵzoneWrap(update$1, true);
|
142 |
|
143 | /**
|
144 | * Generated bundle index. Do not edit.
|
145 | */
|
146 |
|
147 | export { Database, DatabaseInstances, DatabaseModule, auditTrail, changeToData, child, connectDatabaseEmulator, databaseInstance$, enableLogging, endAt, endBefore, equalTo, fromRef, get, getDatabase, goOffline, goOnline, increment, limitToFirst, limitToLast, list, listVal, object, objectVal, off, onChildAdded, onChildChanged, onChildMoved, onChildRemoved, onDisconnect, onValue, orderByChild, orderByKey, orderByPriority, orderByValue, provideDatabase, push, query, ref, refFromURL, remove, runTransaction, serverTimestamp, set, setPriority, setWithPriority, startAfter, startAt, stateChanges, update };
|
148 | //# sourceMappingURL=angular-fire-database.js.map
|