import Catalog from './catalog'; import Result from './result'; import Session from './session'; /** * A driver that can hold multiple {@link Session}s with a remote MillenniumDB instance. The {@link Session}s have * the interface for sending queries and receiving results. It is expected that an application holds a single * driver instance. */ declare class Driver { private _open; private readonly _url; private readonly _sessions; /** * This constructor should never be called directly * * @param url the URL for the MillenniumDB server */ constructor(url: string); /** * Get the {@link Catalog} of the remote MillenniumDB instance * * @returns Promise that will be resolved with the {@link Catalog} */ catalog(): Promise; /** * Cancel the execution of a currently running query. Internally this will create a temporary {@link Session} * that will be closed after the query has been cancelled. * * @param result the {@link Result} to cancel */ cancel(result: Result): Promise; /** * Create a {@link Session}, establishing a new connection with the remote MillenniumDB instance. * The {@link Session} must be closed when your operations are done. * * @param options the options for the {@link Session} * @returns a new {@link Session} instance */ session(): Session; /** * Close all open {@link Session}s * * @returns Promise that will be resolved when all {@link Session}s are closed */ close(): Promise; private _ensureOpen; } export default Driver;