import { SearchResult, SearchResponse } from '../../types'; export type MetadataOperator = 'EQUALS' | 'NOT_EQUALS' | 'CONTAINS' | 'STARTS_WITH'; /** Metadata condition for filtering search results */ export interface MetadataCondition { key: string; value: string; operator?: MetadataOperator; } /** Tag filter for graph-backed search. */ export interface TagFilter { tagIds?: string[]; tagKeys?: string[]; hierarchyPaths?: string[]; vocabularyKeys?: string[]; matchAll?: boolean; includeDescendants?: boolean; depth?: number; } /** Date range for filtering */ export interface DateRange { from?: string; to?: string; } /** Search matching mode */ export type SearchMode = 'PARTIAL' | 'FULLTEXT' | 'EXACT'; /** Sort options for search results */ export type SearchSortBy = 'SCORE_DESC' | 'SCORE_ASC' | 'CREATED_DESC' | 'CREATED_ASC' | 'UPDATED_DESC' | 'UPDATED_ASC' | 'TITLE_ASC' | 'TITLE_DESC'; /** Advanced search filters */ export interface SearchFilters { /** Search matching mode (defaults to PARTIAL for autocomplete) */ searchMode?: SearchMode; /** Filter by entity types (OR logic) */ entityTypes?: string[]; /** Exclude specific entity types */ excludeEntityTypes?: string[]; /** Filter by product sources */ productSources?: string[]; /** Filter to a specific project */ projectId?: string; /** Filter by actor who created the entity */ createdBy?: string; /** Filter by actor who last updated the entity */ updatedBy?: string; /** Date range filter on creation date */ dateRange?: DateRange; /** Date range filter on update date */ updatedDateRange?: DateRange; /** Metadata key-value conditions (AND-ed together) */ metadataConditions?: MetadataCondition[]; /** Entity-owned tag filters resolved in graph search */ tagFilter?: TagFilter; /** Exclude specific entity IDs */ excludeIds?: string[]; /** Sort order (defaults to SCORE_DESC) */ sortBy?: SearchSortBy; /** Number of results per page (max 100) */ limit?: number; /** Offset for pagination */ offset?: number; } export interface UseGlobalSearchReturn { /** Search and return full response with pagination and facets */ searchFull: (query: string, category?: string, filters?: SearchFilters) => Promise; /** Search and return just the results array (backward-compatible) */ search: (query: string, category?: string, filters?: SearchFilters) => Promise; isSearching: boolean; } /** * Maps UI search category names to backend entity types. * Categories without a mapping search across all entity types (no filter). */ export declare const CATEGORY_ENTITY_TYPE_MAP: Record; export declare function resolveEntityTypesForCategory(category?: string): string[] | undefined; /** * Derive a navigation href from an entity type and ID. * Follows the shell's route structure. Exported for unit testing. */ export declare function buildHref(entityType: string, entityId: string, workspaceId?: string | null): string; /** * Map backend entity type to a human-readable category label for grouping. * Exported for unit testing. */ export declare function mapEntityTypeToCategory(entityType: string): string; /** * Global search hook — single entry point for all search operations. * * The `category` parameter provides a quick UI-friendly filter by mapping * category names to entity types. For more advanced filtering, pass a * `SearchFilters` object as the third argument. * * @example Basic search * ```tsx * const { search, isSearching } = useGlobalSearch(); * const results = await search('dashboard'); * ``` * * @example Category filter * ```tsx * const results = await search('dashboard', 'projects'); * ``` * * @example Advanced filters * ```tsx * const results = await search('dashboard', undefined, { * projectId: 'proj-123', * sortBy: 'CREATED_DESC', * metadataConditions: [{ key: 'status', value: 'active' }], * limit: 50, * }); * ``` */ export declare function useGlobalSearch(): UseGlobalSearchReturn; //# sourceMappingURL=useGlobalSearch.d.ts.map