@searchcraft/vue-sdk 0.10.3 → 0.10.5

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/index.d.ts CHANGED
@@ -277,21 +277,33 @@ export interface ADMAd {
277
277
  sale_price?: number;
278
278
  term: string;
279
279
  }
280
+ export type Facet = {
281
+ /**
282
+ * The path of the facet. The path represents where in the facet tree structure
283
+ * this facet exists. There is an arbitrary number of levels in a facet tree.
284
+ *
285
+ * @example
286
+ *
287
+ * '/sports/college' - Represents that this is the facet node exists at [root] -> [sports] -> [college] in the facet tree.
288
+ * '/weather' - Represents that this facet exists at [root] -> [weather] in the facet tree
289
+ * '/news/local' - [root] -> [news] -> [local]
290
+ */
291
+ path: string;
292
+ /**
293
+ * The count value just represents an arbitrary `count` metadata for this facet node.
294
+ */
295
+ count: number;
296
+ };
297
+ export type FacetWithChildrenArray = Facet & {
298
+ children: FacetWithChildrenArray[] | null | undefined;
299
+ };
280
300
  /**
281
301
  * A Facet object returned in a search response.
282
302
  */
283
303
  export type FacetRoot = {
284
- [key: string]: FacetChild[];
304
+ [key: string]: FacetWithChildrenArray[];
285
305
  };
286
306
  export type FacetPrime = FacetRoot[];
287
- /**
288
- * Represents the structure of facets, which group search results into categories.
289
- */
290
- export interface FacetChild {
291
- count: number;
292
- path: string;
293
- children?: FacetChild[];
294
- }
295
307
  /**
296
308
  * Types of measure requests that can be sent to the /measure/event endpoint.
297
309
  */
