Skip to content

Commit 4ce518c

Browse files
Type renames
1 parent 21b56f4 commit 4ce518c

13 files changed

Lines changed: 34 additions & 30 deletions

src/components/Channel/Channel.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ import clsx from 'clsx';
1212
import debounce from 'lodash.debounce';
1313
import throttle from 'lodash.throttle';
1414
import type {
15+
ChannelGetOrCreateRequest,
1516
ChannelMemberResponse,
16-
ChannelQueryOptions,
1717
ChannelState,
1818
ChannelStateResponseFields,
1919
DeleteMessageOptions,
2020
Event,
2121
EventAPIResponse,
2222
GiphyVersions,
2323
LocalMessage,
24-
Message,
24+
MessageRequest,
2525
MessageResponse,
2626
SendMessageAPIResponse,
2727
SendMessageOptions,
@@ -102,7 +102,7 @@ export type ChannelProps = {
102102
* If the channel instance has already been initialized (channel has been queried),
103103
* then the channel query will be skipped and channelQueryOptions will not be applied.
104104
*/
105-
channelQueryOptions?: ChannelQueryOptions;
105+
channelQueryOptions?: ChannelGetOrCreateRequest;
106106
/** Custom action handler to override the default `client.deleteMessage(message.id)` function */
107107
doDeleteMessageRequest?: (
108108
message: LocalMessage,
@@ -116,7 +116,7 @@ export type ChannelProps = {
116116
/** Custom action handler to override the default `channel.sendMessage` request function (advanced usage only) */
117117
doSendMessageRequest?: (
118118
channel: StreamChannel,
119-
message: Message,
119+
message: MessageRequest,
120120
options?: SendMessageOptions,
121121
) => ReturnType<StreamChannel['sendMessage']> | void;
122122
/** Custom action handler to override the default `client.updateMessage` request function (advanced usage only) */
@@ -905,7 +905,7 @@ const ChannelInner = (
905905
options,
906906
}: {
907907
localMessage: LocalMessage;
908-
message: Message;
908+
message: MessageRequest;
909909
options?: SendMessageOptions;
910910
}) => {
911911
try {
@@ -987,7 +987,7 @@ const ChannelInner = (
987987
options,
988988
}: {
989989
localMessage: LocalMessage;
990-
message: Message;
990+
message: MessageRequest;
991991
options?: SendMessageOptions;
992992
}) => {
993993
channel.state.filterErrorMessages();

src/components/Message/hooks/useReactionHandler.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import {
1212
getEmojiCodeByReactionType,
1313
} from '../../Reactions/reactionOptions';
1414

15-
import type { LocalMessage, Reaction, ReactionResponse } from 'stream-chat';
15+
import type { LocalMessage, ReactionRequest, ReactionResponse } from 'stream-chat';
1616

1717
export const reactionHandlerWarning = `Reaction handler was called, but it is missing one of its required arguments.
1818
Make sure the ChannelAction and ChannelState contexts are properly set and the hook is initialized with a valid message.`;
@@ -105,7 +105,7 @@ export const useReactionHandler = (message?: LocalMessage) => {
105105
reaction: {
106106
type,
107107
...(emojiCode && { emoji_code: emojiCode }),
108-
} as Reaction,
108+
} as ReactionRequest,
109109
})
110110
: await channel.deleteReaction({ id, type });
111111

src/components/MessageComposer/MessageComposer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { MessageComposerContextProvider } from '../../context/MessageComposerCon
1111
import { DialogManagerProvider } from '../../context';
1212
import { useStableId } from '../UtilityComponents/useStableId';
1313

14-
import type { LocalMessage, Message, SendMessageOptions } from 'stream-chat';
14+
import type { LocalMessage, MessageRequest, SendMessageOptions } from 'stream-chat';
1515

1616
import type { CustomAudioRecordingConfig } from '../MediaRecorder';
1717
import { useRegisterDropHandlers } from './WithDragAndDropUpload';
@@ -64,7 +64,7 @@ export type MessageComposerProps = {
6464
overrideSubmitHandler?: (params: {
6565
cid: string;
6666
localMessage: LocalMessage;
67-
message: Message;
67+
message: MessageRequest;
6868
sendOptions: SendMessageOptions;
6969
}) => Promise<void> | void;
7070
/** When replying in a thread, the parent message object */

src/components/Poll/PollActions/PollResults/PollOptionWithVotes.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@ import {
77
usePollContext,
88
useTranslationContext,
99
} from '../../../../context';
10-
import type { PollOption, PollState, PollVoteResponseData } from 'stream-chat';
10+
import type {
11+
PollOptionResponseData,
12+
PollState,
13+
PollVoteResponseData,
14+
} from 'stream-chat';
1115
import { Button } from '../../../Button';
1216
import clsx from 'clsx';
1317

@@ -20,7 +24,7 @@ const pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue =
2024
});
2125

2226
export type PollOptionWithVotesProps = {
23-
option: PollOption;
27+
option: PollOptionResponseData;
2428
orderNumber: number;
2529
countVotesPreview?: number;
2630
showAllVotes?: () => void;

src/components/Poll/PollActions/PollResults/PollOptionWithVotesHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import { useStateStore } from '../../../../store';
33
import { usePollContext, useTranslationContext } from '../../../../context';
4-
import type { PollOption, PollState } from 'stream-chat';
4+
import type { PollOptionResponseData, PollState } from 'stream-chat';
55
import { IconTrophy } from '../../../Icons';
66

77
type PollStateSelectorReturnValue = {
@@ -40,7 +40,7 @@ export const PollResultOptionVoteCounter = ({
4040
};
4141

4242
export type PollOptionWithVotesHeaderProps = {
43-
option: PollOption;
43+
option: PollOptionResponseData;
4444
optionOrderNumber: number;
4545
};
4646

src/components/Poll/PollActions/PollResults/PollOptionWithVotesList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ import { PollVoteListing } from '../../PollVote';
33
import { usePollOptionVotesPagination } from '../../hooks';
44
import { LoadingIndicator } from '../../../Loading';
55
import { InfiniteScrollPaginator } from '../../../InfiniteScrollPaginator/InfiniteScrollPaginator';
6-
import type { PollOption, PollOptionVotesQueryParams } from 'stream-chat';
6+
import type { PollOptionResponseData, PollOptionVotesQueryParams } from 'stream-chat';
77
import { PollOptionWithVotesHeader } from './PollOptionWithVotesHeader';
88

99
export type PollOptionWithVotesListProps = {
10-
option: PollOption;
10+
option: PollOptionResponseData;
1111
optionOrderNumber: number;
1212
};
1313

src/components/Poll/PollActions/PollResults/PollResults.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
usePollContext,
99
useTranslationContext,
1010
} from '../../../../context';
11-
import type { PollOption, PollState } from 'stream-chat';
11+
import type { PollOptionResponseData, PollState } from 'stream-chat';
1212
import { COUNT_OPTION_VOTES_PREVIEW } from '../../constants';
1313
import { PollQuestion } from '../PollQuestion';
1414
import { PollOptionWithVotesList } from './PollOptionWithVotesList';
@@ -34,7 +34,7 @@ export const PollResults = () => {
3434
pollStateSelector,
3535
);
3636
const [optionToView, setOptionToView] = useState<{
37-
option: PollOption;
37+
option: PollOptionResponseData;
3838
optionOrderNumber: number;
3939
} | null>(null);
4040

src/components/Poll/PollActions/SuggestPollOptionPrompt.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import {
66
useTranslationContext,
77
} from '../../../context';
88
import { useStateStore } from '../../../store';
9-
import type { PollOption, PollState } from 'stream-chat';
9+
import type { PollOptionResponseData, PollState } from 'stream-chat';
1010
import { Prompt } from '../../Dialog';
1111
import { TextInput } from '../../Form';
1212
import { useFormState } from '../../Form/hooks';
1313

14-
type PollStateSelectorReturnValue = { options: PollOption[] };
14+
type PollStateSelectorReturnValue = { options: PollOptionResponseData[] };
1515
const pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({
1616
options: nextValue.options,
1717
});

src/components/Poll/PollHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import React, { useMemo } from 'react';
22
import { usePollContext, useTranslationContext } from '../../context';
33
import { useStateStore } from '../../store';
4-
import type { PollOption, PollState } from 'stream-chat';
4+
import type { PollOptionResponseData, PollState } from 'stream-chat';
55

66
type PollStateSelectorReturnValue = {
77
enforce_unique_vote: boolean;
88
is_closed: boolean | undefined;
99
max_votes_allowed: number | undefined;
1010
name: string;
11-
options: PollOption[];
11+
options: PollOptionResponseData[];
1212
};
1313
const pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({
1414
enforce_unique_vote: nextValue.enforce_unique_vote,

src/components/Poll/PollOptionList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import {
88
usePollContext,
99
useTranslationContext,
1010
} from '../../context';
11-
import type { PollOption, PollState } from 'stream-chat';
11+
import type { PollOptionResponseData, PollState } from 'stream-chat';
1212
import { PollOptionsFullList as DefaultPollOptionsFullList } from './PollActions/PollOptionsFullList';
1313

14-
type PollStateSelectorReturnValue = { options: PollOption[] };
14+
type PollStateSelectorReturnValue = { options: PollOptionResponseData[] };
1515

1616
const pollStateSelector = (nextValue: PollState): PollStateSelectorReturnValue => ({
1717
options: nextValue.options,

0 commit comments

Comments
 (0)