-
Notifications
You must be signed in to change notification settings - Fork 298
Expand file tree
/
Copy pathtypes.ts
More file actions
84 lines (68 loc) · 2.53 KB
/
types.ts
File metadata and controls
84 lines (68 loc) · 2.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import type { PropsWithChildren } from 'react';
import type { LoadingIndicatorProps } from '../components/Loading/LoadingIndicator';
import type { Attachment, ChannelState as StreamChannelState } from 'stream-chat';
export type UnknownType = Record<string, unknown>;
export type PropsWithChildrenOnly = PropsWithChildren<Record<never, never>>;
export type CustomMessageType = 'channel.intro' | 'message.date';
export type GiphyVersions =
| 'original'
| 'fixed_height'
| 'fixed_height_still'
| 'fixed_height_downsampled'
| 'fixed_width'
| 'fixed_width_still'
| 'fixed_width_downsampled';
export type PaginatorProps = {
/** callback to load the next page */
loadNextPage: () => void;
/** indicates if there is a next page to load */
hasNextPage?: boolean;
/** indicates if there is a previous page to load */
hasPreviousPage?: boolean;
/** indicates whether a loading request is in progress */
isLoading?: boolean;
/** The loading indicator to use */
LoadingIndicator?: React.ComponentType<LoadingIndicatorProps>;
/** callback to load the previous page */
loadPreviousPage?: () => void;
/**
* @desc indicates if there's currently any refreshing taking place
* @deprecated Use loading prop instead of refreshing. Planned for removal: https://github.com/GetStream/stream-chat-react/issues/1804
*/
refreshing?: boolean;
/** display the items in opposite order */
reverse?: boolean;
/** Offset from when to start the loadNextPage call */
threshold?: number;
};
export interface IconProps {
className?: string;
}
export type Dimensions = { height?: string; width?: string };
export type ImageAttachmentConfiguration = {
url: string;
};
export type VideoAttachmentConfiguration = ImageAttachmentConfiguration & {
thumbUrl?: string;
};
export type ImageAttachmentSizeHandler = (
attachment: Attachment,
element: HTMLElement,
) => ImageAttachmentConfiguration;
export type VideoAttachmentSizeHandler = (
attachment: Attachment,
element: HTMLElement,
shouldGenerateVideoThumbnail: boolean,
) => VideoAttachmentConfiguration;
export type ChannelUnreadUiState = Omit<ValuesType<StreamChannelState['read']>, 'user'>;
export type Readable<T> = {
[key in keyof T]: T[key];
} & {};
export type ValuesType<T> = T[keyof T];
export type PartialSelected<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
export type DeepRequired<T> = {
[K in keyof T]-?: T[K] extends object ? DeepRequired<T[K]> : T[K];
};
export type DeepPartial<T> = {
[P in keyof T]?: T[P] extends object ? DeepPartial<T[P]> : T[P];
};