@searchcraft/vue-sdk 0.9.5 → 0.9.7

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
@@ -44,6 +44,10 @@ export interface SearchcraftConfig {
44
44
  * The adm sub value.
45
45
  */
46
46
  admSub?: string;
47
+ /**
48
+ * The amount of debounce delay to add before calling the ad_container_rendered event
49
+ */
50
+ adContainerRenderedDebounceDelay?: number;
47
51
  /**
48
52
  * The number of custom ads to render at the start of the search results page.
49
53
  */
@@ -253,13 +257,14 @@ export type SearchParams = {
253
257
  rangeValueForIndexFields?: Record<string, RangeValueForIndexField>;
254
258
  };
255
259
  export interface SubscriptionEventMap {
256
- ad_container_rendered: AdContainerSubscriptionEvent;
260
+ ad_container_rendered: AdContainerRenderedSubscriptionEvent;
261
+ ad_container_viewed: AdContainerViewedSubscriptionEvent;
257
262
  query_fetched: QueryFetchedEvent;
258
263
  query_submitted: QuerySubmittedEvent;
259
264
  input_cleared: InputClearedEvent;
260
265
  no_results_returned: NoResultsReturnedEvent;
261
266
  }
262
- export interface AdContainerSubscriptionEvent extends SubscriptionEvent {
267
+ export interface AdContainerRenderedSubscriptionEvent extends SubscriptionEvent {
263
268
  name: "ad_container_rendered";
264
269
  data: {
265
270
  adContainerId: string;
@@ -267,6 +272,14 @@ export interface AdContainerSubscriptionEvent extends SubscriptionEvent {
267
272
  searchTerm: string;
268
273
  };
269
274
  }
275
+ export interface AdContainerViewedSubscriptionEvent extends SubscriptionEvent {
276
+ name: "ad_container_viewed";
277
+ data: {
278
+ adContainerId: string;
279
+ adSource: SearchcraftAdSource;
280
+ searchTerm: string;
281
+ };
282
+ }
270
283
  export interface QuerySubmittedEvent extends SubscriptionEvent {
271
284
  name: "query_submitted";
272
285
  data: {
@@ -401,6 +414,18 @@ declare class AdClient {
401
414
  onQuerySubmitted(_params: SearchParams): Promise<void>;
402
415
  onQueryFetched(_params: SearchParams, _response: SearchcraftResponse): Promise<void>;
403
416
  onInputCleared(): Promise<void>;
417
+ onAdContainerRendered(_data: {
418
+ adClientResponseItem?: AdClientResponseItem;
419
+ adContainerId: string;
420
+ adSource: SearchcraftAdSource;
421
+ searchTerm: string;
422
+ }): Promise<void>;
423
+ onAdContainerViewed(_data: {
424
+ adClientResponseItem?: AdClientResponseItem;
425
+ adContainerId: string;
426
+ adSource: SearchcraftAdSource;
427
+ searchTerm: string;
428
+ }): Promise<void>;
404
429
  }
405
430
  declare class MeasureClient {
406
431
  private measureRequestTimeout;
@@ -468,6 +493,15 @@ declare class SearchcraftCore {
468
493
  adSource: SearchcraftAdSource;
469
494
  searchTerm: string;
470
495
  }): void;
496
+ /**
497
+ * Called when a `<searchcraft-ad>` is viewed
498
+ */
499
+ handleAdContainerViewed(data: {
500
+ adClientResponseItem?: AdClientResponseItem;
501
+ adContainerId: string;
502
+ adSource: SearchcraftAdSource;
503
+ searchTerm: string;
504
+ }): void;
471
505
  /**
472
506
  * Perform various actions when the input is cleared
473
507
  */
@@ -1573,6 +1607,7 @@ declare namespace Components {
1573
1607
  */
1574
1608
  interface SearchcraftAd {
1575
1609
  "adClientResponseItem"?: AdClientResponseItem;
1610
+ "adContainerId": string;
1576
1611
  "adSource": SearchcraftAdSource;
1577
1612
  }
1578
1613
  /**
@@ -2488,6 +2523,7 @@ declare namespace LocalJSX {
2488
2523
  */
2489
2524
  interface SearchcraftAd {
2490
2525
  "adClientResponseItem"?: AdClientResponseItem;
2526
+ "adContainerId"?: string;
2491
2527
  "adSource"?: SearchcraftAdSource;
2492
2528
  }
2493
2529
  /**