export async function executeSearch({ query, editContext, maxResults = 10, index, rootItemIds, skipValidation = false, }) {
    const response = await fetch("/parhelia/index/search", {
        method: "POST",
        body: JSON.stringify({
            contextItem: {
                id: editContext.currentItemDescriptor?.id,
                language: "en",
                version: 0,
            },
            query,
            index,
            maxResults,
            rootItemIds,
            skipValidation,
        }),
        credentials: "include",
        headers: {
            "Content-Type": "application/json",
        },
    });
    if (!response.ok)
        return { type: "error", response };
    return { type: "success", response, data: await response.json() };
}
//# sourceMappingURL=searchService.js.map