@gemigo/extension-sdk 0.2.0 → 0.2.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/README.md +63 -61
- package/dist/apis/extension.d.ts +155 -0
- package/dist/apis/index.d.ts +4 -0
- package/dist/core/connection.d.ts +117 -0
- package/dist/core/event-bus.d.ts +35 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/gemigo-extension-sdk.es.js +196 -148
- package/dist/gemigo-extension-sdk.umd.js +1 -1
- package/dist/index.d.ts +4 -63
- package/dist/sdk.d.ts +15 -0
- package/dist/types/ai.d.ts +48 -0
- package/dist/types/clipboard.d.ts +39 -0
- package/dist/types/common.d.ts +39 -0
- package/dist/types/desktop.d.ts +138 -0
- package/dist/types/dialog.d.ts +65 -0
- package/dist/types/extension.d.ts +187 -0
- package/dist/types/file.d.ts +79 -0
- package/dist/types/index.d.ts +88 -0
- package/dist/types/manifest.d.ts +87 -0
- package/dist/types/network.d.ts +37 -0
- package/dist/types/notify.d.ts +35 -0
- package/dist/types/storage.d.ts +27 -0
- package/package.json +1 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network API types
|
|
3
|
+
*/
|
|
4
|
+
/** HTTP request method */
|
|
5
|
+
export type HttpMethod = 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
6
|
+
/** Response type */
|
|
7
|
+
export type ResponseType = 'json' | 'text' | 'arraybuffer';
|
|
8
|
+
/** Request options */
|
|
9
|
+
export interface RequestOptions {
|
|
10
|
+
/** HTTP method */
|
|
11
|
+
method?: HttpMethod;
|
|
12
|
+
/** Request headers */
|
|
13
|
+
headers?: Record<string, string>;
|
|
14
|
+
/** Request body */
|
|
15
|
+
body?: string | object;
|
|
16
|
+
/** Response type */
|
|
17
|
+
responseType?: ResponseType;
|
|
18
|
+
}
|
|
19
|
+
/** Request response */
|
|
20
|
+
export interface RequestResponse<T = unknown> {
|
|
21
|
+
/** HTTP status code */
|
|
22
|
+
status: number;
|
|
23
|
+
/** Response data */
|
|
24
|
+
data: T;
|
|
25
|
+
/** Response headers */
|
|
26
|
+
headers: Record<string, string>;
|
|
27
|
+
}
|
|
28
|
+
/** Network API for cross-origin HTTP requests */
|
|
29
|
+
export interface NetworkAPI {
|
|
30
|
+
/**
|
|
31
|
+
* Make an HTTP request (bypasses CORS restrictions)
|
|
32
|
+
* @param url - Request URL
|
|
33
|
+
* @param options - Request options
|
|
34
|
+
* @returns Response with status, data, and headers
|
|
35
|
+
*/
|
|
36
|
+
request<T = unknown>(url: string, options?: RequestOptions): Promise<RequestResponse<T>>;
|
|
37
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notify API types
|
|
3
|
+
*/
|
|
4
|
+
/** Notification action button */
|
|
5
|
+
export interface NotifyAction {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
/** Notification options */
|
|
10
|
+
export interface NotifyOptions {
|
|
11
|
+
/** Notification title (required) */
|
|
12
|
+
title: string;
|
|
13
|
+
/** Notification body text */
|
|
14
|
+
body?: string;
|
|
15
|
+
/** Icon URL */
|
|
16
|
+
icon?: string;
|
|
17
|
+
/** Action buttons (desktop only) */
|
|
18
|
+
actions?: NotifyAction[];
|
|
19
|
+
}
|
|
20
|
+
/** Notification result */
|
|
21
|
+
export interface NotifyResult {
|
|
22
|
+
success: boolean;
|
|
23
|
+
reason?: string;
|
|
24
|
+
}
|
|
25
|
+
/** Notify API */
|
|
26
|
+
export interface NotifyAPI {
|
|
27
|
+
/**
|
|
28
|
+
* Send a system notification
|
|
29
|
+
* @param options - Notification options
|
|
30
|
+
* @returns Result indicating success or failure
|
|
31
|
+
*/
|
|
32
|
+
(options: NotifyOptions): Promise<NotifyResult>;
|
|
33
|
+
}
|
|
34
|
+
/** Notification action handler */
|
|
35
|
+
export type NotificationActionHandler = (actionId: string, callback: () => void) => () => void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storage API types
|
|
3
|
+
*/
|
|
4
|
+
/** Storage API for persistent key-value storage */
|
|
5
|
+
export interface StorageAPI {
|
|
6
|
+
/**
|
|
7
|
+
* Get a stored value
|
|
8
|
+
* @param key - Storage key
|
|
9
|
+
* @returns The stored value or null if not found
|
|
10
|
+
*/
|
|
11
|
+
get<T = unknown>(key: string): Promise<T | null>;
|
|
12
|
+
/**
|
|
13
|
+
* Store a value
|
|
14
|
+
* @param key - Storage key
|
|
15
|
+
* @param value - Value to store (will be JSON serialized)
|
|
16
|
+
*/
|
|
17
|
+
set(key: string, value: unknown): Promise<void>;
|
|
18
|
+
/**
|
|
19
|
+
* Delete a stored value
|
|
20
|
+
* @param key - Storage key
|
|
21
|
+
*/
|
|
22
|
+
delete(key: string): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Clear all data for the current app
|
|
25
|
+
*/
|
|
26
|
+
clear(): Promise<void>;
|
|
27
|
+
}
|