diff --git a/src/types/global.d.ts b/src/types/global.d.ts deleted file mode 100644 index 22d2be56..00000000 --- a/src/types/global.d.ts +++ /dev/null @@ -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; - run: (sql: string, params?: unknown[]) => Promise<{ changes: number; lastId?: number }>; - get: (sql: string, params?: unknown[]) => Promise; - all: (sql: string, params?: unknown[]) => Promise; - prepare: (sql: string) => Promise; - close: () => void; - } - - interface Statement { - run: (params?: unknown[]) => Promise<{ changes: number; lastId?: number }>; - get: (params?: unknown[]) => Promise; - all: (params?: unknown[]) => Promise; - finalize: () => void; - } - - const initSqlJs: (options?: { - locateFile?: (file: string) => string; - }) => Promise; - - 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; - } -} \ No newline at end of file diff --git a/src/types/modules.d.ts b/src/types/modules.d.ts deleted file mode 100644 index 62eb3f8e..00000000 --- a/src/types/modules.d.ts +++ /dev/null @@ -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; - run: (sql: string, params?: unknown[]) => Promise<{ changes: number; lastId?: number }>; - get: (sql: string, params?: unknown[]) => Promise; - all: (sql: string, params?: unknown[]) => Promise; - prepare: (sql: string) => Promise; - close: () => void; - } - - interface Statement { - run: (params?: unknown[]) => Promise<{ changes: number; lastId?: number }>; - get: (params?: unknown[]) => Promise; - all: (params?: unknown[]) => Promise; - finalize: () => void; - } - - const initSqlJs: (options?: { - locateFile?: (file: string) => string; - }) => Promise; - - 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; - close: () => Promise; - } - - export function initSqlJs(options?: any): Promise; - export function createDatabase(options?: SQLiteOptions): Promise; - export function openDatabase(options?: SQLiteOptions): Promise; -} \ No newline at end of file