Deployed the page to Github Pages.

This commit is contained in:
Batuhan Berk Başoğlu 2024-11-03 21:30:09 -05:00
parent 1d79754e93
commit 2c89899458
Signed by: batuhan-basoglu
SSH key fingerprint: SHA256:kEsnuHX+qbwhxSAXPUQ4ox535wFHu/hIRaa53FzxRpo
62797 changed files with 6551425 additions and 15279 deletions

View file

@ -0,0 +1,5 @@
/**
* Generated bundle index. Do not edit.
*/
/// <amd-module name="@angular/fire/compat/firestore" />
export * from './public_api';

View file

@ -0,0 +1,64 @@
import { Observable } from 'rxjs';
import firebase from 'firebase/compat/app';
import { DocumentChangeAction, DocumentChangeType, DocumentData, Query } from '../interfaces';
import { AngularFirestore } from '../firestore';
/**
* AngularFirestoreCollectionGroup service
*
* This class holds a reference to a Firestore Collection Group Query.
*
* This class uses Symbol.observable to transform into Observable using Observable.from().
*
* This class is rarely used directly and should be created from the AngularFirestore service.
*
* Example:
*
* const collectionGroup = firebase.firestore.collectionGroup('stocks');
* const query = collectionRef.where('price', '>', '0.01');
* const fakeStock = new AngularFirestoreCollectionGroup<Stock>(query, afs);
*
* // Subscribe to changes as snapshots. This provides you data updates as well as delta updates.
* fakeStock.valueChanges().subscribe(value => console.log(value));
*/
export declare class AngularFirestoreCollectionGroup<T = DocumentData> {
private readonly query;
private readonly afs;
/**
* The constructor takes in a CollectionGroupQuery to provide wrapper methods
* for data operations and data streaming.
*/
constructor(query: Query<T>, afs: AngularFirestore);
/**
* Listen to the latest change in the stream. This method returns changes
* as they occur and they are not sorted by query order. This allows you to construct
* your own data structure.
*/
stateChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
/**
* Create a stream of changes as they occur it time. This method is similar to stateChanges()
* but it collects each event in an array over time.
*/
auditTrail(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
/**
* Create a stream of synchronized changes. This method keeps the local array in sorted
* query order.
*/
snapshotChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
/**
* Listen to all documents in the collection and its possible query as an Observable.
*
* If the `idField` option is provided, document IDs are included and mapped to the
* provided `idField` property name.
*/
valueChanges(): Observable<T[]>;
valueChanges({}: {}): Observable<T[]>;
valueChanges<K extends string>(options: {
idField: K;
}): Observable<(T & {
[T in K]: string;
})[]>;
/**
* Retrieve the results of the query once.
*/
get(options?: firebase.firestore.GetOptions): Observable<firebase.firestore.QuerySnapshot<T>>;
}

View file

@ -0,0 +1,22 @@
import { Observable, SchedulerLike } from 'rxjs';
import { DocumentChange, DocumentChangeAction, DocumentChangeType, Query } from '../interfaces';
/**
* Return a stream of document changes on a query. These results are not in sort order but in
* order of occurence.
*/
export declare function docChanges<T>(query: Query, scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]>;
/**
* Return a stream of document changes on a query. These results are in sort order.
*/
export declare function sortedChanges<T>(query: Query, events: DocumentChangeType[], scheduler?: SchedulerLike): Observable<DocumentChangeAction<T>[]>;
/**
* Combines the total result set from the current set of changes from an incoming set
* of changes.
*/
export declare function combineChanges<T>(current: DocumentChange<T>[], changes: DocumentChange<T>[], events: DocumentChangeType[]): DocumentChange<T>[];
/**
* Creates a new sorted array from a new change.
* Build our own because we allow filtering of action types ('added', 'removed', 'modified') before scanning
* and so we have greater control over change detection (by breaking ===)
*/
export declare function combineChange<T>(combined: DocumentChange<T>[], change: DocumentChange<T>): DocumentChange<T>[];

View file

@ -0,0 +1,89 @@
import { Observable } from 'rxjs';
import firebase from 'firebase/compat/app';
import { CollectionReference, DocumentChangeAction, DocumentChangeType, DocumentData, DocumentReference, Query } from '../interfaces';
import { AngularFirestoreDocument } from '../document/document';
import { AngularFirestore } from '../firestore';
export declare function validateEventsArray(events?: DocumentChangeType[]): firebase.firestore.DocumentChangeType[];
/**
* AngularFirestoreCollection service
*
* This class creates a reference to a Firestore Collection. A reference and a query are provided in
* in the constructor. The query can be the unqueried reference if no query is desired.The class
* is generic which gives you type safety for data update methods and data streaming.
*
* This class uses Symbol.observable to transform into Observable using Observable.from().
*
* This class is rarely used directly and should be created from the AngularFirestore service.
*
* Example:
*
* const collectionRef = firebase.firestore.collection('stocks');
* const query = collectionRef.where('price', '>', '0.01');
* const fakeStock = new AngularFirestoreCollection<Stock>(collectionRef, query);
*
* // NOTE!: the updates are performed on the reference not the query
* await fakeStock.add({ name: 'FAKE', price: 0.01 });
*
* // Subscribe to changes as snapshots. This provides you data updates as well as delta updates.
* fakeStock.valueChanges().subscribe(value => console.log(value));
*/
export declare class AngularFirestoreCollection<T = DocumentData> {
readonly ref: CollectionReference<T>;
private readonly query;
private readonly afs;
/**
* The constructor takes in a CollectionReference and Query to provide wrapper methods
* for data operations and data streaming.
*
* Note: Data operation methods are done on the reference not the query. This means
* when you update data it is not updating data to the window of your query unless
* the data fits the criteria of the query. See the AssociatedRefence type for details
* on this implication.
*/
constructor(ref: CollectionReference<T>, query: Query<T>, afs: AngularFirestore);
/**
* Listen to the latest change in the stream. This method returns changes
* as they occur and they are not sorted by query order. This allows you to construct
* your own data structure.
*/
stateChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
/**
* Create a stream of changes as they occur it time. This method is similar to stateChanges()
* but it collects each event in an array over time.
*/
auditTrail(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
/**
* Create a stream of synchronized changes. This method keeps the local array in sorted
* query order.
*/
snapshotChanges(events?: DocumentChangeType[]): Observable<DocumentChangeAction<T>[]>;
/**
* Listen to all documents in the collection and its possible query as an Observable.
*
* If the `idField` option is provided, document IDs are included and mapped to the
* provided `idField` property name.
*/
valueChanges(): Observable<T[]>;
valueChanges({}: {}): Observable<T[]>;
valueChanges<K extends string>(options: {
idField: K;
}): Observable<(T & {
[T in K]: string;
})[]>;
/**
* Retrieve the results of the query once.
*/
get(options?: firebase.firestore.GetOptions): Observable<firebase.firestore.QuerySnapshot<T>>;
/**
* Add data to a collection reference.
*
* Note: Data operation methods are done on the reference not the query. This means
* when you update data it is not updating data to the window of your query unless
* the data fits the criteria of the query.
*/
add(data: T): Promise<DocumentReference<T>>;
/**
* Create a reference to a single document in a collection.
*/
doc<T2 = T>(path?: string): AngularFirestoreDocument<T2>;
}

View file

@ -0,0 +1,73 @@
import { Observable } from 'rxjs';
import { Action, DocumentData, DocumentReference, DocumentSnapshot, QueryFn, SetOptions } from '../interfaces';
import { AngularFirestore } from '../firestore';
import { AngularFirestoreCollection } from '../collection/collection';
import firebase from 'firebase/compat/app';
/**
* AngularFirestoreDocument service
*
* This class creates a reference to a Firestore Document. A reference is provided in
* in the constructor. The class is generic which gives you type safety for data update
* methods and data streaming.
*
* This class uses Symbol.observable to transform into Observable using Observable.from().
*
* This class is rarely used directly and should be created from the AngularFirestore service.
*
* Example:
*
* const fakeStock = new AngularFirestoreDocument<Stock>(doc('stocks/FAKE'));
* await fakeStock.set({ name: 'FAKE', price: 0.01 });
* fakeStock.valueChanges().map(snap => {
* if(snap.exists) return snap.data();
* return null;
* }).subscribe(value => console.log(value));
* // OR! Transform using Observable.from() and the data is unwrapped for you
* Observable.from(fakeStock).subscribe(value => console.log(value));
*/
export declare class AngularFirestoreDocument<T = DocumentData> {
ref: DocumentReference<T>;
private afs;
/**
* The constructor takes in a DocumentReference to provide wrapper methods
* for data operations, data streaming, and Symbol.observable.
*/
constructor(ref: DocumentReference<T>, afs: AngularFirestore);
/**
* Create or overwrite a single document.
*/
set(data: T, options?: SetOptions): Promise<void>;
/**
* Update some fields of a document without overwriting the entire document.
*/
update(data: Partial<T>): Promise<void>;
/**
* Delete a document.
*/
delete(): Promise<void>;
/**
* Create a reference to a sub-collection given a path and an optional query
* function.
*/
collection<R = DocumentData>(path: string, queryFn?: QueryFn): AngularFirestoreCollection<R>;
/**
* Listen to snapshot updates from the document.
*/
snapshotChanges(): Observable<Action<DocumentSnapshot<T>>>;
/**
* Listen to unwrapped snapshot updates from the document.
*
* If the `idField` option is provided, document IDs are included and mapped to the
* provided `idField` property name.
*/
valueChanges(options?: {}): Observable<T | undefined>;
valueChanges<K extends string>(options: {
idField: K;
}): Observable<(T & {
[T in K]: string;
}) | undefined>;
/**
* Retrieve the document once.
*/
get(options?: firebase.firestore.GetOptions): Observable<firebase.firestore.DocumentSnapshot<T>>;
}

View file

@ -0,0 +1,130 @@
import { InjectionToken, NgZone } from '@angular/core';
import { Observable } from 'rxjs';
import { AssociatedReference, CollectionReference, DocumentReference, PersistenceSettings, QueryFn, QueryGroupFn, Settings } from './interfaces';
import { AngularFirestoreDocument } from './document/document';
import { AngularFirestoreCollection } from './collection/collection';
import { AngularFirestoreCollectionGroup } from './collection-group/collection-group';
import { ɵAngularFireSchedulers } from '@angular/fire';
import { FirebaseOptions } from 'firebase/app';
import firebase from 'firebase/compat/app';
import 'firebase/compat/auth';
import 'firebase/compat/firestore';
import { AngularFireAuth } from '@angular/fire/compat/auth';
import { AppCheckInstances } from '@angular/fire/app-check';
import * as i0 from "@angular/core";
/**
* The value of this token determines whether or not the firestore will have persistance enabled
*/
export declare const ENABLE_PERSISTENCE: InjectionToken<boolean>;
export declare const PERSISTENCE_SETTINGS: InjectionToken<firebase.firestore.PersistenceSettings>;
export declare const SETTINGS: InjectionToken<firebase.firestore.Settings>;
export declare const USE_EMULATOR: InjectionToken<[host: string, port: number, options?: {
mockUserToken?: string | firebase.EmulatorMockTokenOptions;
}]>;
/**
* A utility methods for associating a collection reference with
* a query.
*
* @param collectionRef - A collection reference to query
* @param queryFn - The callback to create a query
*
* Example:
* const { query, ref } = associateQuery(docRef.collection('items'), ref => {
* return ref.where('age', '<', 200);
* });
*/
export declare function associateQuery<T>(collectionRef: CollectionReference<T>, queryFn?: (ref: any) => any): AssociatedReference<T>;
/**
* AngularFirestore Service
*
* This service is the main entry point for this feature module. It provides
* an API for creating Collection and Reference services. These services can
* then be used to do data updates and observable streams of the data.
*
* Example:
*
* import { Component } from '@angular/core';
* import { AngularFirestore, AngularFirestoreCollection, AngularFirestoreDocument } from '@angular/fire/firestore';
* import { Observable } from 'rxjs/Observable';
* import { from } from 'rxjs/observable';
*
* @Component({
* selector: 'app-my-component',
* template: `
* <h2>Items for {{ (profile | async)?.name }}
* <ul>
* <li *ngFor="let item of items | async">{{ item.name }}</li>
* </ul>
* <div class="control-input">
* <input type="text" #itemname />
* <button (click)="addItem(itemname.value)">Add Item</button>
* </div>
* `
* })
* export class MyComponent implements OnInit {
*
* // services for data operations and data streaming
* private readonly itemsRef: AngularFirestoreCollection<Item>;
* private readonly profileRef: AngularFirestoreDocument<Profile>;
*
* // observables for template
* items: Observable<Item[]>;
* profile: Observable<Profile>;
*
* // inject main service
* constructor(private readonly afs: AngularFirestore) {}
*
* ngOnInit() {
* this.itemsRef = afs.collection('items', ref => ref.where('user', '==', 'davideast').limit(10));
* this.items = this.itemsRef.valueChanges().map(snap => snap.docs.map(data => doc.data()));
* // this.items = from(this.itemsRef); // you can also do this with no mapping
*
* this.profileRef = afs.doc('users/davideast');
* this.profile = this.profileRef.valueChanges();
* }
*
* addItem(name: string) {
* const user = 'davideast';
* this.itemsRef.add({ name, user });
* }
* }
*/
export declare class AngularFirestore {
schedulers: ɵAngularFireSchedulers;
readonly firestore: firebase.firestore.Firestore;
readonly persistenceEnabled$: Observable<boolean>;
/**
* Each Feature of AngularFire has a FirebaseApp injected. This way we
* don't rely on the main Firebase App instance and we can create named
* apps and use multiple apps.
*/
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
tenantId: string | null, languageCode: string | null, useDeviceLanguage: boolean | null, persistence: string | null, _appCheckInstances: AppCheckInstances);
/**
* Create a reference to a Firestore Collection based on a path or
* CollectionReference and an optional query function to narrow the result
* set.
*/
collection<T>(path: string, queryFn?: QueryFn): AngularFirestoreCollection<T>;
collection<T>(ref: CollectionReference, queryFn?: QueryFn): AngularFirestoreCollection<T>;
/**
* Create a reference to a Firestore Collection Group based on a collectionId
* and an optional query function to narrow the result
* set.
*/
collectionGroup<T>(collectionId: string, queryGroupFn?: QueryGroupFn<T>): AngularFirestoreCollectionGroup<T>;
/**
* Create a reference to a Firestore Document based on a path or
* DocumentReference. Note that documents are not queryable because they are
* simply objects. However, documents have sub-collections that return a
* Collection reference and can be queried.
*/
doc<T>(path: string): AngularFirestoreDocument<T>;
doc<T>(ref: DocumentReference): AngularFirestoreDocument<T>;
/**
* Returns a generated Firestore Document Id.
*/
createId(): string;
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; }]>;
static ɵprov: i0.ɵɵInjectableDeclaration<AngularFirestore>;
}

