refactor: update import statements and export default class EvalGjs

This commit is contained in:
salem.m.s2030@gmail.com
2024-02-24 11:59:39 +03:00
parent 7e708dc871
commit de2854278d

View File

@@ -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 =
'<node>' +
' <interface name="dev.ramottamado.EvalGjs">' +
@@ -35,7 +32,7 @@ const EvalGjsIface =
' </interface>' +
'</node>';
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();
}