import type { BindingAction, CRUD, ActionApply, ActionDelete } from "../Plan.ts"; import type { ProviderMode } from "../ProviderMode.ts"; export interface TreeBinding { sid: string; action: BindingAction; } export type ActionTreeItem = ActionApply | ActionDelete; export type ActionVerb = ActionTreeItem["action"]; /** * A tree node representing a namespace. * Resources and tasks live directly inside the namespace where they were * created. */ export interface TreeNode { id: string; path: string[]; children: Map; resources: CRUD[]; actions: ActionTreeItem[]; } export type DerivedAction = "create" | "update" | "delete" | "replace" | "noop" | "mixed"; export declare function buildNamespaceTree(items: CRUD[], actions?: ReadonlyArray): TreeNode; export declare function deriveNamespaceAction(node: TreeNode): DerivedAction; export interface FlattenedItem { type: "namespace" | "resource" | "binding" | "action"; depth: number; id: string; path: string[]; action: CRUD["action"] | BindingAction | DerivedAction | ActionVerb; resourceType?: string; bindingSid?: string; bindingCount?: number; hasChildren?: boolean; /** For task items, the Task's Type (e.g. "Sync"). */ actionType?: string; /** * For resource items, the {@link ProviderMode} the node's provider was * resolved for. `undefined` for mode-agnostic providers. */ providerMode?: ProviderMode; /** * For resource items planned as a mode-switch replacement, the mode the * old generation was created with (always differs from `providerMode`). */ fromProviderMode?: ProviderMode; } export declare function flattenTree(node: TreeNode, depth?: number, result?: FlattenedItem[]): FlattenedItem[]; //# sourceMappingURL=NamespaceTree.d.ts.map