import type { SettingsCategory } from "@edenapp/types"; import { ExecutionContext } from "../execution/ExecutionContext"; import { CommandRegistry, EdenEmitter, IPCBridge } from "../ipc"; import { PackageCatalog } from "../package-manager/PackageCatalog"; /** * Reserved app ID for Eden system settings. * No external app can use this ID. */ export { EDEN_SETTINGS_APP_ID } from "./constants"; /** * Events emitted by the SettingsManager */ interface SettingsNamespaceEvents { changed: { appId: string; key: string; value: string; }; } /** * SettingsManager - Manages persistent settings storage for Eden and apps * * Provides namespace-isolated settings storage using SQLite backend via Keyv. * Settings are stored separately from app data in settings.db. * Key format: {appId}:{key} * * Eden system settings use appId "com.eden" which is reserved. */ export declare class SettingsManager extends EdenEmitter { private packageCatalog; private executionContext; private keyv; private handler; constructor(ipcBridge: IPCBridge, commandRegistry: CommandRegistry, appsDirectory: string, packageCatalog: PackageCatalog, executionContext: ExecutionContext); /** * Get the namespaced key for an app setting */ private getAppKey; /** * Get a setting value for an app */ get(appId: string, key: string): Promise; /** * Set a setting value for an app */ set(appId: string, key: string, value: string): Promise; delete(appId: string, key: string): Promise; /** * List all setting keys for an app * @param showRestricted - If true, includes keys the current user cannot access (for superuser use) */ list(appId: string, showRestricted?: boolean): Promise; /** * Get all settings with values for an app * @param showRestricted - If true, includes settings the current user cannot access (for superuser use) */ getAll(appId: string, showRestricted?: boolean): Promise>; /** * Reset a setting to its default value */ reset(appId: string, key: string, schema?: SettingsCategory[]): Promise; /** * Get the default value for an Eden setting key */ private getDefault; /** * Get all Eden settings with values (including defaults) */ private getAllEdenSettings; private getSettingDefinition; canRead(ownerAppId: string, key: string, readerAppId: string): boolean; assertReadableBy(ownerAppId: string, key: string, readerAppId: string): void; /** * Resolve the grant key for a setting. * For Eden settings, uses the setting's explicit grant or falls back to the key itself. */ resolveGrantKey(appId: string, settingKey: string): string; /** * Assert the current user has access to a setting, throwing if not. */ assertAccess(appId: string, key: string): void; /** * Filter a list of keys to only those the current user can access. */ filterAllowedKeys(appId: string, keys: string[]): string[]; /** * Filter the Eden settings schema to only categories/settings the current user can access. */ filterSchemaByGrants(categories: SettingsCategory[]): SettingsCategory[]; private canAccessSetting; dispose(): Promise; } //# sourceMappingURL=SettingsManager.d.ts.map