/** * Which plugins run for one signed-in user, from the organization's installations * and that user's own settings. * * Two levels, with different owners. The organization's install is what admits * third-party code at all, and a plugin runs with full app privileges — so nothing * a user does can make an uninstalled plugin run. Within that, the user opts in or * out, unless the admin took the choice away (`allowUserOverride: false`). * * Pure and framework-free, so either side can call it. */ /** One organization-level install record. */ export interface OrgPluginInstallation { pluginId: string; /** The organization's default for this plugin. */ enabled: boolean; /** Whether a user may deviate from that default. */ allowUserOverride: boolean; /** Organization-level settings. */ config?: Record | null; } /** One user's setting for a plugin. Only meaningful if the org installed it. */ export interface UserPluginSetting { pluginId: string; enabled: boolean; /** Per-user overrides, layered over the organization's config. */ config?: Record | null; } export interface ResolvedPluginEnablement { /** Pass straight to `PluginHostProvider`'s `enabledSlugs`. */ enabledSlugs: string[]; /** Pass straight to `PluginHostProvider`'s `configs`. */ configs: Record>; } /** * | installed | allowUserOverride | user setting | result | * |-----------|-------------------|--------------|--------------| * | no | – | anything | off | * | yes, off | false | anything | off | * | yes, off | true | on | on (opt-in) | * | yes, off | true | absent | off | * | yes, on | false | anything | on (forced) | * | yes, on | true | off | off (opt-out)| * | yes, on | true | absent | on | * * A setting for a plugin the org has not installed is ignored, which is what keeps * the org the gatekeeper of which code may run. */ export declare function resolvePluginEnablement(installations: OrgPluginInstallation[], userSettings?: UserPluginSetting[]): ResolvedPluginEnablement; //# sourceMappingURL=enablement.d.ts.map