Files
azuredatastudio/src/sql/platform/tasks/common/tasks.ts
Anthony Dresser c23738f935 Inital platform relayering (#6385)
* moving test files and inital refactoring

* relayer extension host code

* fix imports

* make insights work

* relayer dashboard

* relayer notebooks

* moveing more code around

* formatting

* accept angular as browser

* fix serializer

* add missing files

* remove declarations from extensions

* fix build errors

* more relayering

* change urls to relative to help code relayering

* remove layering to prep for merge

* fix hygiene errors

* fix hygiene errors

* fix tests
2019-07-18 17:29:17 -07:00

61 lines
1.9 KiB
TypeScript

/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IConnectionProfile } from 'sql/platform/connection/common/interfaces';
import * as types from 'vs/base/common/types';
import { ILocalizedString, ICommandAction } from 'vs/platform/actions/common/actions';
import { Event } from 'vs/base/common/event';
import { IDisposable } from 'vs/base/common/lifecycle';
import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey';
import { IdGenerator } from 'vs/base/common/idGenerator';
import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation';
export interface ITaskOptions {
id: string;
title: string;
iconPath: { dark: string; light: string; };
description?: ITaskHandlerDescription;
iconClass?: string;
}
export interface ITaskHandlerDescription {
description: string;
args: { name: string; description?: string; constraint?: types.TypeConstraint; }[];
returns?: string;
}
export interface ITaskEvent {
taskId: string;
}
export interface ITaskAction {
id: string;
title: string | ILocalizedString;
category?: string | ILocalizedString;
iconClass?: string;
iconPath?: string;
}
export interface ITaskHandler {
(accessor: ServicesAccessor, profile: IConnectionProfile, ...args: any[]): void;
}
export interface ITask {
id: string;
handler: ITaskHandler;
precondition?: ContextKeyExpr;
description?: ITaskHandlerDescription;
iconClass?: string;
}
export interface ITaskRegistry {
registerTask(id: string, command: ITaskHandler): IDisposable;
registerTask(command: ITask): IDisposable;
getTasks(): string[];
getOrCreateTaskIconClassName(item: ICommandAction): string;
onTaskRegistered: Event<string>;
}