import Catalog from './catalog'; import Result from './result'; /** * A Session is used to send queries and receive results from the remote MillenniumDB instance */ declare class Session { private _open; private readonly _connection; private readonly _chunkDecoder; private readonly _messageDecoder; private readonly _responseHandler; private readonly _results; /** * This constructor should never be called directly * * @param url the URL for the MillenniumDB server * @param options the options for the {@link Session} */ constructor(url: URL); /** * Get the {@link Catalog} of the remote MillenniumDB instance * * @returns Promise that will be resolved with the {@link Catalog} */ catalog(): Promise; /** * Sends a request for executing a query to the server * * @param query the query to execute * @returns a {@link Result} for the query */ run(query: string): Result; close(): Promise; /** * Try to cancel another query given a {@link Result}. This method should be called exclusively by driver * * @param result the {@link Result} to cancel * @returns a promise that resolves when the query is cancelled */ _cancel(result: Result): Promise; private _ensureOpen; /** * Send a request to the server and attach an observer for its response * * @param iobuffer the data to send * @param observer that will handle the received data */ private _send; /** * Handler for incoming data from the server * * @param iobuffer the data received */ private _onServerMessage; /** * Handler for chunks that were decoded * * @param iobuffer the data received */ private _onChunksDecoded; } export default Session;