Skip to content

Commit

Permalink
ReportsFilters type
Browse files Browse the repository at this point in the history
  • Loading branch information
bolchowka committed Jul 1, 2024
1 parent 85357f1 commit 5e45d12
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/agent-app-sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ Displays a red badge on top of the Fullscreen app icon. Use this to notify Agent

Navigates LiveChat Agent App to given pathname.

#### `setReportsFilters(filters: any): Promise<void>`
#### `setReportsFilters(filters: ReportsFilters): Promise<void>`

Updates "Reports" section filters to given `filters` object.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ import {
createConnection,
IConnection
} from '@livechat/widget-core-sdk';
import { IFullscreenWidgetApi, IFullscreenWidgetEvents } from './interfaces';
import {
IFullscreenWidgetApi,
IFullscreenWidgetEvents,
ReportsFilters
} from './interfaces';

export { ReportsFilters } from './interfaces';

export function FullscreenWidget(
connection: IConnection<IFullscreenWidgetEvents>
Expand All @@ -24,7 +30,7 @@ export function FullscreenWidget(
pathname
);
},
setReportsFilters(filters: any): Promise<void> {
setReportsFilters(filters: ReportsFilters): Promise<void> {
return connection.sendMessage('set_reports_filters', filters);
}
}
Expand Down
3 changes: 2 additions & 1 deletion packages/agent-app-sdk/src/widgets/fullscreen/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
export {
default as createFullscreenWidget,
IFullscreenWidget
IFullscreenWidget,
ReportsFilters
} from './fullscreen-widget';
7 changes: 6 additions & 1 deletion packages/agent-app-sdk/src/widgets/fullscreen/interfaces.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
export type ReportsFilters = Record<
string,
string | string[] | number | number[] | Date
>;

export interface IFullscreenWidgetApi {
setNotificationBadge(count: number | null): void;
navigate(pathname: string): void;
setReportsFilters(filters: any): void;
setReportsFilters(filters: ReportsFilters): void;
}

export interface IFullscreenWidgetEvents {}

0 comments on commit 5e45d12

Please sign in to comment.