-
Notifications
You must be signed in to change notification settings - Fork 1
/
init.ts
32 lines (29 loc) · 825 Bytes
/
init.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import { definePlugin } from "@/modules/plugin";
import SetuConfig from "#/setu-plugin/modules/SetuConfig";
import { Renderer } from "@/modules/renderer";
import cfgList from "./commands";
import routers from "./routes";
import { ExportConfig } from "@/modules/config";
export let config: ExportConfig<SetuConfig>;
export let render: Renderer;
export default definePlugin( {
name: "涩图",
cfgList,
repo: {
owner: "BennettChina",
repoName: "setu-plugin",
ref: "v3"
},
server: {
routers
},
publicDirs: [ "views", "components", "assets" ],
async mounted( params ) {
config = params.configRegister( "setu", SetuConfig.init );
params.setAlias( config.aliases );
config.on( "refresh", ( newCfg ) => {
params.setAlias( newCfg.aliases );
} )
render = params.renderRegister( "#app", "views" );
}
} )