Skip to content

Commit dcc6ae0

Browse files
Adding typescript
1 parent c9519d9 commit dcc6ae0

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed

types/index.d.ts

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,27 @@ export interface ChannelListProps
390390
LoadingErrorIndicator?: React.ElementType<LoadingErrorIndicatorProps>;
391391
/** The indicator to use when channel list is empty */
392392
EmptyStateIndicator?: React.ElementType<EmptyStateIndicatorProps>;
393+
/**
394+
* The indicator to display network-down error at top of list, if there is connectivity issue
395+
* Default: [ChannelListHeaderNetworkDownIndicator](https://getstream.github.io/stream-chat-react-native/#ChannelListHeaderNetworkDownIndicator)
396+
*/
397+
HeaderNetworkDownIndicator?: React.ElementType<
398+
ChannelListHeaderNetworkDownIndicatorProps
399+
>;
400+
/**
401+
* The indicator to display error at top of list, if there was an error loading some page/channels after the first page.
402+
* Default: [ChannelListHeaderErrorIndicator](https://getstream.github.io/stream-chat-react-native/#ChannelListHeaderErrorIndicator)
403+
*/
404+
HeaderErrorIndicator?: React.ElementType<
405+
ChannelListHeaderErrorIndicatorProps
406+
>;
407+
/**
408+
* Loading indicator to display at bottom of the list, while loading further pages.
409+
* Default: [ChannelListFooterLoadingIndicator](https://getstream.github.io/stream-chat-react-native/#ChannelListFooterLoadingIndicator)
410+
*/
411+
FooterLoadingIndicator?: React.ElementType<
412+
ChannelListFooterLoadingIndicatorProps
413+
>;
393414

394415
List?: React.ElementType<ChannelListUIComponentProps>;
395416

@@ -486,8 +507,18 @@ export interface ChannelListUIComponentProps
486507
extends ChannelListProps,
487508
ChannelListState,
488509
StyledComponentProps {
510+
reloadList(): void;
489511
loadNextPage(): void;
512+
refreshList(): void;
513+
}
514+
515+
export interface ChannelListHeaderNetworkDownIndicatorProps
516+
extends TranslationContextValue {}
517+
export interface ChannelListHeaderErrorIndicatorProps
518+
extends TranslationContextValue {
519+
onPress?: () => void;
490520
}
521+
export interface ChannelListFooterLoadingIndicatorProps {}
491522

492523
export interface ChannelPreviewProps
493524
extends ChannelListUIComponentProps,
@@ -997,6 +1028,7 @@ export interface LoadingErrorIndicatorProps
9971028
extends StyledComponentProps,
9981029
TranslationContextValue {
9991030
listType?: listType;
1031+
retry?: () => void;
10001032
}
10011033
export interface LoadingIndicatorProps
10021034
extends StyledComponentProps,
@@ -1252,6 +1284,18 @@ export class MessageTextContainer extends React.PureComponent<
12521284
> {}
12531285

12541286
export class ChannelList extends React.PureComponent<ChannelListProps, any> {}
1287+
export class ChannelListHeaderErrorIndicator extends React.PureComponent<
1288+
ChannelListHeaderErrorIndicatorProps,
1289+
any
1290+
> {}
1291+
export class ChannelListHeaderNetworkDownIndicator extends React.PureComponent<
1292+
ChannelListHeaderNetworkDownIndicatorProps,
1293+
any
1294+
> {}
1295+
export class ChannelListFooterLoadingIndicator extends React.PureComponent<
1296+
ChannelListFooterLoadingIndicatorProps,
1297+
any
1298+
> {}
12551299

12561300
export class Thread extends React.PureComponent<ThreadProps, any> {}
12571301
export class ChannelPreviewMessenger extends React.PureComponent<

0 commit comments

Comments
 (0)