@@ -14,24 +14,16 @@ import { ConfigurationSection, ExtensionId, FullExtensionId, SidebarLeft, Sideba
1414import { IsCursorIDE } from './helpers' ;
1515
1616import type { DatabaseDocument , DocumentModification } from './databaseModel' ;
17- import type { CellValue , RecordId , DialogConfig , DialogButton , CellUpdate , TableQueryOptions , TableCountOptions , QueryResultSet , SchemaSnapshot , ColumnMetadata , CellContentType } from './core/types' ;
17+ import type { CellValue , RecordId , DialogConfig , DialogButton , CellUpdate , TableQueryOptions , TableCountOptions , QueryResultSet , SchemaSnapshot , ColumnMetadata , CellContentType , ModificationEntry , DbParams , ExportOptions } from './core/types' ;
1818import { generateMergePatch } from './core/json-utils' ;
1919import { escapeIdentifier } from './core/sql-utils' ;
2020
21- // Legacy DbParams type for backward compatibility with webview
22- interface DbParams {
23- filename ?: string ;
24- table : string ;
25- name ?: string ;
26- uri ?: string ;
27- }
28-
2921// Type for Uint8Array-like objects (transferable over postMessage)
3022type Uint8ArrayLike = { buffer : ArrayBufferLike , byteOffset : number , byteLength : number } ;
3123
3224// Column type information
3325interface ColumnTypeInfo {
34- [ key : string ] : any ;
26+ [ key : string ] : unknown ;
3527}
3628
3729// Toast service interface for showing dialogs
@@ -562,7 +554,7 @@ export class HostBridge implements ToastService {
562554 /**
563555 * Apply edits to the database.
564556 */
565- async applyEdits ( edits : any , signal ?: any ) {
557+ async applyEdits ( edits : ModificationEntry [ ] , signal ?: AbortSignal ) {
566558 const { document } = this ;
567559 if ( ! document . databaseOperations ) {
568560 throw new Error ( "Database not initialized" ) ;
@@ -573,7 +565,7 @@ export class HostBridge implements ToastService {
573565 /**
574566 * Undo a database edit.
575567 */
576- async undo ( edit : any ) {
568+ async undo ( edit : ModificationEntry ) {
577569 const { document } = this ;
578570 if ( ! document . databaseOperations ) {
579571 throw new Error ( "Database not initialized" ) ;
@@ -584,7 +576,7 @@ export class HostBridge implements ToastService {
584576 /**
585577 * Redo a database edit.
586578 */
587- async redo ( edit : any ) {
579+ async redo ( edit : ModificationEntry ) {
588580 const { document } = this ;
589581 if ( ! document . databaseOperations ) {
590582 throw new Error ( "Database not initialized" ) ;
@@ -595,7 +587,7 @@ export class HostBridge implements ToastService {
595587 /**
596588 * Commit changes to the database.
597589 */
598- async commit ( signal ?: any ) {
590+ async commit ( signal ?: AbortSignal ) {
599591 const { document } = this ;
600592 if ( ! document . databaseOperations ) {
601593 throw new Error ( "Database not initialized" ) ;
@@ -606,7 +598,7 @@ export class HostBridge implements ToastService {
606598 /**
607599 * Rollback changes to the database.
608600 */
609- async rollback ( edits : any , signal ?: any ) {
601+ async rollback ( edits : ModificationEntry [ ] , signal ?: AbortSignal ) {
610602 const { document } = this ;
611603 if ( ! document . databaseOperations ) {
612604 throw new Error ( "Database not initialized" ) ;
@@ -725,7 +717,7 @@ export class HostBridge implements ToastService {
725717 cellParts = [ params . table , params . name || '-' , '__create__.sql' ] ;
726718 } else {
727719 // Determine file extension based on content type
728- const extname = await determineCellExtension ( colTypes , value , type ) ;
720+ const extname = await determineCellExtension ( value , type ) ;
729721 const cellFilename = ( colName || 'cell' ) + extname ;
730722
731723 // Use simple path structure
@@ -833,7 +825,7 @@ export class HostBridge implements ToastService {
833825 * @param exportOptions - Export format options
834826 * @param extras - Additional options
835827 */
836- async exportTable ( dbParams : DbParams , columns : string [ ] , dbOptions ?: any , tableStore ?: any , exportOptions ?: any , extras ?: any ) {
828+ async exportTable ( dbParams : DbParams , columns : string [ ] , dbOptions ?: unknown , tableStore ?: unknown , exportOptions ?: ExportOptions , extras ?: unknown ) {
837829 // Inject the URI of the current document so the command knows which database to use
838830 const enrichedParams = {
839831 ...dbParams ,
@@ -986,7 +978,7 @@ export class HostBridge implements ToastService {
986978 * @param type - File type result
987979 * @returns File extension including the dot
988980 */
989- async function determineCellExtension ( colTypes : ColumnTypeInfo , value ?: CellValue , type ?: CellContentType ) : Promise < string > {
981+ async function determineCellExtension ( value ?: CellValue , type ?: CellContentType ) : Promise < string > {
990982 // Default to .txt for text, .bin for binary
991983 if ( value instanceof Uint8Array || ( value && typeof value === 'object' && 'buffer' in value ) ) {
992984 // Check if it's a known binary format
0 commit comments