Skip to content

Commit 3a4ff53

Browse files
committed
update: new api
1 parent fdc7f58 commit 3a4ff53

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

types/any-menu.d.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,16 @@ export interface PluginInterfaceCtx {
5656
urlRequest: (conf: UrlRequestConfig) => Promise<UrlResponse | null>;
5757
/** 隐藏面板(低风险) */
5858
hidePanel: (list?: string[]) => void;
59+
/** 读取文件(高风险) */
60+
readFile: (basePath: 'CONFIG'|'PUBLIC', relPath: string) => Promise<string | null>;
61+
/** 写入文件(高风险) */
62+
writeFile: (basePath: 'CONFIG'|'PUBLIC', relPath: string, content: string) => Promise<boolean>;
5963
/** 显示面板(低风险) */
6064
showPanel: (list?: string[]) => void;
6165
/** 注册子面板(中风险) */
62-
registerSubPanel?: (options: { id: string; el: HTMLElement }) => void;
66+
registerSubPanel: (options: { id: string; el: HTMLElement }) => void;
6367
/** 注销子面板 */
64-
unregisterSubPanel?: (id: string) => void;
68+
unregisterSubPanel: (id: string) => void;
6569
};
6670
}
6771

vite.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export default defineConfig({
55
lib: { // Library 模式:输出单个 ES 模块文件
66
entry: 'src/index.ts',
77
formats: ['es'],
8-
fileName: () => 'hello-world.js', // 输出文件名:dist/hello-world.js
8+
fileName: () => 'hello-world.js', // 输出文件名
99
},
1010
rollupOptions: {
1111
external: [],

0 commit comments

Comments
 (0)