import { FrontendPlugin, Extension, ExtensionDataRef, ExtensionAttachToSpec } from '../../wiring'; /** * The specification for this {@link AppNode} in the {@link AppTree}. * * @public * @remarks * * The specifications for a collection of app nodes is all the information needed * to build the tree and instantiate the nodes. */ export interface AppNodeSpec { readonly id: string; readonly attachTo: ExtensionAttachToSpec; readonly extension: Extension; readonly disabled: boolean; readonly config?: unknown; readonly plugin?: FrontendPlugin; /** * @deprecated Use {@link AppNodeSpec.plugin} instead. */ readonly source?: FrontendPlugin; } /** * The connections from this {@link AppNode} to other nodes. * * @public * @remarks * * The app node edges are resolved based on the app node specs, regardless of whether * adjacent nodes are disabled or not. If no parent attachment is present or */ export interface AppNodeEdges { readonly attachedTo?: { node: AppNode; input: string; }; readonly attachments: ReadonlyMap; } /** * The instance of this {@link AppNode} in the {@link AppTree}. * * @public * @remarks * * The app node instance is created when the `factory` function of an extension is called. * Instances will only be present for nodes in the app that are connected to the root * node and not disabled */ export interface AppNodeInstance { /** Returns a sequence of all extension data refs that were output by this instance */ getDataRefs(): Iterable>; /** Get the output data for a single extension data ref */ getData(ref: ExtensionDataRef): T | undefined; } /** * A node in the {@link AppTree}. * * @public */ export interface AppNode { /** The specification for how this node should be instantiated */ readonly spec: AppNodeSpec; /** The edges from this node to other nodes in the app tree */ readonly edges: AppNodeEdges; /** The instance of this node, if it was instantiated */ readonly instance?: AppNodeInstance; } /** * The app tree containing all {@link AppNode}s of the app. * * @public */ export interface AppTree { /** The root node of the app */ readonly root: AppNode; /** A map of all nodes in the app by ID, including orphaned or disabled nodes */ readonly nodes: ReadonlyMap; /** A sequence of all nodes with a parent that is not reachable from the app root node */ readonly orphans: Iterable; } /** * The API for interacting with the {@link AppTree}. * * @public */ export interface AppTreeApi { /** * Get the {@link AppTree} for the app. */ getTree(): { tree: AppTree; }; /** * Get all nodes in the app that are mounted at a given route path. */ getNodesByRoutePath(sourcePath: string): { nodes: AppNode[]; }; } /** * The `ApiRef` of {@link AppTreeApi}. * * @public */ export declare const appTreeApiRef: import("@backstage/core-plugin-api").ApiRef;