Browse Source
- Remove src/types/global.d.ts and src/types/modules.d.ts (unused duplicates) - Keep essential type files: sql.js.d.ts and absurd-sql.d.ts - Maintain all existing type definitions and functionality The removed files contained broken import paths and duplicate type declarations that were never actually used by the codebase. All necessary type support for @jlongster/sql.js and absurd-sql modules is preserved in the remaining files. Files removed: - src/types/global.d.ts (unused, had broken imports) - src/types/modules.d.ts (unused, had broken imports) Files kept: - src/types/sql.js.d.ts (comprehensive @jlongster/sql.js types) - src/types/absurd-sql.d.ts (comprehensive absurd-sql types) - src/interfaces/database.ts (core database types)pull/151/head
2 changed files with 0 additions and 150 deletions
@ -1,83 +0,0 @@ |
|||
import type { QueryExecResult, SqlValue } from "./database"; |
|||
|
|||
declare module '@jlongster/sql.js' { |
|||
interface SQL { |
|||
Database: new (path: string, options?: { filename: boolean }) => Database; |
|||
FS: { |
|||
mkdir: (path: string) => void; |
|||
mount: (fs: any, options: any, path: string) => void; |
|||
open: (path: string, flags: string) => any; |
|||
close: (stream: any) => void; |
|||
}; |
|||
register_for_idb: (fs: any) => void; |
|||
} |
|||
|
|||
interface Database { |
|||
exec: (sql: string, params?: unknown[]) => Promise<QueryExecResult[]>; |
|||
run: (sql: string, params?: unknown[]) => Promise<{ changes: number; lastId?: number }>; |
|||
get: (sql: string, params?: unknown[]) => Promise<SqlValue[]>; |
|||
all: (sql: string, params?: unknown[]) => Promise<SqlValue[][]>; |
|||
prepare: (sql: string) => Promise<Statement>; |
|||
close: () => void; |
|||
} |
|||
|
|||
interface Statement { |
|||
run: (params?: unknown[]) => Promise<{ changes: number; lastId?: number }>; |
|||
get: (params?: unknown[]) => Promise<SqlValue[]>; |
|||
all: (params?: unknown[]) => Promise<SqlValue[][]>; |
|||
finalize: () => void; |
|||
} |
|||
|
|||
const initSqlJs: (options?: { |
|||
locateFile?: (file: string) => string; |
|||
}) => Promise<SQL>; |
|||
|
|||
export default initSqlJs; |
|||
} |
|||
|
|||
/** |
|||
* Electron API types for the main world context bridge. |
|||
* |
|||
* These types define the secure IPC APIs exposed by the preload script |
|||
* to the renderer process for native Electron functionality. |
|||
*/ |
|||
interface ElectronAPI { |
|||
/** |
|||
* Export data to the user's Downloads folder. |
|||
* |
|||
* @param fileName - The name of the file to save (e.g., 'backup-2025-07-06.json') |
|||
* @param data - The content to write to the file (string) |
|||
* @returns Promise with success status, file path, or error message |
|||
*/ |
|||
exportData: (fileName: string, data: string) => Promise<{ |
|||
success: boolean; |
|||
path?: string; |
|||
error?: string; |
|||
}>; |
|||
} |
|||
|
|||
/** |
|||
* Global window interface extension for Electron APIs. |
|||
* |
|||
* This makes the electronAPI available on the window object |
|||
* in TypeScript without type errors. |
|||
*/ |
|||
declare global { |
|||
interface Window { |
|||
electronAPI: ElectronAPI; |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Vue instance interface extension for global properties. |
|||
* |
|||
* This makes global properties available on Vue instances |
|||
* in TypeScript without type errors. |
|||
*/ |
|||
declare module 'vue' { |
|||
interface ComponentCustomProperties { |
|||
$notify: (notification: any, timeout?: number) => void; |
|||
$route: import('vue-router').RouteLocationNormalizedLoaded; |
|||
$router: import('vue-router').Router; |
|||
} |
|||
} |
@ -1,67 +0,0 @@ |
|||
import type { QueryExecResult, SqlValue } from "./database"; |
|||
|
|||
declare module '@jlongster/sql.js' { |
|||
interface SQL { |
|||
Database: new (path: string, options?: { filename: boolean }) => Database; |
|||
FS: { |
|||
mkdir: (path: string) => void; |
|||
mount: (fs: any, options: any, path: string) => void; |
|||
open: (path: string, flags: string) => any; |
|||
close: (stream: any) => void; |
|||
}; |
|||
register_for_idb: (fs: any) => void; |
|||
} |
|||
|
|||
interface Database { |
|||
exec: (sql: string, params?: unknown[]) => Promise<QueryExecResult[]>; |
|||
run: (sql: string, params?: unknown[]) => Promise<{ changes: number; lastId?: number }>; |
|||
get: (sql: string, params?: unknown[]) => Promise<SqlValue[]>; |
|||
all: (sql: string, params?: unknown[]) => Promise<SqlValue[][]>; |
|||
prepare: (sql: string) => Promise<Statement>; |
|||
close: () => void; |
|||
} |
|||
|
|||
interface Statement { |
|||
run: (params?: unknown[]) => Promise<{ changes: number; lastId?: number }>; |
|||
get: (params?: unknown[]) => Promise<SqlValue[]>; |
|||
all: (params?: unknown[]) => Promise<SqlValue[][]>; |
|||
finalize: () => void; |
|||
} |
|||
|
|||
const initSqlJs: (options?: { |
|||
locateFile?: (file: string) => string; |
|||
}) => Promise<SQL>; |
|||
|
|||
export default initSqlJs; |
|||
} |
|||
|
|||
declare module 'absurd-sql' { |
|||
import type { SQL } from '@jlongster/sql.js'; |
|||
export class SQLiteFS { |
|||
constructor(fs: any, backend: any); |
|||
} |
|||
} |
|||
|
|||
declare module 'absurd-sql/dist/indexeddb-backend' { |
|||
export default class IndexedDBBackend { |
|||
constructor(); |
|||
} |
|||
} |
|||
|
|||
declare module 'absurd-sql/dist/indexeddb-main-thread' { |
|||
import type { QueryExecResult } from './database'; |
|||
export interface SQLiteOptions { |
|||
filename?: string; |
|||
autoLoad?: boolean; |
|||
debug?: boolean; |
|||
} |
|||
|
|||
export interface SQLiteDatabase { |
|||
exec: (sql: string, params?: unknown[]) => Promise<QueryExecResult[]>; |
|||
close: () => Promise<void>; |
|||
} |
|||
|
|||
export function initSqlJs(options?: any): Promise<any>; |
|||
export function createDatabase(options?: SQLiteOptions): Promise<SQLiteDatabase>; |
|||
export function openDatabase(options?: SQLiteOptions): Promise<SQLiteDatabase>; |
|||
} |
Loading…
Reference in new issue