// Import Mongo
import MongoDB from 'mongodb';

/**
 * Type describing the (global) state of a DB.
 * @author Benedikt Arnarsson
 */
type DbState = {
  // Whether the DB connection has been started (via initMango)
  isInitialized: boolean,
  // Optional version tag
  schemaVersionTag: string,
  // Promise containing a list of collection names
  initDB: Promise<string[]>,
  // The DB itself
  db: MongoDB.Db;
  // The client connection
  client: MongoDB.MongoClient,
};

export default DbState;
