@aliou/pi-utils-settings 0.3.0 → 0.4.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.
- package/package.json +1 -1
- package/settings-command.ts +6 -3
package/package.json
CHANGED
package/settings-command.ts
CHANGED
|
@@ -5,7 +5,10 @@
|
|
|
5
5
|
* Changes are tracked in memory. Ctrl+S saves, Esc exits without saving.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
import type {
|
|
8
|
+
import type {
|
|
9
|
+
ExtensionAPI,
|
|
10
|
+
ExtensionCommandContext,
|
|
11
|
+
} from "@mariozechner/pi-coding-agent";
|
|
9
12
|
import { getSettingsListTheme } from "@mariozechner/pi-coding-agent";
|
|
10
13
|
import { Key, matchesKey } from "@mariozechner/pi-tui";
|
|
11
14
|
import {
|
|
@@ -76,7 +79,7 @@ export interface SettingsCommandOptions<
|
|
|
76
79
|
* Called after save succeeds. Use this to reload runtime state
|
|
77
80
|
* that was captured at extension init time.
|
|
78
81
|
*/
|
|
79
|
-
onSave?: () => void | Promise<void>;
|
|
82
|
+
onSave?: (ctx: ExtensionCommandContext) => void | Promise<void>;
|
|
80
83
|
}
|
|
81
84
|
|
|
82
85
|
function defaultChangeHandler<TConfig extends object>(
|
|
@@ -256,7 +259,7 @@ export function registerSettingsCommand<
|
|
|
256
259
|
|
|
257
260
|
if (saved) {
|
|
258
261
|
ctx.ui.notify(`${extensionLabel}: saved`, "info");
|
|
259
|
-
if (onSave) await onSave();
|
|
262
|
+
if (onSave) await onSave(ctx);
|
|
260
263
|
// Rebuild with fresh data.
|
|
261
264
|
settings = buildSettingsComponent(activeScope);
|
|
262
265
|
}
|