@microsoft/windows-admin-center-sdk
Version:
Microsoft - Windows Admin Center Shell
57 lines (56 loc) • 2.4 kB
TypeScript
import { Observable } from 'rxjs';
import { Rpc } from '../rpc/rpc';
import { ClientNotification } from './client-notification';
import { ClientNotificationInstance } from './client-notification-instance';
import { NotificationManager } from './notification-manager';
import { NotificationState } from './notification-state';
/**
* Notification connection class.
*/
export declare class NotificationConnection {
private rpc;
notificationManager: NotificationManager;
/**
* Initializes a new instance of the NotificationConnection class.
*
* @param rpc the RPC object.
*/
constructor(rpc: Rpc);
/**
* Create a new client notification instance.
*
* @param nodeName the node name. it should set node name of current action connection or gateway name.
* Only shell code could set the node name be null if notification action against shell generic task.
*/
create(nodeName: string): ClientNotificationInstance;
/**
* Send a client notification and an alert either directly to NotificationManager or through RPC.
*
* @param nodeName the node name.
* @param notification the client notification object.
*/
notify(nodeName: string, notification: ClientNotification): Observable<any>;
/**
* send updated notification with new message and state
* @param nodeName the node name
* @param state the new notification state
* @param message the new message
* @param notification the existing notification
*/
updateNotification(nodeName: string, notification: ClientNotification, state: NotificationState, message: string): void;
/**
* @deprecated
*
* Send an alert bar based client notification either directly to NotificationManager or through RPC.
*
* Please use create(), ClientNotificationInstance class or notify() instead.
* Recommend to use create() or ClientNotificationInstance class which allows to display in-progress state of notification,
* and properly set title, message and supported state.
*
* @param nodeName the node name of alert source.
* @param state the notification state.
* @param message the message of alert bar.
* @param title the title of alert bar.
*/
alert(nodeName: string, state: NotificationState, message: string, title?: string): Observable<any>;
}