-
Notifications
You must be signed in to change notification settings - Fork 0
/
ghost-kernel.ts
47 lines (42 loc) · 1.1 KB
/
ghost-kernel.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import {
EventController,
EventRoutes,
EventRoutingConstructor,
LazyEventRouter,
} from "lazy-event-router";
import {
ChangeTransactionInfo,
Operation,
} from "./operation";
export {
ChangeTransactionInfo,
Operation,
};
/** ルーティング設定クラスのリスト */
export const GhostKernelRoutings: EventRoutingConstructor[] = [];
/** Ukagaka baseware ghost instance kernel */
export class GhostKernel extends LazyEventRouter {
/**
* constructor
* @param components components
* @param routes ルーティング
*/
constructor(components: any[] = [], routes = new EventRoutes(GhostKernelRoutings)) {
super(components, routes);
this.registerComponent(new Operation(this));
}
/** カーネルの操作 */
get operation() { return this.component(Operation); }
}
/** カーネル用のコントローラ */
export class GhostKernelController implements EventController {
/** カーネル */
protected readonly kernel: GhostKernel;
/**
* コンストラクタ
* @param kernel カーネル
*/
constructor(kernel: GhostKernel) {
this.kernel = kernel;
}
}