mirror of
https://github.com/actualbudget/actual.git
synced 2026-03-11 12:43:09 -05:00
[TypeScript] Add types to loot-core app (#4155)
* Add types to loot-core app * Release notes --------- Co-authored-by: Matt Fiddaman <github@m.fiddaman.uk>
This commit is contained in:
committed by
GitHub
parent
4bfb64cdfc
commit
f07ad1f8c6
@@ -14,16 +14,19 @@ type Events = {
|
||||
'load-budget': { id: string };
|
||||
};
|
||||
|
||||
type UnlistenService = () => void;
|
||||
type Service = () => UnlistenService;
|
||||
|
||||
class App<Handlers> {
|
||||
events: Emitter<Events>;
|
||||
handlers: Handlers;
|
||||
services;
|
||||
unlistenServices;
|
||||
services: Service[];
|
||||
unlistenServices: UnlistenService[];
|
||||
|
||||
constructor() {
|
||||
this.handlers = {} as Handlers;
|
||||
this.services = [];
|
||||
this.events = mitt();
|
||||
this.events = mitt<Events>();
|
||||
this.unlistenServices = [];
|
||||
}
|
||||
|
||||
@@ -39,7 +42,7 @@ class App<Handlers> {
|
||||
this.handlers[name] = func;
|
||||
}
|
||||
|
||||
service(func) {
|
||||
service(func: Service) {
|
||||
this.services.push(func);
|
||||
}
|
||||
|
||||
|
||||
6
upcoming-release-notes/4155.md
Normal file
6
upcoming-release-notes/4155.md
Normal file
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Maintenance
|
||||
authors: [joel-jeremy]
|
||||
---
|
||||
|
||||
Add types to loot-core app
|
||||
Reference in New Issue
Block a user