forked from denoland/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsearch.client.ts
42 lines (39 loc) · 1.03 KB
/
search.client.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import { OramaClient } from "npm:@oramacloud/client@1";
const client = new OramaClient({
endpoint: "https://cloud.orama.run/v1/indexes/deno-docs-pp7js4",
api_key: "BhHQBNY6gwBukMREm9FOproywA50UDQs",
});
document.addEventListener("DOMContentLoaded", () => {
oramaSearchbox.RegisterSearchBox({
oramaInstance: client,
colorScheme: "light",
resultsMap: {
description: "content",
},
facetProperty: "category",
});
oramaSearchbox.RegisterSearchButton({
colorScheme: "light",
themeConfig: {
light: {
"--search-btn-background-color": "#fff",
"--search-btn-border-color": "rgb(229 231 235)",
},
},
});
});
declare global {
const oramaSearchbox: {
RegisterSearchBox: (options: {
oramaInstance: OramaClient;
colorScheme: "light" | "dark";
resultsMap: Record<string, string>;
}) => void;
RegisterSearchButton: (
options: {
colorScheme: "light" | "dark";
themeConfig: { light: Record<string, string> };
},
) => void;
};
}