@billgangcom/theme-lib 1.12.0 → 1.14.0

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.
@@ -1,8 +1,107 @@
1
+ import { ListingData } from '../ui';
2
+ type Listing = ListingData<'PRODUCT'> | ListingData<'GROUP'> | ListingData<'POST'>;
3
+ export interface Product {
4
+ id: number;
5
+ uniquePath: string;
6
+ name: string;
7
+ shortDescription: string;
8
+ description: string;
9
+ images: Array<{
10
+ id: number;
11
+ cfId: string;
12
+ }>;
13
+ variants: Array<{
14
+ id: number;
15
+ name: string;
16
+ description: string;
17
+ shortDescription: string;
18
+ price: {
19
+ amount: number;
20
+ currency: string;
21
+ };
22
+ compareAtPrice: {
23
+ amount: number;
24
+ currency: string;
25
+ };
26
+ chargeTypes: Array<'ONE_TIME' | 'RECURRING'>;
27
+ subscriptionSettings: {
28
+ price: {
29
+ amount: number;
30
+ currency: string;
31
+ };
32
+ compareAtPrice: {
33
+ amount: number;
34
+ currency: string;
35
+ };
36
+ recurringIntervalDays: number;
37
+ entryFee: {
38
+ amount: number;
39
+ currency: string;
40
+ };
41
+ };
42
+ quantity: {
43
+ available: number;
44
+ restrictions: {
45
+ min: number;
46
+ max: number;
47
+ };
48
+ };
49
+ deliveryTime: number;
50
+ terms: string;
51
+ gateways: Array<{
52
+ name: string;
53
+ overrodePrice: {
54
+ amount: number;
55
+ currency: string;
56
+ };
57
+ }>;
58
+ customFields: Array<{
59
+ name: string;
60
+ required: boolean;
61
+ placeholder: string;
62
+ defaultValue: string;
63
+ regex: string;
64
+ type: 'NUMBER' | 'TEXT' | 'SELECT';
65
+ }>;
66
+ warranty: {
67
+ text: string;
68
+ durationMilliseconds: number;
69
+ };
70
+ discordSettings: {
71
+ isEnabled: boolean;
72
+ isRequired: boolean;
73
+ };
74
+ }>;
75
+ stats: {
76
+ averageRating: number;
77
+ totalReviews: number;
78
+ totalSold: number;
79
+ };
80
+ reviews: Array<{
81
+ id: number;
82
+ message: string;
83
+ rating: number;
84
+ createdAtIso: string;
85
+ purchasedIso: string;
86
+ storeReply: string;
87
+ }>;
88
+ }
89
+ export interface Faq {
90
+ id: number;
91
+ answer: string;
92
+ question: string;
93
+ }
94
+ export interface Category {
95
+ id: number;
96
+ name: string;
97
+ listingIdList: number[];
98
+ }
1
99
  export interface PageContext {
2
- listings: any;
3
- products: any;
100
+ listings: Listing[] | null;
101
+ products: Product[] | null;
4
102
  reviews: any;
5
- categories: any;
6
- faqs: any;
103
+ categories: Category[] | null;
104
+ faqs: Faq[] | null;
7
105
  general: any;
8
106
  }
107
+ export {};
@@ -1,3 +1,9 @@
1
- import type { PageContext } from '../../abstractions/PageContext';
2
- export declare function fetchAllData(): Promise<PageContext>;
3
- export declare function fetchPageData(page: string): Promise<any>;
1
+ export declare function fetchAllData(): Promise<{
2
+ general: PromiseSettledResult<unknown>;
3
+ faqs: PromiseSettledResult<unknown>;
4
+ listings: PromiseSettledResult<unknown>;
5
+ products: PromiseSettledResult<unknown>;
6
+ reviews: PromiseSettledResult<unknown>;
7
+ categories: PromiseSettledResult<unknown>;
8
+ }>;
9
+ export declare function fetchPageData(page: string): Promise<unknown>;
@@ -0,0 +1 @@
1
+ export declare function fetchPagesData(): Promise<any>;
@@ -1,3 +1,4 @@
1
1
  export * from './fetchData';
2
2
  export * from './fetchFontsData';
3
3
  export * from './hotReload';
4
+ export * from './fetchPagesData';