local g=require(script.Collection)local n=require(script.Document)local K={}local f={}f.__index=f function K.new(g)local n={}n.App=g return setmetatable(n,f)end function f.GetCollection(K,n)return g.new(K.App,n)end function f.GetDoc(K,g)return n.new(K.App,g)end return K
local Collection = require(script.Collection)
local Document = require(script.Document)

--[=[
    @class Firestore
    Object tied to a FirebaseApp's Firestore service.
]=]
local Firestore = {}
local FIRESTORE_METATABLE = {}
FIRESTORE_METATABLE.__index = FIRESTORE_METATABLE

--[=[
    @within Firestore
    @private
    Creates a `Firestore` object tied to the given FirebaseApp.

    @param app FirebaseApp
    @return Firestore
]=]
function Firestore.new(app)
    local self = {}

    self.App = app

    return setmetatable(self, FIRESTORE_METATABLE)
end

--[=[
    @within Firestore
    Returns a collection reference.

    @method GetCollection
    @param path string
    @return CollectionReference
]=]
function FIRESTORE_METATABLE:GetCollection(path)
    return Collection.new(self.App, path)
end

--[=[
    @within Firestore
    Returns a document reference.

    @method GetDoc
    @param path string
    @return DocumentReference
]=]
function FIRESTORE_METATABLE:GetDoc(path)
    return Document.new(self.App, path)
end

return Firestore
