mirror of
https://github.com/th-ch/youtube-music.git
synced 2026-01-11 02:31:45 +00:00
feat(plugin): migrate some plugin (WIP)
Co-authored-by: JellyBrick <shlee1503@naver.com>
This commit is contained in:
37
src/plugins/precise-volume/index.ts
Normal file
37
src/plugins/precise-volume/index.ts
Normal file
@ -0,0 +1,37 @@
|
||||
import hudStyle from './volume-hud.css?inline';
|
||||
|
||||
import { createPluginBuilder } from '../utils/builder';
|
||||
|
||||
export type PreciseVolumePluginConfig = {
|
||||
enabled: boolean;
|
||||
steps: number;
|
||||
arrowsShortcut: boolean;
|
||||
globalShortcuts: {
|
||||
volumeUp: string;
|
||||
volumeDown: string;
|
||||
};
|
||||
savedVolume: number | undefined;
|
||||
};
|
||||
|
||||
const builder = createPluginBuilder('precise-volume', {
|
||||
name: 'Precise Volume',
|
||||
config: {
|
||||
enabled: false,
|
||||
steps: 1, // Percentage of volume to change
|
||||
arrowsShortcut: true, // Enable ArrowUp + ArrowDown local shortcuts
|
||||
globalShortcuts: {
|
||||
volumeUp: '',
|
||||
volumeDown: '',
|
||||
},
|
||||
savedVolume: undefined, // Plugin save volume between session here
|
||||
} as PreciseVolumePluginConfig,
|
||||
styles: [hudStyle],
|
||||
});
|
||||
|
||||
export default builder;
|
||||
|
||||
declare global {
|
||||
interface PluginBuilderList {
|
||||
[builder.id]: typeof builder;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user