From 58fa1ab9be7ee8fd4a8e96865121a54d613978cc Mon Sep 17 00:00:00 2001 From: Aylur Date: Sat, 25 May 2024 14:44:50 +0200 Subject: separate node and gjs into its own package --- js/src/application.ts | 28 ---------------------------- 1 file changed, 28 deletions(-) delete mode 100644 js/src/application.ts (limited to 'js/src/application.ts') 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 { - 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) - } - }) -} -- cgit v1.2.3