import { Worktree } from '../types/index.js'; import { SessionItem } from './worktreeUtils.js'; /** * Filter worktrees by matching search query against branch name and path. */ export declare function filterWorktreesByQuery(worktrees: Worktree[], query: string): Worktree[]; /** * Filter session items by matching the search query against the name shown in * the menu (branch name, " (main)" indicator, and session name) and the * worktree path. Status icons and git status columns are not matched. * * Filtering happens per session item (not per worktree) so that a query can * match an individual session name within a worktree that has multiple * sessions. */ export declare function filterSessionItemsByQuery(items: SessionItem[], query: string): SessionItem[]; /** * The user-facing categories a session can be filtered by. `'all'` disables the * filter. The four internal {@link SessionState} values collapse into three * categories: `pending_auto_approval` is shown as `waiting` because it is a * form of "waiting for the user" (mirrors the status display in statusIcons.ts). */ export type SessionStateFilter = 'all' | 'busy' | 'waiting' | 'idle'; /** * Order in which the Tab / Shift+Tab keys cycle the state filter. * "Attention-first" so the states a user most often hunts for come up first. */ export declare const SESSION_STATE_FILTER_CYCLE: SessionStateFilter[]; /** * Filter session items by their current state. This is an independent dimension * from {@link filterSessionItemsByQuery}: callers compose the two so a text * query and a state filter can both be active at once. * * Rows without a session have no state, so they are excluded whenever a specific * state (not `'all'`) is selected. */ export declare function filterSessionItemsByState(items: SessionItem[], filter: SessionStateFilter): SessionItem[]; /** Advance the state filter one step in the cycle (Tab) or back (Shift+Tab). */ export declare function cycleSessionStateFilter(current: SessionStateFilter, direction: 'next' | 'prev'): SessionStateFilter; /** Human-readable label (icon + word) for a state filter, used in the footer. */ export declare function getSessionStateFilterLabel(filter: SessionStateFilter): string;