diff --git a/index.d.ts b/index.d.ts
index 7ba52bd..6b43c5c 100644
--- a/index.d.ts
+++ b/index.d.ts
@@ -1,18 +1,39 @@
///
declare module 'clickhouse' {
- import {Stream} from 'stream';
+ import { Transform, Stream } from 'stream';
type callbackExec = (error: Error, rows?: Object[]) => void;
+ export interface DriverOptions {
+ debug: boolean,
+ database: string,
+ password: string,
+ basicAuth: {
+ username: string
+ password: string
+ },
+ isUseGzip: boolean,
+ config: {
+ session_timeout: number,
+ output_format_json_quote_64bit_integers: number,
+ enable_http_compression: number
+ },
+ format: 'json' | 'tsv' | 'csv',
+ raw: boolean,
+ isSessionPerQuery: boolean,
+ trimQuery: boolean,
+ usePost: boolean,
+ }
+
export class ClickHouse {
- constructor(opts: Object);
+ constructor(opts: DriverOptions);
query(query: String, reqParams?: object): QueryCursor;
insert(query: String, data?: object): QueryCursor;
sessionId: string;
}
- export class WriteStream extends Stream.Transform {
+ export class WriteStream extends Transform {
writeRow(data: Array | string): Promise;
exec(): Promise<{}>;
}