Open awais-satti opened 3 years ago
something... like this...
declare module "@apla/clickhouse" {
import { Duplex } from 'stream';
interface ClickHouseOptions {
host?: string;
user?: string;
password?: string;
dataObjects?: boolean;
path?: string;
format?: string;
readonly?: boolean;
queryOptions?: { [key: string]: any };
}
interface Meta {
name: string;
type: string;
}
interface Statistics {
elapsed: number;
rows_read: number;
bytes_read: number;
transferred: number;
}
interface QueryingResult {
meta: Meta[];
data: any[];
rows: number;
statistics: Statistics
}
interface ClickHouse {
new(opts: ClickHouseOptions): this;
query(query: string, options?: ClickHouseOptions, callback?: (error, result) => void): Duplex;
querying(query: string, options?: ClickHouseOptions): Promise<QueryingResult>;
ping(callback: (error: any, result: any) => void): Duplex;
pinging(): Promise<any>
}
const ClickHouse: ClickHouse;
export = ClickHouse;
}
Do you guys have types available for the extension?