@angular/fire 19.2.0 → 20.0.0-rc.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ai/index.d.ts +32 -5
- package/analytics/index.d.ts +87 -5
- package/app/index.d.ts +36 -5
- package/app-check/index.d.ts +33 -5
- package/auth/index.d.ts +86 -5
- package/auth-guard/index.d.ts +43 -5
- package/compat/analytics/index.d.ts +52 -5
- package/compat/auth/index.d.ts +58 -5
- package/compat/auth-guard/index.d.ts +44 -5
- package/compat/database/index.d.ts +107 -3
- package/compat/firestore/index.d.ts +450 -3
- package/compat/functions/index.d.ts +31 -5
- package/compat/index.d.ts +57 -5
- package/compat/messaging/index.d.ts +32 -5
- package/compat/performance/index.d.ts +43 -5
- package/compat/remote-config/index.d.ts +64 -5
- package/compat/storage/index.d.ts +104 -3
- package/data-connect/index.d.ts +34 -5
- package/database/index.d.ts +77 -5
- package/fesm2022/angular-fire-ai.mjs +4 -4
- package/fesm2022/angular-fire-analytics.mjs +10 -10
- package/fesm2022/angular-fire-app-check.mjs +4 -4
- package/fesm2022/angular-fire-app.mjs +5 -5
- package/fesm2022/angular-fire-auth-guard.mjs +7 -7
- package/fesm2022/angular-fire-auth.mjs +4 -4
- package/fesm2022/angular-fire-compat-analytics.mjs +14 -14
- package/fesm2022/angular-fire-compat-auth-guard.mjs +7 -7
- package/fesm2022/angular-fire-compat-auth.mjs +8 -8
- package/fesm2022/angular-fire-compat-database.mjs +9 -9
- package/fesm2022/angular-fire-compat-firestore.mjs +9 -9
- package/fesm2022/angular-fire-compat-functions.mjs +8 -8
- package/fesm2022/angular-fire-compat-messaging.mjs +8 -8
- package/fesm2022/angular-fire-compat-messaging.mjs.map +1 -1
- package/fesm2022/angular-fire-compat-performance.mjs +11 -11
- package/fesm2022/angular-fire-compat-remote-config.mjs +8 -8
- package/fesm2022/angular-fire-compat-storage.mjs +16 -16
- package/fesm2022/angular-fire-compat.mjs +5 -5
- package/fesm2022/angular-fire-data-connect.mjs +4 -4
- package/fesm2022/angular-fire-database.mjs +4 -4
- package/fesm2022/angular-fire-firestore-lite.mjs +4 -4
- package/fesm2022/angular-fire-firestore.mjs +4 -4
- package/fesm2022/angular-fire-functions.mjs +4 -4
- package/fesm2022/angular-fire-messaging.mjs +4 -4
- package/fesm2022/angular-fire-performance.mjs +4 -4
- package/fesm2022/angular-fire-remote-config.mjs +4 -4
- package/fesm2022/angular-fire-storage.mjs +4 -4
- package/fesm2022/angular-fire-vertexai.mjs +4 -4
- package/fesm2022/angular-fire.mjs +9 -6
- package/fesm2022/angular-fire.mjs.map +1 -1
- package/firestore/index.d.ts +99 -5
- package/firestore/lite/index.d.ts +77 -5
- package/functions/index.d.ts +35 -5
- package/index.d.ts +34 -3
- package/messaging/index.d.ts +33 -5
- package/package.json +13 -13
- package/performance/index.d.ts +40 -5
- package/publish.sh +1 -1
- package/remote-config/index.d.ts +48 -5
- package/schematics/add/index.js +1 -1
- package/schematics/deploy/actions.js +76 -86
- package/schematics/deploy/builder.js +166 -176
- package/schematics/setup/index.js +147 -162
- package/schematics/update/v7/index.js +1 -1
- package/storage/index.d.ts +47 -5
- package/vertexai/index.d.ts +33 -5
- package/ai/ai.d.ts +0 -13
- package/ai/ai.module.d.ts +0 -15
- package/ai/firebase.d.ts +0 -6
- package/ai/public_api.d.ts +0 -3
- package/analytics/analytics.d.ts +0 -13
- package/analytics/analytics.module.d.ts +0 -17
- package/analytics/firebase.d.ts +0 -14
- package/analytics/public_api.d.ts +0 -5
- package/analytics/screen-tracking.service.d.ts +0 -40
- package/analytics/user-tracking.service.d.ts +0 -11
- package/app/app.d.ts +0 -12
- package/app/app.module.d.ts +0 -14
- package/app/firebase.d.ts +0 -10
- package/app/public_api.d.ts +0 -3
- package/app-check/app-check.d.ts +0 -13
- package/app-check/app-check.module.d.ts +0 -15
- package/app-check/firebase.d.ts +0 -7
- package/app-check/public_api.d.ts +0 -3
- package/auth/auth.d.ts +0 -13
- package/auth/auth.module.d.ts +0 -15
- package/auth/firebase.d.ts +0 -55
- package/auth/public_api.d.ts +0 -4
- package/auth/rxfire.d.ts +0 -4
- package/auth-guard/auth-guard.d.ts +0 -29
- package/auth-guard/auth-guard.module.d.ts +0 -7
- package/auth-guard/public_api.d.ts +0 -2
- package/compat/analytics/analytics.d.ts +0 -22
- package/compat/analytics/analytics.module.d.ts +0 -10
- package/compat/analytics/base.d.ts +0 -8
- package/compat/analytics/public_api.d.ts +0 -4
- package/compat/analytics/screen-tracking.service.d.ts +0 -13
- package/compat/analytics/user-tracking.service.d.ts +0 -12
- package/compat/auth/auth.d.ts +0 -50
- package/compat/auth/auth.module.d.ts +0 -7
- package/compat/auth/base.d.ts +0 -36
- package/compat/auth/public_api.d.ts +0 -3
- package/compat/auth-guard/auth-guard.d.ts +0 -31
- package/compat/auth-guard/auth-guard.module.d.ts +0 -7
- package/compat/auth-guard/public_api.d.ts +0 -2
- package/compat/cache.d.ts +0 -1
- package/compat/database/database.d.ts +0 -28
- package/compat/database/database.module.d.ts +0 -7
- package/compat/database/interfaces.d.ts +0 -62
- package/compat/database/list/audit-trail.d.ts +0 -3
- package/compat/database/list/changes.d.ts +0 -3
- package/compat/database/list/create-reference.d.ts +0 -4
- package/compat/database/list/data-operation.d.ts +0 -2
- package/compat/database/list/remove.d.ts +0 -2
- package/compat/database/list/snapshot-changes.d.ts +0 -3
- package/compat/database/list/state-changes.d.ts +0 -3
- package/compat/database/list/utils.d.ts +0 -1
- package/compat/database/object/create-reference.d.ts +0 -4
- package/compat/database/object/snapshot-changes.d.ts +0 -3
- package/compat/database/observable/fromRef.d.ts +0 -10
- package/compat/database/public_api.d.ts +0 -8
- package/compat/database/utils.d.ts +0 -14
- package/compat/firebase.app.d.ts +0 -6
- package/compat/firebase.app.module.d.ts +0 -14
- package/compat/firestore/collection/changes.d.ts +0 -22
- package/compat/firestore/collection/collection.d.ts +0 -90
- package/compat/firestore/collection-group/collection-group.d.ts +0 -65
- package/compat/firestore/document/document.d.ts +0 -74
- package/compat/firestore/firestore.d.ts +0 -131
- package/compat/firestore/firestore.module.d.ts +0 -13
- package/compat/firestore/interfaces.d.ts +0 -70
- package/compat/firestore/observable/fromRef.d.ts +0 -5
- package/compat/firestore/public_api.d.ts +0 -8
- package/compat/functions/base.d.ts +0 -5
- package/compat/functions/functions.d.ts +0 -21
- package/compat/functions/functions.module.d.ts +0 -7
- package/compat/functions/public_api.d.ts +0 -3
- package/compat/messaging/base.d.ts +0 -6
- package/compat/messaging/messaging.d.ts +0 -22
- package/compat/messaging/messaging.module.d.ts +0 -7
- package/compat/messaging/public_api.d.ts +0 -2
- package/compat/performance/base.d.ts +0 -6
- package/compat/performance/performance.d.ts +0 -26
- package/compat/performance/performance.module.d.ts +0 -9
- package/compat/performance/performance.service.d.ts +0 -9
- package/compat/performance/public_api.d.ts +0 -3
- package/compat/proxy.d.ts +0 -32
- package/compat/public_api.d.ts +0 -4
- package/compat/remote-config/base.d.ts +0 -17
- package/compat/remote-config/interfaces.d.ts +0 -2
- package/compat/remote-config/public_api.d.ts +0 -2
- package/compat/remote-config/remote-config.d.ts +0 -52
- package/compat/remote-config/remote-config.module.d.ts +0 -7
- package/compat/storage/interfaces.d.ts +0 -9
- package/compat/storage/observable/fromTask.d.ts +0 -3
- package/compat/storage/pipes/storageUrl.pipe.d.ts +0 -21
- package/compat/storage/public_api.d.ts +0 -6
- package/compat/storage/ref.d.ts +0 -20
- package/compat/storage/storage.d.ts +0 -31
- package/compat/storage/storage.module.d.ts +0 -8
- package/compat/storage/task.d.ts +0 -18
- package/core.d.ts +0 -6
- package/data-connect/data-connect.d.ts +0 -9
- package/data-connect/data-connect.module.d.ts +0 -13
- package/data-connect/firebase.d.ts +0 -12
- package/data-connect/public_api.d.ts +0 -3
- package/database/database.d.ts +0 -13
- package/database/database.module.d.ts +0 -15
- package/database/firebase.d.ts +0 -40
- package/database/public_api.d.ts +0 -4
- package/database/rxfire.d.ts +0 -10
- package/firestore/firebase.d.ts +0 -60
- package/firestore/firestore.d.ts +0 -13
- package/firestore/firestore.module.d.ts +0 -15
- package/firestore/lite/firebase.d.ts +0 -41
- package/firestore/lite/lite.d.ts +0 -13
- package/firestore/lite/lite.module.d.ts +0 -15
- package/firestore/lite/public_api.d.ts +0 -4
- package/firestore/lite/rxfire.d.ts +0 -9
- package/firestore/public_api.d.ts +0 -4
- package/firestore/rxfire.d.ts +0 -12
- package/functions/firebase.d.ts +0 -6
- package/functions/functions.d.ts +0 -13
- package/functions/functions.module.d.ts +0 -15
- package/functions/public_api.d.ts +0 -4
- package/functions/rxfire.d.ts +0 -2
- package/messaging/firebase.d.ts +0 -7
- package/messaging/messaging.d.ts +0 -13
- package/messaging/messaging.module.d.ts +0 -14
- package/messaging/public_api.d.ts +0 -3
- package/performance/firebase.d.ts +0 -5
- package/performance/performance.d.ts +0 -13
- package/performance/performance.module.d.ts +0 -15
- package/performance/public_api.d.ts +0 -4
- package/performance/rxfire.d.ts +0 -8
- package/public_api.d.ts +0 -2
- package/remote-config/firebase.d.ts +0 -15
- package/remote-config/public_api.d.ts +0 -4
- package/remote-config/remote-config.d.ts +0 -13
- package/remote-config/remote-config.module.d.ts +0 -15
- package/remote-config/rxfire.d.ts +0 -6
- package/storage/firebase.d.ts +0 -17
- package/storage/public_api.d.ts +0 -4
- package/storage/rxfire.d.ts +0 -3
- package/storage/storage.d.ts +0 -13
- package/storage/storage.module.d.ts +0 -15
- package/vertexai/firebase.d.ts +0 -6
- package/vertexai/public_api.d.ts +0 -3
- package/vertexai/vertexai.d.ts +0 -13
- package/vertexai/vertexai.module.d.ts +0 -15
- package/zones.d.ts +0 -26
|
@@ -1,5 +1,452 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, NgZone, ModuleWithProviders } from '@angular/core';
|
|
3
|
+
import { ɵAngularFireSchedulers as _AngularFireSchedulers } from '@angular/fire';
|
|
4
|
+
import { AppCheckInstances } from '@angular/fire/app-check';
|
|
5
|
+
import { AngularFireAuth } from '@angular/fire/compat/auth';
|
|
6
|
+
import { FirebaseOptions } from 'firebase/app';
|
|
7
|
+
import firebase from 'firebase/compat/app';
|
|
8
|
+
import { Subscriber, Observable, SchedulerLike } from 'rxjs';
|
|
9
|
+
|
|
10
|
+
type Settings = firebase.firestore.Settings;
|
|
11
|
+
type CollectionReference<T = DocumentData> = firebase.firestore.CollectionReference<T>;
|
|
12
|
+
type DocumentReference<T = DocumentData> = firebase.firestore.DocumentReference<T>;
|
|
13
|
+
type PersistenceSettings = firebase.firestore.PersistenceSettings;
|
|
14
|
+
type DocumentChangeType = firebase.firestore.DocumentChangeType;
|
|
15
|
+
type SnapshotOptions = firebase.firestore.SnapshotOptions;
|
|
16
|
+
type FieldPath = firebase.firestore.FieldPath;
|
|
17
|
+
type Query<T = DocumentData> = firebase.firestore.Query<T>;
|
|
18
|
+
type SetOptions = firebase.firestore.SetOptions;
|
|
19
|
+
type DocumentData = firebase.firestore.DocumentData;
|
|
20
|
+
interface DocumentSnapshotExists<T> extends firebase.firestore.DocumentSnapshot<T> {
|
|
21
|
+
readonly exists: true;
|
|
22
|
+
data(options?: SnapshotOptions): T;
|
|
23
|
+
}
|
|
24
|
+
interface DocumentSnapshotDoesNotExist extends firebase.firestore.DocumentSnapshot {
|
|
25
|
+
readonly exists: false;
|
|
26
|
+
data(options?: SnapshotOptions): undefined;
|
|
27
|
+
get(fieldPath: string | FieldPath, options?: SnapshotOptions): undefined;
|
|
28
|
+
}
|
|
29
|
+
type DocumentSnapshot<T> = DocumentSnapshotExists<T> | DocumentSnapshotDoesNotExist;
|
|
30
|
+
interface QueryDocumentSnapshot<T> extends firebase.firestore.QueryDocumentSnapshot<T> {
|
|
31
|
+
data(options?: SnapshotOptions): T;
|
|
32
|
+
}
|
|
33
|
+
interface QuerySnapshot<T> extends firebase.firestore.QuerySnapshot<T> {
|
|
34
|
+
readonly docs: QueryDocumentSnapshot<T>[];
|
|
35
|
+
}
|
|
36
|
+
interface DocumentChange<T> extends firebase.firestore.DocumentChange<T> {
|
|
37
|
+
readonly doc: QueryDocumentSnapshot<T>;
|
|
38
|
+
}
|
|
39
|
+
interface DocumentChangeAction<T> {
|
|
40
|
+
type: DocumentChangeType;
|
|
41
|
+
payload: DocumentChange<T>;
|
|
42
|
+
}
|
|
43
|
+
interface Action<T> {
|
|
44
|
+
type: string;
|
|
45
|
+
payload: T;
|
|
46
|
+
}
|
|
47
|
+
interface Reference {
|
|
48
|
+
onSnapshot: (options: firebase.firestore.SnapshotListenOptions, sub: Subscriber<any>) => any;
|
|
49
|
+
}
|
|
50
|
+
type QueryFn<T = DocumentData> = (ref: CollectionReference<T>) => Query<T>;
|
|
51
|
+
type QueryGroupFn<T = DocumentData> = (query: Query<T>) => Query<T>;
|
|
1
52
|
/**
|
|
2
|
-
*
|
|
53
|
+
* A structure that provides an association between a reference
|
|
54
|
+
* and a query on that reference. Note: Performing operations
|
|
55
|
+
* on the reference can lead to confusing results with complicated
|
|
56
|
+
* queries.
|
|
57
|
+
*
|
|
58
|
+
* Example:
|
|
59
|
+
*
|
|
60
|
+
* const query = ref.where('type', '==', 'Book').
|
|
61
|
+
* .where('price', '>' 18.00)
|
|
62
|
+
* .where('price', '<' 100.00)
|
|
63
|
+
* .where('category', '==', 'Fiction')
|
|
64
|
+
* .where('publisher', '==', 'BigPublisher')
|
|
65
|
+
*
|
|
66
|
+
* // This addition would not be a result of the query above
|
|
67
|
+
* ref.add({
|
|
68
|
+
* type: 'Magazine',
|
|
69
|
+
* price: 4.99,
|
|
70
|
+
* category: 'Sports',
|
|
71
|
+
* publisher: 'SportsPublisher'
|
|
72
|
+
* });
|
|
3
73
|
*/
|
|
4
|
-
|
|
5
|
-
|
|
74
|
+
interface AssociatedReference<T = DocumentData> {
|
|
75
|
+
ref: CollectionReference<T>;
|
|
76
|
+
query: Query<T>;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* AngularFirestoreDocument service
|
|
81
|
+
*
|
|
82
|
+
* This class creates a reference to a Firestore Document. A reference is provided in
|
|
83
|
+
* in the constructor. The class is generic which gives you type safety for data update
|
|
84
|
+
* methods and data streaming.
|
|
85
|
+
*
|
|
86
|
+
* This class uses Symbol.observable to transform into Observable using Observable.from().
|
|
87
|
+
*
|
|
88
|
+
* This class is rarely used directly and should be created from the AngularFirestore service.
|
|
89
|
+
*
|
|
90
|
+
* Example:
|
|
91
|
+
*
|
|
92
|
+
* const fakeStock = new AngularFirestoreDocument<Stock>(doc('stocks/FAKE'));
|
|
93
|
+
* await fakeStock.set({ name: 'FAKE', price: 0.01 });
|
|
94
|
+
* fakeStock.valueChanges().map(snap => {
|
|
95
|
+
* if(snap.exists) return snap.data();
|
|
96
|
+
* return null;
|
|
97
|
+
* }).subscribe(value => console.log(value));
|
|
98
|
+
* // OR! Transform using Observable.from() and the data is unwrapped for you
|
|
99
|
+
* Observable.from(fakeStock).subscribe(value => console.log(value));
|
|
100
|
+
*/
|
|
101
|
+
declare class AngularFirestoreDocument<T = DocumentData> {
|
|
102
|
+
ref: DocumentReference<T>;
|
|
103
|
+
private afs;
|
|
104
|
+
private readonly injector;
|
|
105
|
+
/**
|
|
106
|
+
* The constructor takes in a DocumentReference to provide wrapper methods
|
|
107
|
+
* for data operations, data streaming, and Symbol.observable.
|
|
108
|
+
*/
|
|
109
|
+
constructor(ref: DocumentReference<T>, afs: AngularFirestore);
|
|
110
|
+
/**
|
|
111
|
+
* Create or overwrite a single document.
|
|
112
|
+
*/
|
|
113
|
+
set(data: T, options?: SetOptions): Promise<void>;
|
|
114
|
+
/**
|
|
115
|
+
* Update some fields of a document without overwriting the entire document.
|
|
116
|
+
*/
|
|
117
|
+
update(data: Partial<T>): Promise<void>;
|
|
118
|
+
/**
|
|
119
|
+
* Delete a document.
|
|
120
|
+
*/
|
|
121
|
+
delete(): Promise<void>;
|
|
122
|
+
/**
|
|
123
|
+
* Create a reference to a sub-collection given a path and an optional query
|
|
124
|
+
* function.
|
|
125
|
+
*/
|
|
126
|
+
collection<R = DocumentData>(path: string, queryFn?: QueryFn): AngularFirestoreCollection<R>;
|
|
127
|
+
/**
|
|
128
|
+
* Listen to snapshot updates from the document.
|
|
129
|
+
*/
|
|
130
|
+
snapshotChanges(): Observable<Action<DocumentSnapshot<T>>>;
|
|
131
|
+
/**
|
|
132
|
+
* Listen to unwrapped snapshot updates from the document.
|
|
133
|
+
*
|
|
134
|
+
* If the `idField` option is provided, document IDs are included and mapped to the
|
|
135
|
+
* provided `idField` property name.
|
|
136
|
+
*/
|
|
137
|
+
valueChanges(options?: unknown): Observable<T | undefined>;
|
|
138
|
+
valueChanges<K extends string>(options: {
|
|
139
|
+
idField: K;
|
|
140
|
+
}): Observable<(T & {
|
|
141
|
+
[T in K]: string;
|
|
142
|
+
}) | undefined>;
|
|
143
|
+
/**
|
|
144
|
+
* Retrieve the document once.
|
|
145
|
+
*/
|
|
146
|
+
get(options?: firebase.firestore.GetOptions): Observable<firebase.firestore.DocumentSnapshot<T>>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
declare function validateEventsArray(events?: DocumentChangeType[]): firebase.firestore.DocumentChangeType[];
|
|
150
|
+
/**
|
|
151
|
+
* AngularFirestoreCollection service
|
|
152
|
+
*
|
|
153
|
+
* This class creates a reference to a Firestore Collection. A reference and a query are provided in
|
|
154
|
+
* in the constructor. The query can be the unqueried reference if no query is desired.The class
|
|
155
|
+
* is generic which gives you type safety for data update methods and data streaming.
|
|
156
|
+
*
|
|
157
|
+
* This class uses Symbol.observable to transform into Observable using Observable.from().
|
|
158
|
+
*
|
|
159
|
+
* This class is rarely used directly and should be created from the AngularFirestore service.
|
|
160
|
+
*
|
|
161
|
+
* Example:
|
|
162
|
+
*
|
|
163
|
+
* const collectionRef = firebase.firestore.collection('stocks');
|
|
164
|
+
* const query = collectionRef.where('price', '>', '0.01');
|
|
165
|
+
* const fakeStock = new AngularFirestoreCollection<Stock>(collectionRef, query);
|
|
166
|
+
*
|
|
167
|
+
* // NOTE!: the updates are performed on the reference not the query
|
|
168
|
+
* await fakeStock.add({ name: 'FAKE', price: 0.01 });
|
|
169
|
+
*
|
|
170
|
+
* // Subscribe to changes as snapshots. This provides you data updates as well as delta updates.
|
|
171
|
+
* fakeStock.valueChanges().subscribe(value => console.log(value));
|
|
172
|
+
*/
|
|
173
|
+
declare class AngularFirestoreCollection<T = DocumentData> {
|
|
174
|
+
readonly ref: CollectionReference<T>;
|
|
175
|
+
private readonly query;
|
|
176
|
+
private readonly afs;
|
|
177
|
+
private readonly injector;
|
|
178
|
+
/**
|
|
179
|
+
* The constructor takes in a CollectionReference and Query to provide wrapper methods
|
|
180
|
+
* for data operations and data streaming.
|
|
181
|
+
*
|
|
182
|
+
* Note: Data operation methods are done on the reference not the query. This means
|
|
183
|
+
* when you update data it is not updating data to the window of your query unless
|
|
184
|
+
* the data fits the criteria of the query. See the AssociatedRefence type for details
|
|
185
|
+
* on this implication.
|
|
186
|
+
*/
|
|
187
|
+
constructor(ref: CollectionReference<T>, query: Query<T>, afs: AngularFirestore);
|
|
188
|
+
/**
|
|
189
|
+
* Listen to the latest change in the stream. This method returns changes
|
|
190
|
+
* as they occur and they are not sorted by query order. This allows you to construct
|
|
191
|
+
* your own data structure.
|
|
192
|
+
*/
|
|
193
|
+
stateChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
|
|
194
|
+
/**
|
|
195
|
+
* Create a stream of changes as they occur it time. This method is similar to stateChanges()
|
|
196
|
+
* but it collects each event in an array over time.
|
|
197
|
+
*/
|
|
198
|
+
auditTrail(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
|
|
199
|
+
/**
|
|
200
|
+
* Create a stream of synchronized changes. This method keeps the local array in sorted
|
|
201
|
+
* query order.
|
|
202
|
+
*/
|
|
203
|
+
snapshotChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
|
|
204
|
+
/**
|
|
205
|
+
* Listen to all documents in the collection and its possible query as an Observable.
|
|
206
|
+
*
|
|
207
|
+
* If the `idField` option is provided, document IDs are included and mapped to the
|
|
208
|
+
* provided `idField` property name.
|
|
209
|
+
*/
|
|
210
|
+
valueChanges(): Observable<T[]>;
|
|
211
|
+
valueChanges({}: {}): Observable<T[]>;
|
|
212
|
+
valueChanges<K extends string>(options: {
|
|
213
|
+
idField: K;
|
|
214
|
+
}): Observable<(T & {
|
|
215
|
+
[T in K]: string;
|
|
216
|
+
})[]>;
|
|
217
|
+
/**
|
|
218
|
+
* Retrieve the results of the query once.
|
|
219
|
+
*/
|
|
220
|
+
get(options?: firebase.firestore.GetOptions): Observable<firebase.firestore.QuerySnapshot<T>>;
|
|
221
|
+
/**
|
|
222
|
+
* Add data to a collection reference.
|
|
223
|
+
*
|
|
224
|
+
* Note: Data operation methods are done on the reference not the query. This means
|
|
225
|
+
* when you update data it is not updating data to the window of your query unless
|
|
226
|
+
* the data fits the criteria of the query.
|
|
227
|
+
*/
|
|
228
|
+
add(data: T): Promise<DocumentReference<T>>;
|
|
229
|
+
/**
|
|
230
|
+
* Create a reference to a single document in a collection.
|
|
231
|
+
*/
|
|
232
|
+
doc<T2 = T>(path?: string): AngularFirestoreDocument<T2>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* AngularFirestoreCollectionGroup service
|
|
237
|
+
*
|
|
238
|
+
* This class holds a reference to a Firestore Collection Group Query.
|
|
239
|
+
*
|
|
240
|
+
* This class uses Symbol.observable to transform into Observable using Observable.from().
|
|
241
|
+
*
|
|
242
|
+
* This class is rarely used directly and should be created from the AngularFirestore service.
|
|
243
|
+
*
|
|
244
|
+
* Example:
|
|
245
|
+
*
|
|
246
|
+
* const collectionGroup = firebase.firestore.collectionGroup('stocks');
|
|
247
|
+
* const query = collectionRef.where('price', '>', '0.01');
|
|
248
|
+
* const fakeStock = new AngularFirestoreCollectionGroup<Stock>(query, afs);
|
|
249
|
+
*
|
|
250
|
+
* // Subscribe to changes as snapshots. This provides you data updates as well as delta updates.
|
|
251
|
+
* fakeStock.valueChanges().subscribe(value => console.log(value));
|
|
252
|
+
*/
|
|
253
|
+
declare class AngularFirestoreCollectionGroup<T = DocumentData> {
|
|
254
|
+
private readonly query;
|
|
255
|
+
private readonly afs;
|
|
256
|
+
private readonly injector;
|
|
257
|
+
/**
|
|
258
|
+
* The constructor takes in a CollectionGroupQuery to provide wrapper methods
|
|
259
|
+
* for data operations and data streaming.
|
|
260
|
+
*/
|
|
261
|
+
constructor(query: Query<T>, afs: AngularFirestore);
|
|
262
|
+
/**
|
|
263
|
+
* Listen to the latest change in the stream. This method returns changes
|
|
264
|
+
* as they occur and they are not sorted by query order. This allows you to construct
|
|
265
|
+
* your own data structure.
|
|
266
|
+
*/
|
|
267
|
+
stateChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
|
|
268
|
+
/**
|
|
269
|
+
* Create a stream of changes as they occur it time. This method is similar to stateChanges()
|
|
270
|
+
* but it collects each event in an array over time.
|
|
271
|
+
*/
|
|
272
|
+
auditTrail(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
|
|
273
|
+
/**
|
|
274
|
+
* Create a stream of synchronized changes. This method keeps the local array in sorted
|
|
275
|
+
* query order.
|
|
276
|
+
*/
|
|
277
|
+
snapshotChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
|
|
278
|
+
/**
|
|
279
|
+
* Listen to all documents in the collection and its possible query as an Observable.
|
|
280
|
+
*
|
|
281
|
+
* If the `idField` option is provided, document IDs are included and mapped to the
|
|
282
|
+
* provided `idField` property name.
|
|
283
|
+
*/
|
|
284
|
+
valueChanges(): Observable<T[]>;
|
|
285
|
+
valueChanges({}: {}): Observable<T[]>;
|
|
286
|
+
valueChanges<K extends string>(options: {
|
|
287
|
+
idField: K;
|
|
288
|
+
}): Observable<(T & {
|
|
289
|
+
[T in K]: string;
|
|
290
|
+
})[]>;
|
|
291
|
+
/**
|
|
292
|
+
* Retrieve the results of the query once.
|
|
293
|
+
*/
|
|
294
|
+
get(options?: firebase.firestore.GetOptions): Observable<firebase.firestore.QuerySnapshot<T>>;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* The value of this token determines whether or not the firestore will have persistance enabled
|
|
299
|
+
*/
|
|
300
|
+
declare const ENABLE_PERSISTENCE: InjectionToken<boolean>;
|
|
301
|
+
declare const PERSISTENCE_SETTINGS: InjectionToken<firebase.firestore.PersistenceSettings>;
|
|
302
|
+
declare const SETTINGS: InjectionToken<firebase.firestore.Settings>;
|
|
303
|
+
declare const USE_EMULATOR: InjectionToken<[host: string, port: number, options?: {
|
|
304
|
+
mockUserToken?: firebase.firestore.EmulatorMockTokenOptions | string;
|
|
305
|
+
}]>;
|
|
306
|
+
/**
|
|
307
|
+
* A utility methods for associating a collection reference with
|
|
308
|
+
* a query.
|
|
309
|
+
*
|
|
310
|
+
* @param collectionRef - A collection reference to query
|
|
311
|
+
* @param queryFn - The callback to create a query
|
|
312
|
+
*
|
|
313
|
+
* Example:
|
|
314
|
+
* const { query, ref } = associateQuery(docRef.collection('items'), ref => {
|
|
315
|
+
* return ref.where('age', '<', 200);
|
|
316
|
+
* });
|
|
317
|
+
*/
|
|
318
|
+
declare function associateQuery<T>(collectionRef: CollectionReference<T>, queryFn?: (ref: any) => any): AssociatedReference<T>;
|
|
319
|
+
/**
|
|
320
|
+
* AngularFirestore Service
|
|
321
|
+
*
|
|
322
|
+
* This service is the main entry point for this feature module. It provides
|
|
323
|
+
* an API for creating Collection and Reference services. These services can
|
|
324
|
+
* then be used to do data updates and observable streams of the data.
|
|
325
|
+
*
|
|
326
|
+
* Example:
|
|
327
|
+
*
|
|
328
|
+
* import { Component } from '@angular/core';
|
|
329
|
+
* import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument } from '@angular/fire/firestore';
|
|
330
|
+
* import { Observable } from 'rxjs/Observable';
|
|
331
|
+
* import { from } from 'rxjs/observable';
|
|
332
|
+
*
|
|
333
|
+
* @Component({
|
|
334
|
+
* selector: 'app-my-component',
|
|
335
|
+
* template: `
|
|
336
|
+
* <h2>Items for {{ (profile | async)?.name }}
|
|
337
|
+
* <ul>
|
|
338
|
+
* <li *ngFor="let item of items | async">{{ item.name }}</li>
|
|
339
|
+
* </ul>
|
|
340
|
+
* <div class="control-input">
|
|
341
|
+
* <input type="text" #itemname />
|
|
342
|
+
* <button (click)="addItem(itemname.value)">Add Item</button>
|
|
343
|
+
* </div>
|
|
344
|
+
* `
|
|
345
|
+
* })
|
|
346
|
+
* export class MyComponent implements OnInit {
|
|
347
|
+
*
|
|
348
|
+
* // services for data operations and data streaming
|
|
349
|
+
* private readonly itemsRef: AngularFirestoreCollection<Item>;
|
|
350
|
+
* private readonly profileRef: AngularFirestoreDocument<Profile>;
|
|
351
|
+
*
|
|
352
|
+
* // observables for template
|
|
353
|
+
* items: Observable<Item[]>;
|
|
354
|
+
* profile: Observable<Profile>;
|
|
355
|
+
*
|
|
356
|
+
* // inject main service
|
|
357
|
+
* constructor(private readonly afs: AngularFirestore) {}
|
|
358
|
+
*
|
|
359
|
+
* ngOnInit() {
|
|
360
|
+
* this.itemsRef = afs.collection('items', ref => ref.where('user', '==', 'davideast').limit(10));
|
|
361
|
+
* this.items = this.itemsRef.valueChanges().map(snap => snap.docs.map(data => doc.data()));
|
|
362
|
+
* // this.items = from(this.itemsRef); // you can also do this with no mapping
|
|
363
|
+
*
|
|
364
|
+
* this.profileRef = afs.doc('users/davideast');
|
|
365
|
+
* this.profile = this.profileRef.valueChanges();
|
|
366
|
+
* }
|
|
367
|
+
*
|
|
368
|
+
* addItem(name: string) {
|
|
369
|
+
* const user = 'davideast';
|
|
370
|
+
* this.itemsRef.add({ name, user });
|
|
371
|
+
* }
|
|
372
|
+
* }
|
|
373
|
+
*/
|
|
374
|
+
declare class AngularFirestore {
|
|
375
|
+
schedulers: _AngularFireSchedulers;
|
|
376
|
+
readonly firestore: firebase.firestore.Firestore;
|
|
377
|
+
readonly persistenceEnabled$: Observable<boolean>;
|
|
378
|
+
private readonly ngZone;
|
|
379
|
+
/**
|
|
380
|
+
* Each Feature of AngularFire has a FirebaseApp injected. This way we
|
|
381
|
+
* don't rely on the main Firebase App instance and we can create named
|
|
382
|
+
* apps and use multiple apps.
|
|
383
|
+
*/
|
|
384
|
+
constructor(options: FirebaseOptions, name: string | null | undefined, shouldEnablePersistence: boolean | null, settings: Settings | null, platformId: Object, zone: NgZone, schedulers: _AngularFireSchedulers, persistenceSettings: PersistenceSettings | null, _useEmulator: any, auth: AngularFireAuth, useAuthEmulator: any, authSettings: any, // can't use firebase.auth.AuthSettings here
|
|
385
|
+
tenantId: string | null, languageCode: string | null, useDeviceLanguage: boolean | null, persistence: string | null, _appCheckInstances: AppCheckInstances);
|
|
386
|
+
/**
|
|
387
|
+
* Create a reference to a Firestore Collection based on a path or
|
|
388
|
+
* CollectionReference and an optional query function to narrow the result
|
|
389
|
+
* set.
|
|
390
|
+
*/
|
|
391
|
+
collection<T>(path: string, queryFn?: QueryFn): AngularFirestoreCollection<T>;
|
|
392
|
+
collection<T>(ref: CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection<T>;
|
|
393
|
+
/**
|
|
394
|
+
* Create a reference to a Firestore Collection Group based on a collectionId
|
|
395
|
+
* and an optional query function to narrow the result
|
|
396
|
+
* set.
|
|
397
|
+
*/
|
|
398
|
+
collectionGroup<T>(collectionId: string, queryGroupFn?: QueryGroupFn<T>): AngularFirestoreCollectionGroup<T>;
|
|
399
|
+
/**
|
|
400
|
+
* Create a reference to a Firestore Document based on a path or
|
|
401
|
+
* DocumentReference. Note that documents are not queryable because they are
|
|
402
|
+
* simply objects. However, documents have sub-collections that return a
|
|
403
|
+
* Collection reference and can be queried.
|
|
404
|
+
*/
|
|
405
|
+
doc<T>(path: string): AngularFirestoreDocument<T>;
|
|
406
|
+
doc<T>(ref: DocumentReference): AngularFirestoreDocument<T>;
|
|
407
|
+
/**
|
|
408
|
+
* Returns a generated Firestore Document Id.
|
|
409
|
+
*/
|
|
410
|
+
createId(): string;
|
|
411
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFirestore, [null, { optional: true; }, { optional: true; }, { optional: true; }, null, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
412
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AngularFirestore>;
|
|
413
|
+
}
|
|
414
|
+
|
|
415
|
+
declare class AngularFirestoreModule {
|
|
416
|
+
constructor();
|
|
417
|
+
/**
|
|
418
|
+
* Attempt to enable persistent storage, if possible
|
|
419
|
+
*/
|
|
420
|
+
static enablePersistence(persistenceSettings?: PersistenceSettings): ModuleWithProviders<AngularFirestoreModule>;
|
|
421
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFirestoreModule, never>;
|
|
422
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AngularFirestoreModule, never, never, never>;
|
|
423
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AngularFirestoreModule>;
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/**
|
|
427
|
+
* Return a stream of document changes on a query. These results are not in sort order but in
|
|
428
|
+
* order of occurence.
|
|
429
|
+
*/
|
|
430
|
+
declare function docChanges<T>(query: Query, scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]>;
|
|
431
|
+
/**
|
|
432
|
+
* Return a stream of document changes on a query. These results are in sort order.
|
|
433
|
+
*/
|
|
434
|
+
declare function sortedChanges<T>(query: Query, events: DocumentChangeType[], scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]>;
|
|
435
|
+
/**
|
|
436
|
+
* Combines the total result set from the current set of changes from an incoming set
|
|
437
|
+
* of changes.
|
|
438
|
+
*/
|
|
439
|
+
declare function combineChanges<T>(current: DocumentChange<T>[], changes: DocumentChange<T>[], events: DocumentChangeType[]): DocumentChange<T>[];
|
|
440
|
+
/**
|
|
441
|
+
* Creates a new sorted array from a new change.
|
|
442
|
+
* Build our own because we allow filtering of action types ('added', 'removed', 'modified') before scanning
|
|
443
|
+
* and so we have greater control over change detection (by breaking ===)
|
|
444
|
+
*/
|
|
445
|
+
declare function combineChange<T>(combined: DocumentChange<T>[], change: DocumentChange<T>): DocumentChange<T>[];
|
|
446
|
+
|
|
447
|
+
declare function fromRef<R, T>(ref: DocumentReference<T> | Query<T>, scheduler?: SchedulerLike): Observable<R>;
|
|
448
|
+
declare function fromDocRef<T>(ref: DocumentReference<T>, scheduler?: SchedulerLike): Observable<Action<DocumentSnapshot<T>>>;
|
|
449
|
+
declare function fromCollectionRef<T>(ref: Query<T>, scheduler?: SchedulerLike): Observable<Action<QuerySnapshot<T>>>;
|
|
450
|
+
|
|
451
|
+
export { AngularFirestore, AngularFirestoreCollection, AngularFirestoreCollectionGroup, AngularFirestoreDocument, AngularFirestoreModule, ENABLE_PERSISTENCE, PERSISTENCE_SETTINGS, SETTINGS, USE_EMULATOR, associateQuery, combineChange, combineChanges, docChanges, fromCollectionRef, fromDocRef, fromRef, sortedChanges, validateEventsArray };
|
|
452
|
+
export type { Action, AssociatedReference, CollectionReference, DocumentChange, DocumentChangeAction, DocumentChangeType, DocumentData, DocumentReference, DocumentSnapshot, DocumentSnapshotDoesNotExist, DocumentSnapshotExists, FieldPath, PersistenceSettings, Query, QueryDocumentSnapshot, QueryFn, QueryGroupFn, QuerySnapshot, Reference, SetOptions, Settings, SnapshotOptions };
|
|
@@ -1,5 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, NgZone } from '@angular/core';
|
|
3
|
+
import { ɵAngularFireSchedulers as _AngularFireSchedulers } from '@angular/fire';
|
|
4
|
+
import { AppCheckInstances } from '@angular/fire/app-check';
|
|
5
|
+
import { ɵPromiseProxy as _PromiseProxy } from '@angular/fire/compat';
|
|
6
|
+
import { HttpsCallableOptions } from '@firebase/functions-types';
|
|
7
|
+
import { FirebaseOptions } from 'firebase/app';
|
|
8
|
+
import firebase from 'firebase/compat/app';
|
|
9
|
+
import { Observable } from 'rxjs';
|
|
10
|
+
|
|
11
|
+
declare const ORIGIN: InjectionToken<string>;
|
|
12
|
+
declare const REGION: InjectionToken<string>;
|
|
13
|
+
declare const USE_EMULATOR: InjectionToken<[host: string, port: number]>;
|
|
14
|
+
interface AngularFireFunctions extends Omit<_PromiseProxy<firebase.functions.Functions>, 'httpsCallable'> {
|
|
15
|
+
}
|
|
16
|
+
declare class AngularFireFunctions {
|
|
17
|
+
readonly httpsCallable: <T = any, R = any>(name: string, options?: HttpsCallableOptions) => (data: T) => Observable<R>;
|
|
18
|
+
constructor(options: FirebaseOptions, name: string | null | undefined, zone: NgZone, schedulers: _AngularFireSchedulers, region: string | null, origin: string | null, _useEmulator: any, // can't use the tuple here
|
|
19
|
+
_appCheckInstances: AppCheckInstances);
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFireFunctions, [null, { optional: true; }, null, null, { optional: true; }, { optional: true; }, { optional: true; }, { optional: true; }]>;
|
|
21
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AngularFireFunctions>;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
declare class AngularFireFunctionsModule {
|
|
25
|
+
constructor();
|
|
26
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFireFunctionsModule, never>;
|
|
27
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AngularFireFunctionsModule, never, never, never>;
|
|
28
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AngularFireFunctionsModule>;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export { AngularFireFunctions, AngularFireFunctionsModule, ORIGIN, REGION, USE_EMULATOR };
|
package/compat/index.d.ts
CHANGED
|
@@ -1,5 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { NgZone, InjectionToken, ModuleWithProviders } from '@angular/core';
|
|
3
|
+
import { Observable } from 'rxjs';
|
|
4
|
+
import firebase from 'firebase/compat/app';
|
|
5
|
+
import { FirebaseOptions, FirebaseAppSettings } from 'firebase/app';
|
|
6
|
+
|
|
7
|
+
type MyFunction = (...args: any[]) => any;
|
|
8
|
+
type FunctionPropertyNames<T> = {
|
|
9
|
+
[K in keyof T]: T[K] extends MyFunction ? K : never;
|
|
10
|
+
}[keyof T];
|
|
11
|
+
type ReturnTypeOrNever<T> = T extends MyFunction ? ReturnType<T> : never;
|
|
12
|
+
type ParametersOrNever<T> = T extends MyFunction ? Parameters<T> : never;
|
|
13
|
+
type PromiseReturningFunctionPropertyNames<T> = {
|
|
14
|
+
[K in FunctionPropertyNames<T>]: ReturnTypeOrNever<T[K]> extends Promise<any> ? K : never;
|
|
15
|
+
}[FunctionPropertyNames<T>];
|
|
16
|
+
type NonPromiseReturningFunctionPropertyNames<T> = {
|
|
17
|
+
[K in FunctionPropertyNames<T>]: ReturnTypeOrNever<T[K]> extends Promise<any> ? never : K;
|
|
18
|
+
}[FunctionPropertyNames<T>];
|
|
19
|
+
type NonFunctionPropertyNames<T> = {
|
|
20
|
+
[K in keyof T]: T[K] extends MyFunction ? never : K;
|
|
21
|
+
}[keyof T];
|
|
22
|
+
type ɵPromiseProxy<T> = {
|
|
23
|
+
[K in NonFunctionPropertyNames<T>]: Promise<T[K]>;
|
|
24
|
+
} & {
|
|
25
|
+
[K in NonPromiseReturningFunctionPropertyNames<T>]: (...args: ParametersOrNever<T[K]>) => Promise<ReturnTypeOrNever<T[K]>>;
|
|
26
|
+
} & {
|
|
27
|
+
[K in PromiseReturningFunctionPropertyNames<T>]: T[K];
|
|
28
|
+
};
|
|
29
|
+
declare const ɵlazySDKProxy: (klass: any, observable: Observable<any>, zone: NgZone, options?: {
|
|
30
|
+
spy?: {
|
|
31
|
+
get?: ((name: string, it: any) => void);
|
|
32
|
+
apply?: ((name: string, args: any[], it: any) => void);
|
|
33
|
+
};
|
|
34
|
+
}) => any;
|
|
35
|
+
declare const ɵapplyMixins: (derivedCtor: any, constructors: any[]) => void;
|
|
36
|
+
|
|
37
|
+
interface FirebaseApp extends firebase.app.App {
|
|
38
|
+
}
|
|
39
|
+
declare class FirebaseApp {
|
|
40
|
+
constructor(app: firebase.app.App);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
declare const FIREBASE_OPTIONS: InjectionToken<FirebaseOptions>;
|
|
44
|
+
declare const FIREBASE_APP_NAME: InjectionToken<string>;
|
|
45
|
+
declare function ɵfirebaseAppFactory(options: FirebaseOptions, zone: NgZone, nameOrConfig?: string | FirebaseAppSettings | null): FirebaseApp;
|
|
46
|
+
declare class AngularFireModule {
|
|
47
|
+
static initializeApp(options: FirebaseOptions, nameOrConfig?: string | FirebaseAppSettings): ModuleWithProviders<AngularFireModule>;
|
|
48
|
+
constructor(platformId: Object);
|
|
49
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFireModule, never>;
|
|
50
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AngularFireModule, never, never, never>;
|
|
51
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AngularFireModule>;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
declare function ɵcacheInstance<T>(cacheKey: any, moduleName: string, appName: string, fn: () => T, deps: any): T;
|
|
55
|
+
|
|
56
|
+
export { AngularFireModule, FIREBASE_APP_NAME, FIREBASE_OPTIONS, FirebaseApp, ɵapplyMixins, ɵcacheInstance, ɵfirebaseAppFactory, ɵlazySDKProxy };
|
|
57
|
+
export type { ɵPromiseProxy };
|
|
@@ -1,5 +1,32 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, NgZone } from '@angular/core';
|
|
3
|
+
import { ɵAngularFireSchedulers as _AngularFireSchedulers } from '@angular/fire';
|
|
4
|
+
import { ɵPromiseProxy as _PromiseProxy } from '@angular/fire/compat';
|
|
5
|
+
import { FirebaseOptions } from 'firebase/app';
|
|
6
|
+
import firebase from 'firebase/compat/app';
|
|
7
|
+
import { Observable } from 'rxjs';
|
|
8
|
+
|
|
9
|
+
declare const VAPID_KEY: InjectionToken<string>;
|
|
10
|
+
declare const SERVICE_WORKER: InjectionToken<Promise<ServiceWorkerRegistration>>;
|
|
11
|
+
interface AngularFireMessaging extends Omit<_PromiseProxy<firebase.messaging.Messaging>, 'deleteToken' | 'getToken' | 'requestPermission'> {
|
|
12
|
+
}
|
|
13
|
+
declare class AngularFireMessaging {
|
|
14
|
+
readonly requestPermission: Observable<NotificationPermission>;
|
|
15
|
+
readonly getToken: Observable<string | null>;
|
|
16
|
+
readonly tokenChanges: Observable<string | null>;
|
|
17
|
+
readonly messages: Observable<firebase.messaging.MessagePayload>;
|
|
18
|
+
readonly requestToken: Observable<string | null>;
|
|
19
|
+
readonly deleteToken: (token: string) => Observable<boolean>;
|
|
20
|
+
constructor(options: FirebaseOptions, name: string | null | undefined, platformId: Object, zone: NgZone, schedulers: _AngularFireSchedulers, vapidKey: string | null, _serviceWorker: any);
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFireMessaging, [null, { optional: true; }, null, null, null, { optional: true; }, { optional: true; }]>;
|
|
22
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AngularFireMessaging>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
declare class AngularFireMessagingModule {
|
|
26
|
+
constructor();
|
|
27
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFireMessagingModule, never>;
|
|
28
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AngularFireMessagingModule, never, never, never>;
|
|
29
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AngularFireMessagingModule>;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { AngularFireMessaging, AngularFireMessagingModule, SERVICE_WORKER, VAPID_KEY };
|
|
@@ -1,5 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, NgZone, OnDestroy, ApplicationRef } from '@angular/core';
|
|
3
|
+
import { ɵPromiseProxy as _PromiseProxy, FirebaseApp } from '@angular/fire/compat';
|
|
4
|
+
import firebase from 'firebase/compat/app';
|
|
5
|
+
import { Observable } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
declare const INSTRUMENTATION_ENABLED: InjectionToken<boolean>;
|
|
8
|
+
declare const DATA_COLLECTION_ENABLED: InjectionToken<boolean>;
|
|
9
|
+
interface AngularFirePerformance extends _PromiseProxy<firebase.performance.Performance> {
|
|
10
|
+
}
|
|
11
|
+
declare class AngularFirePerformance {
|
|
12
|
+
private zone;
|
|
13
|
+
private readonly performance;
|
|
14
|
+
constructor(app: FirebaseApp, instrumentationEnabled: boolean | null, dataCollectionEnabled: boolean | null, zone: NgZone, platformId: Object);
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFirePerformance, [null, { optional: true; }, { optional: true; }, null, null]>;
|
|
16
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AngularFirePerformance>;
|
|
17
|
+
}
|
|
18
|
+
declare const traceUntil: <T = any>(name: string, test: (a: T) => boolean, options?: {
|
|
19
|
+
orComplete?: boolean;
|
|
20
|
+
}) => (source$: Observable<T>) => Observable<T>;
|
|
21
|
+
declare const traceWhile: <T = any>(name: string, test: (a: T) => boolean, options?: {
|
|
22
|
+
orComplete?: boolean;
|
|
23
|
+
}) => (source$: Observable<T>) => Observable<T>;
|
|
24
|
+
declare const traceUntilComplete: <T = any>(name: string) => (source$: Observable<T>) => Observable<T>;
|
|
25
|
+
declare const traceUntilFirst: <T = any>(name: string) => (source$: Observable<T>) => Observable<T>;
|
|
26
|
+
declare const trace: <T = any>(name: string) => (source$: Observable<T>) => Observable<T>;
|
|
27
|
+
|
|
28
|
+
declare class PerformanceMonitoringService implements OnDestroy {
|
|
29
|
+
private disposable;
|
|
30
|
+
constructor(appRef: ApplicationRef);
|
|
31
|
+
ngOnDestroy(): void;
|
|
32
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<PerformanceMonitoringService, never>;
|
|
33
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<PerformanceMonitoringService>;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
declare class AngularFirePerformanceModule {
|
|
37
|
+
constructor(perf: AngularFirePerformance, _: PerformanceMonitoringService);
|
|
38
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFirePerformanceModule, [null, { optional: true; }]>;
|
|
39
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<AngularFirePerformanceModule, never, never, never>;
|
|
40
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<AngularFirePerformanceModule>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { AngularFirePerformance, AngularFirePerformanceModule, DATA_COLLECTION_ENABLED, INSTRUMENTATION_ENABLED, PerformanceMonitoringService, trace, traceUntil, traceUntilComplete, traceUntilFirst, traceWhile };
|