forked from microsoft/BotBuilder-Samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
55 lines (46 loc) · 1.3 KB
/
index.d.ts
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
import { Library, Session } from "botbuilder";
// exported functions
export function create(settings: ISearchDialogSettings): Library;
export function begin(session: Session, args?: any): void;
export function refine(session: Session, args?: any): void;
export function defaultResultsMapper(itemMap: ItemMapper): SearchResultsMapper;
declare type ItemMapper = (input: any) => ISearchHit;
declare type SearchResultsMapper = (providerResults: ISearchResults) => ISearchResults;
declare type RefineFormatter = (refiners: Array<string>) => any;
// entities
export interface ISearchDialogSettings {
search: (query: IQuery) => PromiseLike<ISearchResults>;
pageSize?: number;
multipleSelection?: boolean;
refiners?: Array<string>;
refineFormatter?: RefineFormatter;
}
export interface IQuery {
searchText: string;
pageSize: number;
pageNumber: number;
filters: Array<IFacetFilter>;
facets: Array<string>;
}
export interface ISearchResults {
facets: Array<IFacet>;
results: Array<ISearchHit>;
}
export interface ISearchHit {
key: string;
title: string;
description: string;
imageUrl?: string;
}
export interface IFacetFilter {
key: string;
value: any;
}
export interface IFacet {
key: string;
options: Array<IFacetValue>;
}
export interface IFacetValue {
value: string;
count: number;
}