import basem = require('./ClientApiBases'); import VsoBaseInterfaces = require('./interfaces/common/VsoBaseInterfaces'); import DashboardInterfaces = require("./interfaces/DashboardInterfaces"); import TfsCoreInterfaces = require("./interfaces/CoreInterfaces"); export interface IDashboardApi extends basem.ClientApiBase { createDashboard(dashboard: DashboardInterfaces.Dashboard, teamContext: TfsCoreInterfaces.TeamContext): Promise; deleteDashboard(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise; getDashboard(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise; getDashboards(teamContext: TfsCoreInterfaces.TeamContext): Promise; replaceDashboard(dashboard: DashboardInterfaces.Dashboard, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise; replaceDashboards(group: DashboardInterfaces.DashboardGroup, teamContext: TfsCoreInterfaces.TeamContext): Promise; createWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise; deleteWidget(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise; getWidget(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise; replaceWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise; updateWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise; getWidgetMetadata(contributionId: string, project?: string): Promise; getWidgetTypes(scope: DashboardInterfaces.WidgetScope, project?: string): Promise; } export declare class DashboardApi extends basem.ClientApiBase implements IDashboardApi { constructor(baseUrl: string, handlers: VsoBaseInterfaces.IRequestHandler[], options?: VsoBaseInterfaces.IRequestOptions); static readonly RESOURCE_AREA_ID: string; /** * Create the supplied dashboard. * * @param {DashboardInterfaces.Dashboard} dashboard - The initial state of the dashboard * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ createDashboard(dashboard: DashboardInterfaces.Dashboard, teamContext: TfsCoreInterfaces.TeamContext): Promise; /** * Delete a dashboard given its ID. This also deletes the widgets associated with this dashboard. * * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation * @param {string} dashboardId - ID of the dashboard to delete. */ deleteDashboard(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise; /** * Get a dashboard by its ID. * * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation * @param {string} dashboardId */ getDashboard(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise; /** * Get a list of dashboards. * * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ getDashboards(teamContext: TfsCoreInterfaces.TeamContext): Promise; /** * Replace configuration for the specified dashboard. Replaces Widget list on Dashboard, only if property is supplied. * * @param {DashboardInterfaces.Dashboard} dashboard - The Configuration of the dashboard to replace. * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation * @param {string} dashboardId - ID of the dashboard to replace. */ replaceDashboard(dashboard: DashboardInterfaces.Dashboard, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise; /** * Update the name and position of dashboards in the supplied group, and remove omitted dashboards. Does not modify dashboard content. * * @param {DashboardInterfaces.DashboardGroup} group * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation */ replaceDashboards(group: DashboardInterfaces.DashboardGroup, teamContext: TfsCoreInterfaces.TeamContext): Promise; /** * Create a widget on the specified dashboard. * * @param {DashboardInterfaces.Widget} widget - State of the widget to add * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation * @param {string} dashboardId - ID of dashboard the widget will be added to. */ createWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string): Promise; /** * Delete the specified widget. * * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation * @param {string} dashboardId - ID of the dashboard containing the widget. * @param {string} widgetId - ID of the widget to update. */ deleteWidget(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise; /** * Get the current state of the specified widget. * * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation * @param {string} dashboardId - ID of the dashboard containing the widget. * @param {string} widgetId - ID of the widget to read. */ getWidget(teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise; /** * Override the state of the specified widget. * * @param {DashboardInterfaces.Widget} widget - State to be written for the widget. * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation * @param {string} dashboardId - ID of the dashboard containing the widget. * @param {string} widgetId - ID of the widget to update. */ replaceWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise; /** * Perform a partial update of the specified widget. * * @param {DashboardInterfaces.Widget} widget - Description of the widget changes to apply. All non-null fields will be replaced. * @param {TfsCoreInterfaces.TeamContext} teamContext - The team context for the operation * @param {string} dashboardId - ID of the dashboard containing the widget. * @param {string} widgetId - ID of the widget to update. */ updateWidget(widget: DashboardInterfaces.Widget, teamContext: TfsCoreInterfaces.TeamContext, dashboardId: string, widgetId: string): Promise; /** * Get the widget metadata satisfying the specified contribution ID. * * @param {string} contributionId - The ID of Contribution for the Widget * @param {string} project - Project ID or project name */ getWidgetMetadata(contributionId: string, project?: string): Promise; /** * Get all available widget metadata in alphabetical order. * * @param {DashboardInterfaces.WidgetScope} scope * @param {string} project - Project ID or project name */ getWidgetTypes(scope: DashboardInterfaces.WidgetScope, project?: string): Promise; }