@@ -75,6 +75,11 @@ export interface IChatModel extends IDisposable {
7575 */
7676 readonly viewportChanged ?: ISignal < IChatModel , number [ ] > ;
7777
78+ /**
79+ * A signal emitting when the focus is requested on the input.
80+ */
81+ readonly focusInputSignal ?: ISignal < IChatModel , void > ;
82+
7883 /**
7984 * Send a message, to be defined depending on the chosen technology.
8085 * Default to no-op.
@@ -139,6 +144,11 @@ export interface IChatModel extends IDisposable {
139144 * @param count - the number of messages to delete.
140145 */
141146 messagesDeleted ( index : number , count : number ) : void ;
147+
148+ /**
149+ * Function to request the focus on the input of the chat.
150+ */
151+ focusInput ( ) : void ;
142152}
143153
144154/**
@@ -328,6 +338,13 @@ export class ChatModel implements IChatModel {
328338 return this . _viewportChanged ;
329339 }
330340
341+ /**
342+ * A signal emitting when the focus is requested on the input.
343+ */
344+ get focusInputSignal ( ) : ISignal < IChatModel , void > {
345+ return this . _focusInputSignal ;
346+ }
347+
331348 /**
332349 * Send a message, to be defined depending on the chosen technology.
333350 * Default to no-op.
@@ -435,6 +452,13 @@ export class ChatModel implements IChatModel {
435452 this . _messagesUpdated . emit ( ) ;
436453 }
437454
455+ /**
456+ * Function to request the focus on the input of the chat.
457+ */
458+ focusInput ( ) : void {
459+ this . _focusInputSignal . emit ( ) ;
460+ }
461+
438462 /**
439463 * Add unread messages to the list.
440464 * @param indexes - list of new indexes.
@@ -498,6 +522,7 @@ export class ChatModel implements IChatModel {
498522 private _configChanged = new Signal < IChatModel , IConfig > ( this ) ;
499523 private _unreadChanged = new Signal < IChatModel , number [ ] > ( this ) ;
500524 private _viewportChanged = new Signal < IChatModel , number [ ] > ( this ) ;
525+ private _focusInputSignal = new Signal < ChatModel , void > ( this ) ;
501526}
502527
503528/**
0 commit comments