import { SearchIndex , SearchResult } from "../../_" ; /**
 * Search message type
 */ export const enum SearchMessageType { SETUP , READY , QUERY , RESULT } /**
 * Message containing the data necessary to setup the search index
 */ export interface SearchSetupMessage { type : SearchMessageType . SETUP ; data : SearchIndex ; } /**
 * Message indicating the search index is ready
 */ export interface SearchReadyMessage { type : SearchMessageType . READY ; } /**
 * Message containing a search query
 */ export interface SearchQueryMessage { type : SearchMessageType . QUERY ; data : string ; } /**
 * Message containing results for a search query
 */ export interface SearchResultMessage { type : SearchMessageType . RESULT ; data : SearchResult ; } /**
 * Message exchanged with the search worker
 */ export type SearchMessage = SearchSetupMessage | SearchReadyMessage | SearchQueryMessage | SearchResultMessage ; param message returns export function isSearchSetupMessage ( message ) { return message . type === SearchMessageType . SETUP ; } param message returns export function isSearchReadyMessage ( message ) { return message . type === SearchMessageType . READY ; } param message returns export function isSearchQueryMessage ( message ) { return message . type === SearchMessageType . QUERY ; } param message returns export function isSearchResultMessage ( message ) { return message . type === SearchMessageType . RESULT ; }