@pptb/types 1.0.1 → 1.0.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/toolboxAPI.d.ts +40 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pptb/types",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "TypeScript type definitions for Power Platform Tool Box API",
5
5
  "main": "index.d.ts",
6
6
  "types": "index.d.ts",
package/toolboxAPI.d.ts CHANGED
@@ -85,6 +85,7 @@ declare namespace ToolBoxAPI {
85
85
  shell?: string;
86
86
  cwd?: string;
87
87
  env?: Record<string, string>;
88
+ visible?: boolean; // Whether terminal should be visible initially (default: true)
88
89
  }
89
90
 
90
91
  /**
@@ -201,6 +202,40 @@ declare namespace ToolBoxAPI {
201
202
  off: (callback: (event: any, payload: ToolBoxEventPayload) => void) => void;
202
203
  }
203
204
 
205
+ /**
206
+ * Settings namespace - context-aware tool settings
207
+ * All settings operations automatically use the current tool's ID
208
+ */
209
+ export interface SettingsAPI {
210
+ /**
211
+ * Get all settings for this tool
212
+ * @returns Promise resolving to an object with all settings (empty object if no settings exist)
213
+ */
214
+ getSettings: () => Promise<Record<string, any>>;
215
+
216
+ /**
217
+ * Get a specific setting by key
218
+ * @param key The setting key to retrieve
219
+ * @returns Promise resolving to the setting value, or undefined if not found
220
+ */
221
+ getSetting: (key: string) => Promise<any>;
222
+
223
+ /**
224
+ * Set a specific setting by key
225
+ * @param key The setting key to set
226
+ * @param value The value to store (can be any JSON-serializable value)
227
+ * @returns Promise that resolves when the setting is saved
228
+ */
229
+ setSetting: (key: string, value: any) => Promise<void>;
230
+
231
+ /**
232
+ * Set all settings (replaces entire settings object)
233
+ * @param settings The settings object to store
234
+ * @returns Promise that resolves when the settings are saved
235
+ */
236
+ setSettings: (settings: Record<string, any>) => Promise<void>;
237
+ }
238
+
204
239
  /**
205
240
  * Main ToolBox API exposed to tools via window.toolboxAPI
206
241
  */
@@ -215,6 +250,11 @@ declare namespace ToolBoxAPI {
215
250
  */
216
251
  utils: UtilsAPI;
217
252
 
253
+ /**
254
+ * Tool-specific settings (context-aware)
255
+ */
256
+ settings: SettingsAPI;
257
+
218
258
  /**
219
259
  * Terminal operations (context-aware)
220
260
  */