import { http } from "./http"; import type { DiscoverChat, Message, UserSearchItem } from "../chat/types"; export interface GlobalSearchResponse { users: UserSearchItem[]; chats: DiscoverChat[]; messages: Message[]; } export async function globalSearch(query: string): Promise { const { data } = await http.get("/search", { params: { query, users_limit: 10, chats_limit: 10, messages_limit: 10 } }); return data; }