重构项目,方便开发

This commit is contained in:
super
2026-03-19 13:15:47 +08:00
parent fb2e5ccea5
commit 1e63ab291b
38 changed files with 5940 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
export interface PywebviewApi {
select_brand_xlsx_files?: () => Promise<string[]>
select_brand_folder?: () => Promise<string | null>
select_folder?: () => Promise<string | null>
save_template_xlsx?: () => Promise<{ success: boolean; path?: string; error?: string }>
save_template_zip?: () => Promise<{ success: boolean; path?: string; error?: string }>
save_file_from_url?: (url: string, filename: string) => Promise<{ success: boolean; path?: string; error?: string }>
}
declare global {
interface Window {
pywebview?: {
api?: PywebviewApi
}
}
}
export function getPywebviewApi() {
return window.pywebview?.api
}
export function hasPywebview() {
return Boolean(getPywebviewApi())
}