src/vs/workbench/contrib/tasks/common/tasks.ts/create
	export function create(kind: TaskEventKind, task?: Task, processIdOrExitCodeOrTerminalId?: number, resolvedVariables?: Map<string, string>): ITaskEvent {
		if (task) {
			const result: ITaskEvent = {
				kind: kind,
				taskId: task._id,
				taskName: task.configurationProperties.name,
				runType: task.configurationProperties.isBackground ? TaskRunType.Background : TaskRunType.SingleRun,
				group: task.configurationProperties.group,
				processId: undefined as number | undefined,
				exitCode: undefined as number | undefined,
				terminalId: undefined as number | undefined,
				__task: task,
			};
			if (kind === TaskEventKind.Start) {
				result.terminalId = processIdOrExitCodeOrTerminalId;
				result.resolvedVariables = resolvedVariables;
			} else if (kind === TaskEventKind.ProcessStarted) {
				result.processId = processIdOrExitCodeOrTerminalId;
			} else if (kind === TaskEventKind.ProcessEnded) {
				result.exitCode = processIdOrExitCodeOrTerminalId;
			}
			return Object.freeze(result);
		} else {
			return Object.freeze({ kind: TaskEventKind.Changed });
		}
	}