import type { MudletMap, MudletRoom } from '../mapIO'; /** * Structured room-search query language used by the Search panel. * * A query is a whitespace-separated list of tokens. Each token is either: * - a structured filter `key:value` (e.g. `env:3`, `weight:>5`, `stubs:>0`, * `exits:1`, `door:yes`, `locked:no`), optionally negated with a leading * `-` or `!` (e.g. `-door:yes`); or * - free text, matched against room name / id / userData (legacy behaviour). * * All structured filters are ANDed together; free-text tokens are joined with a * space and matched as a single substring. A token is treated as a filter only * when the part before the first colon is a recognised key — anything else * (including URLs and colon-bearing free text) falls through to free text, so * filters never produce surprising "unknown" errors for ordinary searches. */ export interface RoomMatchContext { room: MudletRoom; id: number; map: MudletMap; } export type RoomPredicate = (ctx: RoomMatchContext) => boolean; export interface ParsedQuery { /** Free-text portion, lowercased; '' when the query is filters-only. */ text: string; /** Structured predicates; a room must satisfy all of them. */ predicates: RoomPredicate[]; /** Canonical keys of the active filters, in first-seen order (for result summaries). */ filterKeys: string[]; /** The original token of the first malformed filter, or null. */ error: string | null; } /** Count of real outgoing exits: cardinal/vertical exits plus special exits. */ export declare function exitCount(room: MudletRoom): number; export declare function parseRoomQuery(input: string): ParsedQuery; /** * Build a compact, human-readable summary of the room values relevant to the * active filter keys — shown as the result row's reason when no free text * supplied a match reason. */ export declare function describeRoom(ctx: RoomMatchContext, keys: string[]): string;