@edenapp/types 0.1.0 → 0.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/README.md CHANGED
@@ -10,13 +10,27 @@ For Eden app development:
10
10
  npm install -D @edenapp/types
11
11
  ```
12
12
 
13
+ ## TypeScript Configuration
14
+
15
+ To enable type support for window APIs, update your `tsconfig.json` to include:
16
+
17
+ ```json
18
+ {
19
+ "compilerOptions": {
20
+ "types": [
21
+ "@edenapp/types/global"
22
+ ]
23
+ }
24
+ }
25
+ ```
26
+
13
27
  ## Usage
14
28
 
15
29
  Import types in your Eden app:
16
30
 
17
31
  ```typescript
18
32
  // Use Eden API in your app's frontend
19
- const files = await window.edenAPI.shellCommand('fs/readdir', {
33
+ const files = await window.edenAPI!.shellCommand('fs/readdir', {
20
34
  path: '/home/user/documents'
21
35
  });
22
36
  ```
package/global.d.ts CHANGED
@@ -3,7 +3,7 @@
3
3
  import type { CommandName, CommandArgs, CommandResult } from "./commands";
4
4
  import type { EventName, EventData } from "./events";
5
5
 
6
- interface EdenAPI {
6
+ export interface EdenAPI {
7
7
  /**
8
8
  * Execute a shell command with type-safe arguments
9
9
  * @param command - The command name (e.g., "process/launch")
@@ -47,9 +47,14 @@ interface EdenAPI {
47
47
  isEventSupported(event: string): Promise<boolean>;
48
48
  }
49
49
 
50
- interface Window {
51
- /**
52
- * Eden API instance available only in renderer processes
53
- */
54
- edenAPI?: EdenAPI;
50
+ declare global {
51
+ interface Window {
52
+ /**
53
+ * Eden API instance available only in renderer processes
54
+ */
55
+ edenAPI?: EdenAPI;
56
+ }
55
57
  }
58
+
59
+ // This export is important - it marks the file as a module
60
+ export {};
package/index.d.ts CHANGED
@@ -4,6 +4,8 @@ export * from "./EdenConfig";
4
4
 
5
5
  export * from "./AppManifest";
6
6
 
7
+ export * from "./global";
8
+
7
9
  /**
8
10
  * App Instance Interface
9
11
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edenapp/types",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "TypeScript type definitions for the Eden platform",
5
5
  "types": "index.d.ts",
6
6
  "author": "Dariusz Majnert",