import type Redis from "ioredis";
import { schema } from "@slackwsh/data";
import { type EntityIdInput } from "./channels";
export interface SearchResult {
    message: typeof schema.messages.$inferSelect;
    channelName: string | null;
    authorName: string;
}
export interface MentionActivityResult {
    message: typeof schema.messages.$inferSelect;
    channelName: string | null;
    authorName: string;
    mentionType: string;
    readAt: string | null;
}
export interface UnreadMessageResult {
    message: typeof schema.messages.$inferSelect;
    channelName: string | null;
    channelType: string;
    authorName: string;
}
interface ParsedQuery {
    text: string;
    fromUsername?: string;
    inChannelName?: string;
}
/**
 * Message search (Feature 6.1: `from:` `in:` `has:` `before:` `after:`
 * `is:` modifiers — `from:` and `in:` implemented here, the rest deferred).
 * Postgres full-text via the GIN index in sql/search.sql, not Typesense
 * (ADR-007's primary path — not wired up yet, see PHASE3_STATUS.md).
 *
 * Scoped to channels the searching user is actually a member of via the
 * channel_members join — never trust a client-supplied channel name alone
 * to mean "searchable," membership is what's searchable.
 */
export declare function parseSearchQuery(raw: string): ParsedQuery;
export declare function searchMessages(workspaceId: EntityIdInput, actorUserId: EntityIdInput, rawQuery: string, limit?: number): Promise<SearchResult[]>;
export declare function listMentionActivity(workspaceId: EntityIdInput, actorUserId: EntityIdInput, limit?: number): Promise<MentionActivityResult[]>;
/** Persist Activity/Mentions read state for every device owned by the user. */
export declare function setActivityReadState(redis: Redis, workspaceId: EntityIdInput, actorUserId: EntityIdInput, messageIds: EntityIdInput[], read: boolean): Promise<number[]>;
/** Top-level unread messages across every room the requesting user can read. */
export declare function listUnreadMessages(workspaceId: EntityIdInput, actorUserId: EntityIdInput, limit?: number): Promise<UnreadMessageResult[]>;
export {};
//# sourceMappingURL=search.d.ts.map