feat(config): add configuration window (#70)

This commit is contained in:
2026-05-21 04:16:21 -07:00
committed by GitHub
parent a54f03f0cd
commit dc52bc2fba
287 changed files with 14507 additions and 8134 deletions
+18 -1
View File
@@ -70,6 +70,7 @@ export type FrequencyDictionaryMatchMode = 'headword' | 'surface';
export interface SubtitleStyleConfig {
primaryDefaultMode?: PrimarySubMode;
css?: Record<string, string>;
enableJlpt?: boolean;
preserveLineBreaks?: boolean;
autoPauseVideoOnHover?: boolean;
@@ -89,6 +90,8 @@ export interface SubtitleStyleConfig {
fontKerning?: string;
textRendering?: string;
textShadow?: string;
paintOrder?: string;
WebkitTextStroke?: string;
backdropFilter?: string;
backgroundColor?: string;
nPlusOneColor?: string;
@@ -110,6 +113,7 @@ export interface SubtitleStyleConfig {
bandedColors?: [string, string, string, string, string];
};
secondary?: {
css?: Record<string, string>;
fontFamily?: string;
fontSize?: number;
fontColor?: string;
@@ -121,11 +125,15 @@ export interface SubtitleStyleConfig {
fontKerning?: string;
textRendering?: string;
textShadow?: string;
paintOrder?: string;
WebkitTextStroke?: string;
backdropFilter?: string;
backgroundColor?: string;
};
}
export type SubtitleRendererStyleConfig = SubtitleStyleConfig;
export interface TokenPos1ExclusionConfig {
defaults?: string[];
add?: string[];
@@ -163,6 +171,7 @@ export interface SubtitleSidebarConfig {
toggleKey?: string;
pauseVideoOnHover?: boolean;
autoScroll?: boolean;
css?: Record<string, string>;
maxWidth?: number;
opacity?: number;
backgroundColor?: string;
@@ -175,6 +184,14 @@ export interface SubtitleSidebarConfig {
hoverLineBackgroundColor?: string;
}
export type ResolvedSubtitleSidebarConfig = Required<Omit<SubtitleSidebarConfig, 'css'>> & {
css: Record<string, string>;
};
export type SubtitleSidebarSnapshotConfig = Required<Omit<SubtitleSidebarConfig, 'css'>> & {
css?: Record<string, string>;
};
export interface SubtitleData {
text: string;
tokens: MergedToken[] | null;
@@ -190,7 +207,7 @@ export interface SubtitleSidebarSnapshot {
startTime: number | null;
endTime: number | null;
};
config: Required<SubtitleSidebarConfig>;
config: SubtitleSidebarSnapshotConfig;
}
export interface SubtitleHoverTokenPayload {