@croffledev/croffle-types 1.0.0 → 1.1.0

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