import Entity from './Entity'; import { IDocumentSnapshot, ICollection } from './types/collection.types'; import { IDocumentRef } from './types'; import { firestore } from 'firebase-admin'; export default class DocumentSnapshot implements IDocumentSnapshot { /** * @hidden */ private _nativeSnapshot; /** * @hidden */ private _doc; /** * Creates a document snapshot. * @param nativeSnapshot The firestore DocumentSnapshot. * @param Entity The entity to represent. * @param collection The parent collection for the entity. */ constructor(nativeSnapshot: firestore.DocumentSnapshot, Entity: new () => T, collection: ICollection); /** * The document in the snapshot. */ get doc(): T; /** * Whether or not the document exists. */ get exists(): boolean; /** * The document reference. */ get ref(): IDocumentRef; }