-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathglobal.d.ts
More file actions
117 lines (110 loc) · 3.75 KB
/
global.d.ts
File metadata and controls
117 lines (110 loc) · 3.75 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
export {};
// API Endpoint Types
interface RouteParam {
name: string;
type: string;
required: boolean;
description?: string;
}
interface SchemaField {
name: string;
type: string;
required: boolean;
children?: SchemaField[];
}
interface DependencyInfo {
name: string;
module: string;
type: 'service' | 'database' | 'external' | 'utility';
usage?: string;
}
interface GroupedDependency {
module: string;
moduleLabel: string;
type: 'service' | 'database' | 'external' | 'utility';
items: string[];
count: number;
}
interface ApiDependencies {
services: DependencyInfo[];
database: DependencyInfo[];
external: DependencyInfo[];
utilities: DependencyInfo[];
grouped: GroupedDependency[];
tables: string[];
apiCalls: string[];
}
interface ApiEndpoint {
path: string;
methods: ('GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS')[];
params: RouteParam[];
queryParams: RouteParam[];
requestBody?: SchemaField[];
responseBody?: SchemaField[];
responses: Array<{
statusCode?: number;
isError: boolean;
schema: SchemaField[];
}>;
dependencies?: ApiDependencies;
filePath: string;
relativePath: string;
lineNumber: number;
description?: string;
}
declare global {
interface Window {
electron: {
getApiPort: () => Promise<number>;
getDesktopPath: () => Promise<string>;
selectDirectory: () => Promise<string | null>;
watchDirectory: (path: string) => Promise<void>;
onDirectoryChanged: (callback: (path: string) => void) => void;
openPath: (path: string, line?: number, app?: string) => Promise<void>;
showItemInFolder: (path: string) => Promise<void>;
readTextFile: (path: string) => Promise<string>;
readImageAsBase64: (path: string) => Promise<string>;
listFiles: (args: { path: string; extensions?: string[]; sort?: 'name' | 'newest' | 'oldest' | 'type' }) => Promise<{ success: boolean; files: any[]; error?: string }>;
batchRename: (operations: { original: string; new: string }[]) => Promise<{ success: string[]; errors: string[] }>;
getFolderSize: (path: string) => Promise<number>;
getDirectoryStats: (path: string) => Promise<{ totalSize: number; fileCount: number; folderCount: number; types: Record<string, number> }>;
searchContent: (args: { directory: string; query: string; extensions?: string[] }) => Promise<{ matches: any[]; totalMatches: number }>;
analyzeDependencies: (path: string) => Promise<{ nodes: any[]; edges: any[] }>;
detectProject: (path: string) => Promise<{
path: string;
type: 'nextjs' | 'vite' | 'node' | 'python' | 'unknown';
isProject: boolean;
name?: string;
version?: string;
dependencies?: string[];
configFiles?: string[]
}>;
analyzeApiEndpoints: (path: string) => Promise<{
success: boolean;
endpoints: ApiEndpoint[];
error?: string
}>;
analyzeOpenAPI: (source: string) => Promise<{
success: boolean;
endpoints: ApiEndpoint[];
error?: string
}>;
analyzeRoute: (filePath: string) => Promise<{
routes: Array<{
method: 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH' | 'OPTIONS' | 'HEAD';
path: string;
filePath: string;
requestBody?: { properties: Array<{ name: string; type: string; optional: boolean }> };
responses: Array<{
schema: { properties: Array<{ name: string; type: string; optional: boolean }> };
statusCode?: number;
isError: boolean;
}>;
}>;
errors: string[];
}>;
getPathForFile: (file: File) => string;
getAvailableEditors: () => Promise<Array<{ name: string; path: string; key: string }>>;
};
}
}