/** * Resolve what should happen when the user picks a search result. * Returns one of five typed actions so the caller is a single switch. * * Resolution order: * 1. `externalUrl` present → resolve the href through the host's * `composeContentUrl` seam (when wired), then use `decideNewTab` to * choose same-tab vs new-tab against the resolved `targetPlatform`. * 2. Row has `id` + `sourceRepo` + `documentType` → synth an Ask-AI * action (entity drill-in via primary key, no URL). * 3. Row has only `path` → legacy navigation fallback. * 4. Nothing actionable → noop. * * Lifted from the hub's `hooks/use-docs.ts:resolveSearchResultAction`. * Pure — no React, no telemetry. */ import type { SearchResult } from '../../ui/search-input'; import type { ChatRef } from '../../chat/chat-ref.types'; import type { ComposeContentUrl } from '../../../utils/content-href'; export type SearchResultAction = { kind: 'navigate-same-tab'; href: string; } | { kind: 'navigate-new-tab'; href: string; } | { kind: 'ask-ai'; detail: { source: string; ref: ChatRef; }; } | { kind: 'route'; path: string; } | { kind: 'noop'; }; export declare function resolveSearchResultAction(result: SearchResult, source: string, runtimeMode?: 'host' | 'embed', /** The host's unified content-href seam (`runtime.composeContentUrl`). * When wired, an entity row's RAG `externalUrl` is re-resolved through it, * so a type the host serves in-app (`hostedTypes`) or deep-links itself * (`overrides`) lands on the SAME href the catalog cards and chat cards * use. Omitted → the legacy verbatim-`externalUrl` behavior. */ composeContentUrl?: ComposeContentUrl): SearchResultAction; //# sourceMappingURL=resolve-search-result-action.d.ts.map