Switch from coffee script to typescrit

- Better tooling support
- Stronger type checking
- Unit test with jest
- JSDocc support
This commit is contained in:
Xuan Sang LE
2020-05-29 22:22:00 +02:00
parent 759cd1fc6f
commit 1c32f2010c
82 changed files with 14880 additions and 7293 deletions

View File

@ -0,0 +1,52 @@
/*
* decaffeinate suggestions:
* DS102: Remove unnecessary code created because of implicit returns
* DS208: Avoid top-level this
* Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
*/
// Copyright 2017-2018 Xuan Sang LE <xsang.le AT gmail DOT com>
// AnTOS Web desktop is is licensed under the GNU General Public
// License v3.0, see the LICENCE file for more information
// This program is free software: you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of
// the License, or (at your option) any later version.
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
// You should have received a copy of the GNU General Public License
//along with this program. If not, see https://www.gnu.org/licenses/.
namespace OS {
export namespace application {
export class Calendar extends BaseService {
constructor(args: AppArgumentsType[]) {
super("Calendar", args);
//@iconclass = "fa fa-commenting"
this.text = "";
this.iconclass = "fa fa-calendar";
}
init(): void {
//update time each second
this.watch(1000, () => {
const now = new Date();
this.text = now.toString();
(this.domel as GUI.tag.SimpleMenuEntryTag).text = this.text;
});
}
awake(e: GUI.TagEventType): void {
this.openDialog("CalendarDialog").then((d) => console.log(d));
}
// do nothing
cleanup(evt: BaseEvent): void {
return console.log("cleanup for quit");
}
}
}
}