View file

@ -0,0 +1,13 @@
import { ModuleWithProviders } from '@angular/core';
import { PersistenceSettings } from './interfaces';
import * as i0 from "@angular/core";
export declare class AngularFirestoreModule {
constructor();
/**
* Attempt to enable persistent storage, if possible
*/
static enablePersistence(persistenceSettings?: PersistenceSettings): ModuleWithProviders<AngularFirestoreModule>;
static ɵfac: i0.ɵɵFactoryDeclaration<AngularFirestoreModule, never>;
static ɵmod: i0.ɵɵNgModuleDeclaration<AngularFirestoreModule, never, never, never>;
static ɵinj: i0.ɵɵInjectorDeclaration<AngularFirestoreModule>;
}

View file

@ -0,0 +1,70 @@
import { Subscriber } from 'rxjs';
import firebase from 'firebase/compat/app';
export declare type Settings = firebase.firestore.Settings;
export declare type CollectionReference<T = DocumentData> = firebase.firestore.CollectionReference<T>;
export declare type DocumentReference<T = DocumentData> = firebase.firestore.DocumentReference<T>;
export declare type PersistenceSettings = firebase.firestore.PersistenceSettings;
export declare type DocumentChangeType = firebase.firestore.DocumentChangeType;
export declare type SnapshotOptions = firebase.firestore.SnapshotOptions;
export declare type FieldPath = firebase.firestore.FieldPath;
export declare type Query<T = DocumentData> = firebase.firestore.Query<T>;
export declare type SetOptions = firebase.firestore.SetOptions;
export declare type DocumentData = firebase.firestore.DocumentData;
export interface DocumentSnapshotExists<T> extends firebase.firestore.DocumentSnapshot {
readonly exists: true;
data(options?: SnapshotOptions): T;
}
export interface DocumentSnapshotDoesNotExist extends firebase.firestore.DocumentSnapshot {
readonly exists: false;
data(options?: SnapshotOptions): undefined;
get(fieldPath: string | FieldPath, options?: SnapshotOptions): undefined;
}
export declare type DocumentSnapshot<T> = DocumentSnapshotExists<T> | DocumentSnapshotDoesNotExist;
export interface QueryDocumentSnapshot<T> extends firebase.firestore.QueryDocumentSnapshot {
data(options?: SnapshotOptions): T;
}
export interface QuerySnapshot<T> extends firebase.firestore.QuerySnapshot {
readonly docs: QueryDocumentSnapshot<T>[];
}
export interface DocumentChange<T> extends firebase.firestore.DocumentChange {
readonly doc: QueryDocumentSnapshot<T>;
}
export interface DocumentChangeAction<T> {
type: DocumentChangeType;
payload: DocumentChange<T>;
}
export interface Action<T> {
type: string;
payload: T;
}
export interface Reference<T> {
onSnapshot: (options: firebase.firestore.SnapshotListenOptions, sub: Subscriber<any>) => any;
}
export declare type QueryFn<T = DocumentData> = (ref: CollectionReference<T>) => Query<T>;
export declare type QueryGroupFn<T = DocumentData> = (query: Query<T>) => Query<T>;
/**
* A structure that provides an association between a reference
* and a query on that reference. Note: Performing operations
* on the reference can lead to confusing results with complicated
* queries.
*
* Example:
*
* const query = ref.where('type', '==', 'Book').
* .where('price', '>' 18.00)
* .where('price', '<' 100.00)
* .where('category', '==', 'Fiction')
* .where('publisher', '==', 'BigPublisher')
*
* // This addition would not be a result of the query above
* ref.add({
* type: 'Magazine',
* price: 4.99,
* category: 'Sports',
* publisher: 'SportsPublisher'
* });
*/
export interface AssociatedReference<T = DocumentData> {
ref: CollectionReference<T>;
query: Query<T>;
}

