import { TaskDefinition , workspace , WorkspaceConfiguration , WorkspaceFolder } from "vscode" ; const tasksKey = 'tasks' ; const versionKey = 'version' ; export const tasksVersion = '2.0.0' ; export function getTasks ( folder ) { return getTasksConfig ( folder ) . get < ITask [ ] > ( tasksKey ) || [ ] ; } export async function updateTasks ( folder , tasks ) { await getTasksConfig ( folder ) . update ( tasksKey , tasks ) ; } export function getTasksVersion ( folder ) { return getTasksConfig ( folder ) . get < string > ( versionKey ) ; } export async function updateTasksVersion ( folder , version ) { await getTasksConfig ( folder ) . update ( versionKey , version ) ; } function getTasksConfig ( folder ) { return workspace . getConfiguration ( tasksKey , folder . uri ) ; } export function convertToFunctionsTaskLabel ( label ) { return `${ label } (functions)` ; } export interface ITasksJson { version : string ; tasks ? : ITask [ ] ; } export interface ITask extends TaskDefinition { label ? : string ; command ? : string ; options ? : ITaskOptions ; } export interface ITaskOptions { cwd ? : string ; env ? : { [ key ] : string ; } ; }