/** * PermissionRegistry * * Central registry for managing app permissions at runtime. * Tracks: * - Base permissions: what the app always has (from manifest.permissions) * - Grant permissions: what the app CAN have if the user has the grant (from manifest.grants) * * Supports glob patterns for permission matching: * - "fs/read" matches exactly "fs/read" * - "fs/*" matches any permission starting with "fs/" * - "*" matches all permissions */ import type { ResolvedGrant } from "@edenapp/types"; export declare class PermissionRegistry { private apps; private eventPermissions; /** * Register permissions for an app from manifest data. * Grants should be pre-resolved via normalizeGrantPresets. */ registerApp(appId: string, permissions?: string[], grants?: ResolvedGrant[]): void; /** * Unregister app permissions (called during uninstall) */ unregisterApp(appId: string): void; /** * Check if an app has a specific permission as a BASE permission. * This does NOT check grants - use getRequiredGrantKeys for that. */ hasPermission(appId: string, requiredPermission: string): boolean; /** * Return grant keys that would unlock a permission for this app. * If the permission is a base permission, returns empty array. * The caller should check if the user has any of these grants. */ getRequiredGrantKeys(appId: string, requiredPermission: string): string[]; /** * Check if an app is registered */ hasApp(appId: string): boolean; /** * Check if any permission pattern matches the required permission. */ private matchesAny; /** Register an event subscription permission for this runtime. */ registerEventPermission(eventName: string, permission: string): void; /** Get the event subscription permission registered in this runtime. */ getEventPermission(eventName: string): string | undefined; /** Return a defensive snapshot of this runtime's event permissions. */ getAllEventPermissions(): Map; dispose(): void; } //# sourceMappingURL=PermissionRegistry.d.ts.map