Add doAction API call for ModelView (#10345)

* Add doAction API call for ModelView

* cleanup
This commit is contained in:
Charles Gagnon
2020-05-12 10:47:20 -07:00
committed by GitHub
parent ff848b5903
commit 3fa0deed71
13 changed files with 70 additions and 8 deletions

View File

@@ -23,6 +23,13 @@ export enum ComponentEventType {
onEnterKeyPressed
}
/**
* Actions that can be handled by ModelView components
*/
export enum ModelViewAction {
SelectTab = 'selectTab'
}
/**
* Defines a component and can be used to map from the model-backed version of the
* world to the frontend UI;
@@ -95,6 +102,7 @@ export interface IComponent extends IDisposable {
setDataProvider(handle: number, componentId: string, context: any): void;
refreshDataProvider(item: any): void;
focus(): void;
doAction(action: string, ...args: any[]): void;
}
export enum ModelComponentTypes {

View File

@@ -45,4 +45,5 @@ export interface IModelView extends IView {
validate(componentId: string): Thenable<boolean>;
readonly onDestroy: Event<void>;
focus(componentId: string): void;
doAction(componentId: string, action: string, ...args: any[]): void;
}