@searchcraft/react-sdk 0.9.5 → 0.9.6

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
@@ -255,13 +255,14 @@ export type SearchParams = {
255
255
  rangeValueForIndexFields?: Record<string, RangeValueForIndexField>;
256
256
  };
257
257
  export interface SubscriptionEventMap {
258
- ad_container_rendered: AdContainerSubscriptionEvent;
258
+ ad_container_rendered: AdContainerRenderedSubscriptionEvent;
259
+ ad_container_viewed: AdContainerViewedSubscriptionEvent;
259
260
  query_fetched: QueryFetchedEvent;
260
261
  query_submitted: QuerySubmittedEvent;
261
262
  input_cleared: InputClearedEvent;
262
263
  no_results_returned: NoResultsReturnedEvent;
263
264
  }
264
- export interface AdContainerSubscriptionEvent extends SubscriptionEvent {
265
+ export interface AdContainerRenderedSubscriptionEvent extends SubscriptionEvent {
265
266
  name: "ad_container_rendered";
266
267
  data: {
267
268
  adContainerId: string;
@@ -269,6 +270,14 @@ export interface AdContainerSubscriptionEvent extends SubscriptionEvent {
269
270
  searchTerm: string;
270
271
  };
271
272
  }
273
+ export interface AdContainerViewedSubscriptionEvent extends SubscriptionEvent {
274
+ name: "ad_container_viewed";
275
+ data: {
276
+ adContainerId: string;
277
+ adSource: SearchcraftAdSource;
278
+ searchTerm: string;
279
+ };
280
+ }
272
281
  export interface QuerySubmittedEvent extends SubscriptionEvent {
273
282
  name: "query_submitted";
274
283
  data: {
@@ -403,6 +412,18 @@ declare class AdClient {
403
412
  onQuerySubmitted(_params: SearchParams): Promise<void>;
404
413
  onQueryFetched(_params: SearchParams, _response: SearchcraftResponse): Promise<void>;
405
414
  onInputCleared(): Promise<void>;
415
+ onAdContainerRendered(_data: {
416
+ adClientResponseItem?: AdClientResponseItem;
417
+ adContainerId: string;
418
+ adSource: SearchcraftAdSource;
419
+ searchTerm: string;
420
+ }): Promise<void>;
421
+ onAdContainerViewed(_data: {
422
+ adClientResponseItem?: AdClientResponseItem;
423
+ adContainerId: string;
424
+ adSource: SearchcraftAdSource;
425
+ searchTerm: string;
426
+ }): Promise<void>;
406
427
  }
407
428
  declare class MeasureClient {
408
429
  private measureRequestTimeout;
@@ -470,6 +491,15 @@ declare class SearchcraftCore {
470
491
  adSource: SearchcraftAdSource;
471
492
  searchTerm: string;
472
493
  }): void;
494
+ /**
495
+ * Called when a `<searchcraft-ad>` is viewed
496
+ */
497
+ handleAdContainerViewed(data: {
498
+ adClientResponseItem?: AdClientResponseItem;
499
+ adContainerId: string;
500
+ adSource: SearchcraftAdSource;
501
+ searchTerm: string;
502
+ }): void;
473
503
  /**
474
504
  * Perform various actions when the input is cleared
475
505
  */