Files
youtube-music/src/plugins/shortcuts/index.ts
2023-12-02 02:33:40 +09:00

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,
});