重构: 前端Vue3+Tailwind+Vite构建管线+设置组件拆分
This commit is contained in:
32
web-ui/src/settings/composables/useGoBridge.ts
Normal file
32
web-ui/src/settings/composables/useGoBridge.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
const w = window as any
|
||||
|
||||
export const go = {
|
||||
loadAllSettings: (): Promise<string> => w.loadAllSettings(),
|
||||
saveToggles: (data: Record<string, boolean>) => w.saveToggles(JSON.stringify(data)),
|
||||
saveLayout: (layout: string) => w.saveLayout(layout),
|
||||
saveZodiac: (zodiac: string) => w.saveZodiac(zodiac),
|
||||
saveCity: (cityId: string) => w.saveCity(cityId),
|
||||
saveWallpaperType: (type: string, theme: string) => w.saveWallpaperType(type, theme),
|
||||
pickLocalImage: (): Promise<string> => w.pickLocalImage(),
|
||||
enableBing: () => w.enableBing(),
|
||||
bingPrev: (): Promise<string> => w.bingPrev(),
|
||||
bingNext: (): Promise<string> => w.bingNext(),
|
||||
bingToggleFavorite: (): Promise<string> => w.bingToggleFavorite(),
|
||||
getBingInfo: (): Promise<string> => w.getBingInfo(),
|
||||
saveBingAutoRefresh: (val: boolean) => w.saveBingAutoRefresh(val),
|
||||
getBingFavorites: (): Promise<string> => w.getBingFavorites(),
|
||||
bingSetByIdx: (idx: number): Promise<string> => w.bingSetByIdx(idx),
|
||||
bingThumbDataURI: (filename: string): Promise<string> => w.bingThumbDataURI(filename),
|
||||
pickSolidColor: (): Promise<string> => w.pickSolidColor(),
|
||||
pickGradientColor: (): Promise<string> => w.pickGradientColor(),
|
||||
addSavedColor: (c1: string, c2: string, gradient: boolean) => w.addSavedColor(c1, c2, gradient),
|
||||
removeSavedColor: (idx: number): Promise<string> => w.removeSavedColor(idx),
|
||||
applySavedColor: (idx: number) => w.applySavedColor(idx),
|
||||
saveWallpaperText: (text: string) => w.saveWallpaperText(text),
|
||||
saveKnowledgeKeyword: (keyword: string) => w.saveKnowledgeKeyword(keyword),
|
||||
saveKnowledgePrompt: (prompt: string) => w.saveKnowledgePrompt(prompt),
|
||||
pickPhotoDir: (): Promise<string> => w.pickPhotoDir(),
|
||||
clearPhotoDir: () => w.clearPhotoDir(),
|
||||
savePhotoInterval: (val: number) => w.savePhotoInterval(val),
|
||||
resizeToFit: (w: number, h: number) => w.resizeToFit(w, h),
|
||||
}
|
||||
Reference in New Issue
Block a user