mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-01 18:22:41 -08:00
refactor: extract anki jimaku ipc deps runtime service
This commit is contained in:
@@ -25,7 +25,7 @@ interface SubtitleTimingTrackerLike {
|
||||
cleanup: () => void;
|
||||
}
|
||||
|
||||
export function registerAnkiJimakuIpcRuntimeService(options: {
|
||||
export interface AnkiJimakuIpcRuntimeOptions {
|
||||
patchAnkiConnectEnabled: (enabled: boolean) => void;
|
||||
getResolvedConfig: () => { ankiConnect?: AnkiConnectConfig };
|
||||
getRuntimeOptionsManager: () => RuntimeOptionsManagerLike | null;
|
||||
@@ -55,7 +55,11 @@ export function registerAnkiJimakuIpcRuntimeService(options: {
|
||||
destPath: string,
|
||||
headers: Record<string, string>,
|
||||
) => Promise<{ ok: true; path: string } | { ok: false; error: { error: string; code?: number; retryAfter?: number } }>;
|
||||
}): void {
|
||||
}
|
||||
|
||||
export function registerAnkiJimakuIpcRuntimeService(
|
||||
options: AnkiJimakuIpcRuntimeOptions,
|
||||
): void {
|
||||
registerAnkiJimakuIpcHandlers({
|
||||
setAnkiConnectEnabled: (enabled) => {
|
||||
options.patchAnkiConnectEnabled(enabled);
|
||||
|
||||
Reference in New Issue
Block a user