File tree Expand file tree Collapse file tree 1 file changed +7
-12
lines changed
Expand file tree Collapse file tree 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change 1- // Type definitions for browser
2- export interface Browser {
3- cdp_ws_url : string ;
4- }
5-
6- // Context definition
71export interface KernelContext {
82 invocationId : string ;
93}
104
11- // Action definition
125export 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
You can’t perform that action at this time.
0 commit comments