import { ComponentHarness, BaseHarnessFilters, HarnessPredicate, ElementDimensions } from '@angular/cdk/testing'; import { CheckState } from '@h-k-dev/angular-tree'; /** Criteria to filter `TreeHarness` instances. */ interface TreeHarnessFilters extends BaseHarnessFilters { } /** Criteria to filter tree node (row) harnesses. */ interface TreeNodeHarnessFilters extends BaseHarnessFilters { /** Full row text (the consumer template's rendered text). */ text?: string | RegExp; /** The node's `expansionKey` result. */ key?: string; /** Zero-based depth — same scale as `TreeNodeContext.level`. */ level?: number; expanded?: boolean; selected?: boolean; } /** Drop position relative to the target row (Phase 4 three-zone math). */ type TreeDropZone = 'before' | 'inside' | 'after'; /** * Harness for one rendered tree row. Obtain via `TreeHarness.getVisibleNodes` * / `getNode` — virtualization renders only a window, so a node harness * exists exactly for rows that currently have DOM. */ declare class TreeNodeHarness extends ComponentHarness { #private; static hostSelector: string; static with(options?: TreeNodeHarnessFilters): HarnessPredicate; /** Trimmed, whitespace-collapsed text of the whole row template. */ getText(): Promise; /** The node's stable key (`expansionKey` result). */ getKey(): Promise; /** Zero-based depth (`aria-level` is 1-based; `TreeNodeContext.level` is not). */ getLevel(): Promise; /** Whether `childrenAccessor` reports children (aria-expanded only exists on parents). */ isExpandable(): Promise; isExpanded(): Promise; /** Selection state — read from `data-selected`, which holds in both plain and checkbox mode. */ isSelected(): Promise; /** Tri-state under `checkboxSelection` (`aria-checked`; `mixed` → `indeterminate`). */ getCheckState(): Promise; /** Expands via the template's `treeNodeToggle`. No-op when already expanded or a leaf. */ expand(): Promise; /** Collapses via the template's `treeNodeToggle`. No-op when already collapsed. */ collapse(): Promise; /** Plain row click — emits `activated`, never mutates selection (Gmail semantics). */ activate(): Promise; /** Toggles selection via the template's `treeNodeCheckbox` (cascade rules apply). */ toggleSelection(): Promise; focus(): Promise; /** Internal (`_` per STYLE.md): `TreeHarness.dragTo` drives the pointer from outside. */ _dispatchMouse(type: string, point: { x: number; y: number; }): Promise; /** Internal: row rect for drop-point math (all zeros in layoutless jsdom). */ _rect(): Promise; /** Internal: resolved row height — the tree's fixed `itemSize`. */ _height(): Promise; } /** * Harness for `` (`@angular/cdk/testing`) — consumers test * expansion, selection and drag & drop without knowing the tree's DOM * (ROADMAP Phase 8; same DX as `MatTreeHarness`). */ declare class TreeHarness extends ComponentHarness { #private; static hostSelector: string; static with(options?: TreeHarnessFilters): HarnessPredicate; /** * Rows that currently have DOM, in visual order. Under virtualization this * is the rendered window, not the whole visible set — scroll (or size the * host) to materialize more. */ getVisibleNodes(filters?: TreeNodeHarnessFilters): Promise; /** Convenience for order assertions: `getVisibleNodes()` mapped to text. */ getVisibleTexts(): Promise; /** The first rendered row matching `filters`; throws when none does. */ getNode(filters: TreeNodeHarnessFilters): Promise; expandNode(filters: TreeNodeHarnessFilters): Promise; collapseNode(filters: TreeNodeHarnessFilters): Promise; /** * Drags `source` onto `target` with a full pointer sequence and releases in * the requested zone — ends in a `moved` intent exactly like a user drag * (guards, `disableDrop`, multi-drag pruning all apply). */ dragTo(source: TreeNodeHarnessFilters, target: TreeNodeHarnessFilters, zone?: TreeDropZone): Promise; } export { TreeHarness, TreeNodeHarness }; export type { TreeDropZone, TreeHarnessFilters, TreeNodeHarnessFilters };