mirror of
https://github.com/BetterSEQTA/BetterSEQTA-Plus.git
synced 2026-06-06 19:54:39 +00:00
format: run prettify
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
import type { Plugin } from '@/plugins/core/types';
|
||||
import { BasePlugin } from '@/plugins/core/settings';
|
||||
import { booleanSetting, defineSettings, Setting } from '@/plugins/core/settingsHelpers';
|
||||
import type { Plugin } from "@/plugins/core/types";
|
||||
import { BasePlugin } from "@/plugins/core/settings";
|
||||
import {
|
||||
booleanSetting,
|
||||
defineSettings,
|
||||
Setting,
|
||||
} from "@/plugins/core/settingsHelpers";
|
||||
|
||||
// Step 1: Define settings with proper typing
|
||||
const settings = defineSettings({
|
||||
@@ -8,7 +12,7 @@ const settings = defineSettings({
|
||||
default: true,
|
||||
title: "Test Plugin",
|
||||
description: "Some random setting",
|
||||
})
|
||||
}),
|
||||
});
|
||||
|
||||
// Step 2: Create the plugin class with @Setting decorators
|
||||
@@ -21,32 +25,32 @@ class TestPluginClass extends BasePlugin<typeof settings> {
|
||||
const settingsInstance = new TestPluginClass();
|
||||
|
||||
const testPlugin: Plugin<typeof settings> = {
|
||||
id: 'test',
|
||||
name: 'Test Plugin',
|
||||
description: 'A test plugin for BetterSEQTA+',
|
||||
version: '1.0.0',
|
||||
id: "test",
|
||||
name: "Test Plugin",
|
||||
description: "A test plugin for BetterSEQTA+",
|
||||
version: "1.0.0",
|
||||
settings: settingsInstance.settings,
|
||||
disableToggle: true,
|
||||
|
||||
run: async (api) => {
|
||||
console.log('Test plugin running');
|
||||
console.log("Test plugin running");
|
||||
|
||||
api.events.on('ping', (data) => {
|
||||
console.log('Ping received! Page changed to: ', data);
|
||||
api.events.on("ping", (data) => {
|
||||
console.log("Ping received! Page changed to: ", data);
|
||||
});
|
||||
|
||||
const { unregister } = api.seqta.onPageChange((page) => {
|
||||
//console.log('Page changed to', page);
|
||||
api.events.emit('ping', page);
|
||||
api.events.emit("ping", page);
|
||||
|
||||
console.log('Current setting value:', api.settings.someSetting);
|
||||
console.log("Current setting value:", api.settings.someSetting);
|
||||
});
|
||||
|
||||
return () => {
|
||||
console.log('Test plugin stopped');
|
||||
console.log("Test plugin stopped");
|
||||
unregister();
|
||||
}
|
||||
}
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
export default testPlugin;
|
||||
|
||||
Reference in New Issue
Block a user