@@ -538,9 +550,10 @@ declare class SearchClient {
538
550
  /**
539
551
  * Make the request to get the search results.
540
552
  * @param {properties} properties - The properties for the search.
553
+ * @param sendTelemetry - Whether or not to emit measure and subscription events for this search.
541
554
  * @returns
542
555
  */
543
- getSearchResponseItems: (properties: SearchClientRequestProperties | string) => Promise<SearchcraftResponse>;
556
+ getSearchResponseItems: (properties: SearchClientRequestProperties | string, sendTelemetry?: boolean) => Promise<SearchcraftResponse>;
544
557
  private handleGetSearchResponseItemsWithString;
545
558
  private handleGetSearchResponseItemsWithObject;
546
559
  /**
@@ -592,7 +605,7 @@ export declare class SearchcraftCore {
592
605
  * Perform various actions when the input is cleared
593
606
  */
594
607
  handleInputCleared(): void;
595
- getResponseItems: (properties: SearchClientRequestProperties | string, searchCallback: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void, adCallback: (items: AdClientResponseItem[]) => void) => void;
608
+ getResponseItems: (properties: SearchClientRequestProperties | string, searchCallback: (response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void, adCallback: (items: AdClientResponseItem[]) => void) => void;
596
609
  }
597
610
  /**
598
611
  * Callable functions made available by the SearchcraftStore.
@@ -608,7 +621,7 @@ export interface SearchcraftStateFunctions {
608
621
  search: () => Promise<void>;
609
622
  set: (state: Partial<SearchcraftState> | ((state: SearchcraftState) => Partial<SearchcraftState>)) => SearchcraftState;
610
623
  setAdClientResponseItems: (items: AdClientResponseItem[]) => void;
611
- setSearchClientResponseItemsFromResponse: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void;
624
+ setSearchClientResponseItemsFromResponse: (response: SearchcraftResponse, items: SearchClientResponseItem[], supplementalResponse: SearchcraftResponse | undefined) => void;
612
625
  setInitialSearchClientResponseItemsFromResponse: (response: SearchcraftResponse, items: SearchClientResponseItem[]) => void;
613
626
  setInitialQuery: (query: string) => void;
614
627
  setPopoverVisibility: (isVisible: boolean) => void;
@@ -642,7 +655,8 @@ export interface SearchcraftStateValues {
642
655
  searchMode: "fuzzy" | "exact";
643
656
  searchClientResponseItems: SearchClientResponseItem[];
644
657
  searchResponseTimeTaken: number | undefined;
645
- searchResponseFacetPrime: FacetPrime | undefined;
658
+ searchResponseFacetPrime: FacetPrime | undefined | null;
659
+ supplementalFacetPrime: FacetPrime | undefined | null;
646
660
  searchResultsCount: number;
647
661
  searchResultsPage: number;
648
662
  searchResultsPerPage: number;
@@ -802,6 +816,10 @@ export namespace Components {
802
816
  * The label rendered above the input.
803
817
  */
804
818
  "inputLabel"?: string;
819
+ /**
820
+ * The placeholder's render behavior. 'hide-on-focus' - Hide the placeholder text immediately when the input form gains focus. 'hide-on-text-entered' - Only hide the placeholder when the input form has text entered into it.
821
+ */
822
+ "placeholderBehavior"?: "hide-on-focus" | "hide-on-text-entered";
805
823
  /**
806
824
  * The input element's placeholder value.
807
825
  */
@@ -1148,13 +1166,13 @@ export namespace Components {
1148
1166
  */
1149
1167
  interface SearchcraftSlider {
1150
1168
  /**
1151
- * The type of data allowed.
1169
+ * The type of data the sliders are using.
1152
1170
  */
1153
1171
  "dataType": "number" | "date";
1154
1172
  /**
1155
- * The granularity that the value must adhere to.
1173
+ * The date granularity to use. Used to format date labels.
1156
1174
  */
1157
- "granularity": number;
1175
+ "dateGranularity"?: "year" | "month" | "day" | "hour";
1158
1176
  /**
1159
1177
  * The maximum value allowed.
1160
1178
  */
@@ -1163,6 +1181,10 @@ export namespace Components {
1163
1181
  * The minimum value allowed.
1164
1182
  */
1165
1183
  "min": number;
1184
+ /**
1185
+ * The step amount for the slider inputs.
1186
+ */
1187
+ "step": number;
1166
1188
  }
1167
1189
  /**
1168
1190
  * This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'
@@ -1829,7 +1851,7 @@ declare namespace LocalJSX {
1829
1851
  */
1830
1852
  "fieldName"?: string;
1831
1853
  /**
1832
- * When the facets are updated.
1854
+ * Emitted when the facets are updated.
1833
1855
  */
1834
1856
  "onFacetSelectionUpdated"?: (event: SearchcraftFacetListCustomEvent<{
1835
1857
  paths: string[];
@@ -1916,6 +1938,10 @@ declare namespace LocalJSX {
1916
1938
  * Event emitted when input initializes.
1917
1939
  */
1918
1940
  "onInputInit"?: (event: SearchcraftInputFormCustomEvent<void>) => void;
1941
+ /**
1942
+ * The placeholder's render behavior. 'hide-on-focus' - Hide the placeholder text immediately when the input form gains focus. 'hide-on-text-entered' - Only hide the placeholder when the input form has text entered into it.
1943
+ */
1944
+ "placeholderBehavior"?: "hide-on-focus" | "hide-on-text-entered";
1919
1945
  /**
1920
1946
  * The input element's placeholder value.
1921
1947
  */
@@ -2266,13 +2292,13 @@ declare namespace LocalJSX {
2266
2292
  */
2267
2293
  interface SearchcraftSlider {
2268
2294
  /**
2269
- * The type of data allowed.
2295
+ * The type of data the sliders are using.
2270
2296
  */
2271
2297
  "dataType"?: "number" | "date";
2272
2298
  /**
2273
- * The granularity that the value must adhere to.
2299
+ * The date granularity to use. Used to format date labels.
2274
2300
  */
2275
- "granularity"?: number;
2301
+ "dateGranularity"?: "year" | "month" | "day" | "hour";
2276
2302
  /**
2277
2303
  * The maximum value allowed.
2278
2304
  */
@@ -2285,6 +2311,10 @@ declare namespace LocalJSX {
2285
2311
  * When the range has changed.
2286
2312
  */
2287
2313
  "onRangeChanged"?: (event: SearchcraftSliderCustomEvent<any>) => void;
2314
+ /**
2315
+ * The step amount for the slider inputs.
2316
+ */
2317
+ "step"?: number;
2288
2318
  }
2289
2319
  /**
2290
2320
  * This web component adds Searchcraft's built-in css theme to your page. It does not render anything visible, its only function is to manage the css styles on the page.'