Skip to content

Commit b08ce30

Browse files
committed
fix: correct NativeAddon.parseFiles signature and relax transaction type
parseFiles: fix parameter order/types to match actual call site in parser.ts (string[], rootDir, dataflow, ast) instead of ({filePath,source}[], dataflow, ast). transaction: relax parameter types to be compatible with better-sqlite3's generic Transaction<F>, allowing direct cast without intermediate unknown.
1 parent 7465f9b commit b08ce30

1 file changed

Lines changed: 3 additions & 6 deletions

File tree

src/types.ts

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,8 @@ export interface BetterSqlite3Database {
16581658
exec(sql: string): void;
16591659
close(): void;
16601660
pragma(sql: string): unknown;
1661-
transaction<T>(fn: (...args: unknown[]) => T): (...args: unknown[]) => T;
1661+
// biome-ignore lint/suspicious/noExplicitAny: must be compatible with better-sqlite3's generic Transaction<F> return type
1662+
transaction<T>(fn: (...args: any[]) => T): (...args: any[]) => T;
16621663
readonly open: boolean;
16631664
readonly name: string;
16641665
}
@@ -1673,11 +1674,7 @@ export type StmtCache<TRow = unknown> = WeakMap<BetterSqlite3Database, SqliteSta
16731674
/** The native napi-rs addon interface (crates/codegraph-core). */
16741675
export interface NativeAddon {
16751676
parseFile(filePath: string, source: string, dataflow: boolean, ast: boolean): unknown;
1676-
parseFiles(
1677-
files: Array<{ filePath: string; source: string }>,
1678-
dataflow: boolean,
1679-
ast: boolean,
1680-
): unknown[];
1677+
parseFiles(files: string[], rootDir: string, dataflow: boolean, ast: boolean): unknown[];
16811678
resolveImport(fromFile: string, importSource: string, rootDir: string, aliases: unknown): string;
16821679
resolveImports(
16831680
items: Array<{ fromFile: string; importSource: string }>,

0 commit comments

Comments
 (0)