import {iMouseEvent} from "@peryl/react-compose"; export interface iSearchDataRender { (dataMeta: iSearchDataMeta): any; } export interface iSearchDataMeta { title?: string, desc?: string, type: 'group' | 'page' | 'header' | 'sub_header' | 'content' | 'favorite' | 'history', data?: any } export interface iSearchServiceDefaultConfig { width: number, render?: iSearchDataRender, placeholder: string, footer?: () => any, cacheName?: string, } export interface iSearchServiceCustomConfig { getData: (searchKey: string) => Promise, onSelect: (data: iSearchDataMeta) => void, } export type iSearchServiceConfig = iSearchServiceDefaultConfig & iSearchServiceCustomConfig export const SearchType2Icon: Record any> = { group: () => null, page: () => ( ), header: () => ( ), sub_header: () => ( ), content: () => ( ), history: () => ( ), favorite: () => ( ), }; export const SearchTreeIcon = { normal: () => ( ), last: () => ( ) }; export const SearchOptionButton = { normal: (onClick?: (e: iMouseEvent) => void) => { return (
); }, favorite: (onClick?: (e: iMouseEvent) => void) => { return (
); }, remove: (onClick?: (e: iMouseEvent) => void) => { return (
); }, };