Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
miagilepner committed Jul 6, 2021
1 parent 986edfd commit d09614e
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -944,8 +944,6 @@ export type QueryMembersOptions = {
user_id_lte?: string;
};

export type SearchOptions = LimitOffsetSearchOptions | NextSearchOptions;

export type LimitOffsetSearchOptions = {
limit?: number;
offset?: number;
Expand All @@ -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.
Expand Down Expand Up @@ -1426,18 +1426,24 @@ export type UserSort<UserType = UnknownType> =

export type SearchRelevanceSort = { relevance?: AscDesc };

export type SearchMessageSortBase =
export type SearchMessageSortBase<MessageType = UnknownType> =
| SearchRelevanceSort
| Sort<Message>
| Sort<MessageType>
| { [field: string]: AscDesc };

export type SearchMessageSort = SearchMessageSortBase | Array<SearchMessageSortBase>;
export type SearchMessageSort<MessageType = UnknownType> =
| SearchMessageSortBase<MessageType>
| Array<SearchMessageSortBase<MessageType>>;

export type QuerySort<ChannelType = UnknownType, UserType = UnknownType> =
export type QuerySort<
ChannelType = UnknownType,
UserType = UnknownType,
MessageType = UnknownType
> =
| BannedUsersSort
| ChannelSort<ChannelType>
| UserSort<UserType>
| SearchMessageSort;
| SearchMessageSort<MessageType>
| UserSort<UserType>;

/**
* Base Types
Expand Down

0 comments on commit d09614e

Please sign in to comment.