2020-10-12 23:03:00 +02:00
|
|
|
import Module from '../../__module';
|
2020-06-03 10:17:29 +02:00
|
|
|
import { Notifier } from '../../../../types/api';
|
|
|
|
import { ConfirmNotifierOptions, NotifierOptions, PromptNotifierOptions } from 'codex-notifier';
|
2018-11-10 13:47:25 +01:00
|
|
|
|
2020-06-03 10:17:29 +02:00
|
|
|
/**
|
|
|
|
*
|
|
|
|
*/
|
2018-11-10 13:47:25 +01:00
|
|
|
export default class NotifierAPI extends Module {
|
|
|
|
/**
|
|
|
|
* Available methods
|
|
|
|
*/
|
2020-06-03 10:17:29 +02:00
|
|
|
public get methods(): Notifier {
|
2018-11-10 13:47:25 +01:00
|
|
|
return {
|
2020-06-03 10:17:29 +02:00
|
|
|
show: (options: NotifierOptions | ConfirmNotifierOptions | PromptNotifierOptions): void => this.show(options),
|
2018-11-10 13:47:25 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2020-06-03 10:17:29 +02:00
|
|
|
/**
|
|
|
|
* Show notification
|
|
|
|
*
|
|
|
|
* @param {NotifierOptions} options - message option
|
|
|
|
*/
|
|
|
|
public show(options: NotifierOptions | ConfirmNotifierOptions | PromptNotifierOptions): void {
|
2018-11-10 13:47:25 +01:00
|
|
|
return this.Editor.Notifier.show(options);
|
|
|
|
}
|
|
|
|
}
|