import type { ApplicationService } from '@adonisjs/core/types'; import { MongoDatabase } from '../src/connection/database.js'; import type { MongoConnectionContract, MongoQueryEventNode } from '../src/types/database.js'; /** * Extending AdonisJS types */ declare module '@adonisjs/core/types' { interface ContainerBindings { 'lucid.mongodb': MongoDatabase; } interface EventsList { 'mongodb:query': MongoQueryEventNode; 'mongodb:connection:connect': MongoConnectionContract; 'mongodb:connection:disconnect': MongoConnectionContract; 'mongodb:connection:error': [Error, MongoConnectionContract]; } } /** * MongoDB database service provider */ export default class MongoDBServiceProvider { protected app: ApplicationService; constructor(app: ApplicationService); /** * Registers repl bindings when running the application * in the REPL environment */ protected registerReplBindings(): Promise; /** * Register TestUtils database macro */ protected registerTestUtils(): Promise; /** * Registeres a listener to pretty print debug queries */ protected prettyPrintDebugQueries(db: MongoDatabase): Promise; /** * Invoked by AdonisJS to register container bindings */ register(): void; /** * Invoked by AdonisJS to extend the framework or pre-configure * objects */ boot(): Promise; /** * Gracefully close connections during shutdown */ shutdown(): Promise; }