View file

@ -0,0 +1,5 @@
import { Observable, SchedulerLike } from 'rxjs';
import { Action, DocumentReference, DocumentSnapshot, Query, QuerySnapshot } from '../interfaces';
export declare function fromRef<R, T>(ref: DocumentReference<T> | Query<T>, scheduler?: SchedulerLike): Observable<R>;
export declare function fromDocRef<T>(ref: DocumentReference<T>, scheduler?: SchedulerLike): Observable<Action<DocumentSnapshot<T>>>;
export declare function fromCollectionRef<T>(ref: Query<T>, scheduler?: SchedulerLike): Observable<Action<QuerySnapshot<T>>>;

View file

@ -0,0 +1,11 @@
{
"$schema": "../../node_modules/ng-packagr/package.schema.json",
"main": "../../bundles/angular-fire-compat-firestore.umd.js",
"module": "../../fesm2015/angular-fire-compat-firestore.js",
"es2015": "../../fesm2015/angular-fire-compat-firestore.js",
"esm2015": "../../esm2015/compat/firestore/angular-fire-compat-firestore.js",
"fesm2015": "../../fesm2015/angular-fire-compat-firestore.js",
"typings": "angular-fire-compat-firestore.d.ts",
"sideEffects": false,
"name": "@angular/fire/compat/firestore"
}

View file

@ -0,0 +1,8 @@
export * from './firestore';
export * from './firestore.module';
export * from './collection/collection';
export * from './collection-group/collection-group';
export * from './document/document';
export * from './collection/changes';
export * from './observable/fromRef';
export * from './interfaces';