forked from jsnbuchanan/crowd-funder-for-time-pwa
refactor: add strict typing to core database methods in PlatformServiceMixin
- Replace all `any` types in $db, $exec, $one, $query, $first, and $contacts with proper interfaces: - Use QueryExecResult and DatabaseExecResult for raw database operations - Use Contact[] for contact queries - Add generics for mapped query results - Update PlatformService and database interfaces to match new types - Remove unused type imports and fix linter errors - Reduces risk of runtime errors and improves type safety for all database access
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { QueryExecResult } from "@/interfaces/database";
|
||||
import { QueryExecResult, DatabaseExecResult } from "@/interfaces/database";
|
||||
|
||||
/**
|
||||
* Represents the result of an image capture or selection operation.
|
||||
@@ -145,10 +145,7 @@ export interface PlatformService {
|
||||
* @param params - The parameters to pass to the statement
|
||||
* @returns Promise resolving to the result of the statement
|
||||
*/
|
||||
dbExec(
|
||||
sql: string,
|
||||
params?: unknown[],
|
||||
): Promise<{ changes: number; lastId?: number }>;
|
||||
dbExec(sql: string, params?: unknown[]): Promise<DatabaseExecResult>;
|
||||
|
||||
/**
|
||||
* Executes a SQL query and returns the first row as an array.
|
||||
|
||||
Reference in New Issue
Block a user