@loczer/storefront-sdk 0.151.0 → 0.152.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.
- package/dist/StorefrontProvider.d.ts +20 -0
- package/dist/booking-period-time-slots.d.ts +7 -41
- package/dist/booking-period.d.ts +6 -0
- package/dist/booking.d.ts +18 -0
- package/dist/chunks/pkg/booking-engine/dist/schemas/{booking-engine-configuration-CnBdp3jk.js → booking-engine-configuration-BKlzwJJX.js} +20 -19
- package/dist/chunks/pkg/booking-engine/dist/schemas/{cart-inputs-DYgEGJ5M.js → cart-inputs-ByBK0IVJ.js} +2 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/{public-booking-engine-configuration-C9VB-WhU.js → public-booking-engine-configuration-DKoak4s5.js} +2 -2
- package/dist/chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-DqNWstqT.js +51 -0
- package/dist/components/BookingPeriodSelector/useBookingPeriodController.js +76 -80
- package/dist/index.js +308 -300
- package/dist/lib/booking-period-time-slots.d.ts +0 -31
- package/dist/lib/booking-period-time-slots.js +122 -221
- package/dist/lib/booking-period.d.ts +5 -0
- package/dist/lib/booking.d.ts +3 -0
- package/dist/lib/booking.js +102 -89
- package/dist/lib/checkoutSubmit.js +4 -4
- package/dist/lib/storefrontTimeSlots.d.ts +43 -0
- package/dist/lib/storefrontTimeSlots.js +26 -0
- package/dist/storefront.css +1 -1
- package/dist/storefrontSchemas.d.ts +8 -0
- package/dist/storefrontSchemas.js +4 -4
- package/dist/storefrontTimeSlots.d.ts +53 -0
- package/dist/whatsapp.d.ts +8 -0
- package/package.json +1 -1
- package/dist/chunks/pkg/booking-engine/dist/schemas/shop-opening-hours-B47MMaoD.js +0 -45
|
@@ -13,37 +13,6 @@ export type TimeSlot = TimeSlotBase & {
|
|
|
13
13
|
isDisabled: boolean;
|
|
14
14
|
disabledReason?: string;
|
|
15
15
|
};
|
|
16
|
-
export interface DisabledTimeSlotRule {
|
|
17
|
-
startMinutes?: number;
|
|
18
|
-
endMinutes?: number;
|
|
19
|
-
values?: string[];
|
|
20
|
-
reason?: string;
|
|
21
|
-
dates?: string[];
|
|
22
|
-
weekdays?: number[];
|
|
23
|
-
}
|
|
24
|
-
export interface DisabledTimeSlotRuleContext {
|
|
25
|
-
date?: string;
|
|
26
|
-
slotInterval: number;
|
|
27
|
-
}
|
|
28
|
-
export declare const staticDisabledTimeSlotRules: DisabledTimeSlotRule[];
|
|
29
|
-
export declare const getDisabledTimeSlotRulesSync: (_context: DisabledTimeSlotRuleContext) => DisabledTimeSlotRule[];
|
|
30
|
-
export declare const getDisabledTimeSlotRules: (context: DisabledTimeSlotRuleContext) => Promise<DisabledTimeSlotRule[]>;
|
|
31
|
-
export interface ExtraTimeSlotRule {
|
|
32
|
-
startMinutes: number;
|
|
33
|
-
endMinutes?: number;
|
|
34
|
-
extraAmount: number;
|
|
35
|
-
dates?: string[];
|
|
36
|
-
weekdays?: number[];
|
|
37
|
-
journeyTypes?: JourneyType[];
|
|
38
|
-
}
|
|
39
|
-
export interface ExtraTimeSlotRuleContext {
|
|
40
|
-
date?: string;
|
|
41
|
-
slotInterval: number;
|
|
42
|
-
journeyType?: JourneyType;
|
|
43
|
-
}
|
|
44
|
-
export declare const staticExtraTimeSlotRules: ExtraTimeSlotRule[];
|
|
45
|
-
export declare const getExtraTimeSlotRulesSync: (_context: ExtraTimeSlotRuleContext) => ExtraTimeSlotRule[];
|
|
46
|
-
export declare const getExtraTimeSlotRules: (context: ExtraTimeSlotRuleContext) => Promise<ExtraTimeSlotRule[]>;
|
|
47
16
|
export declare const toBusinessDateString: (date: string) => string;
|
|
48
17
|
export declare const getBookingPeriodTimeSlotsSync: (bookingPeriodConfig: BookingPeriodConfig, { date, }?: {
|
|
49
18
|
date?: string;
|
|
@@ -1,273 +1,174 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
const { businessDateStringToDate: A, createBookingPeriodConstants:
|
|
3
|
-
|
|
4
|
-
startMinutes: 1140,
|
|
5
|
-
extraAmount: 1e3,
|
|
6
|
-
journeyTypes: ["end"]
|
|
7
|
-
},
|
|
8
|
-
{
|
|
9
|
-
startMinutes: 1170,
|
|
10
|
-
extraAmount: 2e3,
|
|
11
|
-
journeyTypes: ["end"]
|
|
12
|
-
}
|
|
13
|
-
], w = (e) => [], P = async (e) => w(), M = /^\d{4}-\d{2}-\d{2}$/, N = "closed", W = (e) => {
|
|
14
|
-
if (!M.test(e))
|
|
1
|
+
import * as $ from "./booking-period.js";
|
|
2
|
+
const { businessDateStringToDate: A, createBookingPeriodConstants: W, minutesToTimeString: g } = $, p = /^\d{4}-\d{2}-\d{2}$/, w = "closed", D = (t) => {
|
|
3
|
+
if (!p.test(t))
|
|
15
4
|
throw new Error("Invalid time slot date parameter format");
|
|
16
|
-
return
|
|
17
|
-
},
|
|
18
|
-
if (!
|
|
5
|
+
return t;
|
|
6
|
+
}, v = (t) => p.test(t) ? t : /^\d{8}$/.test(t) ? `${t.slice(0, 4)}-${t.slice(4, 6)}-${t.slice(6, 8)}` : t, z = (t) => {
|
|
7
|
+
if (!t)
|
|
19
8
|
return { dateString: void 0, weekday: void 0 };
|
|
20
|
-
const
|
|
9
|
+
const e = v(t);
|
|
21
10
|
let s;
|
|
22
11
|
try {
|
|
23
|
-
s =
|
|
12
|
+
s = D(e);
|
|
24
13
|
} catch {
|
|
25
14
|
return { dateString: void 0, weekday: void 0 };
|
|
26
15
|
}
|
|
27
|
-
const
|
|
28
|
-
return Number.isNaN(
|
|
29
|
-
},
|
|
30
|
-
const { dateString: r, weekday:
|
|
16
|
+
const n = A(s);
|
|
17
|
+
return Number.isNaN(n.getTime()) ? { dateString: void 0, weekday: void 0 } : { dateString: s, weekday: (n.getDay() + 6) % 7 };
|
|
18
|
+
}, E = (t, e, s, n) => {
|
|
19
|
+
const { dateString: r, weekday: o } = z(t), a = e.getNormalizedOpeningHours({
|
|
31
20
|
dateString: r
|
|
32
|
-
}),
|
|
21
|
+
}), l = typeof o == "number" ? o : a.days.find((c) => !c.isClosed && c.openingSlots.length)?.day ?? e.defaultWeekday, d = e.getIntervalsForWeekday(l, {
|
|
33
22
|
dateString: r
|
|
34
23
|
});
|
|
35
|
-
if (
|
|
36
|
-
if (!
|
|
24
|
+
if (n?.fillGaps) {
|
|
25
|
+
if (!d.length)
|
|
37
26
|
return [];
|
|
38
|
-
const
|
|
39
|
-
if (
|
|
40
|
-
return
|
|
41
|
-
for (let
|
|
42
|
-
const
|
|
43
|
-
|
|
44
|
-
value:
|
|
45
|
-
label: `${
|
|
46
|
-
startMinutes:
|
|
47
|
-
endMinutes:
|
|
27
|
+
const c = d.reduce((i, u) => u.startMinutes < i.startMinutes ? u : i), x = d.reduce((i, u) => u.endMinutes > i.endMinutes ? u : i), S = [], m = Math.ceil(c.startMinutes / s) * s, M = Math.max(m, x.endMinutes - s);
|
|
28
|
+
if (M < m)
|
|
29
|
+
return S;
|
|
30
|
+
for (let i = m; i <= M; i += s) {
|
|
31
|
+
const u = g(i), b = i + s, T = g(b);
|
|
32
|
+
S.push({
|
|
33
|
+
value: u,
|
|
34
|
+
label: `${u} - ${T}`,
|
|
35
|
+
startMinutes: i,
|
|
36
|
+
endMinutes: b,
|
|
48
37
|
isExtra: !1
|
|
49
38
|
});
|
|
50
39
|
}
|
|
51
|
-
return
|
|
40
|
+
return S;
|
|
52
41
|
}
|
|
53
|
-
const
|
|
54
|
-
for (const
|
|
55
|
-
const
|
|
56
|
-
if (!(
|
|
57
|
-
for (let
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
value:
|
|
61
|
-
label: `${
|
|
62
|
-
startMinutes:
|
|
63
|
-
endMinutes:
|
|
42
|
+
const f = [];
|
|
43
|
+
for (const c of d) {
|
|
44
|
+
const x = Math.ceil(c.startMinutes / s) * s, S = c.endMinutes - s;
|
|
45
|
+
if (!(S < x))
|
|
46
|
+
for (let m = x; m <= S; m += s) {
|
|
47
|
+
const M = g(m), i = m + s, u = g(i);
|
|
48
|
+
f.push({
|
|
49
|
+
value: M,
|
|
50
|
+
label: `${M} - ${u}`,
|
|
51
|
+
startMinutes: m,
|
|
52
|
+
endMinutes: i,
|
|
64
53
|
isExtra: !1
|
|
65
54
|
});
|
|
66
55
|
}
|
|
67
56
|
}
|
|
68
|
-
return
|
|
69
|
-
},
|
|
70
|
-
if (t.
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}
|
|
81
|
-
return !!(t.values?.length && i || typeof t.startMinutes == "number" && r);
|
|
82
|
-
}, F = (e, t) => !(e.dates?.length && (!t.dateString || !e.dates.some((i) => {
|
|
83
|
-
const r = k(i);
|
|
84
|
-
return M.test(r) ? r === t.dateString : !1;
|
|
85
|
-
})) || e.weekdays?.length && (t.weekday == null || !e.weekdays.includes(t.weekday)) || e.journeyTypes?.length && (!t.journeyType || !e.journeyTypes.includes(t.journeyType))), x = ({
|
|
86
|
-
slots: e,
|
|
87
|
-
rules: t,
|
|
88
|
-
date: s,
|
|
89
|
-
slotInterval: i
|
|
90
|
-
}) => {
|
|
91
|
-
if (!t.length)
|
|
92
|
-
return e.map((n) => ({
|
|
93
|
-
...n,
|
|
94
|
-
isDisabled: !1
|
|
95
|
-
}));
|
|
96
|
-
const { dateString: r, weekday: l } = D(s);
|
|
97
|
-
return e.map((n) => {
|
|
98
|
-
const o = t.find(
|
|
99
|
-
(a) => O(n, a, {
|
|
100
|
-
dateString: r,
|
|
101
|
-
weekday: l,
|
|
102
|
-
slotInterval: i
|
|
103
|
-
})
|
|
104
|
-
);
|
|
105
|
-
return o ? {
|
|
106
|
-
...n,
|
|
107
|
-
isDisabled: !0,
|
|
108
|
-
disabledReason: o.reason
|
|
109
|
-
} : {
|
|
110
|
-
...n,
|
|
111
|
-
isDisabled: !1
|
|
112
|
-
};
|
|
113
|
-
});
|
|
114
|
-
}, I = ({
|
|
115
|
-
slots: e,
|
|
116
|
-
rules: t,
|
|
117
|
-
date: s,
|
|
118
|
-
slotInterval: i,
|
|
119
|
-
journeyType: r
|
|
120
|
-
}) => {
|
|
121
|
-
if (!t.length)
|
|
122
|
-
return e.map((a) => ({
|
|
123
|
-
...a
|
|
124
|
-
}));
|
|
125
|
-
const { dateString: l, weekday: n } = D(s), o = e.map((a) => ({
|
|
126
|
-
...a
|
|
57
|
+
return f;
|
|
58
|
+
}, N = (t, e, s, n) => {
|
|
59
|
+
if (n !== "end" || t.length === 0 || e.length === 0)
|
|
60
|
+
return [];
|
|
61
|
+
const r = e.reduce(
|
|
62
|
+
(o, a) => Math.max(o, a.endMinutes),
|
|
63
|
+
0
|
|
64
|
+
);
|
|
65
|
+
return [...t].sort((o, a) => o.minutesAfterClose - a.minutesAfterClose).map((o) => ({
|
|
66
|
+
startMinutes: Math.max(r, r + o.minutesAfterClose - s),
|
|
67
|
+
endMinutes: r + o.minutesAfterClose,
|
|
68
|
+
extraAmount: o.extraAmount
|
|
127
69
|
}));
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
endMinutes: c,
|
|
140
|
-
label: `${g} - ${m}`,
|
|
70
|
+
}, B = (t, e) => {
|
|
71
|
+
const s = t.map((n) => ({
|
|
72
|
+
...n
|
|
73
|
+
}));
|
|
74
|
+
for (const n of e) {
|
|
75
|
+
const r = g(n.startMinutes), o = g(n.endMinutes), a = s.findIndex((l) => l.startMinutes === n.startMinutes);
|
|
76
|
+
if (a >= 0) {
|
|
77
|
+
s[a] = {
|
|
78
|
+
...s[a],
|
|
79
|
+
endMinutes: n.endMinutes,
|
|
80
|
+
label: `${r} - ${o}`,
|
|
141
81
|
isExtra: !0,
|
|
142
|
-
extraAmount:
|
|
82
|
+
extraAmount: n.extraAmount
|
|
143
83
|
};
|
|
144
84
|
continue;
|
|
145
85
|
}
|
|
146
|
-
|
|
147
|
-
value:
|
|
148
|
-
label: `${
|
|
149
|
-
startMinutes:
|
|
150
|
-
endMinutes:
|
|
86
|
+
s.push({
|
|
87
|
+
value: r,
|
|
88
|
+
label: `${r} - ${o}`,
|
|
89
|
+
startMinutes: n.startMinutes,
|
|
90
|
+
endMinutes: n.endMinutes,
|
|
151
91
|
isExtra: !0,
|
|
152
|
-
extraAmount:
|
|
92
|
+
extraAmount: n.extraAmount
|
|
153
93
|
});
|
|
154
94
|
}
|
|
155
|
-
return
|
|
156
|
-
},
|
|
157
|
-
if (
|
|
158
|
-
return
|
|
95
|
+
return s.sort((n, r) => n.startMinutes - r.startMinutes);
|
|
96
|
+
}, C = (t, e) => {
|
|
97
|
+
if (t.length <= 1)
|
|
98
|
+
return t;
|
|
159
99
|
const s = [];
|
|
160
|
-
let
|
|
161
|
-
for (;
|
|
162
|
-
const r =
|
|
100
|
+
let n = 0;
|
|
101
|
+
for (; n < t.length; ) {
|
|
102
|
+
const r = t[n];
|
|
163
103
|
if (r.isDisabled && !r.isExtra && r.disabledReason == null) {
|
|
164
|
-
let
|
|
165
|
-
for (;
|
|
166
|
-
|
|
167
|
-
const
|
|
104
|
+
let o = r, a = n + 1;
|
|
105
|
+
for (; a < t.length && t[a].isDisabled && !t[a].isExtra && t[a].disabledReason == null && t[a].startMinutes === o.startMinutes + e; )
|
|
106
|
+
o = t[a], a += 1;
|
|
107
|
+
const l = r.startMinutes, d = o.endMinutes, f = g(l), c = g(d);
|
|
168
108
|
s.push({
|
|
169
109
|
...r,
|
|
170
|
-
value:
|
|
171
|
-
label: `${
|
|
172
|
-
startMinutes:
|
|
173
|
-
endMinutes:
|
|
110
|
+
value: f,
|
|
111
|
+
label: `${f} - ${c}`,
|
|
112
|
+
startMinutes: l,
|
|
113
|
+
endMinutes: d,
|
|
174
114
|
isDisabled: !0,
|
|
175
|
-
disabledReason:
|
|
176
|
-
}),
|
|
115
|
+
disabledReason: w
|
|
116
|
+
}), n = a;
|
|
177
117
|
continue;
|
|
178
118
|
}
|
|
179
|
-
s.push(r),
|
|
119
|
+
s.push(r), n += 1;
|
|
180
120
|
}
|
|
181
121
|
return s;
|
|
182
122
|
}, h = ({
|
|
183
|
-
slots:
|
|
184
|
-
baselineSlots:
|
|
123
|
+
slots: t,
|
|
124
|
+
baselineSlots: e,
|
|
185
125
|
slotInterval: s
|
|
186
126
|
}) => {
|
|
187
|
-
const
|
|
188
|
-
...
|
|
127
|
+
const n = new Set(t.map((a) => a.startMinutes)), r = e.filter((a) => !n.has(a.startMinutes)).map((a) => ({
|
|
128
|
+
...a,
|
|
189
129
|
isDisabled: !0
|
|
190
|
-
})),
|
|
191
|
-
return
|
|
192
|
-
},
|
|
193
|
-
getNormalizedOpeningHours:
|
|
194
|
-
getIntervalsForWeekday:
|
|
195
|
-
defaultWeekday:
|
|
196
|
-
},
|
|
197
|
-
|
|
130
|
+
})), o = [...t, ...r].sort((a, l) => a.startMinutes - l.startMinutes);
|
|
131
|
+
return C(o, s);
|
|
132
|
+
}, O = (t, e) => E(t, {
|
|
133
|
+
getNormalizedOpeningHours: e.getNormalizedOpeningHours,
|
|
134
|
+
getIntervalsForWeekday: e.getIntervalsForWeekday,
|
|
135
|
+
defaultWeekday: e.defaultWeekday
|
|
136
|
+
}, e.slotIntervalMinutes), F = (t, e) => E(
|
|
137
|
+
t,
|
|
198
138
|
{
|
|
199
|
-
getNormalizedOpeningHours:
|
|
200
|
-
getIntervalsForWeekday:
|
|
201
|
-
defaultWeekday:
|
|
139
|
+
getNormalizedOpeningHours: e.getSeasonNormalizedOpeningHours,
|
|
140
|
+
getIntervalsForWeekday: e.getSeasonIntervalsForWeekday,
|
|
141
|
+
defaultWeekday: e.defaultSeasonWeekday
|
|
202
142
|
},
|
|
203
|
-
|
|
143
|
+
e.slotIntervalMinutes,
|
|
204
144
|
{ fillGaps: !0 }
|
|
205
|
-
),
|
|
206
|
-
const
|
|
207
|
-
return
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
});
|
|
214
|
-
}, j = (e, {
|
|
215
|
-
date: t
|
|
145
|
+
), y = (t, e, s, n) => {
|
|
146
|
+
const r = e.slotIntervalMinutes, o = O(t, e), a = N(n, o, r, s);
|
|
147
|
+
return B(o, a);
|
|
148
|
+
}, k = (t) => t.map((e) => ({
|
|
149
|
+
...e,
|
|
150
|
+
isDisabled: !1
|
|
151
|
+
})), I = (t, {
|
|
152
|
+
date: e
|
|
216
153
|
} = {}) => {
|
|
217
|
-
const s =
|
|
218
|
-
startTimeSlots: h({
|
|
219
|
-
slots: r.map((u) => ({
|
|
220
|
-
...u,
|
|
221
|
-
isDisabled: !1
|
|
222
|
-
})),
|
|
223
|
-
baselineSlots: n,
|
|
224
|
-
slotInterval: i
|
|
225
|
-
}),
|
|
226
|
-
endTimeSlots: h({
|
|
227
|
-
slots: l.map((u) => ({
|
|
228
|
-
...u,
|
|
229
|
-
isDisabled: !1
|
|
230
|
-
})),
|
|
231
|
-
baselineSlots: n,
|
|
232
|
-
slotInterval: i
|
|
233
|
-
})
|
|
234
|
-
};
|
|
235
|
-
if (!t || !M.test(t))
|
|
236
|
-
return o;
|
|
237
|
-
const a = W(t), c = p(a, s, "start"), d = p(a, s, "end"), g = R(a, s), m = E(), f = x({
|
|
238
|
-
slots: c,
|
|
239
|
-
rules: m,
|
|
240
|
-
date: a,
|
|
241
|
-
slotInterval: i
|
|
242
|
-
}), b = x({
|
|
243
|
-
slots: d,
|
|
244
|
-
rules: m,
|
|
245
|
-
date: a,
|
|
246
|
-
slotInterval: i
|
|
247
|
-
});
|
|
154
|
+
const s = W(t), n = s.slotIntervalMinutes, r = t.extraTimeSlots ?? [], o = e && p.test(e) ? D(e) : void 0, a = y(o, s, "start", r), l = y(o, s, "end", r), d = F(o, s);
|
|
248
155
|
return {
|
|
249
156
|
startTimeSlots: h({
|
|
250
|
-
slots:
|
|
251
|
-
baselineSlots:
|
|
252
|
-
slotInterval:
|
|
157
|
+
slots: k(a),
|
|
158
|
+
baselineSlots: d,
|
|
159
|
+
slotInterval: n
|
|
253
160
|
}),
|
|
254
161
|
endTimeSlots: h({
|
|
255
|
-
slots:
|
|
256
|
-
baselineSlots:
|
|
257
|
-
slotInterval:
|
|
162
|
+
slots: k(l),
|
|
163
|
+
baselineSlots: d,
|
|
164
|
+
slotInterval: n
|
|
258
165
|
})
|
|
259
166
|
};
|
|
260
|
-
},
|
|
261
|
-
date:
|
|
262
|
-
} = {}) =>
|
|
167
|
+
}, R = async (t, {
|
|
168
|
+
date: e
|
|
169
|
+
} = {}) => I(t, { date: e });
|
|
263
170
|
export {
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
E as getDisabledTimeSlotRulesSync,
|
|
268
|
-
P as getExtraTimeSlotRules,
|
|
269
|
-
w as getExtraTimeSlotRulesSync,
|
|
270
|
-
C as staticDisabledTimeSlotRules,
|
|
271
|
-
L as staticExtraTimeSlotRules,
|
|
272
|
-
W as toBusinessDateString
|
|
171
|
+
R as getBookingPeriodTimeSlots,
|
|
172
|
+
I as getBookingPeriodTimeSlotsSync,
|
|
173
|
+
D as toBusinessDateString
|
|
273
174
|
};
|
|
@@ -58,11 +58,16 @@ export type NormalizeOpeningHoursOptions = {
|
|
|
58
58
|
referenceDate?: Date | string | null;
|
|
59
59
|
};
|
|
60
60
|
export declare const normalizeOpeningHours: (openingHours: StoreOpeningHours, openingHoursOverrides: StoreOpeningOverride[], options?: NormalizeOpeningHoursOptions) => NormalizedOpeningHours;
|
|
61
|
+
export type BookingPeriodExtraTimeSlotRule = {
|
|
62
|
+
minutesAfterClose: number;
|
|
63
|
+
extraAmount: number;
|
|
64
|
+
};
|
|
61
65
|
export type BookingPeriodConfig = {
|
|
62
66
|
timing: BookingTimingConfig;
|
|
63
67
|
openingHours: StoreOpeningHours;
|
|
64
68
|
openingHoursOverrides: StoreOpeningOverride[];
|
|
65
69
|
timeZone: string;
|
|
70
|
+
extraTimeSlots?: BookingPeriodExtraTimeSlotRule[];
|
|
66
71
|
};
|
|
67
72
|
export type BookingPeriodConstants = ReturnType<typeof createBookingPeriodConstants>;
|
|
68
73
|
export declare const createBookingPeriodConstants: (config: BookingPeriodConfig) => {
|
package/dist/lib/booking.d.ts
CHANGED
|
@@ -14,6 +14,9 @@ export type StorefrontBookingParams = {
|
|
|
14
14
|
type BookingSearchStorage = Pick<Storage, "getItem" | "removeItem" | "setItem"> | null | undefined;
|
|
15
15
|
export declare const TIME_OPTIONS: string[];
|
|
16
16
|
export declare const getDefaultBookingParams: (now?: Date) => StorefrontBookingParams;
|
|
17
|
+
export declare const createBookingPeriodConfigFromBookingEngineConfiguration: (bookingEngine: StorefrontConfiguration["bookingEngine"], options?: {
|
|
18
|
+
sameDayCutoff?: string;
|
|
19
|
+
}) => BookingPeriodConfig;
|
|
17
20
|
export declare const createBookingPeriodConfigFromStorefrontConfiguration: (storefrontConfiguration: StorefrontConfiguration) => BookingPeriodConfig;
|
|
18
21
|
export declare const getDefaultBookingParamsForStorefrontConfiguration: (storefrontConfiguration: StorefrontConfiguration, now?: Date) => StorefrontBookingParams;
|
|
19
22
|
export declare const getBookingParamsFromSearch: (searchParams: URLSearchParams, fallback?: Partial<StorefrontBookingParams>) => StorefrontBookingParams;
|