mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-04-28 04:19:27 -07:00
Windows update (#49)
This commit is contained in:
75
src/types/session-bindings.ts
Normal file
75
src/types/session-bindings.ts
Normal file
@@ -0,0 +1,75 @@
|
||||
export type SessionKeyModifier = 'ctrl' | 'alt' | 'shift' | 'meta';
|
||||
|
||||
export type SessionActionId =
|
||||
| 'toggleStatsOverlay'
|
||||
| 'toggleVisibleOverlay'
|
||||
| 'copySubtitle'
|
||||
| 'copySubtitleMultiple'
|
||||
| 'updateLastCardFromClipboard'
|
||||
| 'triggerFieldGrouping'
|
||||
| 'triggerSubsync'
|
||||
| 'mineSentence'
|
||||
| 'mineSentenceMultiple'
|
||||
| 'toggleSecondarySub'
|
||||
| 'toggleSubtitleSidebar'
|
||||
| 'markAudioCard'
|
||||
| 'openRuntimeOptions'
|
||||
| 'openSessionHelp'
|
||||
| 'openControllerSelect'
|
||||
| 'openControllerDebug'
|
||||
| 'openJimaku'
|
||||
| 'openYoutubePicker'
|
||||
| 'openPlaylistBrowser'
|
||||
| 'replayCurrentSubtitle'
|
||||
| 'playNextSubtitle'
|
||||
| 'shiftSubDelayPrevLine'
|
||||
| 'shiftSubDelayNextLine'
|
||||
| 'cycleRuntimeOption';
|
||||
|
||||
export interface SessionKeySpec {
|
||||
code: string;
|
||||
modifiers: SessionKeyModifier[];
|
||||
}
|
||||
|
||||
export interface SessionBindingWarning {
|
||||
kind: 'unsupported' | 'conflict' | 'deprecated-config';
|
||||
path: string;
|
||||
message: string;
|
||||
value: unknown;
|
||||
conflictingPaths?: string[];
|
||||
}
|
||||
|
||||
export interface SessionActionPayload {
|
||||
count?: number;
|
||||
runtimeOptionId?: string;
|
||||
direction?: 1 | -1;
|
||||
}
|
||||
|
||||
type CompiledSessionBindingBase = {
|
||||
sourcePath: string;
|
||||
originalKey: string;
|
||||
key: SessionKeySpec;
|
||||
};
|
||||
|
||||
export interface CompiledMpvCommandBinding extends CompiledSessionBindingBase {
|
||||
actionType: 'mpv-command';
|
||||
command: (string | number)[];
|
||||
}
|
||||
|
||||
export interface CompiledSessionActionBinding extends CompiledSessionBindingBase {
|
||||
actionType: 'session-action';
|
||||
actionId: SessionActionId;
|
||||
payload?: SessionActionPayload;
|
||||
}
|
||||
|
||||
export type CompiledSessionBinding =
|
||||
| CompiledMpvCommandBinding
|
||||
| CompiledSessionActionBinding;
|
||||
|
||||
export interface PluginSessionBindingsArtifact {
|
||||
version: 1;
|
||||
generatedAt: string;
|
||||
numericSelectionTimeoutMs: number;
|
||||
bindings: CompiledSessionBinding[];
|
||||
warnings: SessionBindingWarning[];
|
||||
}
|
||||
Reference in New Issue
Block a user