Support view model toolbar (#1533)

* support view model toolbar

* add EULA

* formatting

* address comment
This commit is contained in:
Abbie Petchtes
2018-06-04 10:11:32 -07:00
committed by GitHub
parent a15c315a1c
commit 9ad4ec6464
7 changed files with 240 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ declare module 'sqlops' {
dashboardWebview(webviewId: string): ComponentBuilder<DashboardWebviewComponent>;
formContainer(): FormBuilder;
groupContainer(): GroupBuilder;
toolbarContainer(): ToolbarBuilder;
}
export interface ComponentBuilder<T extends Component> {
@@ -49,6 +50,24 @@ declare module 'sqlops' {
export interface GroupBuilder extends ContainerBuilder<GroupContainer, GroupLayout, GroupItemLayout> {
}
export interface ToolbarBuilder extends ContainerBuilder<ToolbarContainer, any, any> {
withToolbarItems(components: ToolbarComponent[]): ContainerBuilder<ToolbarContainer, any, any>;
/**
* Creates a collection of child components and adds them all to this container
*
* @param toolbarComponents the definitions
*/
addToolbarItems(toolbarComponents: Array<ToolbarComponent>): void;
/**
* Creates a child component and adds it to this container.
*
* @param toolbarComponent the component to be added
*/
addToolbarItem(toolbarComponent: ToolbarComponent): void;
}
export interface FormBuilder extends ContainerBuilder<FormContainer, FormLayout, FormItemLayout> {
withFormItems(components: FormComponent[], itemLayout?: FormItemLayout): ContainerBuilder<FormContainer, FormLayout, FormItemLayout>;
@@ -104,6 +123,11 @@ declare module 'sqlops' {
actions?: Component[];
}
export interface ToolbarComponent {
component: Component;
title?: string;
}
/**
* A component that contains other components
*/
@@ -212,6 +236,9 @@ declare module 'sqlops' {
export interface GroupContainer extends Container<GroupLayout, GroupItemLayout> {
}
export interface ToolbarContainer extends Container<any, any> {
}
/**
* Describes an action to be shown in the UI, with a user-readable label
* and a callback to execute the action