@croffledev/croffle-types 1.1.0 → 1.1.2
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 +48 -11
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export interface FeatureView {
|
|
|
36
36
|
url: string;
|
|
37
37
|
active?: boolean;
|
|
38
38
|
pluginName?: string;
|
|
39
|
+
pluginId?: string;
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
export interface FeatureContextMenu {
|
|
@@ -45,17 +46,26 @@ export interface FeatureContextMenu {
|
|
|
45
46
|
condition?: (targetElement: HTMLElement | null) => boolean;
|
|
46
47
|
disabled?: boolean;
|
|
47
48
|
targetView?: string[];
|
|
49
|
+
pluginId?: string;
|
|
48
50
|
}
|
|
49
51
|
|
|
50
52
|
/** 설정 항목 스키마 (extension SDK / manifest 공용) */
|
|
51
|
-
export type ConfigItemType =
|
|
53
|
+
export type ConfigItemType =
|
|
54
|
+
| "string"
|
|
55
|
+
| "number"
|
|
56
|
+
| "boolean"
|
|
57
|
+
| "select"
|
|
58
|
+
| "path";
|
|
52
59
|
|
|
53
60
|
export interface ConfigItemSchema<T = unknown> {
|
|
54
61
|
type: ConfigItemType;
|
|
55
62
|
label: string;
|
|
56
63
|
description?: string;
|
|
57
64
|
defaultValue: T;
|
|
58
|
-
options?: Array<{
|
|
65
|
+
options?: Array<{
|
|
66
|
+
label: string;
|
|
67
|
+
value: T extends string | number ? T : never;
|
|
68
|
+
}>;
|
|
59
69
|
}
|
|
60
70
|
|
|
61
71
|
/** extension이 기여하는 설정 섹션 (선언형) */
|
|
@@ -280,9 +290,15 @@ export namespace tags {
|
|
|
280
290
|
}
|
|
281
291
|
|
|
282
292
|
export namespace schedules {
|
|
283
|
-
export function getAll(period: {
|
|
293
|
+
export function getAll(period: {
|
|
294
|
+
start: string;
|
|
295
|
+
end: string;
|
|
296
|
+
}): Promise<Schedule[]>;
|
|
284
297
|
export function create(data: Partial<Schedule>): Promise<Schedule>;
|
|
285
|
-
export function update(
|
|
298
|
+
export function update(
|
|
299
|
+
id: string,
|
|
300
|
+
data: Partial<Schedule>,
|
|
301
|
+
): Promise<Schedule>;
|
|
286
302
|
export function remove(id: string): Promise<boolean>;
|
|
287
303
|
export function exportSchedulesToFile(period?: {
|
|
288
304
|
start: string;
|
|
@@ -298,7 +314,11 @@ export namespace pluginInfo {
|
|
|
298
314
|
export function getEnabled(): Promise<PluginInfo[]>;
|
|
299
315
|
export function getByName(name: string): Promise<PluginInfo | null>;
|
|
300
316
|
export function install(data: Partial<PluginInfo>): Promise<PluginInfo>;
|
|
301
|
-
export function
|
|
317
|
+
export function installFromLocal(): Promise<PluginInfo | null>;
|
|
318
|
+
export function toggle(
|
|
319
|
+
name: string,
|
|
320
|
+
enable: boolean,
|
|
321
|
+
): Promise<PluginInfo | null>;
|
|
302
322
|
export function uninstall(name: string): Promise<boolean>;
|
|
303
323
|
}
|
|
304
324
|
|
|
@@ -310,7 +330,9 @@ export namespace search {
|
|
|
310
330
|
export namespace settings {
|
|
311
331
|
export function getAll(): Promise<AppSettings>;
|
|
312
332
|
export function getOf(key: string): Promise<AppSettings[keyof AppSettings]>;
|
|
313
|
-
export function update(
|
|
333
|
+
export function update(
|
|
334
|
+
newSettings: Partial<AppSettings>,
|
|
335
|
+
): Promise<AppSettings>;
|
|
314
336
|
}
|
|
315
337
|
|
|
316
338
|
/** 플러그인별 설정 저장소 (pluginStorage 기반) */
|
|
@@ -328,13 +350,19 @@ export namespace pluginSettings {
|
|
|
328
350
|
|
|
329
351
|
export namespace pluginStorage {
|
|
330
352
|
export function get(pluginId: string, key: string): Promise<string | null>;
|
|
331
|
-
export function set(
|
|
353
|
+
export function set(
|
|
354
|
+
pluginId: string,
|
|
355
|
+
key: string,
|
|
356
|
+
value: string,
|
|
357
|
+
): Promise<void>;
|
|
332
358
|
}
|
|
333
359
|
|
|
334
360
|
export namespace os {
|
|
335
361
|
export function showNotification(title: string, body: string): Promise<void>;
|
|
336
362
|
export function getClipboard(): Promise<ClipboardResult>;
|
|
337
|
-
export function setClipboard(
|
|
363
|
+
export function setClipboard(
|
|
364
|
+
data: ClipboardTextData | ClipboardImageData,
|
|
365
|
+
): Promise<void>;
|
|
338
366
|
}
|
|
339
367
|
|
|
340
368
|
export namespace http {
|
|
@@ -352,7 +380,10 @@ export namespace http {
|
|
|
352
380
|
|
|
353
381
|
export namespace event {
|
|
354
382
|
export function emit(type: string, payload: unknown): void;
|
|
355
|
-
export function on(
|
|
383
|
+
export function on(
|
|
384
|
+
type: string,
|
|
385
|
+
callback: (payload: unknown) => void,
|
|
386
|
+
): () => void;
|
|
356
387
|
}
|
|
357
388
|
|
|
358
389
|
export const base: {
|
|
@@ -393,7 +424,10 @@ export const enums: {
|
|
|
393
424
|
};
|
|
394
425
|
|
|
395
426
|
export const ui: {
|
|
396
|
-
registerView: (
|
|
427
|
+
registerView: (
|
|
428
|
+
viewId: string,
|
|
429
|
+
renderFn: (container: HTMLElement) => void,
|
|
430
|
+
) => void;
|
|
397
431
|
registerContextMenu: (
|
|
398
432
|
target: string,
|
|
399
433
|
command: string,
|
|
@@ -404,5 +438,8 @@ export const ui: {
|
|
|
404
438
|
* 설정 모달에 탭을 추가합니다.
|
|
405
439
|
* @param tabId 고유 탭 ID (플러그인 ID와 조합해 `${pluginId}:${tabId}` 형태로 저장됨)
|
|
406
440
|
*/
|
|
407
|
-
registerSettingsTab: (
|
|
441
|
+
registerSettingsTab: (
|
|
442
|
+
tabId: string,
|
|
443
|
+
options: RegisterSettingsTabOptions,
|
|
444
|
+
) => void;
|
|
408
445
|
};
|