Skip to content

Commit e014ab3

Browse files
committed
updates to app framework
1 parent f465183 commit e014ab3

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/core/app-framework.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
1-
// Type definitions for browser
2-
export interface Browser {
3-
cdp_ws_url: string;
4-
}
5-
6-
// Context definition
71
export interface KernelContext {
82
invocationId: string;
93
}
104

11-
// Action definition
125
export interface KernelAction {
136
name: string;
147
handler: (context: KernelContext, input: any) => Promise<any>;
@@ -130,12 +123,14 @@ class KernelAppRegistry {
130123
return this.apps.get(name);
131124
}
132125

133-
/**
134-
* Export the registry as JSON
135-
*/
126+
export(): KernelJson {
127+
return {
128+
apps: this.getApps().map((app) => app.toJSON()),
129+
};
130+
}
131+
136132
exportJSON(): string {
137-
const apps = this.getApps().map((app) => app.toJSON());
138-
return JSON.stringify({ apps } as KernelJson, null, 2);
133+
return JSON.stringify(this.export(), null, 2);
139134
}
140135
}
141136

0 commit comments

Comments
 (0)