Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
NebulaServices
GitHub Repository: NebulaServices/Nebula
Path: blob/main/src/utils/values.ts
976 views
1
import { defaultStore } from "./storage"
2
3
type cloaks = "default" | "google" | "wikipedia" | "canvas" | "classroom" | "powerschool";
4
5
// Where all of our values like Search Engines, WispServers & SupportedSites live.
6
const SearchEngines: Record<string, string> = {
7
ddg: "https://duckduckgo.com/?q=%s",
8
//google: "https://google.com/search?q=%s",
9
bing: "https://bing.com/search?q=%s"
10
}
11
12
const WispServers: Record<string, string> = {
13
"default": (location.protocol === "https:" ? "wss://" : "ws://") + location.host + "/wisp/",
14
"custom": defaultStore.getVal("customWispUrl")
15
}
16
17
const SupportedSites: Record<string, "uv" | "sj"> = {
18
"discord.gg": "sj",
19
"discord.com": "sj",
20
"spotify.com": "sj",
21
"spotify.link": "sj",
22
"youtube.com": "uv",
23
"youtu.be": "uv",
24
"google.com": "uv"
25
};
26
27
interface SettingsVals {
28
i18n: {
29
lang: "selectedLanguage",
30
languages: {
31
en: string,
32
jp: string
33
}
34
},
35
proxy: {
36
wispServer: string,
37
proxy: {
38
key: string,
39
available: {
40
uv: string;
41
sj: string;
42
automatic: string
43
}
44
},
45
searchEngine: string,
46
transport: {
47
key: string,
48
available: {
49
epoxy: string;
50
libcurl: string;
51
}
52
},
53
},
54
tab: {
55
cloak: string;
56
ab: string;
57
},
58
marketPlace: {
59
themes: string;
60
plugins: string;
61
appearance: {
62
video: string;
63
image: string;
64
theme: {
65
payload: string;
66
name: string;
67
}
68
}
69
}
70
}
71
/**
72
* This object allows us to access things such as the wisp server url and other things that aren't just one offs
73
*/
74
const SettingsVals: SettingsVals = {
75
i18n: {
76
lang: "selectedLanguage",
77
languages: {
78
en: "en_US",
79
jp: "jp"
80
}
81
},
82
proxy: {
83
wispServer: "wispServer",
84
proxy: {
85
key: "proxy",
86
available: {
87
sj: "sj",
88
uv: "uv",
89
automatic: "automatic"
90
}
91
},
92
searchEngine: "searchEngine",
93
transport: {
94
key: "transport",
95
available: {
96
epoxy: "epoxy",
97
libcurl: "libcurl"
98
}
99
}
100
},
101
tab: {
102
cloak: "cloak",
103
ab: "aboutblank"
104
},
105
marketPlace: {
106
themes: "themes",
107
plugins: "plugins",
108
appearance: {
109
video: "video",
110
image: "image",
111
theme: {
112
name: "themeName",
113
payload: "themePayload"
114
}
115
}
116
}
117
}
118
119
export { SearchEngines, WispServers, SupportedSites, SettingsVals, type cloaks }
120
121