interface ResultStream { close: () => Promise; read: () => Promise; } interface StatementWrap { isQuerySync: () => boolean; close: () => Promise; updated: () => Promise; getMetaData: () => Promise; asStreamSync: (bufferSize: number) => ResultStream; asArray: () => Promise; next: () => Promise; } interface TablesReadStream { close: () => Promise; read: () => Promise; getMetaData: () => Promise; } interface JDBCConnection { query: (sql: string, jsonParams: string, trim: boolean) => Promise; queryAsStream: (sql: string, jsonParams: string, bufferSize: number) => Promise; execute: (sql: string, jsonParams: string) => Promise; getTablesAsStreamSync: (catalog: string, schema: string, tableName: string) => TablesReadStream; getColumns: (catalog: string, schema: string, tableNamePattern: string, columnNamePattern: string) => Promise; update: (sql: string, jsonParams: string) => Promise; batchUpdate: (sql: string, jsonParams: string) => Promise; insertAndGetId: (sql: string, jsonParams: string) => Promise; } interface Transaction extends JDBCConnection { commit: () => Promise; rollback: () => Promise; end: () => Promise; } interface Pgm { run: (jsonParams: string, timeout: number) => Promise; } interface MessageQ { read: (wait: number) => Promise; sendInformational: (message: string) => Promise; } interface KeyedDataQueueResponse { getData: () => Promise; write: (data: string) => Promise; } interface KeyedDataQ { read: (key: string, wait: number) => Promise; readResponse: (key: string, wait: number, writeKeyLength: number) => Promise; write: (key: string, data: string) => Promise; } interface AS400Message { getText: () => Promise; } interface MessageFileHandler { read: (messageId: string) => Promise; } interface IfsReadStream { read: () => Promise; } interface IfsWriteStream { write: (data: Buffer) => Promise; flush: () => Promise; } interface JT400 extends JDBCConnection { createTransactionSync: () => Transaction; getPrimaryKeys: (catalog: string, schema: string, table: string) => Promise; pgmSync: (programName: string, paramsSchemaJsonStr: string, libraryName?: string, ccsid?: number) => Pgm; openMessageQ: (name: string, isPath: boolean) => Promise; createKeyedDataQSync: (name: string) => KeyedDataQ; openMessageFile: (path: string) => Promise; createIfsReadStream: (fileName: string) => Promise; createIfsWriteStream: (folderPath: string, fileName: string, append: boolean, ccsid?: number) => Promise; listIfsFiles: (folderName: string) => Promise; moveIfsFile: (fileName: string, newFileName: string) => Promise; deleteIfsFile: (fileName: string) => Promise; getIfsFileMetadata: (fileName: string) => Promise; close: () => Promise; } export type { AS400Message, IfsReadStream, IfsWriteStream, JDBCConnection, JT400, KeyedDataQ, KeyedDataQueueResponse, MessageFileHandler, MessageQ, Pgm, ResultStream, StatementWrap, TablesReadStream, Transaction };