mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-07-29 01:01:34 -07:00
refactor(launcher): split history.ts into focused modules
- Extract types → history-types.ts, DB layer → history-db.ts, navigation → history-navigation.ts - history.ts becomes a re-export barrel - Fix findNextEpisode: deleted-file fallback now advances to next season - Add isReadonlyWalRetryError (WAL-mode guard before read-write retry) - Strengthen bun-sqlite.d.ts with generics on Statement/query/prepare
This commit is contained in:
Vendored
+11
-7
@@ -7,10 +7,10 @@ declare module 'bun:sqlite' {
|
||||
lastInsertRowid: number | bigint;
|
||||
}
|
||||
|
||||
export interface Statement {
|
||||
all(...params: unknown[]): unknown[];
|
||||
get(...params: unknown[]): unknown;
|
||||
run(...params: unknown[]): RunResult;
|
||||
export interface Statement<ReturnType = unknown, ParamsType extends unknown[] = unknown[]> {
|
||||
all(...params: ParamsType): ReturnType[];
|
||||
get(...params: ParamsType): ReturnType | undefined;
|
||||
run(...params: ParamsType): RunResult;
|
||||
}
|
||||
|
||||
export class Database {
|
||||
@@ -18,9 +18,13 @@ declare module 'bun:sqlite' {
|
||||
filename: string,
|
||||
options?: { readonly?: boolean; readwrite?: boolean; create?: boolean },
|
||||
);
|
||||
query(sql: string): Statement;
|
||||
prepare(sql: string): Statement;
|
||||
query<ReturnType = unknown, ParamsType extends unknown[] = unknown[]>(
|
||||
sql: string,
|
||||
): Statement<ReturnType, ParamsType>;
|
||||
prepare<ReturnType = unknown, ParamsType extends unknown[] = unknown[]>(
|
||||
sql: string,
|
||||
): Statement<ReturnType, ParamsType>;
|
||||
run(sql: string, ...params: unknown[]): RunResult;
|
||||
close(): void;
|
||||
close(throwOnError?: boolean): void;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user