summaryrefslogtreecommitdiff
path: root/js/src/application.ts
diff options
context:
space:
mode:
Diffstat (limited to 'js/src/application.ts')
-rw-r--r--js/src/application.ts28
1 files changed, 0 insertions, 28 deletions
diff --git a/js/src/application.ts b/js/src/application.ts
deleted file mode 100644
index 10f840e..0000000
--- a/js/src/application.ts
+++ /dev/null
@@ -1,28 +0,0 @@
-export type RequestHandler = {
- (request: string, res: (response: string) => void): void
-}
-
-export type Config = Partial<{
- instanceName: string
- gtkTheme: string
- iconTheme: string
- cursorTheme: string
- css: string
- requestHandler: RequestHandler
- hold: boolean
-}>
-
-export function runJS(body: string): Promise<any> {
- return new Promise((res, rej) => {
- try {
- const fn = Function(`return (async function() {
- ${body.includes(";") ? body : `return ${body};`}
- })`)
- fn()()
- .then(res)
- .catch(rej)
- } catch (error) {
- rej(error)
- }
- })
-}