mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-03-20 12:11:28 -07:00
feat(stats): add stats server, API endpoints, config, and Anki integration
- Hono HTTP server with 20+ REST endpoints for stats data - Stats overlay BrowserWindow with toggle keybinding - IPC channel definitions and preload bridge - Stats config section (toggleKey, serverPort, autoStartServer, autoOpenBrowser) - Config resolver for stats section - AnkiConnect proxy endpoints (guiBrowse, notesInfo) - Note ID passthrough in card mining callback chain - Stats CLI command with autoOpenBrowser respect
This commit is contained in:
16
src/types.ts
16
src/types.ts
@@ -556,6 +556,13 @@ export interface YoutubeSubgenConfig {
|
||||
primarySubLanguages?: string[];
|
||||
}
|
||||
|
||||
export interface StatsConfig {
|
||||
toggleKey?: string;
|
||||
serverPort?: number;
|
||||
autoStartServer?: boolean;
|
||||
autoOpenBrowser?: boolean;
|
||||
}
|
||||
|
||||
export interface ImmersionTrackingConfig {
|
||||
enabled?: boolean;
|
||||
dbPath?: string;
|
||||
@@ -595,6 +602,7 @@ export interface Config {
|
||||
ai?: AiConfig;
|
||||
youtubeSubgen?: YoutubeSubgenConfig;
|
||||
immersionTracking?: ImmersionTrackingConfig;
|
||||
stats?: StatsConfig;
|
||||
logging?: {
|
||||
level?: 'debug' | 'info' | 'warn' | 'error';
|
||||
};
|
||||
@@ -790,6 +798,12 @@ export interface ResolvedConfig {
|
||||
vacuumIntervalDays: number;
|
||||
};
|
||||
};
|
||||
stats: {
|
||||
toggleKey: string;
|
||||
serverPort: number;
|
||||
autoStartServer: boolean;
|
||||
autoOpenBrowser: boolean;
|
||||
};
|
||||
logging: {
|
||||
level: 'debug' | 'info' | 'warn' | 'error';
|
||||
};
|
||||
@@ -976,6 +990,7 @@ export interface ElectronAPI {
|
||||
sendMpvCommand: (command: (string | number)[]) => void;
|
||||
getKeybindings: () => Promise<Keybinding[]>;
|
||||
getConfiguredShortcuts: () => Promise<Required<ShortcutsConfig>>;
|
||||
getStatsToggleKey: () => Promise<string>;
|
||||
getControllerConfig: () => Promise<ResolvedControllerConfig>;
|
||||
saveControllerPreference: (update: ControllerPreferenceUpdate) => Promise<void>;
|
||||
getJimakuMediaInfo: () => Promise<JimakuMediaInfo>;
|
||||
@@ -985,6 +1000,7 @@ export interface ElectronAPI {
|
||||
quitApp: () => void;
|
||||
toggleDevTools: () => void;
|
||||
toggleOverlay: () => void;
|
||||
toggleStatsOverlay: () => void;
|
||||
getAnkiConnectStatus: () => Promise<boolean>;
|
||||
setAnkiConnectEnabled: (enabled: boolean) => void;
|
||||
clearAnkiConnectHistory: () => void;
|
||||
|
||||
Reference in New Issue
Block a user