mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-12 02:51:46 +00:00
40 lines
832 B
TypeScript
40 lines
832 B
TypeScript
import { createPlugin } from '@/utils';
|
|
import { onMainLoad } from './main';
|
|
import { onMenu } from './menu';
|
|
import { t } from '@/i18n';
|
|
|
|
export type ShortcutMappingType = {
|
|
previous: string;
|
|
playPause: string;
|
|
next: string;
|
|
};
|
|
export type ShortcutsPluginConfig = {
|
|
enabled: boolean;
|
|
overrideMediaKeys: boolean;
|
|
global: ShortcutMappingType;
|
|
local: ShortcutMappingType;
|
|
};
|
|
|
|
export default createPlugin({
|
|
name: () => t('plugins.shortcuts.name'),
|
|
description: () => t('plugins.shortcuts.description'),
|
|
restartNeeded: true,
|
|
config: {
|
|
enabled: false,
|
|
overrideMediaKeys: false,
|
|
global: {
|
|
previous: '',
|
|
playPause: '',
|
|
next: '',
|
|
},
|
|
local: {
|
|
previous: '',
|
|
playPause: '',
|
|
next: '',
|
|
},
|
|
} as ShortcutsPluginConfig,
|
|
menu: onMenu,
|
|
|
|
backend: onMainLoad,
|
|
});
|