@croffledev/croffle-types 1.0.0 → 1.0.1
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/index.d.ts +379 -358
- package/package.json +7 -3
package/index.d.ts
CHANGED
|
@@ -1,365 +1,386 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
export interface SearchQuery {
|
|
24
|
-
text?: string;
|
|
25
|
-
dateRange?: {
|
|
26
|
-
start: string; // ISO 8601 format
|
|
27
|
-
end: string; // ISO 8601 format
|
|
28
|
-
};
|
|
29
|
-
tags?: Tag[];
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface FeatureView {
|
|
33
|
-
id: string; // 각 메뉴를 식별할 고유 ID (플러그인별 고유값)
|
|
34
|
-
title: string; // 사용자에게 보여줄 한글 제목
|
|
35
|
-
subtitle: string; // 디자인을 위한 영문 부제목
|
|
36
|
-
icon: Component; // 표시할 아이콘 컴포넌트
|
|
37
|
-
url: string; // 클릭 시 이동할 경로
|
|
38
|
-
active?: boolean; // 현재 활성화 상태 여부 (선택적)
|
|
39
|
-
pluginName?: string; // 해당 메뉴를 제공하는 플러그인 이름 (관리용)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
export interface FeatureContextMenu {
|
|
43
|
-
id: string; // 메뉴의 고유 식별자 ex) add-schedule, delete-schedule
|
|
44
|
-
label: string; // 메뉴에 표시될 텍스트
|
|
45
|
-
action: (targetElement: HTMLElement | null) => void; // 메뉴 클릭 시 실행될 함수
|
|
46
|
-
condition?: (targetElement: HTMLElement | null) => boolean;
|
|
47
|
-
disabled?: boolean; // 메뉴 활성화 여부 (선택 사항)
|
|
48
|
-
targetView?: string[]; // 메뉴가 표시될 대상 (viewId)
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface PluginInfo {
|
|
52
|
-
enabled: boolean;
|
|
53
|
-
id: string;
|
|
54
|
-
name: string;
|
|
55
|
-
version: string;
|
|
56
|
-
author: string;
|
|
57
|
-
main?: string;
|
|
58
|
-
description?: string;
|
|
59
|
-
features: {
|
|
60
|
-
views?: FeatureView[];
|
|
61
|
-
contextMenus?: FeatureContextMenu[];
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
export enum AppSettingLanguage {
|
|
66
|
-
KO = 'ko',
|
|
67
|
-
EN = 'en',
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export enum AppSettingTheme {
|
|
71
|
-
LIGHT = 'light',
|
|
72
|
-
DARK = 'dark',
|
|
73
|
-
SYSTEM = 'system',
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
export enum AppSettingStartupBehavior {
|
|
77
|
-
OPEN_LAST_SESSION = 'openLastSession',
|
|
78
|
-
OPEN_NEW_WINDOW = 'openNewWindow',
|
|
79
|
-
DO_NOTHING = 'doNothing',
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
export enum CalendarView {
|
|
83
|
-
DAY = 'day',
|
|
84
|
-
WEEK = 'week',
|
|
85
|
-
MONTH = 'month',
|
|
86
|
-
YEAR = 'year',
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
export enum CalendarWeekStartDay {
|
|
90
|
-
SUNDAY = 'sunday',
|
|
91
|
-
MONDAY = 'monday',
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
export enum CalendarTimeFormat {
|
|
95
|
-
H12 = '12h',
|
|
96
|
-
H24 = '24h',
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
export interface AppSettings {
|
|
100
|
-
general: {
|
|
101
|
-
language: AppSettingLanguage;
|
|
102
|
-
theme: AppSettingTheme;
|
|
103
|
-
autoUpdate: boolean;
|
|
104
|
-
startupBehavior: AppSettingStartupBehavior;
|
|
105
|
-
startOnSystemBoot: boolean;
|
|
106
|
-
startMinimized: boolean;
|
|
107
|
-
};
|
|
108
|
-
calendar: {
|
|
109
|
-
defaultView: CalendarView;
|
|
110
|
-
weekStartDay: CalendarWeekStartDay;
|
|
111
|
-
showWeekNumbers: boolean;
|
|
112
|
-
timeFormat: CalendarTimeFormat;
|
|
113
|
-
};
|
|
114
|
-
notifications: {
|
|
115
|
-
enabled: boolean;
|
|
116
|
-
defaultReminderMinutes: number;
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
export enum ClipboardDataType {
|
|
121
|
-
TEXT = 'text',
|
|
122
|
-
IMAGE = 'image',
|
|
123
|
-
EMPTY = 'empty',
|
|
124
|
-
ERROR = 'error',
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
export interface ClipboardResult {
|
|
128
|
-
type: ClipboardDataType;
|
|
129
|
-
value: string | Buffer | null;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export interface ClipboardTextData {
|
|
133
|
-
type: ClipboardDataType.TEXT;
|
|
134
|
-
value: string;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
export interface ClipboardImageData {
|
|
138
|
-
type: ClipboardDataType.IMAGE;
|
|
139
|
-
value: Buffer;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
export interface HttpResponse<T = unknown> {
|
|
143
|
-
ok: boolean;
|
|
144
|
-
status: number;
|
|
145
|
-
data: T | null;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// IPC Event Types in main process
|
|
149
|
-
export enum AppEventType {
|
|
150
|
-
// Schedule
|
|
151
|
-
SCHEDULE_GET = 'schedule:get',
|
|
152
|
-
SCHEDULE_CREATE = 'schedule:create',
|
|
153
|
-
SCHEDULE_UPDATE = 'schedule:update',
|
|
154
|
-
SCHEDULE_DELETE = 'schedule:delete',
|
|
155
|
-
SCHEDULE_EXPORT_TO_FILE = 'schedule:exportToFile',
|
|
156
|
-
SCHEDULE_IMPORT_FROM_FILE = 'schedule:importFromFile',
|
|
157
|
-
|
|
158
|
-
// Tag
|
|
159
|
-
TAG_GET = 'tag:getAll',
|
|
160
|
-
TAG_GET_BY_NAME = 'tag:getByName',
|
|
161
|
-
TAG_CREATE = 'tag:create',
|
|
162
|
-
TAG_UPDATE = 'tag:update',
|
|
163
|
-
TAG_DELETE = 'tag:delete',
|
|
164
|
-
|
|
165
|
-
// Plugin Info
|
|
166
|
-
PLUGIN_INFO_GET_INSTALLED = 'pluginInfo:getInstalled',
|
|
167
|
-
PLUGIN_INFO_GET_ENABLED = 'pluginInfo:getEnabled',
|
|
168
|
-
PLUGIN_INFO_GET_BY_NAME = 'pluginInfo:getByName',
|
|
169
|
-
PLUGIN_INFO_CREATE = 'pluginInfo:create',
|
|
170
|
-
PLUGIN_INFO_UPDATE = 'pluginInfo:update',
|
|
171
|
-
PLUGIN_INFO_DELETE = 'pluginInfo:delete',
|
|
172
|
-
|
|
173
|
-
// Plugin Storage
|
|
174
|
-
PLUGIN_STORAGE_GET = 'pluginStorage:get',
|
|
175
|
-
PLUGIN_STORAGE_SET = 'pluginStorage:set',
|
|
176
|
-
PLUGIN_STORAGE_DELETE = 'pluginStorage:delete',
|
|
177
|
-
|
|
178
|
-
// Settings
|
|
179
|
-
SETTINGS_GET = 'settings:get',
|
|
180
|
-
SETTINGS_GET_OF = 'settings:getOf',
|
|
181
|
-
SETTINGS_UPDATE = 'settings:update',
|
|
182
|
-
|
|
183
|
-
// Window
|
|
184
|
-
WINDOW_MINIMIZE = 'window:minimize',
|
|
185
|
-
WINDOW_RESTORE = 'window:restore',
|
|
186
|
-
WINDOW_MAXIMIZE = 'window:maximize',
|
|
187
|
-
WINDOW_CLOSE = 'window:close',
|
|
188
|
-
WINDOW_EXIT = 'window:exit',
|
|
189
|
-
WINDOW_CHECK_FOR_UPDATES = 'window:checkForUpdates',
|
|
190
|
-
WINDOW_SHOW = 'window:show',
|
|
191
|
-
WINDOW_HIDE = 'window:hide',
|
|
192
|
-
|
|
193
|
-
// OS Service
|
|
194
|
-
NATIVE_OS_NOTIFICATION = 'nativeOs:notification',
|
|
195
|
-
NATIVE_OS_CLIPBOARD_GET = 'nativeOs:clipboard:get',
|
|
196
|
-
NATIVE_OS_CLIPBOARD_SET = 'nativeOs:clipboard:set',
|
|
197
|
-
|
|
198
|
-
// HTTP Service
|
|
199
|
-
HTTP_SERVICE_GET = 'httpService:get',
|
|
200
|
-
HTTP_SERVICE_POST = 'httpService:post',
|
|
201
|
-
|
|
202
|
-
// Plugin
|
|
203
|
-
PLUGIN_INSTALL = 'plugin:install',
|
|
204
|
-
PLUGIN_TOGGLE = 'plugin:toggle',
|
|
205
|
-
PLUGIN_UNINSTALL = 'plugin:uninstall',
|
|
206
|
-
|
|
207
|
-
// Plugin Session Storage
|
|
208
|
-
PLUGIN_SESSION_STORAGE_GET = 'sessionStorage:get',
|
|
209
|
-
PLUGIN_SESSION_STORAGE_SET = 'sessionStorage:set',
|
|
210
|
-
PLUGIN_SESSION_STORAGE_CLEAR = 'sessionStorage:clear',
|
|
211
|
-
PLUGIN_SESSION_STORAGE_DELETE = 'sessionStorage:delete',
|
|
212
|
-
PLUGIN_SESSION_STORAGE_CLEAR_ALL = 'sessionStorage:clearAll',
|
|
213
|
-
|
|
214
|
-
// Background works
|
|
215
|
-
SCHEDULER_REGISTER = 'scheduler:register',
|
|
216
|
-
SCHEDULER_UNREGISTER = 'scheduler:unregister',
|
|
217
|
-
|
|
218
|
-
// UI Extensions
|
|
219
|
-
UI_ADD_MENU_ITEM = 'ui:addMenuItem',
|
|
220
|
-
UI_CONTEXT_MENU_ADD_ITEM = 'ui:contextMenu:addItem',
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
export interface PluginContext {
|
|
224
|
-
base: typeof base;
|
|
225
|
-
app: typeof app;
|
|
226
|
-
enums: typeof enums;
|
|
227
|
-
ui: typeof ui;
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
export namespace windows {
|
|
231
|
-
export function minimize(): Promise<void>;
|
|
232
|
-
export function maximize(): Promise<void>;
|
|
233
|
-
export function close(): Promise<void>;
|
|
234
|
-
export function exitApp(): Promise<void>;
|
|
235
|
-
export function checkForUpdates(): Promise<void>;
|
|
236
|
-
export function setCloseToTrayMode(enabled: boolean): Promise<void>;
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
export namespace tags {
|
|
240
|
-
export function getAll(): Promise<Tag[]>;
|
|
241
|
-
export function getByName(name: string): Promise<Tag | null>;
|
|
242
|
-
export function create(name: string, color: string): Promise<Tag>;
|
|
243
|
-
export function modify(id: string, name: string, color: string): Promise<Tag>;
|
|
244
|
-
export function remove(id: string): Promise<boolean>;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
export namespace schedules {
|
|
248
|
-
export function getAll(period: { start: string; end: string }): Promise<Schedule[]>;
|
|
249
|
-
export function create(data: Partial<Schedule>): Promise<Schedule>;
|
|
250
|
-
export function update(id: string, data: Partial<Schedule>): Promise<Schedule>;
|
|
251
|
-
export function remove(id: string): Promise<boolean>;
|
|
252
|
-
export function exportSchedulesToFile(period?: {
|
|
253
|
-
start: string;
|
|
254
|
-
end: string;
|
|
255
|
-
}): Promise<{ filePath: string; count: number } | null>;
|
|
256
|
-
export function importScheduleFromFile(
|
|
257
|
-
mode?: 'merge' | 'duplicate'
|
|
258
|
-
): Promise<{ created: number; updated: number } | null>;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export namespace pluginInfo {
|
|
262
|
-
export function getInstalled(): Promise<PluginInfo[]>;
|
|
263
|
-
export function getEnabled(): Promise<PluginInfo[]>;
|
|
264
|
-
export function getByName(name: string): Promise<PluginInfo | null>;
|
|
265
|
-
export function install(data: Partial<PluginInfo>): Promise<PluginInfo>;
|
|
266
|
-
export function toggle(name: string, enable: boolean): Promise<PluginInfo | null>;
|
|
267
|
-
export function uninstall(name: string): Promise<boolean>;
|
|
268
|
-
}
|
|
269
|
-
|
|
270
|
-
export namespace search {
|
|
271
|
-
export function search(query: SearchQuery): Promise<Schedule[]>;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
export namespace settings {
|
|
275
|
-
export function getAll(): Promise<AppSettings>;
|
|
276
|
-
export function getOf(key: string): Promise<AppSettings[keyof AppSettings]>;
|
|
277
|
-
export function update(newSettings: Partial<AppSettings>): Promise<AppSettings>;
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
export namespace pluginStorage {
|
|
281
|
-
export function get(pluginId: string, key: string): Promise<string | null>;
|
|
282
|
-
export function set(pluginId: string, key: string, value: string): Promise<void>;
|
|
283
|
-
}
|
|
284
|
-
|
|
285
|
-
export namespace os {
|
|
286
|
-
export function showNotification(title: string, body: string): Promise<void>;
|
|
287
|
-
export function getClipboard(): Promise<ClipboardResult>;
|
|
288
|
-
export function setClipboard(data: ClipboardTextData | ClipboardImageData): Promise<void>;
|
|
289
|
-
}
|
|
290
|
-
|
|
291
|
-
export namespace http {
|
|
292
|
-
export function get(
|
|
293
|
-
url: string,
|
|
294
|
-
params?: Record<string, string>,
|
|
295
|
-
headers?: Record<string, string>
|
|
296
|
-
): Promise<HttpResponse>;
|
|
297
|
-
export function post(
|
|
298
|
-
url: string,
|
|
299
|
-
body?: unknown,
|
|
300
|
-
headers?: Record<string, string>
|
|
301
|
-
): Promise<HttpResponse>;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
export namespace event {
|
|
305
|
-
/**
|
|
306
|
-
* Send event to all windows
|
|
307
|
-
* @param type event type
|
|
308
|
-
* @param payload event payload
|
|
309
|
-
*/
|
|
310
|
-
export function emit(type: string, payload: unknown): void;
|
|
311
|
-
/**
|
|
312
|
-
* Listen to event from all windows
|
|
313
|
-
* @param type event type
|
|
314
|
-
* @param callback callback function
|
|
315
|
-
* @returns unsubscribe function
|
|
316
|
-
*/
|
|
317
|
-
export function on(type: string, callback: (payload: unknown) => void): () => void;
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
export const base: {
|
|
321
|
-
windows: typeof windows;
|
|
322
|
-
tags: typeof tags;
|
|
323
|
-
schedules: typeof schedules;
|
|
324
|
-
pluginInfo: typeof pluginInfo;
|
|
325
|
-
search: typeof search;
|
|
326
|
-
settings: typeof settings;
|
|
327
|
-
};
|
|
1
|
+
export interface Schedule {
|
|
2
|
+
id: string;
|
|
3
|
+
title: string;
|
|
4
|
+
description: string;
|
|
5
|
+
location: string;
|
|
6
|
+
startDate: string; // ISO 8601 format
|
|
7
|
+
endDate: string; // ISO 8601 format
|
|
8
|
+
isAllDay: boolean;
|
|
9
|
+
recurrenceRule?: string;
|
|
10
|
+
colorLabel: string;
|
|
11
|
+
tags: Tag[];
|
|
12
|
+
createdAt: string; // ISO 8601 format
|
|
13
|
+
updatedAt: string; // ISO 8601 format
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface Tag {
|
|
17
|
+
id: string;
|
|
18
|
+
name: string;
|
|
19
|
+
color: string;
|
|
20
|
+
}
|
|
328
21
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
session: PluginSessionAPI;
|
|
22
|
+
export interface SearchQuery {
|
|
23
|
+
text?: string;
|
|
24
|
+
dateRange?: {
|
|
25
|
+
start: string; // ISO 8601 format
|
|
26
|
+
end: string; // ISO 8601 format
|
|
335
27
|
};
|
|
28
|
+
tags?: Tag[];
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface FeatureView {
|
|
32
|
+
id: string; // 각 메뉴를 식별할 고유 ID (플러그인별 고유값)
|
|
33
|
+
title: string; // 사용자에게 보여줄 한글 제목
|
|
34
|
+
subtitle: string; // 디자인을 위한 영문 부제목
|
|
35
|
+
icon: unknown; // 표시할 아이콘 컴포넌트
|
|
36
|
+
url: string; // 클릭 시 이동할 경로
|
|
37
|
+
active?: boolean; // 현재 활성화 상태 여부 (선택적)
|
|
38
|
+
pluginName?: string; // 해당 메뉴를 제공하는 플러그인 이름 (관리용)
|
|
39
|
+
}
|
|
336
40
|
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
41
|
+
export interface FeatureContextMenu {
|
|
42
|
+
id: string; // 메뉴의 고유 식별자 ex) add-schedule, delete-schedule
|
|
43
|
+
label: string; // 메뉴에 표시될 텍스트
|
|
44
|
+
action: (targetElement: HTMLElement | null) => void; // 메뉴 클릭 시 실행될 함수
|
|
45
|
+
condition?: (targetElement: HTMLElement | null) => boolean;
|
|
46
|
+
disabled?: boolean; // 메뉴 활성화 여부 (선택 사항)
|
|
47
|
+
targetView?: string[]; // 메뉴가 표시될 대상 (viewId)
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface PluginInfo {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
id: string;
|
|
53
|
+
name: string;
|
|
54
|
+
version: string;
|
|
55
|
+
author: string;
|
|
56
|
+
main?: string;
|
|
57
|
+
description?: string;
|
|
58
|
+
features: {
|
|
59
|
+
views?: FeatureView[];
|
|
60
|
+
contextMenus?: FeatureContextMenu[];
|
|
354
61
|
};
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export enum AppSettingLanguage {
|
|
65
|
+
KO = "ko",
|
|
66
|
+
EN = "en",
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export enum AppSettingTheme {
|
|
70
|
+
LIGHT = "light",
|
|
71
|
+
DARK = "dark",
|
|
72
|
+
SYSTEM = "system",
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export enum AppSettingStartupBehavior {
|
|
76
|
+
OPEN_LAST_SESSION = "openLastSession",
|
|
77
|
+
OPEN_NEW_WINDOW = "openNewWindow",
|
|
78
|
+
DO_NOTHING = "doNothing",
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export enum CalendarView {
|
|
82
|
+
DAY = "day",
|
|
83
|
+
WEEK = "week",
|
|
84
|
+
MONTH = "month",
|
|
85
|
+
YEAR = "year",
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
export enum CalendarWeekStartDay {
|
|
89
|
+
SUNDAY = "sunday",
|
|
90
|
+
MONDAY = "monday",
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export enum CalendarTimeFormat {
|
|
94
|
+
H12 = "12h",
|
|
95
|
+
H24 = "24h",
|
|
96
|
+
}
|
|
355
97
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
98
|
+
export interface AppSettings {
|
|
99
|
+
general: {
|
|
100
|
+
language: AppSettingLanguage;
|
|
101
|
+
theme: AppSettingTheme;
|
|
102
|
+
autoUpdate: boolean;
|
|
103
|
+
startupBehavior: AppSettingStartupBehavior;
|
|
104
|
+
startOnSystemBoot: boolean;
|
|
105
|
+
startMinimized: boolean;
|
|
106
|
+
};
|
|
107
|
+
calendar: {
|
|
108
|
+
defaultView: CalendarView;
|
|
109
|
+
weekStartDay: CalendarWeekStartDay;
|
|
110
|
+
showWeekNumbers: boolean;
|
|
111
|
+
timeFormat: CalendarTimeFormat;
|
|
364
112
|
};
|
|
113
|
+
notifications: {
|
|
114
|
+
enabled: boolean;
|
|
115
|
+
defaultReminderMinutes: number;
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export enum ClipboardDataType {
|
|
120
|
+
TEXT = "text",
|
|
121
|
+
IMAGE = "image",
|
|
122
|
+
EMPTY = "empty",
|
|
123
|
+
ERROR = "error",
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface ClipboardResult {
|
|
127
|
+
type: ClipboardDataType;
|
|
128
|
+
value: string | Buffer | null;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface ClipboardTextData {
|
|
132
|
+
type: ClipboardDataType.TEXT;
|
|
133
|
+
value: string;
|
|
365
134
|
}
|
|
135
|
+
|
|
136
|
+
export interface ClipboardImageData {
|
|
137
|
+
type: ClipboardDataType.IMAGE;
|
|
138
|
+
value: Buffer;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface HttpResponse<T = unknown> {
|
|
142
|
+
ok: boolean;
|
|
143
|
+
status: number;
|
|
144
|
+
data: T | null;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
// IPC Event Types in main process
|
|
148
|
+
export enum AppEventType {
|
|
149
|
+
// Schedule
|
|
150
|
+
SCHEDULE_GET = "schedule:get",
|
|
151
|
+
SCHEDULE_CREATE = "schedule:create",
|
|
152
|
+
SCHEDULE_UPDATE = "schedule:update",
|
|
153
|
+
SCHEDULE_DELETE = "schedule:delete",
|
|
154
|
+
SCHEDULE_EXPORT_TO_FILE = "schedule:exportToFile",
|
|
155
|
+
SCHEDULE_IMPORT_FROM_FILE = "schedule:importFromFile",
|
|
156
|
+
|
|
157
|
+
// Tag
|
|
158
|
+
TAG_GET = "tag:getAll",
|
|
159
|
+
TAG_GET_BY_NAME = "tag:getByName",
|
|
160
|
+
TAG_CREATE = "tag:create",
|
|
161
|
+
TAG_UPDATE = "tag:update",
|
|
162
|
+
TAG_DELETE = "tag:delete",
|
|
163
|
+
|
|
164
|
+
// Plugin Info
|
|
165
|
+
PLUGIN_INFO_GET_INSTALLED = "pluginInfo:getInstalled",
|
|
166
|
+
PLUGIN_INFO_GET_ENABLED = "pluginInfo:getEnabled",
|
|
167
|
+
PLUGIN_INFO_GET_BY_NAME = "pluginInfo:getByName",
|
|
168
|
+
PLUGIN_INFO_CREATE = "pluginInfo:create",
|
|
169
|
+
PLUGIN_INFO_UPDATE = "pluginInfo:update",
|
|
170
|
+
PLUGIN_INFO_DELETE = "pluginInfo:delete",
|
|
171
|
+
|
|
172
|
+
// Plugin Storage
|
|
173
|
+
PLUGIN_STORAGE_GET = "pluginStorage:get",
|
|
174
|
+
PLUGIN_STORAGE_SET = "pluginStorage:set",
|
|
175
|
+
PLUGIN_STORAGE_DELETE = "pluginStorage:delete",
|
|
176
|
+
|
|
177
|
+
// Settings
|
|
178
|
+
SETTINGS_GET = "settings:get",
|
|
179
|
+
SETTINGS_GET_OF = "settings:getOf",
|
|
180
|
+
SETTINGS_UPDATE = "settings:update",
|
|
181
|
+
|
|
182
|
+
// Window
|
|
183
|
+
WINDOW_MINIMIZE = "window:minimize",
|
|
184
|
+
WINDOW_RESTORE = "window:restore",
|
|
185
|
+
WINDOW_MAXIMIZE = "window:maximize",
|
|
186
|
+
WINDOW_CLOSE = "window:close",
|
|
187
|
+
WINDOW_EXIT = "window:exit",
|
|
188
|
+
WINDOW_CHECK_FOR_UPDATES = "window:checkForUpdates",
|
|
189
|
+
WINDOW_SHOW = "window:show",
|
|
190
|
+
WINDOW_HIDE = "window:hide",
|
|
191
|
+
|
|
192
|
+
// OS Service
|
|
193
|
+
NATIVE_OS_NOTIFICATION = "nativeOs:notification",
|
|
194
|
+
NATIVE_OS_CLIPBOARD_GET = "nativeOs:clipboard:get",
|
|
195
|
+
NATIVE_OS_CLIPBOARD_SET = "nativeOs:clipboard:set",
|
|
196
|
+
|
|
197
|
+
// HTTP Service
|
|
198
|
+
HTTP_SERVICE_GET = "httpService:get",
|
|
199
|
+
HTTP_SERVICE_POST = "httpService:post",
|
|
200
|
+
|
|
201
|
+
// Plugin
|
|
202
|
+
PLUGIN_INSTALL = "plugin:install",
|
|
203
|
+
PLUGIN_TOGGLE = "plugin:toggle",
|
|
204
|
+
PLUGIN_UNINSTALL = "plugin:uninstall",
|
|
205
|
+
|
|
206
|
+
// Plugin Session Storage
|
|
207
|
+
PLUGIN_SESSION_STORAGE_GET = "sessionStorage:get",
|
|
208
|
+
PLUGIN_SESSION_STORAGE_SET = "sessionStorage:set",
|
|
209
|
+
PLUGIN_SESSION_STORAGE_CLEAR = "sessionStorage:clear",
|
|
210
|
+
PLUGIN_SESSION_STORAGE_DELETE = "sessionStorage:delete",
|
|
211
|
+
PLUGIN_SESSION_STORAGE_CLEAR_ALL = "sessionStorage:clearAll",
|
|
212
|
+
|
|
213
|
+
// Background works
|
|
214
|
+
SCHEDULER_REGISTER = "scheduler:register",
|
|
215
|
+
SCHEDULER_UNREGISTER = "scheduler:unregister",
|
|
216
|
+
|
|
217
|
+
// UI Extensions
|
|
218
|
+
UI_ADD_MENU_ITEM = "ui:addMenuItem",
|
|
219
|
+
UI_CONTEXT_MENU_ADD_ITEM = "ui:contextMenu:addItem",
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
export interface PluginContext {
|
|
223
|
+
base: typeof base;
|
|
224
|
+
app: typeof app;
|
|
225
|
+
enums: typeof enums;
|
|
226
|
+
ui: typeof ui;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
export namespace windows {
|
|
230
|
+
export function minimize(): Promise<void>;
|
|
231
|
+
export function maximize(): Promise<void>;
|
|
232
|
+
export function close(): Promise<void>;
|
|
233
|
+
export function exitApp(): Promise<void>;
|
|
234
|
+
export function checkForUpdates(): Promise<void>;
|
|
235
|
+
export function setCloseToTrayMode(enabled: boolean): Promise<void>;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
export namespace tags {
|
|
239
|
+
export function getAll(): Promise<Tag[]>;
|
|
240
|
+
export function getByName(name: string): Promise<Tag | null>;
|
|
241
|
+
export function create(name: string, color: string): Promise<Tag>;
|
|
242
|
+
export function modify(id: string, name: string, color: string): Promise<Tag>;
|
|
243
|
+
export function remove(id: string): Promise<boolean>;
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
export namespace schedules {
|
|
247
|
+
export function getAll(period: {
|
|
248
|
+
start: string;
|
|
249
|
+
end: string;
|
|
250
|
+
}): Promise<Schedule[]>;
|
|
251
|
+
export function create(data: Partial<Schedule>): Promise<Schedule>;
|
|
252
|
+
export function update(
|
|
253
|
+
id: string,
|
|
254
|
+
data: Partial<Schedule>,
|
|
255
|
+
): Promise<Schedule>;
|
|
256
|
+
export function remove(id: string): Promise<boolean>;
|
|
257
|
+
export function exportSchedulesToFile(period?: {
|
|
258
|
+
start: string;
|
|
259
|
+
end: string;
|
|
260
|
+
}): Promise<{ filePath: string; count: number } | null>;
|
|
261
|
+
export function importScheduleFromFile(
|
|
262
|
+
mode?: "merge" | "duplicate",
|
|
263
|
+
): Promise<{ created: number; updated: number } | null>;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
export namespace pluginInfo {
|
|
267
|
+
export function getInstalled(): Promise<PluginInfo[]>;
|
|
268
|
+
export function getEnabled(): Promise<PluginInfo[]>;
|
|
269
|
+
export function getByName(name: string): Promise<PluginInfo | null>;
|
|
270
|
+
export function install(data: Partial<PluginInfo>): Promise<PluginInfo>;
|
|
271
|
+
export function toggle(
|
|
272
|
+
name: string,
|
|
273
|
+
enable: boolean,
|
|
274
|
+
): Promise<PluginInfo | null>;
|
|
275
|
+
export function uninstall(name: string): Promise<boolean>;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
export namespace search {
|
|
279
|
+
export function search(query: SearchQuery): Promise<Schedule[]>;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
export namespace settings {
|
|
283
|
+
export function getAll(): Promise<AppSettings>;
|
|
284
|
+
export function getOf(key: string): Promise<AppSettings[keyof AppSettings]>;
|
|
285
|
+
export function update(
|
|
286
|
+
newSettings: Partial<AppSettings>,
|
|
287
|
+
): Promise<AppSettings>;
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
export namespace pluginStorage {
|
|
291
|
+
export function get(pluginId: string, key: string): Promise<string | null>;
|
|
292
|
+
export function set(
|
|
293
|
+
pluginId: string,
|
|
294
|
+
key: string,
|
|
295
|
+
value: string,
|
|
296
|
+
): Promise<void>;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
export namespace os {
|
|
300
|
+
export function showNotification(title: string, body: string): Promise<void>;
|
|
301
|
+
export function getClipboard(): Promise<ClipboardResult>;
|
|
302
|
+
export function setClipboard(
|
|
303
|
+
data: ClipboardTextData | ClipboardImageData,
|
|
304
|
+
): Promise<void>;
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
export namespace http {
|
|
308
|
+
export function get(
|
|
309
|
+
url: string,
|
|
310
|
+
params?: Record<string, string>,
|
|
311
|
+
headers?: Record<string, string>,
|
|
312
|
+
): Promise<HttpResponse>;
|
|
313
|
+
export function post(
|
|
314
|
+
url: string,
|
|
315
|
+
body?: unknown,
|
|
316
|
+
headers?: Record<string, string>,
|
|
317
|
+
): Promise<HttpResponse>;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
export namespace event {
|
|
321
|
+
/**
|
|
322
|
+
* Send event to all windows
|
|
323
|
+
* @param type event type
|
|
324
|
+
* @param payload event payload
|
|
325
|
+
*/
|
|
326
|
+
export function emit(type: string, payload: unknown): void;
|
|
327
|
+
/**
|
|
328
|
+
* Listen to event from all windows
|
|
329
|
+
* @param type event type
|
|
330
|
+
* @param callback callback function
|
|
331
|
+
* @returns unsubscribe function
|
|
332
|
+
*/
|
|
333
|
+
export function on(
|
|
334
|
+
type: string,
|
|
335
|
+
callback: (payload: unknown) => void,
|
|
336
|
+
): () => void;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
export const base: {
|
|
340
|
+
windows: typeof windows;
|
|
341
|
+
tags: typeof tags;
|
|
342
|
+
schedules: typeof schedules;
|
|
343
|
+
pluginInfo: typeof pluginInfo;
|
|
344
|
+
search: typeof search;
|
|
345
|
+
settings: typeof settings;
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
export const app: {
|
|
349
|
+
os: typeof os;
|
|
350
|
+
http: typeof http;
|
|
351
|
+
storage: typeof pluginStorage;
|
|
352
|
+
event: typeof event;
|
|
353
|
+
session: PluginSessionAPI;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
export interface PluginSessionAPI {
|
|
357
|
+
get: <T = unknown>(pluginId: string, key: string) => Promise<T | null>;
|
|
358
|
+
set: <T = unknown>(pluginId: string, key: string, value: T) => Promise<void>;
|
|
359
|
+
delete: (pluginId: string, key: string) => Promise<boolean>;
|
|
360
|
+
clear: (pluginId: string) => Promise<void>;
|
|
361
|
+
clearAll: () => Promise<void>;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
export const enums: {
|
|
365
|
+
AppSettingLanguage: typeof AppSettingLanguage;
|
|
366
|
+
AppSettingTheme: typeof AppSettingTheme;
|
|
367
|
+
AppSettingStartupBehavior: typeof AppSettingStartupBehavior;
|
|
368
|
+
CalendarView: typeof CalendarView;
|
|
369
|
+
CalendarWeekStartDay: typeof CalendarWeekStartDay;
|
|
370
|
+
CalendarTimeFormat: typeof CalendarTimeFormat;
|
|
371
|
+
ClipboardDataType: typeof ClipboardDataType;
|
|
372
|
+
AppEventType: typeof AppEventType;
|
|
373
|
+
};
|
|
374
|
+
|
|
375
|
+
export const ui: {
|
|
376
|
+
registerView: (
|
|
377
|
+
viewId: string,
|
|
378
|
+
renderFn: (container: HTMLElement) => void,
|
|
379
|
+
) => void;
|
|
380
|
+
registerContextMenu: (
|
|
381
|
+
target: string,
|
|
382
|
+
command: string,
|
|
383
|
+
label: string,
|
|
384
|
+
callback: (target: string) => void,
|
|
385
|
+
) => void;
|
|
386
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@croffledev/croffle-types",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Croffle project type definitions.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -14,11 +14,15 @@
|
|
|
14
14
|
},
|
|
15
15
|
"repository": {
|
|
16
16
|
"type": "git",
|
|
17
|
-
"url": "https://github.com/team-croffle/croffle-types.git"
|
|
17
|
+
"url": "git+https://github.com/team-croffle/croffle-types.git"
|
|
18
18
|
},
|
|
19
19
|
"author": {
|
|
20
20
|
"name": "Croffle Team",
|
|
21
21
|
"email": "support@croffledev.kr",
|
|
22
22
|
"url": "https://github.com/team-croffle"
|
|
23
|
-
}
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@types/node": "^25.5.0"
|
|
26
|
+
},
|
|
27
|
+
"packageManager": "yarn@4.13.0"
|
|
24
28
|
}
|