@@ -2,6 +2,8 @@ import type {
2
2
SearchSourceOptions ,
3
3
SearchSourceType ,
4
4
TextComposerMiddlewareOptions ,
5
+ TextComposerMiddlewareParams ,
6
+ TextComposerSuggestion ,
5
7
} from 'stream-chat' ;
6
8
import {
7
9
BaseSearchSource ,
@@ -14,8 +16,6 @@ import type {
14
16
EmojiSearchIndex ,
15
17
EmojiSearchIndexResult ,
16
18
} from '../../../components/MessageInput' ;
17
- import type { TextComposerSuggestion } from 'stream-chat' ;
18
- import type { MiddlewareParams } from 'stream-chat' ;
19
19
20
20
class EmojiSearchSource <
21
21
T extends TextComposerSuggestion < EmojiSearchIndexResult > ,
@@ -69,7 +69,7 @@ const DEFAULT_OPTIONS: TextComposerMiddlewareOptions = { minChars: 1, trigger: '
69
69
* minChars: 2
70
70
* }));
71
71
*
72
- * @param { EmojiSearchSource } searchSource
72
+ * @param emojiSearchIndex
73
73
* @param {{
74
74
* minChars: number;
75
75
* trigger: string;
@@ -88,7 +88,7 @@ export const createTextComposerEmojiMiddleware = <
88
88
89
89
return {
90
90
id : finalOptions . trigger ,
91
- onChange : async ( { input, nextHandler } : MiddlewareParams < T > ) => {
91
+ onChange : async ( { input, nextHandler } : TextComposerMiddlewareParams < T > ) => {
92
92
const { state } = input ;
93
93
if ( ! state . selection ) return nextHandler ( input ) ;
94
94
@@ -147,7 +147,7 @@ export const createTextComposerEmojiMiddleware = <
147
147
input,
148
148
nextHandler,
149
149
selectedSuggestion,
150
- } : MiddlewareParams < T > ) => {
150
+ } : TextComposerMiddlewareParams < T > ) => {
151
151
const { state } = input ;
152
152
if ( ! selectedSuggestion || state . suggestions ?. trigger !== finalOptions . trigger )
153
153
return nextHandler ( input ) ;
0 commit comments