MCPcopy
hub / github.com/ZToolsCenter/ZTools / Window

Interface Window

src/renderer/src/env.d.ts:15–432  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

13
14declare global {
15 interface Window {
16 electron: {
17 ipcRenderer: {
18 send: (channel: string, ...args: any[]) => void
19 on: (channel: string, callback: (...args: any[]) => void) => () => void
20 }
21 }
22 ztools: {
23 getApps: () => Promise<Array<{ name: string; path: string; icon?: string }>>
24 getSystemSettings: () => Promise<any[]>
25 isWindows: () => Promise<boolean>
26 launch: (options: {
27 path: string
28 type?: 'direct' | 'plugin' | 'builtin' | 'file'
29 featureCode?: string
30 param?: any
31 name?: string
32 cmdType?: string // cmd 类型(用于判断是否添加历史记录)
33 confirmDialog?: any // 确认对话框配置
34 }) => Promise<any>
35 launchAsAdmin: (appPath: string, name?: string) => Promise<void>
36 hideWindow: () => void
37 resizeWindow: (height: number) => void
38 updateLaunchContext: (context: {
39 searchQuery: string
40 pastedImage: string | null
41 pastedFiles: Array<{ path: string; name: string; isDirectory: boolean }> | null
42 pastedText: string | null
43 }) => void
44 getWindowPosition: () => Promise<{ x: number; y: number }>
45 setWindowPosition: (x: number, y: number) => void
46 setWindowSizeLock: (lock: boolean) => void
47 setWindowOpacity: (opacity: number) => void
48 getWindowMaterial: () => Promise<'mica' | 'acrylic' | 'none'>
49 setTrayIconVisible: (visible: boolean) => Promise<void>
50 setWindowMaterial: (material: 'mica' | 'acrylic' | 'none') => Promise<{ success: boolean }>
51 setLaunchAtLogin: (enable: boolean) => Promise<void>
52 getLaunchAtLogin: () => Promise<boolean>
53 setTheme: (theme: string) => Promise<void>
54 openExternal: (url: string) => Promise<void>
55 copyToClipboard: (text: string) => Promise<void>
56 openTerminal: (path: string) => Promise<void>
57 getFinderPath: () => Promise<string | null>
58 analyzeImage: (imagePath: string) => Promise<{
59 isSimpleIcon: boolean
60 mainColor: string | null
61 isDark: boolean
62 needsAdaptation: boolean
63 }>
64 getFrontmostApp: () => Promise<{
65 name: string
66 bundleId: string
67 path: string
68 } | null>
69 activateApp: (
70 identifier: string,
71 type?: 'name' | 'bundleId' | 'path'
72 ) => Promise<{ success: boolean; error?: string }>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected