import type { Database } from "bun:sqlite";
import type { Plan, Project, Task, TaskComment, TaskPriority } from "../types/index.js";
import type { TaskRun } from "../db/task-runs.js";
import { type LocalTaskFieldQuery } from "./local-fields.js";
export type SavedSearchScope = "all" | "tasks" | "projects" | "plans" | "runs" | "comments";
export interface SavedSearchFilters {
    query?: string;
    project_id?: string;
    task_list_id?: string;
    plan_id?: string;
    task_id?: string;
    status?: string | string[];
    priority?: TaskPriority | TaskPriority[];
    assigned_to?: string;
    agent_id?: string;
    tags?: string[];
    local_fields?: LocalTaskFieldQuery;
    created_after?: string;
    updated_after?: string;
    has_dependencies?: boolean;
    is_blocked?: boolean;
    depends_on?: string;
    blocks?: string;
    limit?: number;
}
export interface SavedSearchView {
    id: string;
    name: string;
    description: string | null;
    scope: SavedSearchScope;
    filters: SavedSearchFilters;
    created_at: string;
    updated_at: string;
}
export type SearchResultEntity = Task | Project | Plan | TaskRun | TaskComment;
export interface SavedSearchResult {
    entity_type: Exclude<SavedSearchScope, "all">;
    entity: SearchResultEntity;
}
export interface SavedSearchRunResult {
    view?: SavedSearchView;
    scope: SavedSearchScope;
    filters: SavedSearchFilters;
    count: number;
    results: SavedSearchResult[];
}
export interface SaveSearchViewInput {
    name: string;
    description?: string | null;
    scope?: SavedSearchScope;
    filters?: SavedSearchFilters;
}
export declare function normalizeScope(scope: string | undefined | null): SavedSearchScope;
export declare function runSavedSearch(filters?: SavedSearchFilters, scope?: SavedSearchScope, db?: Database): SavedSearchRunResult;
export declare function saveSearchView(input: SaveSearchViewInput, db?: Database): SavedSearchView;
export declare function getSearchView(idOrName: string, db?: Database): SavedSearchView | null;
export declare function listSearchViews(scope?: SavedSearchScope, db?: Database): SavedSearchView[];
export declare function deleteSearchView(idOrName: string, db?: Database): boolean;
export declare function runSearchView(idOrName: string, db?: Database): SavedSearchRunResult;
//# sourceMappingURL=saved-search-views.d.ts.map