/** * Builds typed Plugin Plans and resolves installed APIs from nested plan inputs. * * @module */ import type { PluginRef } from './plugin-ref.js'; declare const pluginPlanDefinition: unique symbol; interface PluginPlanCompatible { readonly ref: PluginRef; } type PluginPlanItem = PluginPlanCompatible | PluginPlan; type PluginPlanDefinitions = Readonly>; export interface PluginPlan { readonly plugins: readonly TPlugin[]; /** Phantom type used to infer the API mapping returned by installation. */ readonly __apis?: TApis; readonly [pluginPlanDefinition]: PluginPlanDefinitions; } type PluginApiOf = TItem extends PluginPlan ? TApis : TItem extends { readonly ref: PluginRef; } ? TApi : never; type FlattenedPluginOf = TItem extends PluginPlan ? TPlugin : TItem extends PluginPlanCompatible ? TItem : never; export type PluginPlanApis>> = { readonly [TKey in keyof TDefinitions]: PluginApiOf; }; export type PluginArrayApis = { readonly [TIndex in keyof TPlugins]: PluginApiOf; }; /** Creates an immutable declarative Plugin collection without installing it. */ export declare function composePlugins>>(definitions: TDefinitions): PluginPlan, FlattenedPluginOf>; export {};