UNPKG

2 kBTypeScriptView Raw
1import { _SPInstance, ISPQueryable } from "../spqueryable.js";
2import { ISearchQuery, ISearchResponse, ISearchResult, ISearchBuilder, SearchQueryInit } from "./types.js";
3/**
4 * Creates a new instance of the SearchQueryBuilder
5 *
6 * @param queryText Initial query text
7 * @param _query Any initial query configuration
8 */
9export declare function SearchQueryBuilder(queryText?: string, _query?: {}): ISearchBuilder;
10/**
11 * Describes the search API
12 *
13 */
14export declare class _Search extends _SPInstance {
15 /**
16 * @returns Promise
17 */
18 run(queryInit: SearchQueryInit): Promise<SearchResults>;
19 /**
20 * Fix array property
21 *
22 * @param prop property to fix for container struct
23 */
24 private fixArrProp;
25 /**
26 * Translates one of the query initializers into a SearchQuery instance
27 *
28 * @param query
29 */
30 private parseQuery;
31}
32export interface ISearch {
33 (queryInit: SearchQueryInit): Promise<SearchResults>;
34}
35export declare const Search: (baseUrl: string | ISPQueryable) => ISearch;
36export declare class SearchResults {
37 private _search;
38 private _query;
39 private _raw;
40 private _primary;
41 constructor(rawResponse: any, _search: _Search, _query: ISearchQuery, _raw?: ISearchResponse, _primary?: ISearchResult[]);
42 get ElapsedTime(): number;
43 get RowCount(): number;
44 get TotalRows(): number;
45 get TotalRowsIncludingDuplicates(): number;
46 get RawSearchResults(): ISearchResponse;
47 get PrimarySearchResults(): ISearchResult[];
48 /**
49 * Gets a page of results
50 *
51 * @param pageNumber Index of the page to return. Used to determine StartRow
52 * @param pageSize Optional, items per page (default = 10)
53 */
54 getPage(pageNumber: number, pageSize?: number): Promise<SearchResults>;
55 /**
56 * Formats a search results array
57 *
58 * @param rawResults The array to process
59 */
60 protected formatSearchResults(rawResults: any): ISearchResult[];
61}
62//# sourceMappingURL=query.d.ts.map
\No newline at end of file