@@ -2,6 +2,8 @@ import type {
22 SearchSourceOptions ,
33 SearchSourceType ,
44 TextComposerMiddlewareOptions ,
5+ TextComposerMiddlewareParams ,
6+ TextComposerSuggestion ,
57} from 'stream-chat' ;
68import {
79 BaseSearchSource ,
@@ -14,8 +16,6 @@ import type {
1416 EmojiSearchIndex ,
1517 EmojiSearchIndexResult ,
1618} from '../../../components/MessageInput' ;
17- import type { TextComposerSuggestion } from 'stream-chat' ;
18- import type { MiddlewareParams } from 'stream-chat' ;
1919
2020class EmojiSearchSource <
2121 T extends TextComposerSuggestion < EmojiSearchIndexResult > ,
@@ -69,7 +69,7 @@ const DEFAULT_OPTIONS: TextComposerMiddlewareOptions = { minChars: 1, trigger: '
6969 * minChars: 2
7070 * }));
7171 *
72- * @param { EmojiSearchSource } searchSource
72+ * @param emojiSearchIndex
7373 * @param {{
7474 * minChars: number;
7575 * trigger: string;
@@ -88,7 +88,7 @@ export const createTextComposerEmojiMiddleware = <
8888
8989 return {
9090 id : finalOptions . trigger ,
91- onChange : async ( { input, nextHandler } : MiddlewareParams < T > ) => {
91+ onChange : async ( { input, nextHandler } : TextComposerMiddlewareParams < T > ) => {
9292 const { state } = input ;
9393 if ( ! state . selection ) return nextHandler ( input ) ;
9494
@@ -147,7 +147,7 @@ export const createTextComposerEmojiMiddleware = <
147147 input,
148148 nextHandler,
149149 selectedSuggestion,
150- } : MiddlewareParams < T > ) => {
150+ } : TextComposerMiddlewareParams < T > ) => {
151151 const { state } = input ;
152152 if ( ! selectedSuggestion || state . suggestions ?. trigger !== finalOptions . trigger )
153153 return nextHandler ( input ) ;
0 commit comments