@trycourier/courier-react 8.0.0-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/courier-inbox-menu.d.ts +26 -0
- package/dist/components/courier-inbox.d.ts +20 -0
- package/dist/hooks/use-courier.d.ts +32 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.es.js +25713 -0
- package/dist/index.umd.js +271 -0
- package/dist/utils/utils.d.ts +8 -0
- package/package.json +41 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { CourierInboxFeedType, CourierInboxHeaderFactoryProps, CourierInboxListItemActionFactoryProps, CourierInboxListItemFactoryProps, CourierInboxMenuButtonFactoryProps, CourierInboxPaginationItemFactoryProps, CourierInboxPopupAlignment, CourierInboxStateEmptyFactoryProps, CourierInboxStateErrorFactoryProps, CourierInboxStateLoadingFactoryProps, CourierInboxTheme } from '@trycourier/courier-ui-inbox';
|
|
2
|
+
import { CourierComponentThemeMode } from '@trycourier/courier-ui-core';
|
|
3
|
+
export interface CourierInboxMenuProps {
|
|
4
|
+
popupAlignment?: CourierInboxPopupAlignment;
|
|
5
|
+
popupWidth?: string;
|
|
6
|
+
popupHeight?: string;
|
|
7
|
+
left?: string;
|
|
8
|
+
top?: string;
|
|
9
|
+
right?: string;
|
|
10
|
+
bottom?: string;
|
|
11
|
+
lightTheme?: CourierInboxTheme;
|
|
12
|
+
darkTheme?: CourierInboxTheme;
|
|
13
|
+
mode?: CourierComponentThemeMode;
|
|
14
|
+
feedType?: CourierInboxFeedType;
|
|
15
|
+
onMessageClick?: (props: CourierInboxListItemFactoryProps) => void;
|
|
16
|
+
onMessageActionClick?: (props: CourierInboxListItemActionFactoryProps) => void;
|
|
17
|
+
onMessageLongPress?: (props: CourierInboxListItemFactoryProps) => void;
|
|
18
|
+
renderPopupHeader?: (props: CourierInboxHeaderFactoryProps | undefined | null) => React.ReactNode;
|
|
19
|
+
renderPopupListItem?: (props: CourierInboxListItemFactoryProps | undefined | null) => React.ReactNode;
|
|
20
|
+
renderPopupEmptyState?: (props: CourierInboxStateEmptyFactoryProps | undefined | null) => React.ReactNode;
|
|
21
|
+
renderPopupLoadingState?: (props: CourierInboxStateLoadingFactoryProps | undefined | null) => React.ReactNode;
|
|
22
|
+
renderPopupErrorState?: (props: CourierInboxStateErrorFactoryProps | undefined | null) => React.ReactNode;
|
|
23
|
+
renderPopupPaginationItem?: (props: CourierInboxPaginationItemFactoryProps | undefined | null) => React.ReactNode;
|
|
24
|
+
renderPopupMenuButton?: (props: CourierInboxMenuButtonFactoryProps | undefined | null) => React.ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare const CourierInboxMenu: (props: CourierInboxMenuProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { CourierInboxListItemActionFactoryProps, CourierInboxListItemFactoryProps, CourierInboxTheme, CourierInboxHeaderFactoryProps, CourierInboxStateEmptyFactoryProps, CourierInboxStateLoadingFactoryProps, CourierInboxStateErrorFactoryProps, CourierInboxPaginationItemFactoryProps, CourierInboxFeedType } from '@trycourier/courier-ui-inbox';
|
|
3
|
+
import { CourierComponentThemeMode } from '@trycourier/courier-ui-core';
|
|
4
|
+
export interface CourierInboxProps {
|
|
5
|
+
height?: string;
|
|
6
|
+
lightTheme?: CourierInboxTheme;
|
|
7
|
+
darkTheme?: CourierInboxTheme;
|
|
8
|
+
mode?: CourierComponentThemeMode;
|
|
9
|
+
feedType?: CourierInboxFeedType;
|
|
10
|
+
onMessageClick?: (props: CourierInboxListItemFactoryProps) => void;
|
|
11
|
+
onMessageActionClick?: (props: CourierInboxListItemActionFactoryProps) => void;
|
|
12
|
+
onMessageLongPress?: (props: CourierInboxListItemFactoryProps) => void;
|
|
13
|
+
renderHeader?: (props: CourierInboxHeaderFactoryProps | undefined | null) => React.ReactNode;
|
|
14
|
+
renderListItem?: (props: CourierInboxListItemFactoryProps | undefined | null) => React.ReactNode;
|
|
15
|
+
renderEmptyState?: (props: CourierInboxStateEmptyFactoryProps | undefined | null) => React.ReactNode;
|
|
16
|
+
renderLoadingState?: (props: CourierInboxStateLoadingFactoryProps | undefined | null) => React.ReactNode;
|
|
17
|
+
renderErrorState?: (props: CourierInboxStateErrorFactoryProps | undefined | null) => React.ReactNode;
|
|
18
|
+
renderPaginationItem?: (props: CourierInboxPaginationItemFactoryProps | undefined | null) => React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const CourierInbox: (props: CourierInboxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Courier, CourierProps, InboxMessage } from '@trycourier/courier-js';
|
|
2
|
+
import { CourierInboxFeedType, InboxDataSet } from '@trycourier/courier-ui-inbox';
|
|
3
|
+
type AuthenticationHooks = {
|
|
4
|
+
userId?: string;
|
|
5
|
+
signIn: (props: CourierProps) => void;
|
|
6
|
+
signOut: () => void;
|
|
7
|
+
};
|
|
8
|
+
type InboxHooks = {
|
|
9
|
+
load: (props?: {
|
|
10
|
+
feedType: CourierInboxFeedType;
|
|
11
|
+
canUseCache: boolean;
|
|
12
|
+
}) => Promise<void>;
|
|
13
|
+
fetchNextPageOfMessages: (props: {
|
|
14
|
+
feedType: CourierInboxFeedType;
|
|
15
|
+
}) => Promise<InboxDataSet | null>;
|
|
16
|
+
setPaginationLimit: (limit: number) => void;
|
|
17
|
+
readMessage: (message: InboxMessage) => Promise<void>;
|
|
18
|
+
unreadMessage: (message: InboxMessage) => Promise<void>;
|
|
19
|
+
clickMessage: (message: InboxMessage) => Promise<void>;
|
|
20
|
+
archiveMessage: (message: InboxMessage) => Promise<void>;
|
|
21
|
+
openMessage: (message: InboxMessage) => Promise<void>;
|
|
22
|
+
inbox?: InboxDataSet;
|
|
23
|
+
archive?: InboxDataSet;
|
|
24
|
+
unreadCount?: number;
|
|
25
|
+
error?: Error;
|
|
26
|
+
};
|
|
27
|
+
export declare const useCourier: () => {
|
|
28
|
+
shared: Courier;
|
|
29
|
+
auth: AuthenticationHooks;
|
|
30
|
+
inbox: InboxHooks;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
package/dist/index.d.ts
ADDED