2
>
* Copyright (c) Microsoft Corporation. All rights reserved.
3
>
* Licensed under the MIT License. See License.txt in the project root for license information.
4
>
*--------------------------------------------------------------------------------------------*/
5
>
6
>
import { Event } from '../../../../base/common/event.js';
7
>
import { INotification, INotificationHandle, INotificationService, INotificationSource, INotificationSourceFilter, IPromptChoice, IPromptOptions, IStatusHandle, IStatusMessageOptions, NoOpNotification, NotificationsFilter, Severity } from '../../common/notification.js';
8
>
9
>
export class TestNotificationService implements INotificationService {
10
11
readonly onDidChangeFilter: Event<void> = Event.None;
13
>
declare readonly _serviceBrand: undefined;
14
>
15
>
private static readonly NO_OP: INotificationHandle = new NoOpNotification();
16
>
17
>
info(message: string): INotificationHandle {
18
return this.notify({ severity: Severity.Info, message });
19
}
21
>
warn(message: string): INotificationHandle {
22
return this.notify({ severity: Severity.Warning, message });
23
}
25
>
error(error: string | Error): INotificationHandle {
26
return this.notify({ severity: Severity.Error, message: error });
27
}
29
>
notify(notification: INotification): INotificationHandle {
30
return TestNotificationService.NO_OP;
31
}
33
>
prompt(severity: Severity, message: string, choices: IPromptChoice[], options?: IPromptOptions): INotificationHandle {
34
return TestNotificationService.NO_OP;
35
}
37
>
status(message: string | Error, options?: IStatusMessageOptions): IStatusHandle {
38
return {
39
close: () => { }
40
};
41
}
43
>
setFilter(): void { }
44
>
45
>
getFilter(source?: INotificationSource | undefined): NotificationsFilter {
46
return NotificationsFilter.OFF;
47
}
49
>
getFilters(): INotificationSourceFilter[] {
50
return [];
51
}
53
>
removeFilter(sourceId: string): void { }
54
>
}