UNPKG

@furystack/mongodb-store

Version:

MongoDB Store implementation for FuryStack

22 lines 747 B
import { EventHub, type ListenerErrorPayload } from '@furystack/utils'; import type { MongoClientOptions } from 'mongodb'; import { MongoClient } from 'mongodb'; /** * Events emitted by the {@link MongoClientFactory} */ export type MongoClientFactoryEvents = { onClientCreated: { url: string; }; onDisposed: undefined; onListenerError: ListenerErrorPayload; }; /** * Factory for instantiating MongoDb clients */ export declare class MongoClientFactory extends EventHub<MongoClientFactoryEvents> implements AsyncDisposable { private connections; [Symbol.asyncDispose](): Promise<void>; getClientFor(url: string, options?: MongoClientOptions): MongoClient; } //# sourceMappingURL=mongo-client-factory.d.ts.map