@searchcraft/vue-sdk 0.9.4 → 0.9.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 +51 -8
- package/dist/index.es.js +737 -643
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +7 -7
- package/dist/index.umd.js.map +1 -1
- package/package.json +4 -4
package/dist/index.d.ts
CHANGED
|
@@ -64,6 +64,34 @@ export interface SearchcraftConfig {
|
|
|
64
64
|
* A callback function responsible for rendering the custom ad containers.
|
|
65
65
|
*/
|
|
66
66
|
customAdTemplate?: CustomAdTemplateRenderFunction;
|
|
67
|
+
/**
|
|
68
|
+
* The placement id to use for Nativo ads.
|
|
69
|
+
*/
|
|
70
|
+
nativoPlacementId?: number;
|
|
71
|
+
/**
|
|
72
|
+
* The class name for nativo ad containers.
|
|
73
|
+
*/
|
|
74
|
+
nativoAdClassName?: string;
|
|
75
|
+
/**
|
|
76
|
+
* The number of custom ads to render at the start of the search results page.
|
|
77
|
+
*/
|
|
78
|
+
nativoAdStartQuantity?: number;
|
|
79
|
+
/**
|
|
80
|
+
* The number of custom ads to render at the end of the search results page.
|
|
81
|
+
*/
|
|
82
|
+
nativoAdEndQuantity?: number;
|
|
83
|
+
/**
|
|
84
|
+
* Renders a custom ad in between search results, at the specified interval.
|
|
85
|
+
*/
|
|
86
|
+
nativoAdInterstitialInterval?: number;
|
|
87
|
+
/**
|
|
88
|
+
* Specify how many normal search results to render before rendering the first interstitial ad grouping.
|
|
89
|
+
*/
|
|
90
|
+
nativoAdInterstialStartIndex?: number;
|
|
91
|
+
/**
|
|
92
|
+
* Specifies the number of ads to be rendered in each interstitial in between search results.
|
|
93
|
+
*/
|
|
94
|
+
nativoAdInterstitialQuantity?: number;
|
|
67
95
|
}
|
|
68
96
|
export type SearchcraftAdSource = "adMarketplace" | "Nativo" | "Custom" | "None";
|
|
69
97
|
/**
|
|
@@ -226,6 +254,7 @@ export type SearchParams = {
|
|
|
226
254
|
};
|
|
227
255
|
export interface SubscriptionEventMap {
|
|
228
256
|
ad_container_rendered: AdContainerSubscriptionEvent;
|
|
257
|
+
query_fetched: QueryFetchedEvent;
|
|
229
258
|
query_submitted: QuerySubmittedEvent;
|
|
230
259
|
input_cleared: InputClearedEvent;
|
|
231
260
|
no_results_returned: NoResultsReturnedEvent;
|
|
@@ -244,6 +273,12 @@ export interface QuerySubmittedEvent extends SubscriptionEvent {
|
|
|
244
273
|
searchTerm: string;
|
|
245
274
|
};
|
|
246
275
|
}
|
|
276
|
+
export interface QueryFetchedEvent extends SubscriptionEvent {
|
|
277
|
+
name: "query_fetched";
|
|
278
|
+
data: {
|
|
279
|
+
searchTerm: string;
|
|
280
|
+
};
|
|
281
|
+
}
|
|
247
282
|
export interface InputClearedEvent extends SubscriptionEvent {
|
|
248
283
|
name: "input_cleared";
|
|
249
284
|
}
|
|
@@ -363,6 +398,9 @@ declare class AdClient {
|
|
|
363
398
|
config: SearchcraftConfig;
|
|
364
399
|
constructor(config: SearchcraftConfig);
|
|
365
400
|
getAdsForSearchParams(_params: SearchParams): Promise<AdClientResponseItem[]>;
|
|
401
|
+
onQuerySubmitted(_params: SearchParams): Promise<void>;
|
|
402
|
+
onQueryFetched(_params: SearchParams, _response: SearchcraftResponse): Promise<void>;
|
|
403
|
+
onInputCleared(): Promise<void>;
|
|
366
404
|
}
|
|
367
405
|
declare class MeasureClient {
|
|
368
406
|
private measureRequestTimeout;
|
|
@@ -421,6 +459,19 @@ declare class SearchcraftCore {
|
|
|
421
459
|
private initClients;
|
|
422
460
|
emitEvent<T extends SubscriptionEventName>(eventName: T, event: SubscriptionEventMap[T]): void;
|
|
423
461
|
subscribe<T extends SubscriptionEventName>(eventName: T, callback: SubscriptionEventCallback<T>): UnsubscribeFunction;
|
|
462
|
+
/**
|
|
463
|
+
* Called when a `<searchcraft-ad>` component is rendered
|
|
464
|
+
*/
|
|
465
|
+
handleAdContainerRendered(data: {
|
|
466
|
+
adClientResponseItem?: AdClientResponseItem;
|
|
467
|
+
adContainerId: string;
|
|
468
|
+
adSource: SearchcraftAdSource;
|
|
469
|
+
searchTerm: string;
|
|
470
|
+
}): void;
|
|
471
|
+
/**
|
|
472
|
+
* Perform various actions when the input is cleared
|
|
473
|
+
*/
|
|
474
|
+
handleInputCleared(): void;
|
|
424
475
|
/**
|
|
425
476
|
* Gets items from the SearchClient and the AdClient.
|
|
426
477
|
*/
|
|
@@ -1747,10 +1798,6 @@ declare namespace Components {
|
|
|
1747
1798
|
* The input element's placeholder value.
|
|
1748
1799
|
*/
|
|
1749
1800
|
"placeholderValue": string;
|
|
1750
|
-
/**
|
|
1751
|
-
* The starting value of the input element.
|
|
1752
|
-
*/
|
|
1753
|
-
"searchTerm": string;
|
|
1754
1801
|
}
|
|
1755
1802
|
/**
|
|
1756
1803
|
* This web component serves as the input label for the searchcraft-input-form component.
|
|
@@ -2688,10 +2735,6 @@ declare namespace LocalJSX {
|
|
|
2688
2735
|
* The input element's placeholder value.
|
|
2689
2736
|
*/
|
|
2690
2737
|
"placeholderValue"?: string;
|
|
2691
|
-
/**
|
|
2692
|
-
* The starting value of the input element.
|
|
2693
|
-
*/
|
|
2694
|
-
"searchTerm"?: string;
|
|
2695
2738
|
}
|
|
2696
2739
|
/**
|
|
2697
2740
|
* This web component serves as the input label for the searchcraft-input-form component.
|