This commit is contained in:
Erzbir
2025-07-31 15:03:34 +08:00
commit d5c80de2c8
63 changed files with 4514 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
export class Terminal {
constructor() {
this._refreshFunctions = [];
this._initFunctions = [];
this.initialized = false;
}
registerRefresh(func) {
this._refreshFunctions.push(func);
}
registerInitFunc(func) {
this._initFunctions.push(func);
}
refresh() {
if (!this.initialized) {
this._initFunctions.forEach(func => func());
this.initialized = true;
}
this._refreshFunctions.forEach(func => func());
}
}
export var terminal = new Terminal();
window.terminal = terminal;