declare module "@geo.de.tang/heavyai-connector" { import { EventEmitter } from "events" export interface ConnectionConfig { host?: string | string[] port?: number | number[] dbName?: string | string[] user?: string | string[] password?: string | string[] protocol?: string logging?: boolean platform?: string connectionTimeout?: number } export interface QueryResult { results: any[] timing?: { execution_time_ms: number total_time_ms: number } } export interface TableInfo { name: string label: string col_count: number row_count: number } export interface FieldInfo { name: string type: string is_array: boolean is_dict: boolean precision?: number } export interface DashboardInfo { dashboard_id: number dashboard_name: string owner: string dashboard_state: string image_hash: string update_time: string dashboard_metadata: string } export interface UserInfo { user_name: string is_super: boolean default_db: string } export interface ServerInfo { host_name: string version: string rendering_enabled: boolean start_time: number edition: string host_id: string } export interface MemoryInfo { host_name: string max_cpu_slab_size: number max_gpu_slab_size: number page_size: number max_cpu_slab_num_pages: number max_gpu_slab_num_pages: number num_cpu_slabs: number num_gpu_slabs: number cpu_slab_size: number gpu_slab_size: number } export interface ImportOptions { copy_params?: { delimiter?: string null_str?: string has_header?: boolean quoted?: boolean quote?: string escape?: string line_delim?: string array_delim?: string array_begin?: string array_end?: string threads?: number max_reject?: number buffer_size?: number } row_desc?: Array<{ col_name: string col_type: { type: number encoding?: number nullable?: boolean is_array?: boolean precision?: number scale?: number comp_param?: number } }> } export class DbCon extends EventEmitter { constructor() // Connection configuration methods host(host?: string | string[]): string[] | DbCon port(port?: number | number[]): number[] | DbCon dbName(dbName?: string | string[]): string[] | DbCon user(user?: string | string[]): string[] | DbCon password(password?: string | string[]): string[] | DbCon protocol(protocol?: string): string | DbCon logging(logging?: boolean): boolean | DbCon platform(platform?: string): string | DbCon connectionTimeout(timeout?: number): number | DbCon // Connection management connect(): Promise disconnect(): Promise // Query methods query(query: string, options?: any): Promise queryAsync(query: string, options?: any): Promise queryDFAsync(query: string, options?: any): Promise validateQuery(query: string): Promise // Table management getTables(): Promise getTablesAsync(): Promise getFields(tableName: string): Promise getFieldsAsync(tableName: string): Promise createTable( tableName: string, rowDesc: any[], tableType?: number ): Promise createTableAsync( tableName: string, rowDesc: any[], tableType?: number ): Promise importTable( tableName: string, fileName: string, options?: ImportOptions ): Promise importTableAsync( tableName: string, fileName: string, options?: ImportOptions ): Promise importTableGeo( tableName: string, fileName: string, options?: ImportOptions ): Promise importTableGeoAsync( tableName: string, fileName: string, options?: ImportOptions ): Promise detectColumnTypes(fileName: string, options?: ImportOptions): Promise detectColumnTypesAsync( fileName: string, options?: ImportOptions ): Promise // Dashboard management getDashboards(): Promise getDashboardsAsync(): Promise createDashboard( dashboardName: string, dashboardState: string, imageHash: string, dashboardMetadata?: string ): Promise createDashboardAsync( dashboardName: string, dashboardState: string, imageHash: string, dashboardMetadata?: string ): Promise replaceDashboard( dashboardId: number, dashboardName: string, dashboardState: string, imageHash: string, dashboardMetadata?: string ): Promise replaceDashboardAsync( dashboardId: number, dashboardName: string, dashboardState: string, imageHash: string, dashboardMetadata?: string ): Promise deleteDashboard(dashboardId: number): Promise deleteDashboardAsync(dashboardId: number): Promise // User management getUsers(): Promise getUsersAsync(): Promise createUser( userName: string, userPassword: string, isSuper?: boolean ): Promise createUserAsync( userName: string, userPassword: string, isSuper?: boolean ): Promise deleteUser(userName: string): Promise deleteUserAsync(userName: string): Promise // Database information getDatabases(): Promise getDatabasesAsync(): Promise getStatus(): Promise getStatusAsync(): Promise getHardwareInfo(): Promise getHardwareInfoAsync(): Promise getMemory(): Promise getMemoryAsync(): Promise getRoles(): Promise getRolesAsync(): Promise // Rendering methods renderVega(widget: any, options?: any, vega?: any): Promise renderVegaAsync(widget: any, options?: any, vega?: any): Promise getRenderStatus(): Promise getRenderStatusAsync(): Promise // Utility methods wrapTimeout(promise: Promise, timeout: number | null): Promise convertFromThriftTypes(fields: any): FieldInfo[] // Internal methods executeSingleClient(method: string, ...args: any[]): Promise executeAllClients(method: string, ...args: any[]): Promise addPendingRequest(requestId: string): void } // Default export export default DbCon // Re-export Thrift types export * from "./thrift/common_types" export * from "./thrift/completion_hints_types" export * from "./thrift/extension_functions_types" export * from "./thrift/Heavy" export * from "./thrift/heavy_types" export * from "./thrift/serialized_result_set_types" }