ha-nitrous-personalization 0.0.18 → 0.0.19
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/types/index.d.ts +66 -11
- package/package.json +1 -1
package/dist/types/index.d.ts
CHANGED
|
@@ -1,16 +1,26 @@
|
|
|
1
1
|
import { FunctionComponent } from 'react';
|
|
2
|
+
import { GetPersonalizationDataItem } from '../types/Api';
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
declare type GetPersonalizationCarItem = {
|
|
5
|
+
vehicle_tags: Array<{
|
|
6
|
+
model: {
|
|
7
|
+
price: {
|
|
8
|
+
high: number;
|
|
9
|
+
low: number;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
}>;
|
|
13
|
+
} & GetPersonalizationContentItem;
|
|
4
14
|
|
|
5
|
-
declare
|
|
15
|
+
declare interface GetPersonalizationContentItem {
|
|
6
16
|
__typename: 'Content';
|
|
7
17
|
id: string;
|
|
8
|
-
media: {
|
|
18
|
+
media: Array<{
|
|
9
19
|
url: string;
|
|
10
|
-
}
|
|
11
|
-
metadata
|
|
20
|
+
}>;
|
|
21
|
+
metadata?: {
|
|
12
22
|
dek: string;
|
|
13
|
-
links
|
|
23
|
+
links?: {
|
|
14
24
|
frontend: {
|
|
15
25
|
url: string;
|
|
16
26
|
};
|
|
@@ -18,32 +28,77 @@ declare type GetPersonalizationDataItem = {
|
|
|
18
28
|
};
|
|
19
29
|
publish_from: string;
|
|
20
30
|
title: string;
|
|
21
|
-
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export declare const getPersonalizationData: (params: GetPersonalizationDataParams) => Promise<GetPersonalizationDataResponse["data"]["recommendations"] | undefined>;
|
|
34
|
+
|
|
35
|
+
declare type GetPersonalizationDataItem_2 = GetPersonalizationCarItem | GetPersonalizationContentItem | GetPersonalizationVideoItem;
|
|
22
36
|
|
|
23
37
|
declare type GetPersonalizationDataParams = {
|
|
24
38
|
brand: string;
|
|
39
|
+
isProd?: boolean;
|
|
40
|
+
itemId?: string;
|
|
25
41
|
type: 'article' | 'car' | 'video';
|
|
26
42
|
useCase: PersonalizationUseCase;
|
|
27
|
-
userId
|
|
43
|
+
userId?: string;
|
|
28
44
|
};
|
|
29
45
|
|
|
30
46
|
declare type GetPersonalizationDataResponse = {
|
|
31
47
|
data: {
|
|
32
|
-
recommendations:
|
|
48
|
+
recommendations: GetPersonalizationDataItem_2[];
|
|
33
49
|
};
|
|
34
50
|
error?: unknown;
|
|
35
51
|
};
|
|
36
52
|
|
|
53
|
+
declare interface GetPersonalizationVideoItem {
|
|
54
|
+
__typename: 'Video';
|
|
55
|
+
description: string;
|
|
56
|
+
duration: number;
|
|
57
|
+
id: string;
|
|
58
|
+
preview_image: string;
|
|
59
|
+
published_at: string;
|
|
60
|
+
slug: string;
|
|
61
|
+
title: string;
|
|
62
|
+
transcodings: VideoTranscoding[];
|
|
63
|
+
}
|
|
64
|
+
|
|
37
65
|
declare type PersonalizationUseCase = 'similar_items' | 'trending_now' | 'user_personalization';
|
|
38
66
|
|
|
39
67
|
export declare const PersonalizationWidget: FunctionComponent<PersonalizationWidgetProps>;
|
|
40
68
|
|
|
41
69
|
declare type PersonalizationWidgetProps = {
|
|
42
|
-
|
|
70
|
+
brand: string;
|
|
71
|
+
contentType?: GetPersonalizationDataParams['type'];
|
|
72
|
+
model?: 'recommended-for-you' | 'trending' | 'ymal';
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
export declare const usePersonalizationData: ({ brand, contentId, contentType, model, }: UsePersonalizationDataProps) => GetPersonalizationDataItem[] | undefined;
|
|
76
|
+
|
|
77
|
+
declare type UsePersonalizationDataProps = {
|
|
43
78
|
brand?: string;
|
|
79
|
+
contentId?: string;
|
|
44
80
|
contentType?: GetPersonalizationDataParams['type'];
|
|
45
|
-
data?: GetPersonalizationDataResponse;
|
|
46
81
|
model?: 'recommended-for-you' | 'trending' | 'ymal';
|
|
47
82
|
};
|
|
48
83
|
|
|
84
|
+
declare type VideoTranscoding = {
|
|
85
|
+
bitrate?: string;
|
|
86
|
+
duration?: number;
|
|
87
|
+
duration_millis?: number;
|
|
88
|
+
file_size?: number;
|
|
89
|
+
frame_rate?: string;
|
|
90
|
+
full_url?: string;
|
|
91
|
+
height?: number;
|
|
92
|
+
id?: string;
|
|
93
|
+
key?: string;
|
|
94
|
+
mapped_preset_name?: string;
|
|
95
|
+
preset_id?: string;
|
|
96
|
+
preset_name?: string;
|
|
97
|
+
status?: string;
|
|
98
|
+
thumbnail_pattern?: string;
|
|
99
|
+
url?: string;
|
|
100
|
+
watermarks?: unknown[];
|
|
101
|
+
width?: number;
|
|
102
|
+
};
|
|
103
|
+
|
|
49
104
|
export { }
|