import {ShortcutType} from 'sentry/components/smartSearchBar/types'; type SearchEventBase = { query: string; search_type: string; search_source?: string; }; type OpenEvent = {}; type SelectEvent = {result_type: string; source_type: string; query?: string}; type QueryEvent = {query: string}; type ProjectSelectorEvent = {path: string}; export type SearchEventParameters = { 'command_palette.open': OpenEvent; 'command_palette.query': QueryEvent; 'command_palette.select': SelectEvent; 'organization_saved_search.selected': { id: number; search_type: string; }; 'projectselector.clear': ProjectSelectorEvent; 'projectselector.direct_selection': ProjectSelectorEvent; 'projectselector.multi_button_clicked': ProjectSelectorEvent & { button_type: 'all' | 'my'; }; 'projectselector.toggle': ProjectSelectorEvent & { action: 'added' | 'removed'; }; 'projectselector.update': ProjectSelectorEvent & { count: number; multi: boolean; }; 'search.invalid_field': Omit & {attempted_field_name: string}; 'search.operator_autocompleted': SearchEventBase & {search_operator: string}; 'search.pin': { action: 'pin' | 'unpin'; search_type: string; query?: string; }; 'search.search_with_invalid': SearchEventBase; 'search.searched': SearchEventBase & {search_source?: string}; 'search.shortcut_used': SearchEventBase & { shortcut_method: 'hotkey' | 'click'; shortcut_type: ShortcutType; search_source?: string; }; 'settings_search.open': OpenEvent; 'settings_search.query': QueryEvent; 'settings_search.select': SelectEvent; 'sidebar_help.open': OpenEvent; 'sidebar_help.query': QueryEvent; 'sidebar_help.select': SelectEvent; }; export type SearchEventKey = keyof SearchEventParameters; export const searchEventMap: Record = { 'search.searched': 'Search: Performed search', 'search.operator_autocompleted': 'Search: Operator Autocompleted', 'search.shortcut_used': 'Search: Shortcut Used', 'search.search_with_invalid': 'Search: Attempted Invalid Search', 'search.invalid_field': 'Search: Unsupported Field Warning Shown', 'organization_saved_search.selected': 'Organization Saved Search: Selected saved search', 'settings_search.open': 'settings_search Open', 'command_palette.open': 'command_palette Open', 'sidebar_help.open': 'sidebar_help Open', 'settings_search.select': 'settings_search Select', 'command_palette.select': 'command_palette Select', 'sidebar_help.select': 'sidebar_help Select', 'settings_search.query': 'settings_search Query', 'command_palette.query': 'command_palette Query', 'sidebar_help.query': 'sidebar_help Query', 'projectselector.direct_selection': 'Project Selector: Direct Selection', 'projectselector.update': 'Project Selector: Update', 'projectselector.clear': 'Project Selector: Clear', 'projectselector.toggle': 'Project Selector: Toggle', 'projectselector.multi_button_clicked': 'Project Selector: Multi Button Clicked', 'search.pin': 'Search: Pin', };