From d09614e3c80c63d349c75645674e1e1cc8db3e6b Mon Sep 17 00:00:00 2001 From: miagilepner Date: Tue, 6 Jul 2021 14:51:21 +0200 Subject: [PATCH] fixes --- src/types.ts | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/types.ts b/src/types.ts index 70afb757f..8a0053cfb 100644 --- a/src/types.ts +++ b/src/types.ts @@ -944,8 +944,6 @@ export type QueryMembersOptions = { user_id_lte?: string; }; -export type SearchOptions = LimitOffsetSearchOptions | NextSearchOptions; - export type LimitOffsetSearchOptions = { limit?: number; offset?: number; @@ -957,6 +955,8 @@ export type NextSearchOptions = { sort?: SearchMessageSort; }; +export type SearchOptions = LimitOffsetSearchOptions | NextSearchOptions; + export type StreamChatOptions = AxiosRequestConfig & { /** * Used to disable warnings that are triggered by using connectUser or connectAnonymousUser server-side. @@ -1426,18 +1426,24 @@ export type UserSort = export type SearchRelevanceSort = { relevance?: AscDesc }; -export type SearchMessageSortBase = +export type SearchMessageSortBase = | SearchRelevanceSort - | Sort + | Sort | { [field: string]: AscDesc }; -export type SearchMessageSort = SearchMessageSortBase | Array; +export type SearchMessageSort = + | SearchMessageSortBase + | Array>; -export type QuerySort = +export type QuerySort< + ChannelType = UnknownType, + UserType = UnknownType, + MessageType = UnknownType +> = | BannedUsersSort | ChannelSort - | UserSort - | SearchMessageSort; + | SearchMessageSort + | UserSort; /** * Base Types