From de2854278d010e082a4caa59207b0cae5cc44b9e Mon Sep 17 00:00:00 2001 From: "salem.m.s2030@gmail.com" Date: Sat, 24 Feb 2024 11:59:39 +0300 Subject: [PATCH] refactor: update import statements and export default class EvalGjs --- eval-gjs@ramottamado.dev/extension.js | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/eval-gjs@ramottamado.dev/extension.js b/eval-gjs@ramottamado.dev/extension.js index 78e31e1..9b485f5 100644 --- a/eval-gjs@ramottamado.dev/extension.js +++ b/eval-gjs@ramottamado.dev/extension.js @@ -1,3 +1,8 @@ +import Gio from 'gi://Gio'; +import Meta from 'gi://Meta'; +import GLib from 'gi://GLib'; +import * as Main from 'resource:///org/gnome/shell/ui/main.js'; + /* extension.js * * This program is free software: you can redistribute it and/or modify @@ -16,14 +21,6 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ -/* exported init */ - -'use strict'; - -const { Gio, GLib, Meta } = imports.gi; - -const Main = imports.ui.main; - const EvalGjsIface = '' + ' ' + @@ -35,7 +32,7 @@ const EvalGjsIface = ' ' + ''; -class EvalGjs { +export default class EvalGjs { constructor() { this._dbusImpl = Gio.DBusExportedObject.wrapJSObject(EvalGjsIface, this); } @@ -85,7 +82,3 @@ class EvalGjs { if (this._dbusImpl) this._dbusImpl.unexport(); } } - -function init() { - return new EvalGjs(); -}