import type { BaseResultSet, ClickHouseSpan, DataFormat, JSONHandling, ResponseHeaders, ResultJSONType, ResultStream, Row } from "./common/index"; export declare class ResultSet implements BaseResultSet, Format> { readonly response_headers: ResponseHeaders; private readonly exceptionTag; private isAlreadyConsumed; private readonly jsonHandling; private _stream; private readonly format; /** The `clickhouse.query.stream` span owned by this result set (if the * client was configured with a tracer); it ends via {@link finishSpan} * when the response stream is fully consumed, closed, or fails. */ private readonly span; /** Decoded (decompressed) bytes received from the server so far. */ private span_bytes; /** Rows decoded from the response stream so far. */ private span_rows; private span_rows_counted; /** UTF-16 code-unit length of the response body, recorded by {@link text} * instead of {@link span_bytes} to avoid the `TextEncoder` allocation that * accurate byte counting would require. */ private span_text_length; private span_finished; readonly query_id: string; constructor(_stream: ReadableStream, format: Format, query_id: string, _response_headers?: ResponseHeaders, jsonHandling?: JSONHandling, span?: ClickHouseSpan); /** See {@link BaseResultSet.text} */ text(): Promise; /** See {@link BaseResultSet.json} */ json(): Promise>; /** See {@link BaseResultSet.stream} */ stream(): ResultStream[]>>; close(): Promise; /** * Closes the `ResultSet`. * * Automatically called when using `using` statement in supported environments. * @see {@link ResultSet.close} * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/using */ [Symbol.asyncDispose](): Promise; private markAsConsumed; /** Add the number of rows decoded from the response stream. */ private addSpanRows; /** Record the final response metrics (`clickhouse.response.decoded_bytes`, * `clickhouse.response.text_length` when called from {@link text}, and * `db.response.returned_rows` when rows were counted) and the error * (if any) on the span, and end it. Safe to call multiple times - only * the first call wins. */ private finishSpan; }