refactor(ags): make custom services global for outside access

This commit is contained in:
matt1432 2023-11-04 13:38:02 -04:00
parent 070f5345c8
commit 97239557f7
3 changed files with 8 additions and 4 deletions

View file

@ -32,7 +32,8 @@
"no-useless-escape": ["off"]
},
"globals": {
"ags": "readonly",
"Tablet": "readonly",
"Pointers": "readonly",
"ARGV": "readonly",
"imports": "readonly",
"print": "readonly",

View file

@ -4,6 +4,12 @@ Array.prototype.remove = function (el) { this.splice(this.indexOf(el), 1); };
import App from 'resource:///com/github/Aylur/ags/app.js';
import { exec, execAsync } from 'resource:///com/github/Aylur/ags/utils.js';
import Tablet from './services/tablet.js';
globalThis.Tablet = Tablet;
import Pointers from './services/pointers.js';
globalThis.Pointers = Pointers;
import closeAll from './js/misc/closer.js';
globalThis.closeAll = closeAll;

View file

@ -1,8 +1,5 @@
import App from 'resource:///com/github/Aylur/ags/app.js';
// TODO: find a way to not need this?
import Pointers from '../../services/pointers.js';
export default () => {
Array.from(App.windows)