craft-native 0.0.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +21 -0
- package/README.md +424 -0
- package/bin/cli.ts +937 -0
- package/dist/api/android-advanced.d.ts +737 -0
- package/dist/api/android-advanced.d.ts.map +1 -0
- package/dist/api/app.d.ts +432 -0
- package/dist/api/app.d.ts.map +1 -0
- package/dist/api/clipboard.d.ts +85 -0
- package/dist/api/clipboard.d.ts.map +1 -0
- package/dist/api/crypto.d.ts +79 -0
- package/dist/api/crypto.d.ts.map +1 -0
- package/dist/api/db.d.ts +427 -0
- package/dist/api/db.d.ts.map +1 -0
- package/dist/api/dialog.d.ts +141 -0
- package/dist/api/dialog.d.ts.map +1 -0
- package/dist/api/fs.d.ts +131 -0
- package/dist/api/fs.d.ts.map +1 -0
- package/dist/api/http.d.ts +196 -0
- package/dist/api/http.d.ts.map +1 -0
- package/dist/api/index.d.ts +38 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/ios-advanced.d.ts +833 -0
- package/dist/api/ios-advanced.d.ts.map +1 -0
- package/dist/api/macos-advanced.d.ts +721 -0
- package/dist/api/macos-advanced.d.ts.map +1 -0
- package/dist/api/media.d.ts +233 -0
- package/dist/api/media.d.ts.map +1 -0
- package/dist/api/mobile.d.ts +658 -0
- package/dist/api/mobile.d.ts.map +1 -0
- package/dist/api/process.d.ts +168 -0
- package/dist/api/process.d.ts.map +1 -0
- package/dist/api/sidebar.d.ts +125 -0
- package/dist/api/sidebar.d.ts.map +1 -0
- package/dist/api/tray.d.ts +410 -0
- package/dist/api/tray.d.ts.map +1 -0
- package/dist/api/window.d.ts +462 -0
- package/dist/api/window.d.ts.map +1 -0
- package/dist/api/windows-advanced.d.ts +719 -0
- package/dist/api/windows-advanced.d.ts.map +1 -0
- package/dist/assets/index.d.ts +69 -0
- package/dist/assets/index.d.ts.map +1 -0
- package/dist/binary-resolver.d.ts +39 -0
- package/dist/binary-resolver.d.ts.map +1 -0
- package/dist/bridge/android.d.ts +574 -0
- package/dist/bridge/android.d.ts.map +1 -0
- package/dist/bridge/core.d.ts +474 -0
- package/dist/bridge/core.d.ts.map +1 -0
- package/dist/bridge/ids.d.ts +18 -0
- package/dist/bridge/ids.d.ts.map +1 -0
- package/dist/bridge/ios.d.ts +528 -0
- package/dist/bridge/ios.d.ts.map +1 -0
- package/dist/bridge/webkit-pending.d.ts +50 -0
- package/dist/bridge/webkit-pending.d.ts.map +1 -0
- package/dist/build/bundle-optimizer.d.ts +69 -0
- package/dist/build/bundle-optimizer.d.ts.map +1 -0
- package/dist/components/index.d.ts +719 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/components/native.d.ts +728 -0
- package/dist/components/native.d.ts.map +1 -0
- package/dist/components/sidebar.d.ts +458 -0
- package/dist/components/sidebar.d.ts.map +1 -0
- package/dist/dev/devtools.d.ts +118 -0
- package/dist/dev/devtools.d.ts.map +1 -0
- package/dist/dev/error-overlay.d.ts +73 -0
- package/dist/dev/error-overlay.d.ts.map +1 -0
- package/dist/dev/hot-reload.d.ts +127 -0
- package/dist/dev/hot-reload.d.ts.map +1 -0
- package/dist/index.cjs +10253 -0
- package/dist/index.d.cts +59 -0
- package/dist/index.d.ts +59 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10240 -0
- package/dist/logging/index.d.ts +152 -0
- package/dist/logging/index.d.ts.map +1 -0
- package/dist/optimizations/index.d.ts +232 -0
- package/dist/optimizations/index.d.ts.map +1 -0
- package/dist/package.d.ts +90 -0
- package/dist/package.d.ts.map +1 -0
- package/dist/performance/runtime.d.ts +230 -0
- package/dist/performance/runtime.d.ts.map +1 -0
- package/dist/performance/startup.d.ts +223 -0
- package/dist/performance/startup.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +114 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/security/index.d.ts +268 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/signing/index.d.ts +104 -0
- package/dist/signing/index.d.ts.map +1 -0
- package/dist/styles/headwind.d.ts +222 -0
- package/dist/styles/headwind.d.ts.map +1 -0
- package/dist/styles/index.d.ts +31 -0
- package/dist/styles/index.d.ts.map +1 -0
- package/dist/styles/sidebar-templates.d.ts +77 -0
- package/dist/styles/sidebar-templates.d.ts.map +1 -0
- package/dist/styles/sidebars.d.ts +194 -0
- package/dist/styles/sidebars.d.ts.map +1 -0
- package/dist/types.d.ts +1555 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/updater/index.d.ts +164 -0
- package/dist/updater/index.d.ts.map +1 -0
- package/dist/utils/audio.d.ts +40 -0
- package/dist/utils/audio.d.ts.map +1 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/native.d.ts +27 -0
- package/dist/utils/native.d.ts.map +1 -0
- package/dist/utils/react.d.ts +157 -0
- package/dist/utils/react.d.ts.map +1 -0
- package/dist/utils/storage.d.ts +35 -0
- package/dist/utils/storage.d.ts.map +1 -0
- package/dist/utils/svelte.d.ts +187 -0
- package/dist/utils/svelte.d.ts.map +1 -0
- package/dist/utils/timer.d.ts +57 -0
- package/dist/utils/timer.d.ts.map +1 -0
- package/dist/utils/vue.d.ts +157 -0
- package/dist/utils/vue.d.ts.map +1 -0
- package/package.json +78 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,1555 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Craft Platform Support Matrix
|
|
3
|
+
*
|
|
4
|
+
* This file defines types for the desktop TypeScript SDK (craft-native).
|
|
5
|
+
* For mobile bridge types (window.craft injected at runtime), see types/craft.d.ts.
|
|
6
|
+
*
|
|
7
|
+
* Feature | macOS | Linux | Windows | iOS | Android
|
|
8
|
+
* ---------------------|-------|-------|---------|-----|--------
|
|
9
|
+
* Window Management | ✓ | ✓ | ✓ | - | -
|
|
10
|
+
* System Tray | ✓ | ✓ | ✓ | - | -
|
|
11
|
+
* Native Sidebar | ✓ | - | - | - | -
|
|
12
|
+
* Touch Bar | ✓ | - | - | - | -
|
|
13
|
+
* Toolbar | ✓ | ✓ | ✓ | - | -
|
|
14
|
+
* File System | ✓ | ✓ | ✓ | ✓ | ✓
|
|
15
|
+
* Database (SQLite) | ✓ | ✓ | ✓ | ✓ | ✓
|
|
16
|
+
* HTTP Client | ✓ | ✓ | ✓ | ✓ | ✓
|
|
17
|
+
* Crypto | ✓ | ✓ | ✓ | ✓ | ✓
|
|
18
|
+
* Notifications | ✓ | ✓ | ✓ | ✓ | ✓
|
|
19
|
+
* Clipboard | ✓ | ✓ | ✓ | ✓ | ✓
|
|
20
|
+
* Dialogs (File/Alert) | ✓ | ✓ | ✓ | - | -
|
|
21
|
+
* App Lifecycle | ✓ | ✓ | ✓ | ✓ | ✓
|
|
22
|
+
* Keyboard Shortcuts | ✓ | ✓ | ✓ | - | -
|
|
23
|
+
* Process/Exec | ✓ | ✓ | ✓ | - | -
|
|
24
|
+
* Hot Reload | ✓ | ✓ | ✓ | ✓ | ✓
|
|
25
|
+
* Camera/Microphone | ✓ | ✓ | ✓ | ✓ | ✓
|
|
26
|
+
* GPU Acceleration | ✓ | ✓ | ✓ | - | -
|
|
27
|
+
* Stage Manager | ✓ | - | - | - | -
|
|
28
|
+
* Handoff/Continuity | ✓ | - | - | - | -
|
|
29
|
+
* Spotlight | ✓ | - | - | - | -
|
|
30
|
+
* Jump List | - | - | ✓ | - | -
|
|
31
|
+
* Taskbar Progress | - | - | ✓ | - | -
|
|
32
|
+
* Windows Hello | - | - | ✓ | - | -
|
|
33
|
+
* Toast Notifications | - | - | ✓ | - | -
|
|
34
|
+
* Biometrics | - | - | - | ✓ | ✓
|
|
35
|
+
* Haptic Feedback | - | - | - | ✓ | ✓
|
|
36
|
+
* Secure Storage | - | - | - | ✓ | ✓
|
|
37
|
+
* Location | - | - | - | ✓ | ✓
|
|
38
|
+
* Share Sheet | - | - | - | ✓ | ✓
|
|
39
|
+
* CarPlay | - | - | - | ✓ | -
|
|
40
|
+
* Live Activities | - | - | - | ✓ | -
|
|
41
|
+
* SharePlay | - | - | - | ✓ | -
|
|
42
|
+
* StoreKit (IAP) | - | - | - | ✓ | -
|
|
43
|
+
* Material You | - | - | - | - | ✓
|
|
44
|
+
* Play Billing (IAP) | - | - | - | - | ✓
|
|
45
|
+
* Work Manager | - | - | - | - | ✓
|
|
46
|
+
* Predictive Back | - | - | - | - | ✓
|
|
47
|
+
*
|
|
48
|
+
* Mobile-only bridge APIs (window.craft, defined in types/craft.d.ts):
|
|
49
|
+
* AR (ARKit/ARCore), ML (Core ML/ML Kit), Deep Links, OTA Updates,
|
|
50
|
+
* Widgets, Auth Persistence, Contacts, Calendar, Health/Fitness,
|
|
51
|
+
* Watch Connectivity, Siri/Assistant, Background Tasks, PDF Viewer
|
|
52
|
+
*/
|
|
53
|
+
export interface WindowOptions {
|
|
54
|
+
/**
|
|
55
|
+
* Window title
|
|
56
|
+
*/
|
|
57
|
+
title?: string;
|
|
58
|
+
/**
|
|
59
|
+
* Window width in pixels
|
|
60
|
+
* @default 800
|
|
61
|
+
*/
|
|
62
|
+
width?: number;
|
|
63
|
+
/**
|
|
64
|
+
* Window height in pixels
|
|
65
|
+
* @default 600
|
|
66
|
+
*/
|
|
67
|
+
height?: number;
|
|
68
|
+
/**
|
|
69
|
+
* X position of window
|
|
70
|
+
*/
|
|
71
|
+
x?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Y position of window
|
|
74
|
+
*/
|
|
75
|
+
y?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Whether window is resizable
|
|
78
|
+
* @default true
|
|
79
|
+
*/
|
|
80
|
+
resizable?: boolean;
|
|
81
|
+
/**
|
|
82
|
+
* Whether window is frameless
|
|
83
|
+
* @default false
|
|
84
|
+
*/
|
|
85
|
+
frameless?: boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Whether window has transparency
|
|
88
|
+
* @default false
|
|
89
|
+
*/
|
|
90
|
+
transparent?: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Whether window is always on top
|
|
93
|
+
* @default false
|
|
94
|
+
*/
|
|
95
|
+
alwaysOnTop?: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Whether window starts in fullscreen
|
|
98
|
+
* @default false
|
|
99
|
+
*/
|
|
100
|
+
fullscreen?: boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Enable dark mode
|
|
103
|
+
*/
|
|
104
|
+
darkMode?: boolean;
|
|
105
|
+
/**
|
|
106
|
+
* Enable hot reload for development
|
|
107
|
+
* @default false
|
|
108
|
+
*/
|
|
109
|
+
hotReload?: boolean;
|
|
110
|
+
/**
|
|
111
|
+
* Enable developer tools
|
|
112
|
+
* @default false in production, true in development
|
|
113
|
+
*/
|
|
114
|
+
devTools?: boolean;
|
|
115
|
+
/**
|
|
116
|
+
* Enable system tray icon
|
|
117
|
+
* @default false
|
|
118
|
+
*/
|
|
119
|
+
systemTray?: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* Hide dock icon (menubar-only mode, macOS)
|
|
122
|
+
* @default false
|
|
123
|
+
*/
|
|
124
|
+
hideDockIcon?: boolean;
|
|
125
|
+
/**
|
|
126
|
+
* Menubar-only mode (no window, only system tray)
|
|
127
|
+
* @default false
|
|
128
|
+
*/
|
|
129
|
+
menubarOnly?: boolean;
|
|
130
|
+
/**
|
|
131
|
+
* Hide the titlebar (content extends to window edge)
|
|
132
|
+
* @default false
|
|
133
|
+
*/
|
|
134
|
+
titlebarHidden?: boolean;
|
|
135
|
+
/**
|
|
136
|
+
* Use native macOS sidebar (Finder-style with vibrancy)
|
|
137
|
+
* Creates a split view with NSOutlineView sidebar and WebView content
|
|
138
|
+
* @default false
|
|
139
|
+
*/
|
|
140
|
+
nativeSidebar?: boolean;
|
|
141
|
+
/**
|
|
142
|
+
* Width of the native sidebar in pixels
|
|
143
|
+
* Only used when nativeSidebar is true
|
|
144
|
+
* @default 220
|
|
145
|
+
*/
|
|
146
|
+
sidebarWidth?: number;
|
|
147
|
+
/**
|
|
148
|
+
* Native sidebar visual variant.
|
|
149
|
+
* The desktop variant enables a translucent sidebar material by default.
|
|
150
|
+
*/
|
|
151
|
+
sidebarVariant?: SidebarVariant;
|
|
152
|
+
/**
|
|
153
|
+
* Native material used for the sidebar.
|
|
154
|
+
*/
|
|
155
|
+
sidebarMaterial?: SidebarMaterial;
|
|
156
|
+
/**
|
|
157
|
+
* Native sidebar background treatment.
|
|
158
|
+
*/
|
|
159
|
+
sidebarBackgroundEffect?: SidebarBackgroundEffect;
|
|
160
|
+
/**
|
|
161
|
+
* Whether the native sidebar should allow background vibrancy.
|
|
162
|
+
*/
|
|
163
|
+
sidebarAllowsVibrancy?: boolean;
|
|
164
|
+
/**
|
|
165
|
+
* Sidebar configuration (sections and items)
|
|
166
|
+
* Only used when nativeSidebar is true
|
|
167
|
+
*/
|
|
168
|
+
sidebarConfig?: SidebarConfig;
|
|
169
|
+
/**
|
|
170
|
+
* Path to a dock icon image (PNG, JPG, or ICNS).
|
|
171
|
+
* On macOS, the file is loaded with `[NSImage initWithContentsOfFile:]`
|
|
172
|
+
* and applied via `[NSApp setApplicationIconImage:]` before the first
|
|
173
|
+
* window appears. Other platforms ignore this option for now.
|
|
174
|
+
*
|
|
175
|
+
* @example "/path/to/resources/assets/images/app-icon.png"
|
|
176
|
+
*/
|
|
177
|
+
icon?: string;
|
|
178
|
+
}
|
|
179
|
+
export type SidebarVariant = 'tahoe' | 'vibrancy' | 'solid' | 'transparent' | 'workspace' | 'desktop';
|
|
180
|
+
export type SidebarMaterial = 'auto' | 'sidebar' | 'hud' | 'popover' | 'content';
|
|
181
|
+
export type SidebarBackgroundEffect = 'none' | 'vibrancy' | 'shimmer';
|
|
182
|
+
/**
|
|
183
|
+
* Sidebar item configuration
|
|
184
|
+
*/
|
|
185
|
+
export interface SidebarItem {
|
|
186
|
+
/**
|
|
187
|
+
* Unique identifier for the item
|
|
188
|
+
*/
|
|
189
|
+
id: string;
|
|
190
|
+
/**
|
|
191
|
+
* Display label
|
|
192
|
+
*/
|
|
193
|
+
label: string;
|
|
194
|
+
/**
|
|
195
|
+
* SF Symbol name (macOS) or icon path
|
|
196
|
+
* @example "house.fill", "folder", "star.fill"
|
|
197
|
+
*/
|
|
198
|
+
icon?: string;
|
|
199
|
+
/**
|
|
200
|
+
* Badge text (e.g., unread count)
|
|
201
|
+
*/
|
|
202
|
+
badge?: string | number;
|
|
203
|
+
/**
|
|
204
|
+
* Tint color for the icon (hex color)
|
|
205
|
+
* Useful for tag colors
|
|
206
|
+
* @example "#ff0000"
|
|
207
|
+
*/
|
|
208
|
+
tintColor?: string;
|
|
209
|
+
/**
|
|
210
|
+
* Whether this item is currently selected
|
|
211
|
+
*/
|
|
212
|
+
selected?: boolean;
|
|
213
|
+
/**
|
|
214
|
+
* Whether this item is disabled
|
|
215
|
+
*/
|
|
216
|
+
disabled?: boolean;
|
|
217
|
+
/**
|
|
218
|
+
* Nested items (for expandable sections)
|
|
219
|
+
*/
|
|
220
|
+
children?: SidebarItem[];
|
|
221
|
+
/**
|
|
222
|
+
* URL or path associated with this item
|
|
223
|
+
*/
|
|
224
|
+
url?: string;
|
|
225
|
+
/**
|
|
226
|
+
* Custom data to pass to event handlers
|
|
227
|
+
*/
|
|
228
|
+
data?: Record<string, unknown>;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* Sidebar section configuration
|
|
232
|
+
*/
|
|
233
|
+
export interface SidebarSection {
|
|
234
|
+
/**
|
|
235
|
+
* Unique identifier for the section
|
|
236
|
+
*/
|
|
237
|
+
id: string;
|
|
238
|
+
/**
|
|
239
|
+
* Section header text
|
|
240
|
+
*/
|
|
241
|
+
title: string;
|
|
242
|
+
/**
|
|
243
|
+
* Whether section is collapsible
|
|
244
|
+
* @default true
|
|
245
|
+
*/
|
|
246
|
+
collapsible?: boolean;
|
|
247
|
+
/**
|
|
248
|
+
* Whether section is initially collapsed
|
|
249
|
+
* @default false
|
|
250
|
+
*/
|
|
251
|
+
collapsed?: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Items in this section
|
|
254
|
+
*/
|
|
255
|
+
items: SidebarItem[];
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Complete sidebar configuration
|
|
259
|
+
*/
|
|
260
|
+
export interface SidebarConfig {
|
|
261
|
+
/**
|
|
262
|
+
* Visual style variant shared with STX web sidebars
|
|
263
|
+
*/
|
|
264
|
+
variant?: SidebarVariant;
|
|
265
|
+
/**
|
|
266
|
+
* Native material used for the sidebar
|
|
267
|
+
*/
|
|
268
|
+
material?: SidebarMaterial;
|
|
269
|
+
/**
|
|
270
|
+
* Native background effect
|
|
271
|
+
*/
|
|
272
|
+
backgroundEffect?: SidebarBackgroundEffect;
|
|
273
|
+
/**
|
|
274
|
+
* Let the desktop background show through the sidebar material
|
|
275
|
+
*/
|
|
276
|
+
allowsVibrancy?: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* Sections to display in the sidebar
|
|
279
|
+
*/
|
|
280
|
+
sections: SidebarSection[];
|
|
281
|
+
/**
|
|
282
|
+
* Minimum sidebar width
|
|
283
|
+
* @default 180
|
|
284
|
+
*/
|
|
285
|
+
minWidth?: number;
|
|
286
|
+
/**
|
|
287
|
+
* Maximum sidebar width
|
|
288
|
+
* @default 320
|
|
289
|
+
*/
|
|
290
|
+
maxWidth?: number;
|
|
291
|
+
/**
|
|
292
|
+
* Whether sidebar can be collapsed
|
|
293
|
+
* @default true
|
|
294
|
+
*/
|
|
295
|
+
canCollapse?: boolean;
|
|
296
|
+
/**
|
|
297
|
+
* Search placeholder text (shows search field if provided)
|
|
298
|
+
*/
|
|
299
|
+
searchPlaceholder?: string;
|
|
300
|
+
/**
|
|
301
|
+
* Header content (optional custom header)
|
|
302
|
+
*/
|
|
303
|
+
header?: {
|
|
304
|
+
title?: string;
|
|
305
|
+
subtitle?: string;
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Sidebar selection event
|
|
310
|
+
*/
|
|
311
|
+
export interface SidebarSelectEvent {
|
|
312
|
+
/**
|
|
313
|
+
* ID of the selected item
|
|
314
|
+
*/
|
|
315
|
+
itemId: string;
|
|
316
|
+
/**
|
|
317
|
+
* ID of the section containing the item
|
|
318
|
+
*/
|
|
319
|
+
sectionId: string;
|
|
320
|
+
/**
|
|
321
|
+
* The full item configuration
|
|
322
|
+
*/
|
|
323
|
+
item: SidebarItem;
|
|
324
|
+
/**
|
|
325
|
+
* Custom data from the item
|
|
326
|
+
*/
|
|
327
|
+
data?: Record<string, unknown>;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Sidebar API (available as window.craft.sidebar in WebView)
|
|
331
|
+
*/
|
|
332
|
+
export interface CraftSidebarAPI {
|
|
333
|
+
/**
|
|
334
|
+
* Update sidebar configuration
|
|
335
|
+
* @param config - New sidebar configuration
|
|
336
|
+
*/
|
|
337
|
+
setConfig(config: SidebarConfig): Promise<void>;
|
|
338
|
+
/**
|
|
339
|
+
* Update a specific section
|
|
340
|
+
* @param sectionId - Section ID to update
|
|
341
|
+
* @param section - New section configuration
|
|
342
|
+
*/
|
|
343
|
+
updateSection(sectionId: string, section: Partial<SidebarSection>): Promise<void>;
|
|
344
|
+
/**
|
|
345
|
+
* Update a specific item
|
|
346
|
+
* @param itemId - Item ID to update
|
|
347
|
+
* @param item - New item configuration
|
|
348
|
+
*/
|
|
349
|
+
updateItem(itemId: string, item: Partial<SidebarItem>): Promise<void>;
|
|
350
|
+
/**
|
|
351
|
+
* Add an item to a section
|
|
352
|
+
* @param sectionId - Section to add to
|
|
353
|
+
* @param item - Item to add
|
|
354
|
+
* @param index - Optional index to insert at
|
|
355
|
+
*/
|
|
356
|
+
addItem(sectionId: string, item: SidebarItem, index?: number): Promise<void>;
|
|
357
|
+
/**
|
|
358
|
+
* Remove an item
|
|
359
|
+
* @param itemId - Item ID to remove
|
|
360
|
+
*/
|
|
361
|
+
removeItem(itemId: string): Promise<void>;
|
|
362
|
+
/**
|
|
363
|
+
* Select an item programmatically
|
|
364
|
+
* @param itemId - Item ID to select
|
|
365
|
+
*/
|
|
366
|
+
selectItem(itemId: string): Promise<void>;
|
|
367
|
+
/**
|
|
368
|
+
* Get the currently selected item ID
|
|
369
|
+
*/
|
|
370
|
+
getSelectedItem(): Promise<string | null>;
|
|
371
|
+
/**
|
|
372
|
+
* Set badge for an item
|
|
373
|
+
* @param itemId - Item ID
|
|
374
|
+
* @param badge - Badge text or number (null to remove)
|
|
375
|
+
*/
|
|
376
|
+
setBadge(itemId: string, badge: string | number | null): Promise<void>;
|
|
377
|
+
/**
|
|
378
|
+
* Expand a section
|
|
379
|
+
* @param sectionId - Section ID to expand
|
|
380
|
+
*/
|
|
381
|
+
expandSection(sectionId: string): Promise<void>;
|
|
382
|
+
/**
|
|
383
|
+
* Collapse a section
|
|
384
|
+
* @param sectionId - Section ID to collapse
|
|
385
|
+
*/
|
|
386
|
+
collapseSection(sectionId: string): Promise<void>;
|
|
387
|
+
/**
|
|
388
|
+
* Toggle section expanded state
|
|
389
|
+
* @param sectionId - Section ID to toggle
|
|
390
|
+
*/
|
|
391
|
+
toggleSection(sectionId: string): Promise<void>;
|
|
392
|
+
/**
|
|
393
|
+
* Register selection change handler
|
|
394
|
+
* @param callback - Function called when selection changes
|
|
395
|
+
* @returns Unsubscribe function
|
|
396
|
+
*/
|
|
397
|
+
onSelect(callback: (event: SidebarSelectEvent) => void): () => void;
|
|
398
|
+
/**
|
|
399
|
+
* Register search handler
|
|
400
|
+
* @param callback - Function called when search text changes
|
|
401
|
+
* @returns Unsubscribe function
|
|
402
|
+
*/
|
|
403
|
+
onSearch(callback: (query: string) => void): () => void;
|
|
404
|
+
/**
|
|
405
|
+
* Register context menu handler
|
|
406
|
+
* @param callback - Function called on right-click
|
|
407
|
+
* @returns Unsubscribe function
|
|
408
|
+
*/
|
|
409
|
+
onContextMenu(callback: (event: SidebarSelectEvent) => void): () => void;
|
|
410
|
+
}
|
|
411
|
+
export interface AppConfig {
|
|
412
|
+
/**
|
|
413
|
+
* HTML content to display
|
|
414
|
+
*/
|
|
415
|
+
html?: string;
|
|
416
|
+
/**
|
|
417
|
+
* URL to load
|
|
418
|
+
*/
|
|
419
|
+
url?: string;
|
|
420
|
+
/**
|
|
421
|
+
* Window options
|
|
422
|
+
*/
|
|
423
|
+
window?: WindowOptions;
|
|
424
|
+
/**
|
|
425
|
+
* Path to Craft binary (auto-detected if not provided)
|
|
426
|
+
*/
|
|
427
|
+
craftPath?: string;
|
|
428
|
+
/**
|
|
429
|
+
* Suppress all non-error output from the native binary.
|
|
430
|
+
* When true, the binary runs with --quiet and stdio is piped.
|
|
431
|
+
* @default false
|
|
432
|
+
*/
|
|
433
|
+
quiet?: boolean;
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Craft System Tray API (available as window.craft.tray in WebView)
|
|
437
|
+
*/
|
|
438
|
+
export interface CraftTrayAPI {
|
|
439
|
+
/**
|
|
440
|
+
* Update the system tray title/text
|
|
441
|
+
* Updates in real-time (60fps max)
|
|
442
|
+
* @param title - Text to show in menubar (max 20 chars recommended)
|
|
443
|
+
*/
|
|
444
|
+
setTitle(title: string): Promise<void>;
|
|
445
|
+
/**
|
|
446
|
+
* Set tooltip text for the tray icon
|
|
447
|
+
* @param tooltip - Tooltip text (shows on hover)
|
|
448
|
+
*/
|
|
449
|
+
setTooltip(tooltip: string): Promise<void>;
|
|
450
|
+
/**
|
|
451
|
+
* Register a click handler for tray icon clicks
|
|
452
|
+
* @param callback - Function to call when tray icon is clicked
|
|
453
|
+
* @returns Function to unregister the handler
|
|
454
|
+
*/
|
|
455
|
+
onClick(callback: (event: TrayClickEvent) => void): () => void;
|
|
456
|
+
/**
|
|
457
|
+
* Convenience: toggle window visibility on tray click
|
|
458
|
+
* @returns Function to unregister the handler
|
|
459
|
+
*/
|
|
460
|
+
onClickToggleWindow(): () => void;
|
|
461
|
+
/**
|
|
462
|
+
* Set a context menu for the tray icon
|
|
463
|
+
* @param items - Menu item definitions
|
|
464
|
+
*/
|
|
465
|
+
setMenu(items: MenuItem[]): Promise<void>;
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Craft Window Control API (available as window.craft.window in WebView)
|
|
469
|
+
*/
|
|
470
|
+
export interface CraftWindowAPI {
|
|
471
|
+
/**
|
|
472
|
+
* Show the window
|
|
473
|
+
*/
|
|
474
|
+
show(): Promise<void>;
|
|
475
|
+
/**
|
|
476
|
+
* Hide the window
|
|
477
|
+
*/
|
|
478
|
+
hide(): Promise<void>;
|
|
479
|
+
/**
|
|
480
|
+
* Toggle window visibility
|
|
481
|
+
*/
|
|
482
|
+
toggle(): Promise<void>;
|
|
483
|
+
/**
|
|
484
|
+
* Minimize the window
|
|
485
|
+
*/
|
|
486
|
+
minimize(): Promise<void>;
|
|
487
|
+
/**
|
|
488
|
+
* Close the window
|
|
489
|
+
*/
|
|
490
|
+
close(): Promise<void>;
|
|
491
|
+
}
|
|
492
|
+
/**
|
|
493
|
+
* Craft App Control API (available as window.craft.app in WebView)
|
|
494
|
+
*/
|
|
495
|
+
export interface CraftAppAPI {
|
|
496
|
+
/**
|
|
497
|
+
* Hide the dock icon (menubar-only mode, macOS)
|
|
498
|
+
*/
|
|
499
|
+
hideDockIcon(): Promise<void>;
|
|
500
|
+
/**
|
|
501
|
+
* Show the dock icon (normal mode, macOS)
|
|
502
|
+
*/
|
|
503
|
+
showDockIcon(): Promise<void>;
|
|
504
|
+
/**
|
|
505
|
+
* Quit the application
|
|
506
|
+
*/
|
|
507
|
+
quit(): Promise<void>;
|
|
508
|
+
/**
|
|
509
|
+
* Send a native system notification
|
|
510
|
+
* @param options - Notification configuration
|
|
511
|
+
*/
|
|
512
|
+
notify(options: NotificationOptions): Promise<void>;
|
|
513
|
+
/**
|
|
514
|
+
* Get application information
|
|
515
|
+
*/
|
|
516
|
+
getInfo(): Promise<AppInfo>;
|
|
517
|
+
}
|
|
518
|
+
/**
|
|
519
|
+
* Tray click event details
|
|
520
|
+
*/
|
|
521
|
+
export interface TrayClickEvent {
|
|
522
|
+
/**
|
|
523
|
+
* Which mouse button was clicked
|
|
524
|
+
*/
|
|
525
|
+
button: 'left' | 'right' | 'middle';
|
|
526
|
+
/**
|
|
527
|
+
* Timestamp of the click
|
|
528
|
+
*/
|
|
529
|
+
timestamp: number;
|
|
530
|
+
/**
|
|
531
|
+
* Keyboard modifiers held during click
|
|
532
|
+
*/
|
|
533
|
+
modifiers: {
|
|
534
|
+
command?: boolean;
|
|
535
|
+
shift?: boolean;
|
|
536
|
+
option?: boolean;
|
|
537
|
+
control?: boolean;
|
|
538
|
+
};
|
|
539
|
+
}
|
|
540
|
+
/**
|
|
541
|
+
* Menu item configuration
|
|
542
|
+
*/
|
|
543
|
+
export interface MenuItem {
|
|
544
|
+
/**
|
|
545
|
+
* Unique identifier for the menu item
|
|
546
|
+
*/
|
|
547
|
+
id?: string;
|
|
548
|
+
/**
|
|
549
|
+
* Label text to display
|
|
550
|
+
*/
|
|
551
|
+
label?: string;
|
|
552
|
+
/**
|
|
553
|
+
* Menu item type
|
|
554
|
+
*/
|
|
555
|
+
type?: 'normal' | 'separator' | 'checkbox' | 'radio';
|
|
556
|
+
/**
|
|
557
|
+
* Whether the item is checked (for checkbox/radio types)
|
|
558
|
+
*/
|
|
559
|
+
checked?: boolean;
|
|
560
|
+
/**
|
|
561
|
+
* Whether the item is enabled
|
|
562
|
+
*/
|
|
563
|
+
enabled?: boolean;
|
|
564
|
+
/**
|
|
565
|
+
* Action to perform when clicked (built-in or custom)
|
|
566
|
+
*/
|
|
567
|
+
action?: 'show' | 'hide' | 'toggle' | 'quit' | string;
|
|
568
|
+
/**
|
|
569
|
+
* Keyboard shortcut (e.g., 'Cmd+Q')
|
|
570
|
+
*/
|
|
571
|
+
shortcut?: string;
|
|
572
|
+
/**
|
|
573
|
+
* Submenu items
|
|
574
|
+
*/
|
|
575
|
+
submenu?: MenuItem[];
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* Application information
|
|
579
|
+
*/
|
|
580
|
+
export interface AppInfo {
|
|
581
|
+
/**
|
|
582
|
+
* Application name
|
|
583
|
+
*/
|
|
584
|
+
name: string;
|
|
585
|
+
/**
|
|
586
|
+
* Application version
|
|
587
|
+
*/
|
|
588
|
+
version: string;
|
|
589
|
+
/**
|
|
590
|
+
* Platform (macos, linux, windows)
|
|
591
|
+
*/
|
|
592
|
+
platform: string;
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Notification options
|
|
596
|
+
*/
|
|
597
|
+
export interface NotificationOptions {
|
|
598
|
+
/**
|
|
599
|
+
* Notification title (required)
|
|
600
|
+
*/
|
|
601
|
+
title: string;
|
|
602
|
+
/**
|
|
603
|
+
* Notification body text
|
|
604
|
+
*/
|
|
605
|
+
body?: string;
|
|
606
|
+
/**
|
|
607
|
+
* Icon path or data URL
|
|
608
|
+
*/
|
|
609
|
+
icon?: string;
|
|
610
|
+
/**
|
|
611
|
+
* Sound to play
|
|
612
|
+
* - "default" - System default sound
|
|
613
|
+
* - "Glass" - Glass sound (macOS)
|
|
614
|
+
* - "Ping" - Ping sound (macOS)
|
|
615
|
+
* - Or any system sound name
|
|
616
|
+
*/
|
|
617
|
+
sound?: string;
|
|
618
|
+
/**
|
|
619
|
+
* Action buttons (platform dependent)
|
|
620
|
+
*/
|
|
621
|
+
actions?: Array<{
|
|
622
|
+
action: string;
|
|
623
|
+
title: string;
|
|
624
|
+
}>;
|
|
625
|
+
/**
|
|
626
|
+
* Notification tag (for grouping/replacing)
|
|
627
|
+
*/
|
|
628
|
+
tag?: string;
|
|
629
|
+
/**
|
|
630
|
+
* Auto-close timeout in milliseconds
|
|
631
|
+
*/
|
|
632
|
+
timeout?: number;
|
|
633
|
+
}
|
|
634
|
+
/**
|
|
635
|
+
* Device information (mobile platforms)
|
|
636
|
+
*/
|
|
637
|
+
export interface DeviceInfo {
|
|
638
|
+
/**
|
|
639
|
+
* Platform (ios, android)
|
|
640
|
+
*/
|
|
641
|
+
platform: 'ios' | 'android';
|
|
642
|
+
/**
|
|
643
|
+
* OS version
|
|
644
|
+
*/
|
|
645
|
+
osVersion: string;
|
|
646
|
+
/**
|
|
647
|
+
* Device model
|
|
648
|
+
*/
|
|
649
|
+
model: string;
|
|
650
|
+
/**
|
|
651
|
+
* Screen width in points
|
|
652
|
+
*/
|
|
653
|
+
screenWidth: number;
|
|
654
|
+
/**
|
|
655
|
+
* Screen height in points
|
|
656
|
+
*/
|
|
657
|
+
screenHeight: number;
|
|
658
|
+
/**
|
|
659
|
+
* Device pixel ratio
|
|
660
|
+
*/
|
|
661
|
+
scaleFactor: number;
|
|
662
|
+
/**
|
|
663
|
+
* Whether device is a tablet
|
|
664
|
+
*/
|
|
665
|
+
isTablet: boolean;
|
|
666
|
+
/**
|
|
667
|
+
* Safe area insets
|
|
668
|
+
*/
|
|
669
|
+
safeAreaInsets: {
|
|
670
|
+
top: number;
|
|
671
|
+
bottom: number;
|
|
672
|
+
left: number;
|
|
673
|
+
right: number;
|
|
674
|
+
};
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Permission types
|
|
678
|
+
*/
|
|
679
|
+
export type Permission = 'camera' | 'microphone' | 'location' | 'photos' | 'notifications' | 'contacts' | 'calendar' | 'reminders';
|
|
680
|
+
/**
|
|
681
|
+
* Permission status
|
|
682
|
+
*/
|
|
683
|
+
export type PermissionStatus = 'granted' | 'denied' | 'notDetermined' | 'restricted';
|
|
684
|
+
/**
|
|
685
|
+
* Haptic feedback types
|
|
686
|
+
*/
|
|
687
|
+
export type HapticType = 'selection' | 'impact-light' | 'impact-medium' | 'impact-heavy' | 'notification-success' | 'notification-warning' | 'notification-error';
|
|
688
|
+
/**
|
|
689
|
+
* Camera options
|
|
690
|
+
*/
|
|
691
|
+
export interface CameraOptions {
|
|
692
|
+
/**
|
|
693
|
+
* Camera type (front or back)
|
|
694
|
+
*/
|
|
695
|
+
type?: 'front' | 'back';
|
|
696
|
+
/**
|
|
697
|
+
* Media type to capture
|
|
698
|
+
*/
|
|
699
|
+
mediaType?: 'photo' | 'video';
|
|
700
|
+
/**
|
|
701
|
+
* Maximum video duration in seconds
|
|
702
|
+
*/
|
|
703
|
+
maxDuration?: number;
|
|
704
|
+
/**
|
|
705
|
+
* Video quality
|
|
706
|
+
*/
|
|
707
|
+
quality?: 'low' | 'medium' | 'high';
|
|
708
|
+
}
|
|
709
|
+
/**
|
|
710
|
+
* Photo picker options
|
|
711
|
+
*/
|
|
712
|
+
export interface PhotoPickerOptions {
|
|
713
|
+
/**
|
|
714
|
+
* Maximum number of selections
|
|
715
|
+
*/
|
|
716
|
+
maxSelections?: number;
|
|
717
|
+
/**
|
|
718
|
+
* Media types to show
|
|
719
|
+
*/
|
|
720
|
+
mediaType?: 'photo' | 'video' | 'all';
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* Share options
|
|
724
|
+
*/
|
|
725
|
+
export interface ShareOptions {
|
|
726
|
+
/**
|
|
727
|
+
* Text to share
|
|
728
|
+
*/
|
|
729
|
+
text?: string;
|
|
730
|
+
/**
|
|
731
|
+
* URL to share
|
|
732
|
+
*/
|
|
733
|
+
url?: string;
|
|
734
|
+
/**
|
|
735
|
+
* Title (Android only)
|
|
736
|
+
*/
|
|
737
|
+
title?: string;
|
|
738
|
+
/**
|
|
739
|
+
* Dialog title (Android only)
|
|
740
|
+
*/
|
|
741
|
+
dialogTitle?: string;
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
* Craft Mobile API (device-specific features)
|
|
745
|
+
*/
|
|
746
|
+
export interface CraftMobileAPI {
|
|
747
|
+
/**
|
|
748
|
+
* Get device information
|
|
749
|
+
*/
|
|
750
|
+
getDeviceInfo(): Promise<DeviceInfo>;
|
|
751
|
+
/**
|
|
752
|
+
* Request permission
|
|
753
|
+
* @param permission - Permission type to request
|
|
754
|
+
*/
|
|
755
|
+
requestPermission(permission: Permission): Promise<PermissionStatus>;
|
|
756
|
+
/**
|
|
757
|
+
* Check permission status
|
|
758
|
+
* @param permission - Permission type to check
|
|
759
|
+
*/
|
|
760
|
+
checkPermission(permission: Permission): Promise<PermissionStatus>;
|
|
761
|
+
/**
|
|
762
|
+
* Trigger haptic feedback
|
|
763
|
+
* @param type - Haptic feedback type
|
|
764
|
+
*/
|
|
765
|
+
haptic(type: HapticType): Promise<void>;
|
|
766
|
+
/**
|
|
767
|
+
* Vibrate device
|
|
768
|
+
* @param duration - Duration in milliseconds
|
|
769
|
+
*/
|
|
770
|
+
vibrate(duration: number): Promise<void>;
|
|
771
|
+
/**
|
|
772
|
+
* Show native toast (Android) or banner (iOS)
|
|
773
|
+
* @param message - Message to display
|
|
774
|
+
* @param duration - Duration in milliseconds (optional)
|
|
775
|
+
*/
|
|
776
|
+
toast(message: string, duration?: number): Promise<void>;
|
|
777
|
+
/**
|
|
778
|
+
* Open camera to capture photo/video
|
|
779
|
+
* @param options - Camera configuration
|
|
780
|
+
*/
|
|
781
|
+
openCamera(options?: CameraOptions): Promise<string>;
|
|
782
|
+
/**
|
|
783
|
+
* Open photo picker
|
|
784
|
+
* @param options - Picker configuration
|
|
785
|
+
*/
|
|
786
|
+
pickPhoto(options?: PhotoPickerOptions): Promise<string[]>;
|
|
787
|
+
/**
|
|
788
|
+
* Share content via system share sheet
|
|
789
|
+
* @param options - Share configuration
|
|
790
|
+
*/
|
|
791
|
+
share(options: ShareOptions): Promise<void>;
|
|
792
|
+
/**
|
|
793
|
+
* Set orientation lock
|
|
794
|
+
* @param orientation - Orientation to lock to
|
|
795
|
+
*/
|
|
796
|
+
setOrientation(orientation: 'portrait' | 'landscape' | 'any'): Promise<void>;
|
|
797
|
+
/**
|
|
798
|
+
* Set status bar style (iOS)
|
|
799
|
+
* @param style - Status bar style
|
|
800
|
+
*/
|
|
801
|
+
setStatusBarStyle(style: 'light' | 'dark' | 'default'): Promise<void>;
|
|
802
|
+
/**
|
|
803
|
+
* Open app settings
|
|
804
|
+
*/
|
|
805
|
+
openSettings(): Promise<void>;
|
|
806
|
+
/**
|
|
807
|
+
* Check if biometric auth is available
|
|
808
|
+
*/
|
|
809
|
+
isBiometricAvailable(): Promise<boolean>;
|
|
810
|
+
/**
|
|
811
|
+
* Authenticate with biometrics
|
|
812
|
+
* @param reason - Reason shown to user (iOS)
|
|
813
|
+
*/
|
|
814
|
+
authenticateBiometric(reason: string): Promise<boolean>;
|
|
815
|
+
/**
|
|
816
|
+
* Store data securely (keychain/keystore)
|
|
817
|
+
* @param key - Storage key
|
|
818
|
+
* @param value - Value to store
|
|
819
|
+
*/
|
|
820
|
+
secureStore(key: string, value: string): Promise<void>;
|
|
821
|
+
/**
|
|
822
|
+
* Retrieve data from secure storage
|
|
823
|
+
* @param key - Storage key
|
|
824
|
+
*/
|
|
825
|
+
secureRetrieve(key: string): Promise<string | null>;
|
|
826
|
+
/**
|
|
827
|
+
* Delete data from secure storage
|
|
828
|
+
* @param key - Storage key
|
|
829
|
+
*/
|
|
830
|
+
secureDelete(key: string): Promise<void>;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Craft Desktop Bridge API (available as window.craft in desktop WebView)
|
|
834
|
+
*
|
|
835
|
+
* This interface covers the desktop platforms (macOS, Linux, Windows).
|
|
836
|
+
* For the mobile bridge API (iOS/Android), see types/craft.d.ts which
|
|
837
|
+
* defines the CraftBridge interface with additional mobile-only features
|
|
838
|
+
* such as AR, ML, deep links, OTA updates, widgets, and auth persistence.
|
|
839
|
+
*/
|
|
840
|
+
export interface CraftBridgeAPI {
|
|
841
|
+
/**
|
|
842
|
+
* System tray control (desktop only)
|
|
843
|
+
*/
|
|
844
|
+
tray?: CraftTrayAPI;
|
|
845
|
+
/**
|
|
846
|
+
* Window control (desktop)
|
|
847
|
+
*/
|
|
848
|
+
window?: CraftWindowAPI;
|
|
849
|
+
/**
|
|
850
|
+
* Application control
|
|
851
|
+
*/
|
|
852
|
+
app: CraftAppAPI;
|
|
853
|
+
/**
|
|
854
|
+
* Mobile-specific APIs (mobile only)
|
|
855
|
+
*/
|
|
856
|
+
mobile?: CraftMobileAPI;
|
|
857
|
+
/**
|
|
858
|
+
* File system APIs
|
|
859
|
+
*/
|
|
860
|
+
fs?: CraftFileSystemAPI;
|
|
861
|
+
/**
|
|
862
|
+
* Database APIs
|
|
863
|
+
*/
|
|
864
|
+
db?: CraftDatabaseAPI;
|
|
865
|
+
/**
|
|
866
|
+
* HTTP client APIs
|
|
867
|
+
*/
|
|
868
|
+
http?: CraftHttpAPI;
|
|
869
|
+
/**
|
|
870
|
+
* Native sidebar APIs (macOS)
|
|
871
|
+
*/
|
|
872
|
+
sidebar?: CraftSidebarAPI;
|
|
873
|
+
/**
|
|
874
|
+
* Crypto APIs
|
|
875
|
+
*/
|
|
876
|
+
crypto?: CraftCryptoAPI;
|
|
877
|
+
}
|
|
878
|
+
/**
|
|
879
|
+
* File system API
|
|
880
|
+
*/
|
|
881
|
+
export interface CraftFileSystemAPI {
|
|
882
|
+
/**
|
|
883
|
+
* Read file contents
|
|
884
|
+
* @param path - File path
|
|
885
|
+
*/
|
|
886
|
+
readFile(path: string): Promise<string>;
|
|
887
|
+
/**
|
|
888
|
+
* Write file contents
|
|
889
|
+
* @param path - File path
|
|
890
|
+
* @param content - File content
|
|
891
|
+
*/
|
|
892
|
+
writeFile(path: string, content: string): Promise<void>;
|
|
893
|
+
/**
|
|
894
|
+
* Read directory contents
|
|
895
|
+
* @param path - Directory path
|
|
896
|
+
*/
|
|
897
|
+
readDir(path: string): Promise<string[]>;
|
|
898
|
+
/**
|
|
899
|
+
* Create directory
|
|
900
|
+
* @param path - Directory path
|
|
901
|
+
*/
|
|
902
|
+
mkdir(path: string): Promise<void>;
|
|
903
|
+
/**
|
|
904
|
+
* Remove file or directory
|
|
905
|
+
* @param path - Path to remove
|
|
906
|
+
*/
|
|
907
|
+
remove(path: string): Promise<void>;
|
|
908
|
+
/**
|
|
909
|
+
* Check if path exists
|
|
910
|
+
* @param path - Path to check
|
|
911
|
+
*/
|
|
912
|
+
exists(path: string): Promise<boolean>;
|
|
913
|
+
}
|
|
914
|
+
/**
|
|
915
|
+
* Database API (SQLite)
|
|
916
|
+
*/
|
|
917
|
+
export interface CraftDatabaseAPI {
|
|
918
|
+
/**
|
|
919
|
+
* Execute SQL query
|
|
920
|
+
* @param sql - SQL query
|
|
921
|
+
* @param params - Query parameters
|
|
922
|
+
*/
|
|
923
|
+
execute(sql: string, params?: unknown[]): Promise<void>;
|
|
924
|
+
/**
|
|
925
|
+
* Query database
|
|
926
|
+
* @param sql - SQL query
|
|
927
|
+
* @param params - Query parameters
|
|
928
|
+
*/
|
|
929
|
+
query(sql: string, params?: unknown[]): Promise<unknown[]>;
|
|
930
|
+
/**
|
|
931
|
+
* Begin transaction
|
|
932
|
+
*/
|
|
933
|
+
beginTransaction(): Promise<void>;
|
|
934
|
+
/**
|
|
935
|
+
* Commit transaction
|
|
936
|
+
*/
|
|
937
|
+
commit(): Promise<void>;
|
|
938
|
+
/**
|
|
939
|
+
* Rollback transaction
|
|
940
|
+
*/
|
|
941
|
+
rollback(): Promise<void>;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* HTTP client API
|
|
945
|
+
*/
|
|
946
|
+
export interface CraftHttpAPI {
|
|
947
|
+
/**
|
|
948
|
+
* Fetch resource
|
|
949
|
+
* @param url - URL to fetch
|
|
950
|
+
* @param options - Fetch options
|
|
951
|
+
*/
|
|
952
|
+
fetch(url: string, options?: RequestInit): Promise<Response>;
|
|
953
|
+
/**
|
|
954
|
+
* Download file with progress
|
|
955
|
+
* @param url - URL to download
|
|
956
|
+
* @param destination - Download destination path
|
|
957
|
+
* @param onProgress - Progress callback
|
|
958
|
+
*/
|
|
959
|
+
download(url: string, destination: string, onProgress?: (progress: {
|
|
960
|
+
loaded: number;
|
|
961
|
+
total: number;
|
|
962
|
+
}) => void): Promise<void>;
|
|
963
|
+
/**
|
|
964
|
+
* Upload file with progress
|
|
965
|
+
* @param url - Upload URL
|
|
966
|
+
* @param filePath - File to upload
|
|
967
|
+
* @param onProgress - Progress callback
|
|
968
|
+
*/
|
|
969
|
+
upload(url: string, filePath: string, onProgress?: (progress: {
|
|
970
|
+
loaded: number;
|
|
971
|
+
total: number;
|
|
972
|
+
}) => void): Promise<Response>;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Crypto API
|
|
976
|
+
*/
|
|
977
|
+
export interface CraftCryptoAPI {
|
|
978
|
+
/**
|
|
979
|
+
* Generate random bytes
|
|
980
|
+
* @param size - Number of bytes
|
|
981
|
+
*/
|
|
982
|
+
randomBytes(size: number): Promise<Uint8Array>;
|
|
983
|
+
/**
|
|
984
|
+
* Hash data
|
|
985
|
+
* @param algorithm - Hash algorithm
|
|
986
|
+
* @param data - Data to hash
|
|
987
|
+
*/
|
|
988
|
+
hash(algorithm: 'sha256' | 'sha512' | 'md5', data: string): Promise<string>;
|
|
989
|
+
/**
|
|
990
|
+
* Encrypt data
|
|
991
|
+
* @param data - Data to encrypt
|
|
992
|
+
* @param key - Encryption key
|
|
993
|
+
*/
|
|
994
|
+
encrypt(data: string, key: string): Promise<string>;
|
|
995
|
+
/**
|
|
996
|
+
* Decrypt data
|
|
997
|
+
* @param encryptedData - Data to decrypt
|
|
998
|
+
* @param key - Decryption key
|
|
999
|
+
*/
|
|
1000
|
+
decrypt(encryptedData: string, key: string): Promise<string>;
|
|
1001
|
+
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Event types for craft.on() and craft.off()
|
|
1004
|
+
*/
|
|
1005
|
+
export type CraftEventType = 'window:focus' | 'window:blur' | 'window:resize' | 'window:move' | 'window:close' | 'window:minimize' | 'window:maximize' | 'window:fullscreen' | 'app:activate' | 'app:deactivate' | 'app:beforeQuit' | 'app:willQuit' | 'tray:click' | 'tray:rightClick' | 'tray:doubleClick' | 'menu:click' | 'shortcut:triggered' | 'deeplink:open' | 'file:drop' | 'theme:change' | 'network:online' | 'network:offline' | 'battery:low' | 'battery:charging' | 'idle:active' | 'idle:idle' | 'display:added' | 'display:removed' | 'display:changed';
|
|
1006
|
+
/**
|
|
1007
|
+
* Event data map for typed event handlers
|
|
1008
|
+
*/
|
|
1009
|
+
export interface CraftEventMap {
|
|
1010
|
+
'window:focus': void;
|
|
1011
|
+
'window:blur': void;
|
|
1012
|
+
'window:resize': {
|
|
1013
|
+
width: number;
|
|
1014
|
+
height: number;
|
|
1015
|
+
};
|
|
1016
|
+
'window:move': {
|
|
1017
|
+
x: number;
|
|
1018
|
+
y: number;
|
|
1019
|
+
};
|
|
1020
|
+
'window:close': void;
|
|
1021
|
+
'window:minimize': void;
|
|
1022
|
+
'window:maximize': void;
|
|
1023
|
+
'window:fullscreen': {
|
|
1024
|
+
isFullscreen: boolean;
|
|
1025
|
+
};
|
|
1026
|
+
'app:activate': void;
|
|
1027
|
+
'app:deactivate': void;
|
|
1028
|
+
'app:beforeQuit': {
|
|
1029
|
+
preventDefault: () => void;
|
|
1030
|
+
};
|
|
1031
|
+
'app:willQuit': void;
|
|
1032
|
+
'tray:click': TrayClickEvent;
|
|
1033
|
+
'tray:rightClick': TrayClickEvent;
|
|
1034
|
+
'tray:doubleClick': TrayClickEvent;
|
|
1035
|
+
'menu:click': {
|
|
1036
|
+
menuId: string;
|
|
1037
|
+
itemId: string;
|
|
1038
|
+
};
|
|
1039
|
+
'shortcut:triggered': {
|
|
1040
|
+
shortcut: string;
|
|
1041
|
+
};
|
|
1042
|
+
'deeplink:open': {
|
|
1043
|
+
url: string;
|
|
1044
|
+
};
|
|
1045
|
+
'file:drop': {
|
|
1046
|
+
files: string[];
|
|
1047
|
+
};
|
|
1048
|
+
'theme:change': {
|
|
1049
|
+
theme: 'light' | 'dark' | 'system';
|
|
1050
|
+
};
|
|
1051
|
+
'network:online': void;
|
|
1052
|
+
'network:offline': void;
|
|
1053
|
+
'battery:low': {
|
|
1054
|
+
level: number;
|
|
1055
|
+
};
|
|
1056
|
+
'battery:charging': {
|
|
1057
|
+
isCharging: boolean;
|
|
1058
|
+
};
|
|
1059
|
+
'idle:active': void;
|
|
1060
|
+
'idle:idle': {
|
|
1061
|
+
idleTime: number;
|
|
1062
|
+
};
|
|
1063
|
+
'display:added': DisplayInfo;
|
|
1064
|
+
'display:removed': {
|
|
1065
|
+
id: string;
|
|
1066
|
+
};
|
|
1067
|
+
'display:changed': DisplayInfo;
|
|
1068
|
+
}
|
|
1069
|
+
/**
|
|
1070
|
+
* Event handler type
|
|
1071
|
+
*/
|
|
1072
|
+
export type CraftEventHandler<T extends CraftEventType> = (_data: CraftEventMap[T]) => void;
|
|
1073
|
+
/**
|
|
1074
|
+
* Display information
|
|
1075
|
+
*/
|
|
1076
|
+
export interface DisplayInfo {
|
|
1077
|
+
/** Display ID */
|
|
1078
|
+
id: string;
|
|
1079
|
+
/** Display name */
|
|
1080
|
+
name: string;
|
|
1081
|
+
/** Width in pixels */
|
|
1082
|
+
width: number;
|
|
1083
|
+
/** Height in pixels */
|
|
1084
|
+
height: number;
|
|
1085
|
+
/** Scale factor */
|
|
1086
|
+
scaleFactor: number;
|
|
1087
|
+
/** Whether this is the primary display */
|
|
1088
|
+
isPrimary: boolean;
|
|
1089
|
+
/** Display bounds */
|
|
1090
|
+
bounds: {
|
|
1091
|
+
x: number;
|
|
1092
|
+
y: number;
|
|
1093
|
+
width: number;
|
|
1094
|
+
height: number;
|
|
1095
|
+
};
|
|
1096
|
+
/** Work area bounds (excluding taskbar/dock) */
|
|
1097
|
+
workArea: {
|
|
1098
|
+
x: number;
|
|
1099
|
+
y: number;
|
|
1100
|
+
width: number;
|
|
1101
|
+
height: number;
|
|
1102
|
+
};
|
|
1103
|
+
}
|
|
1104
|
+
/**
|
|
1105
|
+
* Event emitter API
|
|
1106
|
+
*/
|
|
1107
|
+
export interface CraftEventEmitter {
|
|
1108
|
+
/**
|
|
1109
|
+
* Register an event handler
|
|
1110
|
+
* @param event - Event type
|
|
1111
|
+
* @param handler - Event handler function
|
|
1112
|
+
* @returns Unsubscribe function
|
|
1113
|
+
*/
|
|
1114
|
+
on<T extends CraftEventType>(event: T, handler: CraftEventHandler<T>): () => void;
|
|
1115
|
+
/**
|
|
1116
|
+
* Register a one-time event handler
|
|
1117
|
+
* @param event - Event type
|
|
1118
|
+
* @param handler - Event handler function
|
|
1119
|
+
* @returns Unsubscribe function
|
|
1120
|
+
*/
|
|
1121
|
+
once<T extends CraftEventType>(event: T, handler: CraftEventHandler<T>): () => void;
|
|
1122
|
+
/**
|
|
1123
|
+
* Remove an event handler
|
|
1124
|
+
* @param event - Event type
|
|
1125
|
+
* @param handler - Event handler function
|
|
1126
|
+
*/
|
|
1127
|
+
off<T extends CraftEventType>(event: T, handler: CraftEventHandler<T>): void;
|
|
1128
|
+
/**
|
|
1129
|
+
* Remove all handlers for an event
|
|
1130
|
+
* @param event - Event type
|
|
1131
|
+
*/
|
|
1132
|
+
removeAllListeners(event?: CraftEventType): void;
|
|
1133
|
+
/**
|
|
1134
|
+
* Emit an event (internal use)
|
|
1135
|
+
* @param event - Event type
|
|
1136
|
+
* @param data - Event data
|
|
1137
|
+
*/
|
|
1138
|
+
emit<T extends CraftEventType>(event: T, data: CraftEventMap[T]): void;
|
|
1139
|
+
}
|
|
1140
|
+
/**
|
|
1141
|
+
* iOS-specific configuration
|
|
1142
|
+
*/
|
|
1143
|
+
export interface IOSConfig {
|
|
1144
|
+
/** Bundle identifier */
|
|
1145
|
+
bundleId: string;
|
|
1146
|
+
/** App name */
|
|
1147
|
+
appName: string;
|
|
1148
|
+
/** Version string */
|
|
1149
|
+
version: string;
|
|
1150
|
+
/** Build number */
|
|
1151
|
+
buildNumber: string;
|
|
1152
|
+
/** Minimum iOS version */
|
|
1153
|
+
minimumOSVersion?: string;
|
|
1154
|
+
/** Device families (1=iPhone, 2=iPad) */
|
|
1155
|
+
deviceFamily?: (1 | 2)[];
|
|
1156
|
+
/** Supported orientations */
|
|
1157
|
+
orientations?: ('portrait' | 'portraitUpsideDown' | 'landscapeLeft' | 'landscapeRight')[];
|
|
1158
|
+
/** Status bar style */
|
|
1159
|
+
statusBarStyle?: 'default' | 'lightContent' | 'darkContent';
|
|
1160
|
+
/** Hide status bar */
|
|
1161
|
+
statusBarHidden?: boolean;
|
|
1162
|
+
/** Requires full screen */
|
|
1163
|
+
requiresFullScreen?: boolean;
|
|
1164
|
+
/** Background modes */
|
|
1165
|
+
backgroundModes?: ('audio' | 'location' | 'fetch' | 'remote-notification' | 'processing')[];
|
|
1166
|
+
/** URL schemes */
|
|
1167
|
+
urlSchemes?: string[];
|
|
1168
|
+
/** Associated domains (for universal links) */
|
|
1169
|
+
associatedDomains?: string[];
|
|
1170
|
+
/** App Transport Security settings */
|
|
1171
|
+
ats?: {
|
|
1172
|
+
allowsArbitraryLoads?: boolean;
|
|
1173
|
+
allowsArbitraryLoadsForMedia?: boolean;
|
|
1174
|
+
allowsArbitraryLoadsInWebContent?: boolean;
|
|
1175
|
+
exceptionDomains?: Record<string, {
|
|
1176
|
+
includesSubdomains?: boolean;
|
|
1177
|
+
allowsInsecureHTTPLoads?: boolean;
|
|
1178
|
+
}>;
|
|
1179
|
+
};
|
|
1180
|
+
/** Privacy usage descriptions */
|
|
1181
|
+
privacyDescriptions?: {
|
|
1182
|
+
camera?: string;
|
|
1183
|
+
microphone?: string;
|
|
1184
|
+
photoLibrary?: string;
|
|
1185
|
+
location?: string;
|
|
1186
|
+
locationAlways?: string;
|
|
1187
|
+
contacts?: string;
|
|
1188
|
+
calendars?: string;
|
|
1189
|
+
reminders?: string;
|
|
1190
|
+
healthShare?: string;
|
|
1191
|
+
healthUpdate?: string;
|
|
1192
|
+
motion?: string;
|
|
1193
|
+
bluetooth?: string;
|
|
1194
|
+
faceId?: string;
|
|
1195
|
+
speechRecognition?: string;
|
|
1196
|
+
tracking?: string;
|
|
1197
|
+
};
|
|
1198
|
+
/** Capabilities */
|
|
1199
|
+
capabilities?: {
|
|
1200
|
+
pushNotifications?: boolean;
|
|
1201
|
+
appGroups?: string[];
|
|
1202
|
+
iCloud?: {
|
|
1203
|
+
containers?: string[];
|
|
1204
|
+
};
|
|
1205
|
+
healthKit?: boolean;
|
|
1206
|
+
homeKit?: boolean;
|
|
1207
|
+
siriKit?: boolean;
|
|
1208
|
+
carPlay?: boolean;
|
|
1209
|
+
accessWifi?: boolean;
|
|
1210
|
+
nfc?: boolean;
|
|
1211
|
+
};
|
|
1212
|
+
/**
|
|
1213
|
+
* Custom entitlements as plist key/value pairs. Values must be one of the
|
|
1214
|
+
* primitive plist types — booleans, strings, numbers, or arrays of those.
|
|
1215
|
+
* Anything richer (e.g. nested dicts) needs a manual `.entitlements`
|
|
1216
|
+
* file referenced via {@link AppleSigningOptions.entitlementsPath}.
|
|
1217
|
+
*/
|
|
1218
|
+
entitlements?: Record<string, boolean | string | number | Array<string | number>>;
|
|
1219
|
+
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Android-specific configuration
|
|
1222
|
+
*/
|
|
1223
|
+
export interface AndroidConfig {
|
|
1224
|
+
/** Package name */
|
|
1225
|
+
packageName: string;
|
|
1226
|
+
/** App name */
|
|
1227
|
+
appName: string;
|
|
1228
|
+
/** Version name */
|
|
1229
|
+
versionName: string;
|
|
1230
|
+
/** Version code */
|
|
1231
|
+
versionCode: number;
|
|
1232
|
+
/** Minimum SDK version */
|
|
1233
|
+
minSdkVersion?: number;
|
|
1234
|
+
/** Target SDK version */
|
|
1235
|
+
targetSdkVersion?: number;
|
|
1236
|
+
/** Compile SDK version */
|
|
1237
|
+
compileSdkVersion?: number;
|
|
1238
|
+
/** Supported screen sizes */
|
|
1239
|
+
screenSizes?: ('small' | 'normal' | 'large' | 'xlarge')[];
|
|
1240
|
+
/** Screen orientations */
|
|
1241
|
+
orientations?: ('portrait' | 'landscape' | 'sensor')[];
|
|
1242
|
+
/** Permissions */
|
|
1243
|
+
permissions?: string[];
|
|
1244
|
+
/** Features */
|
|
1245
|
+
features?: Array<{
|
|
1246
|
+
name: string;
|
|
1247
|
+
required?: boolean;
|
|
1248
|
+
}>;
|
|
1249
|
+
/** Intent filters */
|
|
1250
|
+
intentFilters?: Array<{
|
|
1251
|
+
action: string;
|
|
1252
|
+
category?: string[];
|
|
1253
|
+
data?: {
|
|
1254
|
+
scheme?: string;
|
|
1255
|
+
host?: string;
|
|
1256
|
+
pathPrefix?: string;
|
|
1257
|
+
};
|
|
1258
|
+
}>;
|
|
1259
|
+
/** Deep links */
|
|
1260
|
+
deepLinks?: Array<{
|
|
1261
|
+
scheme: string;
|
|
1262
|
+
host: string;
|
|
1263
|
+
pathPrefix?: string;
|
|
1264
|
+
}>;
|
|
1265
|
+
/** Gradle config */
|
|
1266
|
+
gradle?: {
|
|
1267
|
+
buildToolsVersion?: string;
|
|
1268
|
+
ndkVersion?: string;
|
|
1269
|
+
kotlinVersion?: string;
|
|
1270
|
+
dependencies?: string[];
|
|
1271
|
+
plugins?: string[];
|
|
1272
|
+
};
|
|
1273
|
+
/** ProGuard rules */
|
|
1274
|
+
proguardRules?: string[];
|
|
1275
|
+
/** Signing config */
|
|
1276
|
+
signing?: {
|
|
1277
|
+
keyAlias: string;
|
|
1278
|
+
keyPassword?: string;
|
|
1279
|
+
storeFile: string;
|
|
1280
|
+
storePassword?: string;
|
|
1281
|
+
};
|
|
1282
|
+
/** Adaptive icon */
|
|
1283
|
+
adaptiveIcon?: {
|
|
1284
|
+
foreground: string;
|
|
1285
|
+
background: string;
|
|
1286
|
+
monochromeIcon?: string;
|
|
1287
|
+
};
|
|
1288
|
+
/** Splash screen */
|
|
1289
|
+
splashScreen?: {
|
|
1290
|
+
backgroundColor: string;
|
|
1291
|
+
icon: string;
|
|
1292
|
+
iconWidth?: number;
|
|
1293
|
+
};
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* macOS-specific configuration
|
|
1297
|
+
*/
|
|
1298
|
+
export interface MacOSConfig {
|
|
1299
|
+
/** Bundle identifier */
|
|
1300
|
+
bundleId: string;
|
|
1301
|
+
/** App name */
|
|
1302
|
+
appName: string;
|
|
1303
|
+
/** Version */
|
|
1304
|
+
version: string;
|
|
1305
|
+
/** Build number */
|
|
1306
|
+
buildNumber: string;
|
|
1307
|
+
/** Minimum macOS version */
|
|
1308
|
+
minimumOSVersion?: string;
|
|
1309
|
+
/** App category */
|
|
1310
|
+
category?: string;
|
|
1311
|
+
/** Copyright */
|
|
1312
|
+
copyright?: string;
|
|
1313
|
+
/** Sandbox enabled */
|
|
1314
|
+
sandbox?: boolean;
|
|
1315
|
+
/** Hardened runtime */
|
|
1316
|
+
hardenedRuntime?: boolean;
|
|
1317
|
+
/** Code signing identity */
|
|
1318
|
+
signingIdentity?: string;
|
|
1319
|
+
/** Provisioning profile */
|
|
1320
|
+
provisioningProfile?: string;
|
|
1321
|
+
/** Entitlements */
|
|
1322
|
+
entitlements?: {
|
|
1323
|
+
'com.apple.security.app-sandbox'?: boolean;
|
|
1324
|
+
'com.apple.security.network.client'?: boolean;
|
|
1325
|
+
'com.apple.security.network.server'?: boolean;
|
|
1326
|
+
'com.apple.security.files.user-selected.read-only'?: boolean;
|
|
1327
|
+
'com.apple.security.files.user-selected.read-write'?: boolean;
|
|
1328
|
+
'com.apple.security.files.downloads.read-only'?: boolean;
|
|
1329
|
+
'com.apple.security.files.downloads.read-write'?: boolean;
|
|
1330
|
+
'com.apple.security.device.camera'?: boolean;
|
|
1331
|
+
'com.apple.security.device.microphone'?: boolean;
|
|
1332
|
+
'com.apple.security.device.usb'?: boolean;
|
|
1333
|
+
'com.apple.security.device.bluetooth'?: boolean;
|
|
1334
|
+
'com.apple.security.personal-information.location'?: boolean;
|
|
1335
|
+
'com.apple.security.personal-information.addressbook'?: boolean;
|
|
1336
|
+
'com.apple.security.personal-information.calendars'?: boolean;
|
|
1337
|
+
'com.apple.security.automation.apple-events'?: boolean;
|
|
1338
|
+
[key: string]: boolean | string | string[] | undefined;
|
|
1339
|
+
};
|
|
1340
|
+
/** URL schemes */
|
|
1341
|
+
urlSchemes?: string[];
|
|
1342
|
+
/** File type associations */
|
|
1343
|
+
fileAssociations?: Array<{
|
|
1344
|
+
extension: string;
|
|
1345
|
+
name: string;
|
|
1346
|
+
role: 'Editor' | 'Viewer' | 'Shell' | 'None';
|
|
1347
|
+
icon?: string;
|
|
1348
|
+
}>;
|
|
1349
|
+
/** DMG options */
|
|
1350
|
+
dmg?: {
|
|
1351
|
+
title?: string;
|
|
1352
|
+
icon?: string;
|
|
1353
|
+
background?: string;
|
|
1354
|
+
windowWidth?: number;
|
|
1355
|
+
windowHeight?: number;
|
|
1356
|
+
iconSize?: number;
|
|
1357
|
+
contents?: Array<{
|
|
1358
|
+
x: number;
|
|
1359
|
+
y: number;
|
|
1360
|
+
type: 'file' | 'link';
|
|
1361
|
+
path: string;
|
|
1362
|
+
}>;
|
|
1363
|
+
};
|
|
1364
|
+
/** Notarization */
|
|
1365
|
+
notarization?: {
|
|
1366
|
+
appleId: string;
|
|
1367
|
+
teamId: string;
|
|
1368
|
+
password?: string;
|
|
1369
|
+
};
|
|
1370
|
+
}
|
|
1371
|
+
/**
|
|
1372
|
+
* Windows-specific configuration
|
|
1373
|
+
*/
|
|
1374
|
+
export interface WindowsConfig {
|
|
1375
|
+
/** Application ID */
|
|
1376
|
+
appId: string;
|
|
1377
|
+
/** App name */
|
|
1378
|
+
appName: string;
|
|
1379
|
+
/** Version */
|
|
1380
|
+
version: string;
|
|
1381
|
+
/** Publisher name */
|
|
1382
|
+
publisher: string;
|
|
1383
|
+
/** Publisher display name */
|
|
1384
|
+
publisherDisplayName: string;
|
|
1385
|
+
/** Description */
|
|
1386
|
+
description?: string;
|
|
1387
|
+
/** App icon */
|
|
1388
|
+
icon?: string;
|
|
1389
|
+
/** Request elevation */
|
|
1390
|
+
requestedExecutionLevel?: 'asInvoker' | 'highestAvailable' | 'requireAdministrator';
|
|
1391
|
+
/** File associations */
|
|
1392
|
+
fileAssociations?: Array<{
|
|
1393
|
+
extension: string;
|
|
1394
|
+
name: string;
|
|
1395
|
+
description?: string;
|
|
1396
|
+
icon?: string;
|
|
1397
|
+
}>;
|
|
1398
|
+
/** Protocol handlers */
|
|
1399
|
+
protocols?: Array<{
|
|
1400
|
+
name: string;
|
|
1401
|
+
schemes: string[];
|
|
1402
|
+
}>;
|
|
1403
|
+
/** NSIS installer options */
|
|
1404
|
+
nsis?: {
|
|
1405
|
+
oneClick?: boolean;
|
|
1406
|
+
perMachine?: boolean;
|
|
1407
|
+
allowElevation?: boolean;
|
|
1408
|
+
allowToChangeInstallationDirectory?: boolean;
|
|
1409
|
+
installerIcon?: string;
|
|
1410
|
+
uninstallerIcon?: string;
|
|
1411
|
+
installerHeaderIcon?: string;
|
|
1412
|
+
createDesktopShortcut?: boolean | 'always';
|
|
1413
|
+
createStartMenuShortcut?: boolean;
|
|
1414
|
+
shortcutName?: string;
|
|
1415
|
+
include?: string;
|
|
1416
|
+
license?: string;
|
|
1417
|
+
};
|
|
1418
|
+
/** MSI installer options */
|
|
1419
|
+
msi?: {
|
|
1420
|
+
oneClick?: boolean;
|
|
1421
|
+
perMachine?: boolean;
|
|
1422
|
+
upgradeCode?: string;
|
|
1423
|
+
};
|
|
1424
|
+
/** MSIX package options */
|
|
1425
|
+
msix?: {
|
|
1426
|
+
identityName?: string;
|
|
1427
|
+
applicationId?: string;
|
|
1428
|
+
publisher?: string;
|
|
1429
|
+
publisherDisplayName?: string;
|
|
1430
|
+
certificateFile?: string;
|
|
1431
|
+
certificatePassword?: string;
|
|
1432
|
+
};
|
|
1433
|
+
/** Code signing */
|
|
1434
|
+
signing?: {
|
|
1435
|
+
certificateFile?: string;
|
|
1436
|
+
certificatePassword?: string;
|
|
1437
|
+
certificateSubjectName?: string;
|
|
1438
|
+
certificateSha1?: string;
|
|
1439
|
+
signingHashAlgorithms?: ('sha1' | 'sha256')[];
|
|
1440
|
+
timestampServer?: string;
|
|
1441
|
+
};
|
|
1442
|
+
}
|
|
1443
|
+
/**
|
|
1444
|
+
* Linux-specific configuration
|
|
1445
|
+
*/
|
|
1446
|
+
export interface LinuxConfig {
|
|
1447
|
+
/** App name */
|
|
1448
|
+
appName: string;
|
|
1449
|
+
/** Executable name */
|
|
1450
|
+
executableName: string;
|
|
1451
|
+
/** Version */
|
|
1452
|
+
version: string;
|
|
1453
|
+
/** Description */
|
|
1454
|
+
description?: string;
|
|
1455
|
+
/** Maintainer */
|
|
1456
|
+
maintainer?: string;
|
|
1457
|
+
/** Vendor */
|
|
1458
|
+
vendor?: string;
|
|
1459
|
+
/** Homepage */
|
|
1460
|
+
homepage?: string;
|
|
1461
|
+
/** Category */
|
|
1462
|
+
category?: string;
|
|
1463
|
+
/** Icon */
|
|
1464
|
+
icon?: string | Record<string, string>;
|
|
1465
|
+
/** Desktop file */
|
|
1466
|
+
desktop?: {
|
|
1467
|
+
Name?: string;
|
|
1468
|
+
GenericName?: string;
|
|
1469
|
+
Comment?: string;
|
|
1470
|
+
Exec?: string;
|
|
1471
|
+
Icon?: string;
|
|
1472
|
+
Terminal?: boolean;
|
|
1473
|
+
Type?: string;
|
|
1474
|
+
Categories?: string[];
|
|
1475
|
+
MimeType?: string[];
|
|
1476
|
+
StartupWMClass?: string;
|
|
1477
|
+
Keywords?: string[];
|
|
1478
|
+
};
|
|
1479
|
+
/** Deb package options */
|
|
1480
|
+
deb?: {
|
|
1481
|
+
depends?: string[];
|
|
1482
|
+
recommends?: string[];
|
|
1483
|
+
section?: string;
|
|
1484
|
+
priority?: string;
|
|
1485
|
+
scripts?: {
|
|
1486
|
+
preinst?: string;
|
|
1487
|
+
postinst?: string;
|
|
1488
|
+
prerm?: string;
|
|
1489
|
+
postrm?: string;
|
|
1490
|
+
};
|
|
1491
|
+
};
|
|
1492
|
+
/** RPM package options */
|
|
1493
|
+
rpm?: {
|
|
1494
|
+
requires?: string[];
|
|
1495
|
+
license?: string;
|
|
1496
|
+
group?: string;
|
|
1497
|
+
scripts?: {
|
|
1498
|
+
pre?: string;
|
|
1499
|
+
post?: string;
|
|
1500
|
+
preun?: string;
|
|
1501
|
+
postun?: string;
|
|
1502
|
+
};
|
|
1503
|
+
};
|
|
1504
|
+
/** AppImage options */
|
|
1505
|
+
appImage?: {
|
|
1506
|
+
license?: string;
|
|
1507
|
+
category?: string;
|
|
1508
|
+
};
|
|
1509
|
+
/** Flatpak options */
|
|
1510
|
+
flatpak?: {
|
|
1511
|
+
appId: string;
|
|
1512
|
+
branch?: string;
|
|
1513
|
+
runtime?: string;
|
|
1514
|
+
runtimeVersion?: string;
|
|
1515
|
+
sdk?: string;
|
|
1516
|
+
permissions?: string[];
|
|
1517
|
+
modules?: any[];
|
|
1518
|
+
};
|
|
1519
|
+
/** Snap options */
|
|
1520
|
+
snap?: {
|
|
1521
|
+
name: string;
|
|
1522
|
+
grade?: 'stable' | 'devel';
|
|
1523
|
+
confinement?: 'strict' | 'classic' | 'devmode';
|
|
1524
|
+
base?: string;
|
|
1525
|
+
plugs?: string[];
|
|
1526
|
+
slots?: string[];
|
|
1527
|
+
};
|
|
1528
|
+
}
|
|
1529
|
+
/**
|
|
1530
|
+
* Complete app configuration with platform-specific options
|
|
1531
|
+
*/
|
|
1532
|
+
export interface CraftAppConfig extends AppConfig {
|
|
1533
|
+
/** iOS configuration */
|
|
1534
|
+
ios?: IOSConfig;
|
|
1535
|
+
/** Android configuration */
|
|
1536
|
+
android?: AndroidConfig;
|
|
1537
|
+
/** macOS configuration */
|
|
1538
|
+
macos?: MacOSConfig;
|
|
1539
|
+
/** Windows configuration */
|
|
1540
|
+
windows?: WindowsConfig;
|
|
1541
|
+
/** Linux configuration */
|
|
1542
|
+
linux?: LinuxConfig;
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Augment the Window interface to include the Craft bridge
|
|
1546
|
+
*/
|
|
1547
|
+
declare global {
|
|
1548
|
+
interface Window {
|
|
1549
|
+
/**
|
|
1550
|
+
* Craft native bridge API (auto-injected)
|
|
1551
|
+
*/
|
|
1552
|
+
craft?: CraftBridgeAPI & CraftEventEmitter;
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
//# sourceMappingURL=types.d.ts.map
|