-
Notifications
You must be signed in to change notification settings - Fork 561
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
857e209
commit 6356a42
Showing
5 changed files
with
119 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 25 additions & 0 deletions
25
packages/controllers/src/services/PluginExecutionEnvironmentService.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { JsonRpcRequest } from 'json-rpc-engine'; | ||
import { PluginData } from '@mm-snap/types'; | ||
|
||
export interface PluginMetadata { | ||
hostname: string; | ||
} | ||
|
||
export type TerminatePlugin = (pluginName: string) => void; | ||
export type Command = ( | ||
pluginName: string, | ||
message: JsonRpcRequest<unknown>, | ||
) => Promise<unknown>; | ||
export type TerminateAll = () => void; | ||
export type CreatePluginEnvironment = ( | ||
metadata: PluginMetadata, | ||
) => Promise<string>; | ||
export type StartPlugin = (pluginData: PluginData) => Promise<unknown>; | ||
|
||
export interface PluginExecutionEnvironmentService { | ||
terminatePlugin: TerminatePlugin; | ||
terminateAllPlugins: TerminateAll; | ||
createPluginEnvironment: CreatePluginEnvironment; | ||
command: Command; | ||
startPlugin: StartPlugin; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.