@getlupa/client 0.7.0-alpha-2 → 0.7.0-alpha-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/cjs/index.d.ts +2 -2
- package/dist/cjs/index.min.js +1 -0
- package/dist/cjs/types/DocumentElement.d.ts +10 -10
- package/dist/cjs/types/search-results/BadgeOptions.d.ts +9 -8
- package/dist/es/index.d.ts +2 -2
- package/dist/es/index.min.js +1 -0
- package/dist/es/types/DocumentElement.d.ts +10 -10
- package/dist/es/types/search-results/BadgeOptions.d.ts +9 -8
- package/dist/iife/index.d.ts +2 -2
- package/dist/iife/types/DocumentElement.d.ts +10 -10
- package/dist/iife/types/search-results/BadgeOptions.d.ts +9 -8
- package/package.json +1 -1
package/dist/cjs/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
|
|
2
|
-
import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsFilterOptions, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
2
|
+
import { CallbackContext, FacetFilterQuery, FacetStyle, ResultFacetOptions, SearchResultEventCallbacks, SearchResultsFilterOptions, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
3
3
|
import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
|
|
4
4
|
import { CategoryFilterOptions, ProductListOptions } from "./types/product-list/ProductListOptions";
|
|
5
5
|
import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
|
|
@@ -17,5 +17,5 @@ declare const lupaSearch: {
|
|
|
17
17
|
clearSearchResults: () => void;
|
|
18
18
|
clearProductList: () => void;
|
|
19
19
|
};
|
|
20
|
-
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, };
|
|
20
|
+
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, };
|
|
21
21
|
export default lupaSearch;
|
package/dist/cjs/index.min.js
CHANGED
|
@@ -11771,6 +11771,7 @@ __vue_render__$10._withStripped = true;
|
|
|
11771
11771
|
undefined
|
|
11772
11772
|
);
|
|
11773
11773
|
|
|
11774
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11774
11775
|
exports.DocumentElementType = void 0;
|
|
11775
11776
|
(function (DocumentElementType) {
|
|
11776
11777
|
DocumentElementType["IMAGE"] = "image";
|
|
@@ -9,44 +9,44 @@ export declare enum DocumentElementType {
|
|
|
9
9
|
ADDTOCART = "addToCart",
|
|
10
10
|
CUSTOM_HTML = "customHtml"
|
|
11
11
|
}
|
|
12
|
-
export declare type DocumentElementBase<T =
|
|
12
|
+
export declare type DocumentElementBase<T = any> = {
|
|
13
13
|
type: DocumentElementType;
|
|
14
14
|
key?: string;
|
|
15
15
|
display?: (document: T) => boolean;
|
|
16
16
|
isHtml?: boolean;
|
|
17
17
|
};
|
|
18
|
-
export declare type ImageDocumentElement = DocumentElementBase & {
|
|
18
|
+
export declare type ImageDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
19
19
|
type: DocumentElementType.IMAGE;
|
|
20
20
|
placeholder: string;
|
|
21
21
|
baseUrl?: string;
|
|
22
22
|
key: string;
|
|
23
23
|
};
|
|
24
|
-
export declare type TitleDocumentElement = DocumentElementBase & {
|
|
24
|
+
export declare type TitleDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
25
25
|
type: DocumentElementType.TITLE;
|
|
26
26
|
maxLines: number;
|
|
27
27
|
link?: boolean;
|
|
28
28
|
key: string;
|
|
29
29
|
};
|
|
30
|
-
export declare type DescriptionDocumentElement = DocumentElementBase & {
|
|
30
|
+
export declare type DescriptionDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
31
31
|
type: DocumentElementType.DESCRIPTION;
|
|
32
32
|
maxLines: number;
|
|
33
33
|
key: string;
|
|
34
34
|
className: string;
|
|
35
35
|
};
|
|
36
|
-
export declare type CustomDocumentElement = DocumentElementBase & {
|
|
36
|
+
export declare type CustomDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
37
37
|
type: DocumentElementType.CUSTOM;
|
|
38
38
|
className: string;
|
|
39
39
|
key: string;
|
|
40
40
|
};
|
|
41
|
-
export declare type PriceElement = DocumentElementBase & {
|
|
41
|
+
export declare type PriceElement<T = any> = DocumentElementBase<T> & {
|
|
42
42
|
type: DocumentElementType.PRICE;
|
|
43
43
|
key: string;
|
|
44
44
|
};
|
|
45
|
-
export declare type RegularPriceDocumentElement = DocumentElementBase & {
|
|
45
|
+
export declare type RegularPriceDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
46
46
|
type: DocumentElementType.REGULARPRICE;
|
|
47
47
|
key: string;
|
|
48
48
|
};
|
|
49
|
-
export declare type RatingElement<T =
|
|
49
|
+
export declare type RatingElement<T = any> = DocumentElementBase<T> & {
|
|
50
50
|
type: DocumentElementType.RATING;
|
|
51
51
|
labels: RatingLabels;
|
|
52
52
|
links: RatingLinks;
|
|
@@ -60,14 +60,14 @@ export declare type RatingLabels = {
|
|
|
60
60
|
export declare type RatingLinks = {
|
|
61
61
|
ratingDetails?: string;
|
|
62
62
|
};
|
|
63
|
-
export declare type AddToCartElement<T =
|
|
63
|
+
export declare type AddToCartElement<T = any> = DocumentElementBase<T> & {
|
|
64
64
|
type: DocumentElementType.ADDTOCART;
|
|
65
65
|
action: (document: T, amount: number) => Promise<unknown> | undefined;
|
|
66
66
|
labels: {
|
|
67
67
|
addToCart: string;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
-
export declare type CustomHtmlElement<T =
|
|
70
|
+
export declare type CustomHtmlElement<T = any> = DocumentElementBase<T> & {
|
|
71
71
|
type: DocumentElementType.CUSTOM_HTML;
|
|
72
72
|
html: (document: T) => string;
|
|
73
73
|
className: string;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Document } from "@getlupa/client-sdk/Types";
|
|
2
1
|
import { AnchorPosition } from "./SearchResultsProductCardOptions";
|
|
3
2
|
export declare type SearchResultBadgeType = "text" | "image" | "customHtml";
|
|
4
3
|
export declare type BadgeOptions = {
|
|
5
4
|
anchor: AnchorPosition;
|
|
6
5
|
elements: BadgeElement[];
|
|
7
|
-
product?:
|
|
6
|
+
product?: any;
|
|
8
7
|
};
|
|
9
|
-
export declare type SearchResultBadgeElement<T =
|
|
8
|
+
export declare type SearchResultBadgeElement<T = any> = {
|
|
10
9
|
type: SearchResultBadgeType;
|
|
11
10
|
key: string;
|
|
12
11
|
isHtml?: boolean;
|
|
@@ -14,24 +13,26 @@ export declare type SearchResultBadgeElement<T = Record<string, unknown>> = {
|
|
|
14
13
|
product?: T;
|
|
15
14
|
display?: (document: T) => boolean;
|
|
16
15
|
rootImageUrl?: string;
|
|
16
|
+
maxItems?: number;
|
|
17
|
+
html: (doc: T) => string;
|
|
17
18
|
};
|
|
18
|
-
export declare type BaseBadgeElement = SearchResultBadgeElement & {
|
|
19
|
+
export declare type BaseBadgeElement<T = any> = SearchResultBadgeElement<T> & {
|
|
19
20
|
value?: string;
|
|
20
21
|
};
|
|
21
|
-
export declare type TextBadgeElement = BaseBadgeElement & {
|
|
22
|
+
export declare type TextBadgeElement<T = any> = BaseBadgeElement<T> & {
|
|
22
23
|
type: "text";
|
|
23
24
|
prefix?: string;
|
|
24
25
|
maxItems?: number;
|
|
25
26
|
};
|
|
26
|
-
export declare type ImageBadgeElement = BaseBadgeElement & {
|
|
27
|
+
export declare type ImageBadgeElement<T = any> = BaseBadgeElement<T> & {
|
|
27
28
|
type: "image";
|
|
28
29
|
rootImageUrl?: string;
|
|
29
30
|
maxItems?: number;
|
|
30
31
|
};
|
|
31
|
-
export declare type CustomHtmlBadgeElement = BaseBadgeElement & {
|
|
32
|
+
export declare type CustomHtmlBadgeElement<T = any> = BaseBadgeElement<T> & {
|
|
32
33
|
type: "customHtml";
|
|
33
34
|
className?: string;
|
|
34
|
-
html: (doc:
|
|
35
|
+
html: (doc: T) => string;
|
|
35
36
|
};
|
|
36
37
|
export declare type BadgeElement = BaseBadgeElement | TextBadgeElement;
|
|
37
38
|
export declare enum BadgeType {
|
package/dist/es/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
|
|
2
|
-
import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsFilterOptions, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
2
|
+
import { CallbackContext, FacetFilterQuery, FacetStyle, ResultFacetOptions, SearchResultEventCallbacks, SearchResultsFilterOptions, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
3
3
|
import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
|
|
4
4
|
import { CategoryFilterOptions, ProductListOptions } from "./types/product-list/ProductListOptions";
|
|
5
5
|
import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
|
|
@@ -17,5 +17,5 @@ declare const lupaSearch: {
|
|
|
17
17
|
clearSearchResults: () => void;
|
|
18
18
|
clearProductList: () => void;
|
|
19
19
|
};
|
|
20
|
-
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, };
|
|
20
|
+
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, };
|
|
21
21
|
export default lupaSearch;
|
package/dist/es/index.min.js
CHANGED
|
@@ -11767,6 +11767,7 @@ __vue_render__$10._withStripped = true;
|
|
|
11767
11767
|
undefined
|
|
11768
11768
|
);
|
|
11769
11769
|
|
|
11770
|
+
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
11770
11771
|
var DocumentElementType;
|
|
11771
11772
|
(function (DocumentElementType) {
|
|
11772
11773
|
DocumentElementType["IMAGE"] = "image";
|
|
@@ -9,44 +9,44 @@ export declare enum DocumentElementType {
|
|
|
9
9
|
ADDTOCART = "addToCart",
|
|
10
10
|
CUSTOM_HTML = "customHtml"
|
|
11
11
|
}
|
|
12
|
-
export declare type DocumentElementBase<T =
|
|
12
|
+
export declare type DocumentElementBase<T = any> = {
|
|
13
13
|
type: DocumentElementType;
|
|
14
14
|
key?: string;
|
|
15
15
|
display?: (document: T) => boolean;
|
|
16
16
|
isHtml?: boolean;
|
|
17
17
|
};
|
|
18
|
-
export declare type ImageDocumentElement = DocumentElementBase & {
|
|
18
|
+
export declare type ImageDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
19
19
|
type: DocumentElementType.IMAGE;
|
|
20
20
|
placeholder: string;
|
|
21
21
|
baseUrl?: string;
|
|
22
22
|
key: string;
|
|
23
23
|
};
|
|
24
|
-
export declare type TitleDocumentElement = DocumentElementBase & {
|
|
24
|
+
export declare type TitleDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
25
25
|
type: DocumentElementType.TITLE;
|
|
26
26
|
maxLines: number;
|
|
27
27
|
link?: boolean;
|
|
28
28
|
key: string;
|
|
29
29
|
};
|
|
30
|
-
export declare type DescriptionDocumentElement = DocumentElementBase & {
|
|
30
|
+
export declare type DescriptionDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
31
31
|
type: DocumentElementType.DESCRIPTION;
|
|
32
32
|
maxLines: number;
|
|
33
33
|
key: string;
|
|
34
34
|
className: string;
|
|
35
35
|
};
|
|
36
|
-
export declare type CustomDocumentElement = DocumentElementBase & {
|
|
36
|
+
export declare type CustomDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
37
37
|
type: DocumentElementType.CUSTOM;
|
|
38
38
|
className: string;
|
|
39
39
|
key: string;
|
|
40
40
|
};
|
|
41
|
-
export declare type PriceElement = DocumentElementBase & {
|
|
41
|
+
export declare type PriceElement<T = any> = DocumentElementBase<T> & {
|
|
42
42
|
type: DocumentElementType.PRICE;
|
|
43
43
|
key: string;
|
|
44
44
|
};
|
|
45
|
-
export declare type RegularPriceDocumentElement = DocumentElementBase & {
|
|
45
|
+
export declare type RegularPriceDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
46
46
|
type: DocumentElementType.REGULARPRICE;
|
|
47
47
|
key: string;
|
|
48
48
|
};
|
|
49
|
-
export declare type RatingElement<T =
|
|
49
|
+
export declare type RatingElement<T = any> = DocumentElementBase<T> & {
|
|
50
50
|
type: DocumentElementType.RATING;
|
|
51
51
|
labels: RatingLabels;
|
|
52
52
|
links: RatingLinks;
|
|
@@ -60,14 +60,14 @@ export declare type RatingLabels = {
|
|
|
60
60
|
export declare type RatingLinks = {
|
|
61
61
|
ratingDetails?: string;
|
|
62
62
|
};
|
|
63
|
-
export declare type AddToCartElement<T =
|
|
63
|
+
export declare type AddToCartElement<T = any> = DocumentElementBase<T> & {
|
|
64
64
|
type: DocumentElementType.ADDTOCART;
|
|
65
65
|
action: (document: T, amount: number) => Promise<unknown> | undefined;
|
|
66
66
|
labels: {
|
|
67
67
|
addToCart: string;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
-
export declare type CustomHtmlElement<T =
|
|
70
|
+
export declare type CustomHtmlElement<T = any> = DocumentElementBase<T> & {
|
|
71
71
|
type: DocumentElementType.CUSTOM_HTML;
|
|
72
72
|
html: (document: T) => string;
|
|
73
73
|
className: string;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Document } from "@getlupa/client-sdk/Types";
|
|
2
1
|
import { AnchorPosition } from "./SearchResultsProductCardOptions";
|
|
3
2
|
export declare type SearchResultBadgeType = "text" | "image" | "customHtml";
|
|
4
3
|
export declare type BadgeOptions = {
|
|
5
4
|
anchor: AnchorPosition;
|
|
6
5
|
elements: BadgeElement[];
|
|
7
|
-
product?:
|
|
6
|
+
product?: any;
|
|
8
7
|
};
|
|
9
|
-
export declare type SearchResultBadgeElement<T =
|
|
8
|
+
export declare type SearchResultBadgeElement<T = any> = {
|
|
10
9
|
type: SearchResultBadgeType;
|
|
11
10
|
key: string;
|
|
12
11
|
isHtml?: boolean;
|
|
@@ -14,24 +13,26 @@ export declare type SearchResultBadgeElement<T = Record<string, unknown>> = {
|
|
|
14
13
|
product?: T;
|
|
15
14
|
display?: (document: T) => boolean;
|
|
16
15
|
rootImageUrl?: string;
|
|
16
|
+
maxItems?: number;
|
|
17
|
+
html: (doc: T) => string;
|
|
17
18
|
};
|
|
18
|
-
export declare type BaseBadgeElement = SearchResultBadgeElement & {
|
|
19
|
+
export declare type BaseBadgeElement<T = any> = SearchResultBadgeElement<T> & {
|
|
19
20
|
value?: string;
|
|
20
21
|
};
|
|
21
|
-
export declare type TextBadgeElement = BaseBadgeElement & {
|
|
22
|
+
export declare type TextBadgeElement<T = any> = BaseBadgeElement<T> & {
|
|
22
23
|
type: "text";
|
|
23
24
|
prefix?: string;
|
|
24
25
|
maxItems?: number;
|
|
25
26
|
};
|
|
26
|
-
export declare type ImageBadgeElement = BaseBadgeElement & {
|
|
27
|
+
export declare type ImageBadgeElement<T = any> = BaseBadgeElement<T> & {
|
|
27
28
|
type: "image";
|
|
28
29
|
rootImageUrl?: string;
|
|
29
30
|
maxItems?: number;
|
|
30
31
|
};
|
|
31
|
-
export declare type CustomHtmlBadgeElement = BaseBadgeElement & {
|
|
32
|
+
export declare type CustomHtmlBadgeElement<T = any> = BaseBadgeElement<T> & {
|
|
32
33
|
type: "customHtml";
|
|
33
34
|
className?: string;
|
|
34
|
-
html: (doc:
|
|
35
|
+
html: (doc: T) => string;
|
|
35
36
|
};
|
|
36
37
|
export declare type BadgeElement = BaseBadgeElement | TextBadgeElement;
|
|
37
38
|
export declare enum BadgeType {
|
package/dist/iife/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SearchBoxOptions } from "./types/search-box/SearchBoxOptions";
|
|
2
|
-
import { CallbackContext, FacetFilterQuery, FacetStyle, SearchResultEventCallbacks, SearchResultsFilterOptions, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
2
|
+
import { CallbackContext, FacetFilterQuery, FacetStyle, ResultFacetOptions, SearchResultEventCallbacks, SearchResultsFilterOptions, SearchResultsOptions } from "./types/search-results/SearchResultsOptions";
|
|
3
3
|
import { SdkOptions, TrackingOptions, Environment, SortDirection } from "./types/General";
|
|
4
4
|
import { CategoryFilterOptions, ProductListOptions } from "./types/product-list/ProductListOptions";
|
|
5
5
|
import { AddToCartElement, CustomDocumentElement, CustomHtmlElement, DescriptionDocumentElement, DocumentElement, DocumentElementType, ImageDocumentElement, PriceElement, RatingElement, RegularPriceDocumentElement, TitleDocumentElement } from "./types/DocumentElement";
|
|
@@ -17,5 +17,5 @@ declare const lupaSearch: {
|
|
|
17
17
|
clearSearchResults: () => void;
|
|
18
18
|
clearProductList: () => void;
|
|
19
19
|
};
|
|
20
|
-
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, };
|
|
20
|
+
export { TrackingOptions, SearchBoxOptions, SearchResultsOptions, ProductListOptions, SdkOptions, DocumentElementType, SearchBoxPanelType, FacetStyle, Environment, RoutingBehavior, AnchorPosition, BadgeType, SortDirection, DocumentElement, ImageDocumentElement, TitleDocumentElement, DescriptionDocumentElement, CustomDocumentElement, PriceElement, RegularPriceDocumentElement, RatingElement, AddToCartElement, CustomHtmlElement, SortOptions, SearchResultsSortOptions, SearchResultEventCallbacks, CallbackContext, FacetFilterQuery, CategoryFilterOptions, SearchResultsFilterOptions, SearchResultBadgeType, SearchResultBadgeElement, ResultFacetOptions, };
|
|
21
21
|
export default lupaSearch;
|
|
@@ -9,44 +9,44 @@ export declare enum DocumentElementType {
|
|
|
9
9
|
ADDTOCART = "addToCart",
|
|
10
10
|
CUSTOM_HTML = "customHtml"
|
|
11
11
|
}
|
|
12
|
-
export declare type DocumentElementBase<T =
|
|
12
|
+
export declare type DocumentElementBase<T = any> = {
|
|
13
13
|
type: DocumentElementType;
|
|
14
14
|
key?: string;
|
|
15
15
|
display?: (document: T) => boolean;
|
|
16
16
|
isHtml?: boolean;
|
|
17
17
|
};
|
|
18
|
-
export declare type ImageDocumentElement = DocumentElementBase & {
|
|
18
|
+
export declare type ImageDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
19
19
|
type: DocumentElementType.IMAGE;
|
|
20
20
|
placeholder: string;
|
|
21
21
|
baseUrl?: string;
|
|
22
22
|
key: string;
|
|
23
23
|
};
|
|
24
|
-
export declare type TitleDocumentElement = DocumentElementBase & {
|
|
24
|
+
export declare type TitleDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
25
25
|
type: DocumentElementType.TITLE;
|
|
26
26
|
maxLines: number;
|
|
27
27
|
link?: boolean;
|
|
28
28
|
key: string;
|
|
29
29
|
};
|
|
30
|
-
export declare type DescriptionDocumentElement = DocumentElementBase & {
|
|
30
|
+
export declare type DescriptionDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
31
31
|
type: DocumentElementType.DESCRIPTION;
|
|
32
32
|
maxLines: number;
|
|
33
33
|
key: string;
|
|
34
34
|
className: string;
|
|
35
35
|
};
|
|
36
|
-
export declare type CustomDocumentElement = DocumentElementBase & {
|
|
36
|
+
export declare type CustomDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
37
37
|
type: DocumentElementType.CUSTOM;
|
|
38
38
|
className: string;
|
|
39
39
|
key: string;
|
|
40
40
|
};
|
|
41
|
-
export declare type PriceElement = DocumentElementBase & {
|
|
41
|
+
export declare type PriceElement<T = any> = DocumentElementBase<T> & {
|
|
42
42
|
type: DocumentElementType.PRICE;
|
|
43
43
|
key: string;
|
|
44
44
|
};
|
|
45
|
-
export declare type RegularPriceDocumentElement = DocumentElementBase & {
|
|
45
|
+
export declare type RegularPriceDocumentElement<T = any> = DocumentElementBase<T> & {
|
|
46
46
|
type: DocumentElementType.REGULARPRICE;
|
|
47
47
|
key: string;
|
|
48
48
|
};
|
|
49
|
-
export declare type RatingElement<T =
|
|
49
|
+
export declare type RatingElement<T = any> = DocumentElementBase<T> & {
|
|
50
50
|
type: DocumentElementType.RATING;
|
|
51
51
|
labels: RatingLabels;
|
|
52
52
|
links: RatingLinks;
|
|
@@ -60,14 +60,14 @@ export declare type RatingLabels = {
|
|
|
60
60
|
export declare type RatingLinks = {
|
|
61
61
|
ratingDetails?: string;
|
|
62
62
|
};
|
|
63
|
-
export declare type AddToCartElement<T =
|
|
63
|
+
export declare type AddToCartElement<T = any> = DocumentElementBase<T> & {
|
|
64
64
|
type: DocumentElementType.ADDTOCART;
|
|
65
65
|
action: (document: T, amount: number) => Promise<unknown> | undefined;
|
|
66
66
|
labels: {
|
|
67
67
|
addToCart: string;
|
|
68
68
|
};
|
|
69
69
|
};
|
|
70
|
-
export declare type CustomHtmlElement<T =
|
|
70
|
+
export declare type CustomHtmlElement<T = any> = DocumentElementBase<T> & {
|
|
71
71
|
type: DocumentElementType.CUSTOM_HTML;
|
|
72
72
|
html: (document: T) => string;
|
|
73
73
|
className: string;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { Document } from "@getlupa/client-sdk/Types";
|
|
2
1
|
import { AnchorPosition } from "./SearchResultsProductCardOptions";
|
|
3
2
|
export declare type SearchResultBadgeType = "text" | "image" | "customHtml";
|
|
4
3
|
export declare type BadgeOptions = {
|
|
5
4
|
anchor: AnchorPosition;
|
|
6
5
|
elements: BadgeElement[];
|
|
7
|
-
product?:
|
|
6
|
+
product?: any;
|
|
8
7
|
};
|
|
9
|
-
export declare type SearchResultBadgeElement<T =
|
|
8
|
+
export declare type SearchResultBadgeElement<T = any> = {
|
|
10
9
|
type: SearchResultBadgeType;
|
|
11
10
|
key: string;
|
|
12
11
|
isHtml?: boolean;
|
|
@@ -14,24 +13,26 @@ export declare type SearchResultBadgeElement<T = Record<string, unknown>> = {
|
|
|
14
13
|
product?: T;
|
|
15
14
|
display?: (document: T) => boolean;
|
|
16
15
|
rootImageUrl?: string;
|
|
16
|
+
maxItems?: number;
|
|
17
|
+
html: (doc: T) => string;
|
|
17
18
|
};
|
|
18
|
-
export declare type BaseBadgeElement = SearchResultBadgeElement & {
|
|
19
|
+
export declare type BaseBadgeElement<T = any> = SearchResultBadgeElement<T> & {
|
|
19
20
|
value?: string;
|
|
20
21
|
};
|
|
21
|
-
export declare type TextBadgeElement = BaseBadgeElement & {
|
|
22
|
+
export declare type TextBadgeElement<T = any> = BaseBadgeElement<T> & {
|
|
22
23
|
type: "text";
|
|
23
24
|
prefix?: string;
|
|
24
25
|
maxItems?: number;
|
|
25
26
|
};
|
|
26
|
-
export declare type ImageBadgeElement = BaseBadgeElement & {
|
|
27
|
+
export declare type ImageBadgeElement<T = any> = BaseBadgeElement<T> & {
|
|
27
28
|
type: "image";
|
|
28
29
|
rootImageUrl?: string;
|
|
29
30
|
maxItems?: number;
|
|
30
31
|
};
|
|
31
|
-
export declare type CustomHtmlBadgeElement = BaseBadgeElement & {
|
|
32
|
+
export declare type CustomHtmlBadgeElement<T = any> = BaseBadgeElement<T> & {
|
|
32
33
|
type: "customHtml";
|
|
33
34
|
className?: string;
|
|
34
|
-
html: (doc:
|
|
35
|
+
html: (doc: T) => string;
|
|
35
36
|
};
|
|
36
37
|
export declare type BadgeElement = BaseBadgeElement | TextBadgeElement;
|
|
37
38
|
export declare enum BadgeType {
|