@wix/table-reservations 1.0.135 → 1.0.137

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,39 +1,127 @@
1
- type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
2
- interface HttpClient {
3
- request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
1
+ type HostModule$2<T, H extends Host$2> = {
2
+ __type: 'host';
3
+ create(host: H): T;
4
+ };
5
+ type HostModuleAPI$2<T extends HostModule$2<any, any>> = T extends HostModule$2<infer U, any> ? U : never;
6
+ type Host$2<Environment = unknown> = {
7
+ channel: {
8
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
9
+ disconnect: () => void;
10
+ } | Promise<{
11
+ disconnect: () => void;
12
+ }>;
13
+ };
14
+ environment?: Environment;
15
+ /**
16
+ * Optional bast url to use for API requests, for example `www.wixapis.com`
17
+ */
18
+ apiBaseUrl?: string;
19
+ /**
20
+ * Possible data to be provided by every host, for cross cutting concerns
21
+ * like internationalization, billing, etc.
22
+ */
23
+ essentials?: {
24
+ /**
25
+ * The language of the currently viewed session
26
+ */
27
+ language?: string;
28
+ /**
29
+ * The locale of the currently viewed session
30
+ */
31
+ locale?: string;
32
+ /**
33
+ * Any headers that should be passed through to the API requests
34
+ */
35
+ passThroughHeaders?: Record<string, string>;
36
+ };
37
+ };
38
+
39
+ type RESTFunctionDescriptor$2<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$2) => T;
40
+ interface HttpClient$2 {
41
+ request<TResponse, TData = any>(req: RequestOptionsFactory$2<TResponse, TData>): Promise<HttpResponse$2<TResponse>>;
4
42
  fetchWithAuth: typeof fetch;
5
43
  wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
44
+ getActiveToken?: () => string | undefined;
6
45
  }
7
- type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
8
- type HttpResponse<T = any> = {
46
+ type RequestOptionsFactory$2<TResponse = any, TData = any> = (context: any) => RequestOptions$2<TResponse, TData>;
47
+ type HttpResponse$2<T = any> = {
9
48
  data: T;
10
49
  status: number;
11
50
  statusText: string;
12
51
  headers: any;
13
52
  request?: any;
14
53
  };
15
- type RequestOptions<_TResponse = any, Data = any> = {
54
+ type RequestOptions$2<_TResponse = any, Data = any> = {
16
55
  method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
17
56
  url: string;
18
57
  data?: Data;
19
58
  params?: URLSearchParams;
20
- } & APIMetadata;
21
- type APIMetadata = {
59
+ } & APIMetadata$2;
60
+ type APIMetadata$2 = {
22
61
  methodFqn?: string;
23
62
  entityFqdn?: string;
24
63
  packageName?: string;
25
64
  };
26
- type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
27
- type EventDefinition<Payload = unknown, Type extends string = string> = {
65
+ type BuildRESTFunction$2<T extends RESTFunctionDescriptor$2> = T extends RESTFunctionDescriptor$2<infer U> ? U : never;
66
+ type EventDefinition$4<Payload = unknown, Type extends string = string> = {
28
67
  __type: 'event-definition';
29
68
  type: Type;
30
69
  isDomainEvent?: boolean;
31
70
  transformations?: (envelope: unknown) => Payload;
32
71
  __payload: Payload;
33
72
  };
34
- declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
35
- type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
36
- type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
73
+ declare function EventDefinition$4<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$4<Payload, Type>;
74
+ type EventHandler$4<T extends EventDefinition$4> = (payload: T['__payload']) => void | Promise<void>;
75
+ type BuildEventDefinition$4<T extends EventDefinition$4<any, string>> = (handler: EventHandler$4<T>) => void;
76
+
77
+ type ServicePluginMethodInput$2 = {
78
+ request: any;
79
+ metadata: any;
80
+ };
81
+ type ServicePluginContract$2 = Record<string, (payload: ServicePluginMethodInput$2) => unknown | Promise<unknown>>;
82
+ type ServicePluginMethodMetadata$2 = {
83
+ name: string;
84
+ primaryHttpMappingPath: string;
85
+ transformations: {
86
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput$2;
87
+ toREST: (...args: unknown[]) => unknown;
88
+ };
89
+ };
90
+ type ServicePluginDefinition$2<Contract extends ServicePluginContract$2> = {
91
+ __type: 'service-plugin-definition';
92
+ componentType: string;
93
+ methods: ServicePluginMethodMetadata$2[];
94
+ __contract: Contract;
95
+ };
96
+ declare function ServicePluginDefinition$2<Contract extends ServicePluginContract$2>(componentType: string, methods: ServicePluginMethodMetadata$2[]): ServicePluginDefinition$2<Contract>;
97
+ type BuildServicePluginDefinition$2<T extends ServicePluginDefinition$2<any>> = (implementation: T['__contract']) => void;
98
+ declare const SERVICE_PLUGIN_ERROR_TYPE$2 = "wix_spi_error";
99
+
100
+ type RequestContext$2 = {
101
+ isSSR: boolean;
102
+ host: string;
103
+ protocol?: string;
104
+ };
105
+ type ResponseTransformer$2 = (data: any, headers?: any) => any;
106
+ /**
107
+ * Ambassador request options types are copied mostly from AxiosRequestConfig.
108
+ * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
109
+ * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
110
+ */
111
+ type Method$2 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
112
+ type AmbassadorRequestOptions$2<T = any> = {
113
+ _?: T;
114
+ url?: string;
115
+ method?: Method$2;
116
+ params?: any;
117
+ data?: any;
118
+ transformResponse?: ResponseTransformer$2 | ResponseTransformer$2[];
119
+ };
120
+ type AmbassadorFactory$2<Request, Response> = (payload: Request) => ((context: RequestContext$2) => AmbassadorRequestOptions$2<Response>) & {
121
+ __isAmbassador: boolean;
122
+ };
123
+ type AmbassadorFunctionDescriptor$2<Request = any, Response = any> = AmbassadorFactory$2<Request, Response>;
124
+ type BuildAmbassadorFunction$2<T extends AmbassadorFunctionDescriptor$2> = T extends AmbassadorFunctionDescriptor$2<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
37
125
 
38
126
  declare global {
39
127
  // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
@@ -42,6 +130,284 @@ declare global {
42
130
  }
43
131
  }
44
132
 
133
+ declare const emptyObjectSymbol$2: unique symbol;
134
+
135
+ /**
136
+ Represents a strictly empty plain object, the `{}` value.
137
+
138
+ When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
139
+
140
+ @example
141
+ ```
142
+ import type {EmptyObject} from 'type-fest';
143
+
144
+ // The following illustrates the problem with `{}`.
145
+ const foo1: {} = {}; // Pass
146
+ const foo2: {} = []; // Pass
147
+ const foo3: {} = 42; // Pass
148
+ const foo4: {} = {a: 1}; // Pass
149
+
150
+ // With `EmptyObject` only the first case is valid.
151
+ const bar1: EmptyObject = {}; // Pass
152
+ const bar2: EmptyObject = 42; // Fail
153
+ const bar3: EmptyObject = []; // Fail
154
+ const bar4: EmptyObject = {a: 1}; // Fail
155
+ ```
156
+
157
+ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
158
+
159
+ @category Object
160
+ */
161
+ type EmptyObject$2 = {[emptyObjectSymbol$2]?: never};
162
+
163
+ /**
164
+ Returns a boolean for whether the two given types are equal.
165
+
166
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
167
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
168
+
169
+ Use-cases:
170
+ - If you want to make a conditional branch based on the result of a comparison of two types.
171
+
172
+ @example
173
+ ```
174
+ import type {IsEqual} from 'type-fest';
175
+
176
+ // This type returns a boolean for whether the given array includes the given item.
177
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
178
+ type Includes<Value extends readonly any[], Item> =
179
+ Value extends readonly [Value[0], ...infer rest]
180
+ ? IsEqual<Value[0], Item> extends true
181
+ ? true
182
+ : Includes<rest, Item>
183
+ : false;
184
+ ```
185
+
186
+ @category Type Guard
187
+ @category Utilities
188
+ */
189
+ type IsEqual$2<A, B> =
190
+ (<G>() => G extends A ? 1 : 2) extends
191
+ (<G>() => G extends B ? 1 : 2)
192
+ ? true
193
+ : false;
194
+
195
+ /**
196
+ Filter out keys from an object.
197
+
198
+ Returns `never` if `Exclude` is strictly equal to `Key`.
199
+ Returns `never` if `Key` extends `Exclude`.
200
+ Returns `Key` otherwise.
201
+
202
+ @example
203
+ ```
204
+ type Filtered = Filter<'foo', 'foo'>;
205
+ //=> never
206
+ ```
207
+
208
+ @example
209
+ ```
210
+ type Filtered = Filter<'bar', string>;
211
+ //=> never
212
+ ```
213
+
214
+ @example
215
+ ```
216
+ type Filtered = Filter<'bar', 'foo'>;
217
+ //=> 'bar'
218
+ ```
219
+
220
+ @see {Except}
221
+ */
222
+ type Filter$2<KeyType, ExcludeType> = IsEqual$2<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
223
+
224
+ type ExceptOptions$2 = {
225
+ /**
226
+ Disallow assigning non-specified properties.
227
+
228
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
229
+
230
+ @default false
231
+ */
232
+ requireExactProps?: boolean;
233
+ };
234
+
235
+ /**
236
+ Create a type from an object type without certain keys.
237
+
238
+ We recommend setting the `requireExactProps` option to `true`.
239
+
240
+ This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
241
+
242
+ This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
243
+
244
+ @example
245
+ ```
246
+ import type {Except} from 'type-fest';
247
+
248
+ type Foo = {
249
+ a: number;
250
+ b: string;
251
+ };
252
+
253
+ type FooWithoutA = Except<Foo, 'a'>;
254
+ //=> {b: string}
255
+
256
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
257
+ //=> errors: 'a' does not exist in type '{ b: string; }'
258
+
259
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
260
+ //=> {a: number} & Partial<Record<"b", never>>
261
+
262
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
263
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
264
+ ```
265
+
266
+ @category Object
267
+ */
268
+ type Except$2<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$2 = {requireExactProps: false}> = {
269
+ [KeyType in keyof ObjectType as Filter$2<KeyType, KeysType>]: ObjectType[KeyType];
270
+ } & (Options['requireExactProps'] extends true
271
+ ? Partial<Record<KeysType, never>>
272
+ : {});
273
+
274
+ /**
275
+ Extract the keys from a type where the value type of the key extends the given `Condition`.
276
+
277
+ Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
278
+
279
+ @example
280
+ ```
281
+ import type {ConditionalKeys} from 'type-fest';
282
+
283
+ interface Example {
284
+ a: string;
285
+ b: string | number;
286
+ c?: string;
287
+ d: {};
288
+ }
289
+
290
+ type StringKeysOnly = ConditionalKeys<Example, string>;
291
+ //=> 'a'
292
+ ```
293
+
294
+ To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
295
+
296
+ @example
297
+ ```
298
+ import type {ConditionalKeys} from 'type-fest';
299
+
300
+ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
301
+ //=> 'a' | 'c'
302
+ ```
303
+
304
+ @category Object
305
+ */
306
+ type ConditionalKeys$2<Base, Condition> = NonNullable<
307
+ // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
308
+ {
309
+ // Map through all the keys of the given base type.
310
+ [Key in keyof Base]:
311
+ // Pick only keys with types extending the given `Condition` type.
312
+ Base[Key] extends Condition
313
+ // Retain this key since the condition passes.
314
+ ? Key
315
+ // Discard this key since the condition fails.
316
+ : never;
317
+
318
+ // Convert the produced object into a union type of the keys which passed the conditional test.
319
+ }[keyof Base]
320
+ >;
321
+
322
+ /**
323
+ Exclude keys from a shape that matches the given `Condition`.
324
+
325
+ This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
326
+
327
+ @example
328
+ ```
329
+ import type {Primitive, ConditionalExcept} from 'type-fest';
330
+
331
+ class Awesome {
332
+ name: string;
333
+ successes: number;
334
+ failures: bigint;
335
+
336
+ run() {}
337
+ }
338
+
339
+ type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
340
+ //=> {run: () => void}
341
+ ```
342
+
343
+ @example
344
+ ```
345
+ import type {ConditionalExcept} from 'type-fest';
346
+
347
+ interface Example {
348
+ a: string;
349
+ b: string | number;
350
+ c: () => void;
351
+ d: {};
352
+ }
353
+
354
+ type NonStringKeysOnly = ConditionalExcept<Example, string>;
355
+ //=> {b: string | number; c: () => void; d: {}}
356
+ ```
357
+
358
+ @category Object
359
+ */
360
+ type ConditionalExcept$2<Base, Condition> = Except$2<
361
+ Base,
362
+ ConditionalKeys$2<Base, Condition>
363
+ >;
364
+
365
+ /**
366
+ * Descriptors are objects that describe the API of a module, and the module
367
+ * can either be a REST module or a host module.
368
+ * This type is recursive, so it can describe nested modules.
369
+ */
370
+ type Descriptors$2 = RESTFunctionDescriptor$2 | AmbassadorFunctionDescriptor$2 | HostModule$2<any, any> | EventDefinition$4<any> | ServicePluginDefinition$2<any> | {
371
+ [key: string]: Descriptors$2 | PublicMetadata$2 | any;
372
+ };
373
+ /**
374
+ * This type takes in a descriptors object of a certain Host (including an `unknown` host)
375
+ * and returns an object with the same structure, but with all descriptors replaced with their API.
376
+ * Any non-descriptor properties are removed from the returned object, including descriptors that
377
+ * do not match the given host (as they will not work with the given host).
378
+ */
379
+ type BuildDescriptors$2<T extends Descriptors$2, H extends Host$2<any> | undefined, Depth extends number = 5> = {
380
+ done: T;
381
+ recurse: T extends {
382
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE$2;
383
+ } ? never : T extends AmbassadorFunctionDescriptor$2 ? BuildAmbassadorFunction$2<T> : T extends RESTFunctionDescriptor$2 ? BuildRESTFunction$2<T> : T extends EventDefinition$4<any> ? BuildEventDefinition$4<T> : T extends ServicePluginDefinition$2<any> ? BuildServicePluginDefinition$2<T> : T extends HostModule$2<any, any> ? HostModuleAPI$2<T> : ConditionalExcept$2<{
384
+ [Key in keyof T]: T[Key] extends Descriptors$2 ? BuildDescriptors$2<T[Key], H, [
385
+ -1,
386
+ 0,
387
+ 1,
388
+ 2,
389
+ 3,
390
+ 4,
391
+ 5
392
+ ][Depth]> : never;
393
+ }, EmptyObject$2>;
394
+ }[Depth extends -1 ? 'done' : 'recurse'];
395
+ type PublicMetadata$2 = {
396
+ PACKAGE_NAME?: string;
397
+ };
398
+
399
+ declare global {
400
+ interface ContextualClient {
401
+ }
402
+ }
403
+ /**
404
+ * A type used to create concerete types from SDK descriptors in
405
+ * case a contextual client is available.
406
+ */
407
+ type MaybeContext$2<T extends Descriptors$2> = globalThis.ContextualClient extends {
408
+ host: Host$2;
409
+ } ? BuildDescriptors$2<T, globalThis.ContextualClient['host']> : T;
410
+
45
411
  /** The reservation domain object. */
46
412
  interface Reservation {
47
413
  /**
@@ -1511,7 +1877,7 @@ interface ReservationsQueryBuilder {
1511
1877
  find: () => Promise<ReservationsQueryResult>;
1512
1878
  }
1513
1879
 
1514
- declare function createReservation$1(httpClient: HttpClient): CreateReservationSignature;
1880
+ declare function createReservation$1(httpClient: HttpClient$2): CreateReservationSignature;
1515
1881
  interface CreateReservationSignature {
1516
1882
  /**
1517
1883
  * Creates a new reservation.
@@ -1541,7 +1907,7 @@ interface CreateReservationSignature {
1541
1907
  */
1542
1908
  (reservation: Reservation, options?: CreateReservationOptions | undefined): Promise<Reservation & ReservationNonNullableFields>;
1543
1909
  }
1544
- declare function getReservation$1(httpClient: HttpClient): GetReservationSignature;
1910
+ declare function getReservation$1(httpClient: HttpClient$2): GetReservationSignature;
1545
1911
  interface GetReservationSignature {
1546
1912
  /**
1547
1913
  * Retrieves a reservation.
@@ -1552,7 +1918,7 @@ interface GetReservationSignature {
1552
1918
  */
1553
1919
  (reservationId: string, options?: GetReservationOptions | undefined): Promise<Reservation & ReservationNonNullableFields>;
1554
1920
  }
1555
- declare function updateReservation$1(httpClient: HttpClient): UpdateReservationSignature;
1921
+ declare function updateReservation$1(httpClient: HttpClient$2): UpdateReservationSignature;
1556
1922
  interface UpdateReservationSignature {
1557
1923
  /**
1558
1924
  * Updates a reservation.
@@ -1567,7 +1933,7 @@ interface UpdateReservationSignature {
1567
1933
  */
1568
1934
  (_id: string | null, reservation: UpdateReservation, options?: UpdateReservationOptions | undefined): Promise<Reservation & ReservationNonNullableFields>;
1569
1935
  }
1570
- declare function updateExtendedFields$3(httpClient: HttpClient): UpdateExtendedFieldsSignature$1;
1936
+ declare function updateExtendedFields$3(httpClient: HttpClient$2): UpdateExtendedFieldsSignature$1;
1571
1937
  interface UpdateExtendedFieldsSignature$1 {
1572
1938
  /**
1573
1939
  * Updates extended fields of a reservation without incrementing revision
@@ -1576,7 +1942,7 @@ interface UpdateExtendedFieldsSignature$1 {
1576
1942
  */
1577
1943
  (_id: string, namespace: string, options: UpdateExtendedFieldsOptions$1): Promise<UpdateExtendedFieldsResponse$1 & UpdateExtendedFieldsResponseNonNullableFields$1>;
1578
1944
  }
1579
- declare function createHeldReservation$1(httpClient: HttpClient): CreateHeldReservationSignature;
1945
+ declare function createHeldReservation$1(httpClient: HttpClient$2): CreateHeldReservationSignature;
1580
1946
  interface CreateHeldReservationSignature {
1581
1947
  /**
1582
1948
  * Creates a new temporary reservation and holds it for the customer for 10 minutes.
@@ -1591,7 +1957,7 @@ interface CreateHeldReservationSignature {
1591
1957
  */
1592
1958
  (reservationDetails: HeldReservationDetails): Promise<CreateHeldReservationResponse & CreateHeldReservationResponseNonNullableFields>;
1593
1959
  }
1594
- declare function reserveReservation$1(httpClient: HttpClient): ReserveReservationSignature;
1960
+ declare function reserveReservation$1(httpClient: HttpClient$2): ReserveReservationSignature;
1595
1961
  interface ReserveReservationSignature {
1596
1962
  /**
1597
1963
  * Reserves or requests a held reservation.
@@ -1611,7 +1977,7 @@ interface ReserveReservationSignature {
1611
1977
  */
1612
1978
  (reservationId: string, reservee: Reservee, revision: string | null): Promise<ReserveReservationResponse & ReserveReservationResponseNonNullableFields>;
1613
1979
  }
1614
- declare function cancelReservation$1(httpClient: HttpClient): CancelReservationSignature;
1980
+ declare function cancelReservation$1(httpClient: HttpClient$2): CancelReservationSignature;
1615
1981
  interface CancelReservationSignature {
1616
1982
  /**
1617
1983
  * Cancels a reservation.
@@ -1625,7 +1991,7 @@ interface CancelReservationSignature {
1625
1991
  */
1626
1992
  (reservationId: string, revision: string | null, options?: CancelReservationOptions | undefined): Promise<CancelReservationResponse & CancelReservationResponseNonNullableFields>;
1627
1993
  }
1628
- declare function deleteReservation$1(httpClient: HttpClient): DeleteReservationSignature;
1994
+ declare function deleteReservation$1(httpClient: HttpClient$2): DeleteReservationSignature;
1629
1995
  interface DeleteReservationSignature {
1630
1996
  /**
1631
1997
  * Deletes a reservation. Only reservations with the `HELD` status can be deleted.
@@ -1633,7 +1999,7 @@ interface DeleteReservationSignature {
1633
1999
  */
1634
2000
  (reservationId: string): Promise<void>;
1635
2001
  }
1636
- declare function listReservations$1(httpClient: HttpClient): ListReservationsSignature;
2002
+ declare function listReservations$1(httpClient: HttpClient$2): ListReservationsSignature;
1637
2003
  interface ListReservationsSignature {
1638
2004
  /**
1639
2005
  * Retrieves a list of up to 100 reservations.
@@ -1641,7 +2007,7 @@ interface ListReservationsSignature {
1641
2007
  */
1642
2008
  (options?: ListReservationsOptions | undefined): Promise<ListReservationsResponse & ListReservationsResponseNonNullableFields>;
1643
2009
  }
1644
- declare function queryReservations$1(httpClient: HttpClient): QueryReservationsSignature;
2010
+ declare function queryReservations$1(httpClient: HttpClient$2): QueryReservationsSignature;
1645
2011
  interface QueryReservationsSignature {
1646
2012
  /**
1647
2013
  * Creates a query to retrieve a list of reservations.
@@ -1662,7 +2028,7 @@ interface QueryReservationsSignature {
1662
2028
  */
1663
2029
  (): ReservationsQueryBuilder;
1664
2030
  }
1665
- declare function searchReservations$1(httpClient: HttpClient): SearchReservationsSignature;
2031
+ declare function searchReservations$1(httpClient: HttpClient$2): SearchReservationsSignature;
1666
2032
  interface SearchReservationsSignature {
1667
2033
  /**
1668
2034
  * Use this endpoint to search the fields of the table reservations on a site for a given expression.
@@ -1673,23 +2039,41 @@ interface SearchReservationsSignature {
1673
2039
  */
1674
2040
  (search: CursorSearch): Promise<SearchReservationsResponse & SearchReservationsResponseNonNullableFields>;
1675
2041
  }
1676
- declare const onReservationCreated$1: EventDefinition<ReservationCreatedEnvelope, "wix.table_reservations.v1.reservation_created">;
1677
- declare const onReservationUpdated$1: EventDefinition<ReservationUpdatedEnvelope, "wix.table_reservations.v1.reservation_updated">;
1678
- declare const onReservationDeleted$1: EventDefinition<ReservationDeletedEnvelope, "wix.table_reservations.v1.reservation_deleted">;
2042
+ declare const onReservationCreated$1: EventDefinition$4<ReservationCreatedEnvelope, "wix.table_reservations.v1.reservation_created">;
2043
+ declare const onReservationUpdated$1: EventDefinition$4<ReservationUpdatedEnvelope, "wix.table_reservations.v1.reservation_updated">;
2044
+ declare const onReservationDeleted$1: EventDefinition$4<ReservationDeletedEnvelope, "wix.table_reservations.v1.reservation_deleted">;
1679
2045
 
1680
- declare function createEventModule$1<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
2046
+ type EventDefinition$3<Payload = unknown, Type extends string = string> = {
2047
+ __type: 'event-definition';
2048
+ type: Type;
2049
+ isDomainEvent?: boolean;
2050
+ transformations?: (envelope: unknown) => Payload;
2051
+ __payload: Payload;
2052
+ };
2053
+ declare function EventDefinition$3<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$3<Payload, Type>;
2054
+ type EventHandler$3<T extends EventDefinition$3> = (payload: T['__payload']) => void | Promise<void>;
2055
+ type BuildEventDefinition$3<T extends EventDefinition$3<any, string>> = (handler: EventHandler$3<T>) => void;
1681
2056
 
1682
- declare const createReservation: BuildRESTFunction<typeof createReservation$1> & typeof createReservation$1;
1683
- declare const getReservation: BuildRESTFunction<typeof getReservation$1> & typeof getReservation$1;
1684
- declare const updateReservation: BuildRESTFunction<typeof updateReservation$1> & typeof updateReservation$1;
1685
- declare const updateExtendedFields$2: BuildRESTFunction<typeof updateExtendedFields$3> & typeof updateExtendedFields$3;
1686
- declare const createHeldReservation: BuildRESTFunction<typeof createHeldReservation$1> & typeof createHeldReservation$1;
1687
- declare const reserveReservation: BuildRESTFunction<typeof reserveReservation$1> & typeof reserveReservation$1;
1688
- declare const cancelReservation: BuildRESTFunction<typeof cancelReservation$1> & typeof cancelReservation$1;
1689
- declare const deleteReservation: BuildRESTFunction<typeof deleteReservation$1> & typeof deleteReservation$1;
1690
- declare const listReservations: BuildRESTFunction<typeof listReservations$1> & typeof listReservations$1;
1691
- declare const queryReservations: BuildRESTFunction<typeof queryReservations$1> & typeof queryReservations$1;
1692
- declare const searchReservations: BuildRESTFunction<typeof searchReservations$1> & typeof searchReservations$1;
2057
+ declare global {
2058
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2059
+ interface SymbolConstructor {
2060
+ readonly observable: symbol;
2061
+ }
2062
+ }
2063
+
2064
+ declare function createEventModule$1<T extends EventDefinition$3<any, string>>(eventDefinition: T): BuildEventDefinition$3<T> & T;
2065
+
2066
+ declare const createReservation: MaybeContext$2<BuildRESTFunction$2<typeof createReservation$1> & typeof createReservation$1>;
2067
+ declare const getReservation: MaybeContext$2<BuildRESTFunction$2<typeof getReservation$1> & typeof getReservation$1>;
2068
+ declare const updateReservation: MaybeContext$2<BuildRESTFunction$2<typeof updateReservation$1> & typeof updateReservation$1>;
2069
+ declare const updateExtendedFields$2: MaybeContext$2<BuildRESTFunction$2<typeof updateExtendedFields$3> & typeof updateExtendedFields$3>;
2070
+ declare const createHeldReservation: MaybeContext$2<BuildRESTFunction$2<typeof createHeldReservation$1> & typeof createHeldReservation$1>;
2071
+ declare const reserveReservation: MaybeContext$2<BuildRESTFunction$2<typeof reserveReservation$1> & typeof reserveReservation$1>;
2072
+ declare const cancelReservation: MaybeContext$2<BuildRESTFunction$2<typeof cancelReservation$1> & typeof cancelReservation$1>;
2073
+ declare const deleteReservation: MaybeContext$2<BuildRESTFunction$2<typeof deleteReservation$1> & typeof deleteReservation$1>;
2074
+ declare const listReservations: MaybeContext$2<BuildRESTFunction$2<typeof listReservations$1> & typeof listReservations$1>;
2075
+ declare const queryReservations: MaybeContext$2<BuildRESTFunction$2<typeof queryReservations$1> & typeof queryReservations$1>;
2076
+ declare const searchReservations: MaybeContext$2<BuildRESTFunction$2<typeof searchReservations$1> & typeof searchReservations$1>;
1693
2077
 
1694
2078
  type _publicOnReservationCreatedType = typeof onReservationCreated$1;
1695
2079
  /**
@@ -1848,6 +2232,416 @@ declare namespace index_d$2 {
1848
2232
  export { type ActionEvent$1 as ActionEvent, type index_d$2_Aggregation as Aggregation, type index_d$2_AggregationData as AggregationData, type index_d$2_AggregationKindOneOf as AggregationKindOneOf, type index_d$2_AggregationResults as AggregationResults, type index_d$2_AggregationResultsResultOneOf as AggregationResultsResultOneOf, type index_d$2_AggregationResultsScalarResult as AggregationResultsScalarResult, index_d$2_AggregationType as AggregationType, type BaseEventMetadata$1 as BaseEventMetadata, type index_d$2_CancelReservationOptions as CancelReservationOptions, type index_d$2_CancelReservationRequest as CancelReservationRequest, type index_d$2_CancelReservationResponse as CancelReservationResponse, type index_d$2_CancelReservationResponseNonNullableFields as CancelReservationResponseNonNullableFields, type index_d$2_CreateHeldReservationRequest as CreateHeldReservationRequest, type index_d$2_CreateHeldReservationResponse as CreateHeldReservationResponse, type index_d$2_CreateHeldReservationResponseNonNullableFields as CreateHeldReservationResponseNonNullableFields, type index_d$2_CreateReservationOptions as CreateReservationOptions, type index_d$2_CreateReservationRequest as CreateReservationRequest, type index_d$2_CreateReservationResponse as CreateReservationResponse, type index_d$2_CreateReservationResponseNonNullableFields as CreateReservationResponseNonNullableFields, type CursorPaging$1 as CursorPaging, type CursorPagingMetadata$1 as CursorPagingMetadata, type index_d$2_CursorQuery as CursorQuery, type index_d$2_CursorQueryPagingMethodOneOf as CursorQueryPagingMethodOneOf, type index_d$2_CursorSearch as CursorSearch, type index_d$2_CursorSearchPagingMethodOneOf as CursorSearchPagingMethodOneOf, type Cursors$1 as Cursors, type index_d$2_DateHistogramAggregation as DateHistogramAggregation, type index_d$2_DateHistogramResult as DateHistogramResult, type index_d$2_DateHistogramResults as DateHistogramResults, type index_d$2_DeleteReservationRequest as DeleteReservationRequest, type index_d$2_DeleteReservationResponse as DeleteReservationResponse, type index_d$2_Details as Details, type DomainEvent$1 as DomainEvent, type DomainEventBodyOneOf$1 as DomainEventBodyOneOf, type Empty$1 as Empty, type EntityCreatedEvent$1 as EntityCreatedEvent, type EntityDeletedEvent$1 as EntityDeletedEvent, type EntityUpdatedEvent$1 as EntityUpdatedEvent, type EventMetadata$1 as EventMetadata, type ExtendedFields$1 as ExtendedFields, type index_d$2_GetReservationOptions as GetReservationOptions, type index_d$2_GetReservationRequest as GetReservationRequest, type index_d$2_GetReservationResponse as GetReservationResponse, type index_d$2_GetReservationResponseNonNullableFields as GetReservationResponseNonNullableFields, type index_d$2_GroupByValueResults as GroupByValueResults, type index_d$2_HeadersEntry as HeadersEntry, type index_d$2_HeldReservationDetails as HeldReservationDetails, type IdentificationData$1 as IdentificationData, type IdentificationDataIdOneOf$1 as IdentificationDataIdOneOf, type index_d$2_IncludeMissingValuesOptions as IncludeMissingValuesOptions, index_d$2_Interval as Interval, type index_d$2_ListReservationsOptions as ListReservationsOptions, type index_d$2_ListReservationsRequest as ListReservationsRequest, type index_d$2_ListReservationsResponse as ListReservationsResponse, type index_d$2_ListReservationsResponseNonNullableFields as ListReservationsResponseNonNullableFields, type MessageEnvelope$1 as MessageEnvelope, type index_d$2_MigrationNote as MigrationNote, index_d$2_MissingValues as MissingValues, Mode$1 as Mode, type index_d$2_NestedAggregation as NestedAggregation, type index_d$2_NestedAggregationItem as NestedAggregationItem, type index_d$2_NestedAggregationItemKindOneOf as NestedAggregationItemKindOneOf, type index_d$2_NestedAggregationResults as NestedAggregationResults, type index_d$2_NestedAggregationResultsResultOneOf as NestedAggregationResultsResultOneOf, index_d$2_NestedAggregationType as NestedAggregationType, type index_d$2_NestedResultValue as NestedResultValue, type index_d$2_NestedResultValueResultOneOf as NestedResultValueResultOneOf, type index_d$2_NestedResults as NestedResults, type index_d$2_NestedValueAggregationResult as NestedValueAggregationResult, type index_d$2_PathParametersEntry as PathParametersEntry, index_d$2_PaymentStatus as PaymentStatus, type index_d$2_QueryParametersEntry as QueryParametersEntry, type index_d$2_QueryReservationsRequest as QueryReservationsRequest, type index_d$2_QueryReservationsResponse as QueryReservationsResponse, type index_d$2_QueryReservationsResponseNonNullableFields as QueryReservationsResponseNonNullableFields, type index_d$2_RangeAggregation as RangeAggregation, type index_d$2_RangeAggregationResult as RangeAggregationResult, type index_d$2_RangeBucket as RangeBucket, type index_d$2_RangeResult as RangeResult, type index_d$2_RangeResults as RangeResults, type index_d$2_RawHttpRequest as RawHttpRequest, type index_d$2_RawHttpResponse as RawHttpResponse, type index_d$2_RemoveReservationMigrationNotesRequest as RemoveReservationMigrationNotesRequest, type index_d$2_RemoveReservationMigrationNotesResponse as RemoveReservationMigrationNotesResponse, type index_d$2_Reservation as Reservation, type index_d$2_ReservationCanceled as ReservationCanceled, type index_d$2_ReservationCreated as ReservationCreated, type index_d$2_ReservationCreatedEnvelope as ReservationCreatedEnvelope, type index_d$2_ReservationDelayedDomainEvent as ReservationDelayedDomainEvent, type index_d$2_ReservationDelayedDomainEventBodyTypeOneOf as ReservationDelayedDomainEventBodyTypeOneOf, type index_d$2_ReservationDelayedDomainEventReservationCanceled as ReservationDelayedDomainEventReservationCanceled, type index_d$2_ReservationDeletedEnvelope as ReservationDeletedEnvelope, type index_d$2_ReservationDetailsConflicts as ReservationDetailsConflicts, type ReservationLocationConflict$1 as ReservationLocationConflict, type index_d$2_ReservationNonNullableFields as ReservationNonNullableFields, type index_d$2_ReservationUpdated as ReservationUpdated, type index_d$2_ReservationUpdatedEnvelope as ReservationUpdatedEnvelope, type index_d$2_ReservationsQueryBuilder as ReservationsQueryBuilder, type index_d$2_ReservationsQueryResult as ReservationsQueryResult, type index_d$2_ReserveReservationRequest as ReserveReservationRequest, type index_d$2_ReserveReservationResponse as ReserveReservationResponse, type index_d$2_ReserveReservationResponseNonNullableFields as ReserveReservationResponseNonNullableFields, type index_d$2_ReservedBy as ReservedBy, type index_d$2_Reservee as Reservee, type RestoreInfo$1 as RestoreInfo, type index_d$2_Results as Results, type index_d$2_ScalarAggregation as ScalarAggregation, type index_d$2_ScalarResult as ScalarResult, index_d$2_ScalarType as ScalarType, type index_d$2_SearchDetails as SearchDetails, type index_d$2_SearchReservationsRequest as SearchReservationsRequest, type index_d$2_SearchReservationsResponse as SearchReservationsResponse, type index_d$2_SearchReservationsResponseNonNullableFields as SearchReservationsResponseNonNullableFields, Set$1 as Set, index_d$2_SortDirection as SortDirection, SortOrder$1 as SortOrder, index_d$2_SortType as SortType, type Sorting$1 as Sorting, index_d$2_Source as Source, Status$1 as Status, type TableCombinationConflict$1 as TableCombinationConflict, TableCombinationConflictType$1 as TableCombinationConflictType, type index_d$2_TableWithReservationConflicts as TableWithReservationConflicts, type index_d$2_Tables as Tables, Type$1 as Type, type UpdateExtendedFieldsOptions$1 as UpdateExtendedFieldsOptions, type UpdateExtendedFieldsRequest$1 as UpdateExtendedFieldsRequest, type UpdateExtendedFieldsResponse$1 as UpdateExtendedFieldsResponse, type UpdateExtendedFieldsResponseNonNullableFields$1 as UpdateExtendedFieldsResponseNonNullableFields, type index_d$2_UpdateReservation as UpdateReservation, type index_d$2_UpdateReservationOptions as UpdateReservationOptions, type index_d$2_UpdateReservationRequest as UpdateReservationRequest, type index_d$2_UpdateReservationResponse as UpdateReservationResponse, type index_d$2_UpdateReservationResponseNonNullableFields as UpdateReservationResponseNonNullableFields, type index_d$2_ValueAggregation as ValueAggregation, type index_d$2_ValueAggregationOptionsOneOf as ValueAggregationOptionsOneOf, type index_d$2_ValueAggregationResult as ValueAggregationResult, type index_d$2_ValueResult as ValueResult, type index_d$2_ValueResults as ValueResults, WebhookIdentityType$1 as WebhookIdentityType, type index_d$2__publicOnReservationCreatedType as _publicOnReservationCreatedType, type index_d$2__publicOnReservationDeletedType as _publicOnReservationDeletedType, type index_d$2__publicOnReservationUpdatedType as _publicOnReservationUpdatedType, index_d$2_cancelReservation as cancelReservation, index_d$2_createHeldReservation as createHeldReservation, index_d$2_createReservation as createReservation, index_d$2_deleteReservation as deleteReservation, index_d$2_getReservation as getReservation, index_d$2_listReservations as listReservations, index_d$2_onReservationCreated as onReservationCreated, index_d$2_onReservationDeleted as onReservationDeleted, index_d$2_onReservationUpdated as onReservationUpdated, onReservationCreated$1 as publicOnReservationCreated, onReservationDeleted$1 as publicOnReservationDeleted, onReservationUpdated$1 as publicOnReservationUpdated, index_d$2_queryReservations as queryReservations, index_d$2_reserveReservation as reserveReservation, index_d$2_searchReservations as searchReservations, updateExtendedFields$2 as updateExtendedFields, index_d$2_updateReservation as updateReservation };
1849
2233
  }
1850
2234
 
2235
+ type HostModule$1<T, H extends Host$1> = {
2236
+ __type: 'host';
2237
+ create(host: H): T;
2238
+ };
2239
+ type HostModuleAPI$1<T extends HostModule$1<any, any>> = T extends HostModule$1<infer U, any> ? U : never;
2240
+ type Host$1<Environment = unknown> = {
2241
+ channel: {
2242
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
2243
+ disconnect: () => void;
2244
+ } | Promise<{
2245
+ disconnect: () => void;
2246
+ }>;
2247
+ };
2248
+ environment?: Environment;
2249
+ /**
2250
+ * Optional bast url to use for API requests, for example `www.wixapis.com`
2251
+ */
2252
+ apiBaseUrl?: string;
2253
+ /**
2254
+ * Possible data to be provided by every host, for cross cutting concerns
2255
+ * like internationalization, billing, etc.
2256
+ */
2257
+ essentials?: {
2258
+ /**
2259
+ * The language of the currently viewed session
2260
+ */
2261
+ language?: string;
2262
+ /**
2263
+ * The locale of the currently viewed session
2264
+ */
2265
+ locale?: string;
2266
+ /**
2267
+ * Any headers that should be passed through to the API requests
2268
+ */
2269
+ passThroughHeaders?: Record<string, string>;
2270
+ };
2271
+ };
2272
+
2273
+ type RESTFunctionDescriptor$1<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient$1) => T;
2274
+ interface HttpClient$1 {
2275
+ request<TResponse, TData = any>(req: RequestOptionsFactory$1<TResponse, TData>): Promise<HttpResponse$1<TResponse>>;
2276
+ fetchWithAuth: typeof fetch;
2277
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
2278
+ getActiveToken?: () => string | undefined;
2279
+ }
2280
+ type RequestOptionsFactory$1<TResponse = any, TData = any> = (context: any) => RequestOptions$1<TResponse, TData>;
2281
+ type HttpResponse$1<T = any> = {
2282
+ data: T;
2283
+ status: number;
2284
+ statusText: string;
2285
+ headers: any;
2286
+ request?: any;
2287
+ };
2288
+ type RequestOptions$1<_TResponse = any, Data = any> = {
2289
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
2290
+ url: string;
2291
+ data?: Data;
2292
+ params?: URLSearchParams;
2293
+ } & APIMetadata$1;
2294
+ type APIMetadata$1 = {
2295
+ methodFqn?: string;
2296
+ entityFqdn?: string;
2297
+ packageName?: string;
2298
+ };
2299
+ type BuildRESTFunction$1<T extends RESTFunctionDescriptor$1> = T extends RESTFunctionDescriptor$1<infer U> ? U : never;
2300
+ type EventDefinition$2<Payload = unknown, Type extends string = string> = {
2301
+ __type: 'event-definition';
2302
+ type: Type;
2303
+ isDomainEvent?: boolean;
2304
+ transformations?: (envelope: unknown) => Payload;
2305
+ __payload: Payload;
2306
+ };
2307
+ declare function EventDefinition$2<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$2<Payload, Type>;
2308
+ type EventHandler$2<T extends EventDefinition$2> = (payload: T['__payload']) => void | Promise<void>;
2309
+ type BuildEventDefinition$2<T extends EventDefinition$2<any, string>> = (handler: EventHandler$2<T>) => void;
2310
+
2311
+ type ServicePluginMethodInput$1 = {
2312
+ request: any;
2313
+ metadata: any;
2314
+ };
2315
+ type ServicePluginContract$1 = Record<string, (payload: ServicePluginMethodInput$1) => unknown | Promise<unknown>>;
2316
+ type ServicePluginMethodMetadata$1 = {
2317
+ name: string;
2318
+ primaryHttpMappingPath: string;
2319
+ transformations: {
2320
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput$1;
2321
+ toREST: (...args: unknown[]) => unknown;
2322
+ };
2323
+ };
2324
+ type ServicePluginDefinition$1<Contract extends ServicePluginContract$1> = {
2325
+ __type: 'service-plugin-definition';
2326
+ componentType: string;
2327
+ methods: ServicePluginMethodMetadata$1[];
2328
+ __contract: Contract;
2329
+ };
2330
+ declare function ServicePluginDefinition$1<Contract extends ServicePluginContract$1>(componentType: string, methods: ServicePluginMethodMetadata$1[]): ServicePluginDefinition$1<Contract>;
2331
+ type BuildServicePluginDefinition$1<T extends ServicePluginDefinition$1<any>> = (implementation: T['__contract']) => void;
2332
+ declare const SERVICE_PLUGIN_ERROR_TYPE$1 = "wix_spi_error";
2333
+
2334
+ type RequestContext$1 = {
2335
+ isSSR: boolean;
2336
+ host: string;
2337
+ protocol?: string;
2338
+ };
2339
+ type ResponseTransformer$1 = (data: any, headers?: any) => any;
2340
+ /**
2341
+ * Ambassador request options types are copied mostly from AxiosRequestConfig.
2342
+ * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
2343
+ * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
2344
+ */
2345
+ type Method$1 = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
2346
+ type AmbassadorRequestOptions$1<T = any> = {
2347
+ _?: T;
2348
+ url?: string;
2349
+ method?: Method$1;
2350
+ params?: any;
2351
+ data?: any;
2352
+ transformResponse?: ResponseTransformer$1 | ResponseTransformer$1[];
2353
+ };
2354
+ type AmbassadorFactory$1<Request, Response> = (payload: Request) => ((context: RequestContext$1) => AmbassadorRequestOptions$1<Response>) & {
2355
+ __isAmbassador: boolean;
2356
+ };
2357
+ type AmbassadorFunctionDescriptor$1<Request = any, Response = any> = AmbassadorFactory$1<Request, Response>;
2358
+ type BuildAmbassadorFunction$1<T extends AmbassadorFunctionDescriptor$1> = T extends AmbassadorFunctionDescriptor$1<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
2359
+
2360
+ declare global {
2361
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
2362
+ interface SymbolConstructor {
2363
+ readonly observable: symbol;
2364
+ }
2365
+ }
2366
+
2367
+ declare const emptyObjectSymbol$1: unique symbol;
2368
+
2369
+ /**
2370
+ Represents a strictly empty plain object, the `{}` value.
2371
+
2372
+ When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
2373
+
2374
+ @example
2375
+ ```
2376
+ import type {EmptyObject} from 'type-fest';
2377
+
2378
+ // The following illustrates the problem with `{}`.
2379
+ const foo1: {} = {}; // Pass
2380
+ const foo2: {} = []; // Pass
2381
+ const foo3: {} = 42; // Pass
2382
+ const foo4: {} = {a: 1}; // Pass
2383
+
2384
+ // With `EmptyObject` only the first case is valid.
2385
+ const bar1: EmptyObject = {}; // Pass
2386
+ const bar2: EmptyObject = 42; // Fail
2387
+ const bar3: EmptyObject = []; // Fail
2388
+ const bar4: EmptyObject = {a: 1}; // Fail
2389
+ ```
2390
+
2391
+ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
2392
+
2393
+ @category Object
2394
+ */
2395
+ type EmptyObject$1 = {[emptyObjectSymbol$1]?: never};
2396
+
2397
+ /**
2398
+ Returns a boolean for whether the two given types are equal.
2399
+
2400
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
2401
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
2402
+
2403
+ Use-cases:
2404
+ - If you want to make a conditional branch based on the result of a comparison of two types.
2405
+
2406
+ @example
2407
+ ```
2408
+ import type {IsEqual} from 'type-fest';
2409
+
2410
+ // This type returns a boolean for whether the given array includes the given item.
2411
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
2412
+ type Includes<Value extends readonly any[], Item> =
2413
+ Value extends readonly [Value[0], ...infer rest]
2414
+ ? IsEqual<Value[0], Item> extends true
2415
+ ? true
2416
+ : Includes<rest, Item>
2417
+ : false;
2418
+ ```
2419
+
2420
+ @category Type Guard
2421
+ @category Utilities
2422
+ */
2423
+ type IsEqual$1<A, B> =
2424
+ (<G>() => G extends A ? 1 : 2) extends
2425
+ (<G>() => G extends B ? 1 : 2)
2426
+ ? true
2427
+ : false;
2428
+
2429
+ /**
2430
+ Filter out keys from an object.
2431
+
2432
+ Returns `never` if `Exclude` is strictly equal to `Key`.
2433
+ Returns `never` if `Key` extends `Exclude`.
2434
+ Returns `Key` otherwise.
2435
+
2436
+ @example
2437
+ ```
2438
+ type Filtered = Filter<'foo', 'foo'>;
2439
+ //=> never
2440
+ ```
2441
+
2442
+ @example
2443
+ ```
2444
+ type Filtered = Filter<'bar', string>;
2445
+ //=> never
2446
+ ```
2447
+
2448
+ @example
2449
+ ```
2450
+ type Filtered = Filter<'bar', 'foo'>;
2451
+ //=> 'bar'
2452
+ ```
2453
+
2454
+ @see {Except}
2455
+ */
2456
+ type Filter$1<KeyType, ExcludeType> = IsEqual$1<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
2457
+
2458
+ type ExceptOptions$1 = {
2459
+ /**
2460
+ Disallow assigning non-specified properties.
2461
+
2462
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
2463
+
2464
+ @default false
2465
+ */
2466
+ requireExactProps?: boolean;
2467
+ };
2468
+
2469
+ /**
2470
+ Create a type from an object type without certain keys.
2471
+
2472
+ We recommend setting the `requireExactProps` option to `true`.
2473
+
2474
+ This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
2475
+
2476
+ This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
2477
+
2478
+ @example
2479
+ ```
2480
+ import type {Except} from 'type-fest';
2481
+
2482
+ type Foo = {
2483
+ a: number;
2484
+ b: string;
2485
+ };
2486
+
2487
+ type FooWithoutA = Except<Foo, 'a'>;
2488
+ //=> {b: string}
2489
+
2490
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
2491
+ //=> errors: 'a' does not exist in type '{ b: string; }'
2492
+
2493
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
2494
+ //=> {a: number} & Partial<Record<"b", never>>
2495
+
2496
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
2497
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
2498
+ ```
2499
+
2500
+ @category Object
2501
+ */
2502
+ type Except$1<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions$1 = {requireExactProps: false}> = {
2503
+ [KeyType in keyof ObjectType as Filter$1<KeyType, KeysType>]: ObjectType[KeyType];
2504
+ } & (Options['requireExactProps'] extends true
2505
+ ? Partial<Record<KeysType, never>>
2506
+ : {});
2507
+
2508
+ /**
2509
+ Extract the keys from a type where the value type of the key extends the given `Condition`.
2510
+
2511
+ Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
2512
+
2513
+ @example
2514
+ ```
2515
+ import type {ConditionalKeys} from 'type-fest';
2516
+
2517
+ interface Example {
2518
+ a: string;
2519
+ b: string | number;
2520
+ c?: string;
2521
+ d: {};
2522
+ }
2523
+
2524
+ type StringKeysOnly = ConditionalKeys<Example, string>;
2525
+ //=> 'a'
2526
+ ```
2527
+
2528
+ To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
2529
+
2530
+ @example
2531
+ ```
2532
+ import type {ConditionalKeys} from 'type-fest';
2533
+
2534
+ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
2535
+ //=> 'a' | 'c'
2536
+ ```
2537
+
2538
+ @category Object
2539
+ */
2540
+ type ConditionalKeys$1<Base, Condition> = NonNullable<
2541
+ // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
2542
+ {
2543
+ // Map through all the keys of the given base type.
2544
+ [Key in keyof Base]:
2545
+ // Pick only keys with types extending the given `Condition` type.
2546
+ Base[Key] extends Condition
2547
+ // Retain this key since the condition passes.
2548
+ ? Key
2549
+ // Discard this key since the condition fails.
2550
+ : never;
2551
+
2552
+ // Convert the produced object into a union type of the keys which passed the conditional test.
2553
+ }[keyof Base]
2554
+ >;
2555
+
2556
+ /**
2557
+ Exclude keys from a shape that matches the given `Condition`.
2558
+
2559
+ This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
2560
+
2561
+ @example
2562
+ ```
2563
+ import type {Primitive, ConditionalExcept} from 'type-fest';
2564
+
2565
+ class Awesome {
2566
+ name: string;
2567
+ successes: number;
2568
+ failures: bigint;
2569
+
2570
+ run() {}
2571
+ }
2572
+
2573
+ type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
2574
+ //=> {run: () => void}
2575
+ ```
2576
+
2577
+ @example
2578
+ ```
2579
+ import type {ConditionalExcept} from 'type-fest';
2580
+
2581
+ interface Example {
2582
+ a: string;
2583
+ b: string | number;
2584
+ c: () => void;
2585
+ d: {};
2586
+ }
2587
+
2588
+ type NonStringKeysOnly = ConditionalExcept<Example, string>;
2589
+ //=> {b: string | number; c: () => void; d: {}}
2590
+ ```
2591
+
2592
+ @category Object
2593
+ */
2594
+ type ConditionalExcept$1<Base, Condition> = Except$1<
2595
+ Base,
2596
+ ConditionalKeys$1<Base, Condition>
2597
+ >;
2598
+
2599
+ /**
2600
+ * Descriptors are objects that describe the API of a module, and the module
2601
+ * can either be a REST module or a host module.
2602
+ * This type is recursive, so it can describe nested modules.
2603
+ */
2604
+ type Descriptors$1 = RESTFunctionDescriptor$1 | AmbassadorFunctionDescriptor$1 | HostModule$1<any, any> | EventDefinition$2<any> | ServicePluginDefinition$1<any> | {
2605
+ [key: string]: Descriptors$1 | PublicMetadata$1 | any;
2606
+ };
2607
+ /**
2608
+ * This type takes in a descriptors object of a certain Host (including an `unknown` host)
2609
+ * and returns an object with the same structure, but with all descriptors replaced with their API.
2610
+ * Any non-descriptor properties are removed from the returned object, including descriptors that
2611
+ * do not match the given host (as they will not work with the given host).
2612
+ */
2613
+ type BuildDescriptors$1<T extends Descriptors$1, H extends Host$1<any> | undefined, Depth extends number = 5> = {
2614
+ done: T;
2615
+ recurse: T extends {
2616
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE$1;
2617
+ } ? never : T extends AmbassadorFunctionDescriptor$1 ? BuildAmbassadorFunction$1<T> : T extends RESTFunctionDescriptor$1 ? BuildRESTFunction$1<T> : T extends EventDefinition$2<any> ? BuildEventDefinition$2<T> : T extends ServicePluginDefinition$1<any> ? BuildServicePluginDefinition$1<T> : T extends HostModule$1<any, any> ? HostModuleAPI$1<T> : ConditionalExcept$1<{
2618
+ [Key in keyof T]: T[Key] extends Descriptors$1 ? BuildDescriptors$1<T[Key], H, [
2619
+ -1,
2620
+ 0,
2621
+ 1,
2622
+ 2,
2623
+ 3,
2624
+ 4,
2625
+ 5
2626
+ ][Depth]> : never;
2627
+ }, EmptyObject$1>;
2628
+ }[Depth extends -1 ? 'done' : 'recurse'];
2629
+ type PublicMetadata$1 = {
2630
+ PACKAGE_NAME?: string;
2631
+ };
2632
+
2633
+ declare global {
2634
+ interface ContextualClient {
2635
+ }
2636
+ }
2637
+ /**
2638
+ * A type used to create concerete types from SDK descriptors in
2639
+ * case a contextual client is available.
2640
+ */
2641
+ type MaybeContext$1<T extends Descriptors$1> = globalThis.ContextualClient extends {
2642
+ host: Host$1;
2643
+ } ? BuildDescriptors$1<T, globalThis.ContextualClient['host']> : T;
2644
+
1851
2645
  interface ReservationLocation {
1852
2646
  /**
1853
2647
  * Reservation location ID.
@@ -4126,7 +4920,7 @@ interface ListReservationLocationsOptions {
4126
4920
  fieldsets?: Set[];
4127
4921
  }
4128
4922
 
4129
- declare function getReservationLocation$1(httpClient: HttpClient): GetReservationLocationSignature;
4923
+ declare function getReservationLocation$1(httpClient: HttpClient$1): GetReservationLocationSignature;
4130
4924
  interface GetReservationLocationSignature {
4131
4925
  /**
4132
4926
  * Retrieves a reservation location by ID.
@@ -4138,7 +4932,7 @@ interface GetReservationLocationSignature {
4138
4932
  */
4139
4933
  (reservationLocationId: string, options?: GetReservationLocationOptions | undefined): Promise<ReservationLocation & ReservationLocationNonNullableFields>;
4140
4934
  }
4141
- declare function updateReservationLocation$1(httpClient: HttpClient): UpdateReservationLocationSignature;
4935
+ declare function updateReservationLocation$1(httpClient: HttpClient$1): UpdateReservationLocationSignature;
4142
4936
  interface UpdateReservationLocationSignature {
4143
4937
  /**
4144
4938
  * Updates a reservation location. Supports partial updates.
@@ -4152,7 +4946,7 @@ interface UpdateReservationLocationSignature {
4152
4946
  */
4153
4947
  (_id: string | null, reservationLocation: UpdateReservationLocation): Promise<ReservationLocation & ReservationLocationNonNullableFields>;
4154
4948
  }
4155
- declare function updateExtendedFields$1(httpClient: HttpClient): UpdateExtendedFieldsSignature;
4949
+ declare function updateExtendedFields$1(httpClient: HttpClient$1): UpdateExtendedFieldsSignature;
4156
4950
  interface UpdateExtendedFieldsSignature {
4157
4951
  /**
4158
4952
  * Updates extended fields of a reservation location without incrementing revision
@@ -4161,7 +4955,7 @@ interface UpdateExtendedFieldsSignature {
4161
4955
  */
4162
4956
  (_id: string, namespace: string, options: UpdateExtendedFieldsOptions): Promise<UpdateExtendedFieldsResponse & UpdateExtendedFieldsResponseNonNullableFields>;
4163
4957
  }
4164
- declare function queryReservationLocations$1(httpClient: HttpClient): QueryReservationLocationsSignature;
4958
+ declare function queryReservationLocations$1(httpClient: HttpClient$1): QueryReservationLocationsSignature;
4165
4959
  interface QueryReservationLocationsSignature {
4166
4960
  /**
4167
4961
  * Creates a query to retrieve a list of reservation locations.
@@ -4184,7 +4978,7 @@ interface QueryReservationLocationsSignature {
4184
4978
  */
4185
4979
  (options?: QueryReservationLocationsOptions | undefined): ReservationLocationsQueryBuilder;
4186
4980
  }
4187
- declare function listReservationLocations$1(httpClient: HttpClient): ListReservationLocationsSignature;
4981
+ declare function listReservationLocations$1(httpClient: HttpClient$1): ListReservationLocationsSignature;
4188
4982
  interface ListReservationLocationsSignature {
4189
4983
  /**
4190
4984
  * Retrieves a list of up to 100 reservation locations.
@@ -4194,16 +4988,34 @@ interface ListReservationLocationsSignature {
4194
4988
  */
4195
4989
  (options?: ListReservationLocationsOptions | undefined): Promise<ListReservationLocationsResponse & ListReservationLocationsResponseNonNullableFields>;
4196
4990
  }
4197
- declare const onReservationLocationUpdated$1: EventDefinition<ReservationLocationUpdatedEnvelope, "wix.table_reservations.v1.reservation_location_updated">;
4198
- declare const onReservationLocationCreated$1: EventDefinition<ReservationLocationCreatedEnvelope, "wix.table_reservations.v1.reservation_location_created">;
4991
+ declare const onReservationLocationUpdated$1: EventDefinition$2<ReservationLocationUpdatedEnvelope, "wix.table_reservations.v1.reservation_location_updated">;
4992
+ declare const onReservationLocationCreated$1: EventDefinition$2<ReservationLocationCreatedEnvelope, "wix.table_reservations.v1.reservation_location_created">;
4993
+
4994
+ type EventDefinition$1<Payload = unknown, Type extends string = string> = {
4995
+ __type: 'event-definition';
4996
+ type: Type;
4997
+ isDomainEvent?: boolean;
4998
+ transformations?: (envelope: unknown) => Payload;
4999
+ __payload: Payload;
5000
+ };
5001
+ declare function EventDefinition$1<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition$1<Payload, Type>;
5002
+ type EventHandler$1<T extends EventDefinition$1> = (payload: T['__payload']) => void | Promise<void>;
5003
+ type BuildEventDefinition$1<T extends EventDefinition$1<any, string>> = (handler: EventHandler$1<T>) => void;
5004
+
5005
+ declare global {
5006
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
5007
+ interface SymbolConstructor {
5008
+ readonly observable: symbol;
5009
+ }
5010
+ }
4199
5011
 
4200
- declare function createEventModule<T extends EventDefinition<any, string>>(eventDefinition: T): BuildEventDefinition<T> & T;
5012
+ declare function createEventModule<T extends EventDefinition$1<any, string>>(eventDefinition: T): BuildEventDefinition$1<T> & T;
4201
5013
 
4202
- declare const getReservationLocation: BuildRESTFunction<typeof getReservationLocation$1> & typeof getReservationLocation$1;
4203
- declare const updateReservationLocation: BuildRESTFunction<typeof updateReservationLocation$1> & typeof updateReservationLocation$1;
4204
- declare const updateExtendedFields: BuildRESTFunction<typeof updateExtendedFields$1> & typeof updateExtendedFields$1;
4205
- declare const queryReservationLocations: BuildRESTFunction<typeof queryReservationLocations$1> & typeof queryReservationLocations$1;
4206
- declare const listReservationLocations: BuildRESTFunction<typeof listReservationLocations$1> & typeof listReservationLocations$1;
5014
+ declare const getReservationLocation: MaybeContext$1<BuildRESTFunction$1<typeof getReservationLocation$1> & typeof getReservationLocation$1>;
5015
+ declare const updateReservationLocation: MaybeContext$1<BuildRESTFunction$1<typeof updateReservationLocation$1> & typeof updateReservationLocation$1>;
5016
+ declare const updateExtendedFields: MaybeContext$1<BuildRESTFunction$1<typeof updateExtendedFields$1> & typeof updateExtendedFields$1>;
5017
+ declare const queryReservationLocations: MaybeContext$1<BuildRESTFunction$1<typeof queryReservationLocations$1> & typeof queryReservationLocations$1>;
5018
+ declare const listReservationLocations: MaybeContext$1<BuildRESTFunction$1<typeof listReservationLocations$1> & typeof listReservationLocations$1>;
4207
5019
 
4208
5020
  type _publicOnReservationLocationUpdatedType = typeof onReservationLocationUpdated$1;
4209
5021
  /**
@@ -4437,6 +5249,416 @@ declare namespace index_d$1 {
4437
5249
  export { type index_d$1_ActionEvent as ActionEvent, type index_d$1_Address as Address, type index_d$1_AddressHint as AddressHint, type index_d$1_AddressLocation as AddressLocation, type index_d$1_App as App, type index_d$1_Approval as Approval, index_d$1_ApprovalMode as ApprovalMode, type index_d$1_ApprovalOptionsOneOf as ApprovalOptionsOneOf, type index_d$1_Asset as Asset, type index_d$1_AssignedFromFloatingReason as AssignedFromFloatingReason, type index_d$1_BaseEventMetadata as BaseEventMetadata, type index_d$1_BooleanFeature as BooleanFeature, type index_d$1_BusinessSchedule as BusinessSchedule, type index_d$1_CancelRequestedReason as CancelRequestedReason, type index_d$1_Categories as Categories, type index_d$1_ChangeContext as ChangeContext, type index_d$1_ChangeContextPayloadOneOf as ChangeContextPayloadOneOf, type index_d$1_CheckReservationLocationsCreatedRequest as CheckReservationLocationsCreatedRequest, type index_d$1_CheckReservationLocationsCreatedResponse as CheckReservationLocationsCreatedResponse, type index_d$1_CommonBusinessSchedule as CommonBusinessSchedule, index_d$1_CommonDayOfWeek as CommonDayOfWeek, type index_d$1_CommonSpecialHourPeriod as CommonSpecialHourPeriod, type index_d$1_CommonTimePeriod as CommonTimePeriod, type index_d$1_Configuration as Configuration, type index_d$1_ConsentPolicy as ConsentPolicy, type index_d$1_ContractSwitchedReason as ContractSwitchedReason, type index_d$1_CursorPaging as CursorPaging, type index_d$1_CursorPagingMetadata as CursorPagingMetadata, type index_d$1_Cursors as Cursors, type index_d$1_CustomFieldDefinition as CustomFieldDefinition, index_d$1_DayOfWeek as DayOfWeek, type index_d$1_DeleteContext as DeleteContext, type index_d$1_DeleteOrphanReservationLocationRequest as DeleteOrphanReservationLocationRequest, type index_d$1_DeleteOrphanReservationLocationResponse as DeleteOrphanReservationLocationResponse, index_d$1_DeleteStatus as DeleteStatus, type index_d$1_DomainEvent as DomainEvent, type index_d$1_DomainEventBodyOneOf as DomainEventBodyOneOf, type index_d$1_EmailMarketingCheckbox as EmailMarketingCheckbox, type index_d$1_Empty as Empty, type index_d$1_EntityCreatedEvent as EntityCreatedEvent, type index_d$1_EntityDeletedEvent as EntityDeletedEvent, type index_d$1_EntityUpdatedEvent as EntityUpdatedEvent, type index_d$1_EventMetadata as EventMetadata, type index_d$1_ExtendedFields as ExtendedFields, type index_d$1_Feature as Feature, type index_d$1_FeatureCancelled as FeatureCancelled, type index_d$1_FeatureCancelledReasonOneOf as FeatureCancelledReasonOneOf, type index_d$1_FeatureContext as FeatureContext, type index_d$1_FeatureDisabled as FeatureDisabled, type index_d$1_FeatureDisabledReasonOneOf as FeatureDisabledReasonOneOf, type index_d$1_FeatureEnabled as FeatureEnabled, type index_d$1_FeatureEnabledReasonOneOf as FeatureEnabledReasonOneOf, type index_d$1_FeatureEvent as FeatureEvent, type index_d$1_FeatureEventEventOneOf as FeatureEventEventOneOf, index_d$1_FeaturePeriod as FeaturePeriod, type index_d$1_FeatureQuantityInfoOneOf as FeatureQuantityInfoOneOf, type index_d$1_FeatureUpdated as FeatureUpdated, type index_d$1_FeatureUpdatedPreviousQuantityInfoOneOf as FeatureUpdatedPreviousQuantityInfoOneOf, type index_d$1_FeatureUpdatedReasonOneOf as FeatureUpdatedReasonOneOf, index_d$1_FieldType as FieldType, type index_d$1_File as File, type index_d$1_GeoCoordinates as GeoCoordinates, type index_d$1_GetReservationLocationOptions as GetReservationLocationOptions, type index_d$1_GetReservationLocationRequest as GetReservationLocationRequest, type index_d$1_GetReservationLocationResponse as GetReservationLocationResponse, type index_d$1_GetReservationLocationResponseNonNullableFields as GetReservationLocationResponseNonNullableFields, type index_d$1_IdentificationData as IdentificationData, type index_d$1_IdentificationDataIdOneOf as IdentificationDataIdOneOf, type index_d$1_InvalidateCache as InvalidateCache, type index_d$1_InvalidateCacheGetByOneOf as InvalidateCacheGetByOneOf, type index_d$1_ListReservationLocationsOptions as ListReservationLocationsOptions, type index_d$1_ListReservationLocationsRequest as ListReservationLocationsRequest, type index_d$1_ListReservationLocationsResponse as ListReservationLocationsResponse, type index_d$1_ListReservationLocationsResponseNonNullableFields as ListReservationLocationsResponseNonNullableFields, type index_d$1_Locale as Locale, type index_d$1_Location as Location, type index_d$1_LocationAddress as LocationAddress, type index_d$1_ManualApproval as ManualApproval, type index_d$1_ManualApprovalValueOneOf as ManualApprovalValueOneOf, type index_d$1_ManualFeatureCreationReason as ManualFeatureCreationReason, type index_d$1_ManualForLargePartiesOptions as ManualForLargePartiesOptions, type index_d$1_MessageEnvelope as MessageEnvelope, type index_d$1_MetaSiteSpecialEvent as MetaSiteSpecialEvent, type index_d$1_MetaSiteSpecialEventPayloadOneOf as MetaSiteSpecialEventPayloadOneOf, type index_d$1_MigrateOldRestaurantSettingsRequest as MigrateOldRestaurantSettingsRequest, type index_d$1_MigrateOldRestaurantSettingsResponse as MigrateOldRestaurantSettingsResponse, type index_d$1_MigratedFromLegacyReason as MigratedFromLegacyReason, type index_d$1_MigrationParsingError as MigrationParsingError, type index_d$1_MigrationResult as MigrationResult, index_d$1_Mode as Mode, type index_d$1_Multilingual as Multilingual, type index_d$1_MyReservationsField as MyReservationsField, index_d$1_Namespace as Namespace, type index_d$1_NamespaceChanged as NamespaceChanged, type index_d$1_NewFeatureReason as NewFeatureReason, type index_d$1_NoticePeriod as NoticePeriod, type index_d$1_OldCustomField as OldCustomField, type index_d$1_OldInstant as OldInstant, type index_d$1_OldPolicy as OldPolicy, type index_d$1_OldScheduleException as OldScheduleException, type index_d$1_OldScheduleInterval as OldScheduleInterval, type index_d$1_OldTerms as OldTerms, type index_d$1_OnOptions as OnOptions, type index_d$1_OnlineReservations as OnlineReservations, type index_d$1_Page as Page, type index_d$1_Paging as Paging, type index_d$1_PagingMetadataV2 as PagingMetadataV2, type index_d$1_ParsedSettings as ParsedSettings, type index_d$1_PartiesSize as PartiesSize, type index_d$1_PartyPacing as PartyPacing, type index_d$1_PartySize as PartySize, index_d$1_PlacementType as PlacementType, type index_d$1_PrivacyPolicy as PrivacyPolicy, type index_d$1_PrivacyPolicyValueOneOf as PrivacyPolicyValueOneOf, type index_d$1_Properties as Properties, type index_d$1_PropertiesChange as PropertiesChange, type index_d$1_QueryReservationLocationsOptions as QueryReservationLocationsOptions, type index_d$1_QueryReservationLocationsRequest as QueryReservationLocationsRequest, type index_d$1_QueryReservationLocationsResponse as QueryReservationLocationsResponse, type index_d$1_QueryReservationLocationsResponseNonNullableFields as QueryReservationLocationsResponseNonNullableFields, type index_d$1_QueryV2 as QueryV2, type index_d$1_QueryV2PagingMethodOneOf as QueryV2PagingMethodOneOf, type index_d$1_QuotaFeature as QuotaFeature, type index_d$1_QuotaInfo as QuotaInfo, type index_d$1_ReassignedFromSiteReason as ReassignedFromSiteReason, type index_d$1_ReassignedToAnotherSiteReason as ReassignedToAnotherSiteReason, type index_d$1_ReplacedByAnotherSubscriptionReason as ReplacedByAnotherSubscriptionReason, type index_d$1_ReservationForm as ReservationForm, type index_d$1_ReservationLocation as ReservationLocation, type index_d$1_ReservationLocationCreatedEnvelope as ReservationLocationCreatedEnvelope, type index_d$1_ReservationLocationNonNullableFields as ReservationLocationNonNullableFields, type index_d$1_ReservationLocationUpdatedEnvelope as ReservationLocationUpdatedEnvelope, type index_d$1_ReservationLocationsQueryBuilder as ReservationLocationsQueryBuilder, type index_d$1_ReservationLocationsQueryResult as ReservationLocationsQueryResult, type index_d$1_ReservationPayment as ReservationPayment, index_d$1_ResolutionMethod as ResolutionMethod, type index_d$1_RestoreInfo as RestoreInfo, type index_d$1_SeatPacing as SeatPacing, type index_d$1_ServiceProvisioned as ServiceProvisioned, type index_d$1_ServiceRemoved as ServiceRemoved, index_d$1_Set as Set, type index_d$1_Settings as Settings, index_d$1_SettingsMode as SettingsMode, type index_d$1_SettingsOptionsOneOf as SettingsOptionsOneOf, type index_d$1_SiteCloned as SiteCloned, type index_d$1_SiteCreated as SiteCreated, index_d$1_SiteCreatedContext as SiteCreatedContext, type index_d$1_SiteDeleted as SiteDeleted, type index_d$1_SiteHardDeleted as SiteHardDeleted, type index_d$1_SiteMarkedAsTemplate as SiteMarkedAsTemplate, type index_d$1_SiteMarkedAsWixSite as SiteMarkedAsWixSite, type index_d$1_SitePropertiesEvent as SitePropertiesEvent, type index_d$1_SitePropertiesNotification as SitePropertiesNotification, type index_d$1_SitePublished as SitePublished, type index_d$1_SiteRenamed as SiteRenamed, type index_d$1_SiteTransferred as SiteTransferred, type index_d$1_SiteUndeleted as SiteUndeleted, type index_d$1_SiteUnpublished as SiteUnpublished, index_d$1_SortOrder as SortOrder, type index_d$1_Sorting as Sorting, type index_d$1_SpecialHourPeriod as SpecialHourPeriod, index_d$1_State as State, type index_d$1_StreetAddress as StreetAddress, type index_d$1_StudioAssigned as StudioAssigned, type index_d$1_StudioUnassigned as StudioUnassigned, type index_d$1_SupportedLanguage as SupportedLanguage, type TableCombination$1 as TableCombination, type index_d$1_TableDefinition as TableDefinition, type index_d$1_TableManagement as TableManagement, type index_d$1_TablesDeleted as TablesDeleted, type index_d$1_TermsAndConditions as TermsAndConditions, type index_d$1_TermsAndConditionsValueOneOf as TermsAndConditionsValueOneOf, type index_d$1_TimePeriod as TimePeriod, type index_d$1_TransferredFromAnotherAccountReason as TransferredFromAnotherAccountReason, type index_d$1_TransferredToAnotherAccountReason as TransferredToAnotherAccountReason, type index_d$1_Translation as Translation, type index_d$1_TurnoverRule as TurnoverRule, type index_d$1_TurnoverTimeRule as TurnoverTimeRule, type index_d$1_URI as URI, type index_d$1_UnAssingedToFloatingReason as UnAssingedToFloatingReason, index_d$1_Unit as Unit, type index_d$1_UpdateExtendedFieldsOptions as UpdateExtendedFieldsOptions, type index_d$1_UpdateExtendedFieldsRequest as UpdateExtendedFieldsRequest, type index_d$1_UpdateExtendedFieldsResponse as UpdateExtendedFieldsResponse, type index_d$1_UpdateExtendedFieldsResponseNonNullableFields as UpdateExtendedFieldsResponseNonNullableFields, type index_d$1_UpdateReservationLocation as UpdateReservationLocation, type index_d$1_UpdateReservationLocationRequest as UpdateReservationLocationRequest, type index_d$1_UpdateReservationLocationResponse as UpdateReservationLocationResponse, type index_d$1_UpdateReservationLocationResponseNonNullableFields as UpdateReservationLocationResponseNonNullableFields, type index_d$1_V4SiteCreated as V4SiteCreated, index_d$1_WebhookIdentityType as WebhookIdentityType, type index_d$1__publicOnReservationLocationCreatedType as _publicOnReservationLocationCreatedType, type index_d$1__publicOnReservationLocationUpdatedType as _publicOnReservationLocationUpdatedType, index_d$1_getReservationLocation as getReservationLocation, index_d$1_listReservationLocations as listReservationLocations, index_d$1_onReservationLocationCreated as onReservationLocationCreated, index_d$1_onReservationLocationUpdated as onReservationLocationUpdated, onReservationLocationCreated$1 as publicOnReservationLocationCreated, onReservationLocationUpdated$1 as publicOnReservationLocationUpdated, index_d$1_queryReservationLocations as queryReservationLocations, index_d$1_updateExtendedFields as updateExtendedFields, index_d$1_updateReservationLocation as updateReservationLocation };
4438
5250
  }
4439
5251
 
5252
+ type HostModule<T, H extends Host> = {
5253
+ __type: 'host';
5254
+ create(host: H): T;
5255
+ };
5256
+ type HostModuleAPI<T extends HostModule<any, any>> = T extends HostModule<infer U, any> ? U : never;
5257
+ type Host<Environment = unknown> = {
5258
+ channel: {
5259
+ observeState(callback: (props: unknown, environment: Environment) => unknown): {
5260
+ disconnect: () => void;
5261
+ } | Promise<{
5262
+ disconnect: () => void;
5263
+ }>;
5264
+ };
5265
+ environment?: Environment;
5266
+ /**
5267
+ * Optional bast url to use for API requests, for example `www.wixapis.com`
5268
+ */
5269
+ apiBaseUrl?: string;
5270
+ /**
5271
+ * Possible data to be provided by every host, for cross cutting concerns
5272
+ * like internationalization, billing, etc.
5273
+ */
5274
+ essentials?: {
5275
+ /**
5276
+ * The language of the currently viewed session
5277
+ */
5278
+ language?: string;
5279
+ /**
5280
+ * The locale of the currently viewed session
5281
+ */
5282
+ locale?: string;
5283
+ /**
5284
+ * Any headers that should be passed through to the API requests
5285
+ */
5286
+ passThroughHeaders?: Record<string, string>;
5287
+ };
5288
+ };
5289
+
5290
+ type RESTFunctionDescriptor<T extends (...args: any[]) => any = (...args: any[]) => any> = (httpClient: HttpClient) => T;
5291
+ interface HttpClient {
5292
+ request<TResponse, TData = any>(req: RequestOptionsFactory<TResponse, TData>): Promise<HttpResponse<TResponse>>;
5293
+ fetchWithAuth: typeof fetch;
5294
+ wixAPIFetch: (relativeUrl: string, options: RequestInit) => Promise<Response>;
5295
+ getActiveToken?: () => string | undefined;
5296
+ }
5297
+ type RequestOptionsFactory<TResponse = any, TData = any> = (context: any) => RequestOptions<TResponse, TData>;
5298
+ type HttpResponse<T = any> = {
5299
+ data: T;
5300
+ status: number;
5301
+ statusText: string;
5302
+ headers: any;
5303
+ request?: any;
5304
+ };
5305
+ type RequestOptions<_TResponse = any, Data = any> = {
5306
+ method: 'POST' | 'GET' | 'PUT' | 'DELETE' | 'PATCH' | 'HEAD' | 'OPTIONS';
5307
+ url: string;
5308
+ data?: Data;
5309
+ params?: URLSearchParams;
5310
+ } & APIMetadata;
5311
+ type APIMetadata = {
5312
+ methodFqn?: string;
5313
+ entityFqdn?: string;
5314
+ packageName?: string;
5315
+ };
5316
+ type BuildRESTFunction<T extends RESTFunctionDescriptor> = T extends RESTFunctionDescriptor<infer U> ? U : never;
5317
+ type EventDefinition<Payload = unknown, Type extends string = string> = {
5318
+ __type: 'event-definition';
5319
+ type: Type;
5320
+ isDomainEvent?: boolean;
5321
+ transformations?: (envelope: unknown) => Payload;
5322
+ __payload: Payload;
5323
+ };
5324
+ declare function EventDefinition<Type extends string>(type: Type, isDomainEvent?: boolean, transformations?: (envelope: any) => unknown): <Payload = unknown>() => EventDefinition<Payload, Type>;
5325
+ type EventHandler<T extends EventDefinition> = (payload: T['__payload']) => void | Promise<void>;
5326
+ type BuildEventDefinition<T extends EventDefinition<any, string>> = (handler: EventHandler<T>) => void;
5327
+
5328
+ type ServicePluginMethodInput = {
5329
+ request: any;
5330
+ metadata: any;
5331
+ };
5332
+ type ServicePluginContract = Record<string, (payload: ServicePluginMethodInput) => unknown | Promise<unknown>>;
5333
+ type ServicePluginMethodMetadata = {
5334
+ name: string;
5335
+ primaryHttpMappingPath: string;
5336
+ transformations: {
5337
+ fromREST: (...args: unknown[]) => ServicePluginMethodInput;
5338
+ toREST: (...args: unknown[]) => unknown;
5339
+ };
5340
+ };
5341
+ type ServicePluginDefinition<Contract extends ServicePluginContract> = {
5342
+ __type: 'service-plugin-definition';
5343
+ componentType: string;
5344
+ methods: ServicePluginMethodMetadata[];
5345
+ __contract: Contract;
5346
+ };
5347
+ declare function ServicePluginDefinition<Contract extends ServicePluginContract>(componentType: string, methods: ServicePluginMethodMetadata[]): ServicePluginDefinition<Contract>;
5348
+ type BuildServicePluginDefinition<T extends ServicePluginDefinition<any>> = (implementation: T['__contract']) => void;
5349
+ declare const SERVICE_PLUGIN_ERROR_TYPE = "wix_spi_error";
5350
+
5351
+ type RequestContext = {
5352
+ isSSR: boolean;
5353
+ host: string;
5354
+ protocol?: string;
5355
+ };
5356
+ type ResponseTransformer = (data: any, headers?: any) => any;
5357
+ /**
5358
+ * Ambassador request options types are copied mostly from AxiosRequestConfig.
5359
+ * They are copied and not imported to reduce the amount of dependencies (to reduce install time).
5360
+ * https://github.com/axios/axios/blob/3f53eb6960f05a1f88409c4b731a40de595cb825/index.d.ts#L307-L315
5361
+ */
5362
+ type Method = 'get' | 'GET' | 'delete' | 'DELETE' | 'head' | 'HEAD' | 'options' | 'OPTIONS' | 'post' | 'POST' | 'put' | 'PUT' | 'patch' | 'PATCH' | 'purge' | 'PURGE' | 'link' | 'LINK' | 'unlink' | 'UNLINK';
5363
+ type AmbassadorRequestOptions<T = any> = {
5364
+ _?: T;
5365
+ url?: string;
5366
+ method?: Method;
5367
+ params?: any;
5368
+ data?: any;
5369
+ transformResponse?: ResponseTransformer | ResponseTransformer[];
5370
+ };
5371
+ type AmbassadorFactory<Request, Response> = (payload: Request) => ((context: RequestContext) => AmbassadorRequestOptions<Response>) & {
5372
+ __isAmbassador: boolean;
5373
+ };
5374
+ type AmbassadorFunctionDescriptor<Request = any, Response = any> = AmbassadorFactory<Request, Response>;
5375
+ type BuildAmbassadorFunction<T extends AmbassadorFunctionDescriptor> = T extends AmbassadorFunctionDescriptor<infer Request, infer Response> ? (req: Request) => Promise<Response> : never;
5376
+
5377
+ declare global {
5378
+ // eslint-disable-next-line @typescript-eslint/consistent-type-definitions -- It has to be an `interface` so that it can be merged.
5379
+ interface SymbolConstructor {
5380
+ readonly observable: symbol;
5381
+ }
5382
+ }
5383
+
5384
+ declare const emptyObjectSymbol: unique symbol;
5385
+
5386
+ /**
5387
+ Represents a strictly empty plain object, the `{}` value.
5388
+
5389
+ When you annotate something as the type `{}`, it can be anything except `null` and `undefined`. This means that you cannot use `{}` to represent an empty plain object ([read more](https://stackoverflow.com/questions/47339869/typescript-empty-object-and-any-difference/52193484#52193484)).
5390
+
5391
+ @example
5392
+ ```
5393
+ import type {EmptyObject} from 'type-fest';
5394
+
5395
+ // The following illustrates the problem with `{}`.
5396
+ const foo1: {} = {}; // Pass
5397
+ const foo2: {} = []; // Pass
5398
+ const foo3: {} = 42; // Pass
5399
+ const foo4: {} = {a: 1}; // Pass
5400
+
5401
+ // With `EmptyObject` only the first case is valid.
5402
+ const bar1: EmptyObject = {}; // Pass
5403
+ const bar2: EmptyObject = 42; // Fail
5404
+ const bar3: EmptyObject = []; // Fail
5405
+ const bar4: EmptyObject = {a: 1}; // Fail
5406
+ ```
5407
+
5408
+ Unfortunately, `Record<string, never>`, `Record<keyof any, never>` and `Record<never, never>` do not work. See {@link https://github.com/sindresorhus/type-fest/issues/395 #395}.
5409
+
5410
+ @category Object
5411
+ */
5412
+ type EmptyObject = {[emptyObjectSymbol]?: never};
5413
+
5414
+ /**
5415
+ Returns a boolean for whether the two given types are equal.
5416
+
5417
+ @link https://github.com/microsoft/TypeScript/issues/27024#issuecomment-421529650
5418
+ @link https://stackoverflow.com/questions/68961864/how-does-the-equals-work-in-typescript/68963796#68963796
5419
+
5420
+ Use-cases:
5421
+ - If you want to make a conditional branch based on the result of a comparison of two types.
5422
+
5423
+ @example
5424
+ ```
5425
+ import type {IsEqual} from 'type-fest';
5426
+
5427
+ // This type returns a boolean for whether the given array includes the given item.
5428
+ // `IsEqual` is used to compare the given array at position 0 and the given item and then return true if they are equal.
5429
+ type Includes<Value extends readonly any[], Item> =
5430
+ Value extends readonly [Value[0], ...infer rest]
5431
+ ? IsEqual<Value[0], Item> extends true
5432
+ ? true
5433
+ : Includes<rest, Item>
5434
+ : false;
5435
+ ```
5436
+
5437
+ @category Type Guard
5438
+ @category Utilities
5439
+ */
5440
+ type IsEqual<A, B> =
5441
+ (<G>() => G extends A ? 1 : 2) extends
5442
+ (<G>() => G extends B ? 1 : 2)
5443
+ ? true
5444
+ : false;
5445
+
5446
+ /**
5447
+ Filter out keys from an object.
5448
+
5449
+ Returns `never` if `Exclude` is strictly equal to `Key`.
5450
+ Returns `never` if `Key` extends `Exclude`.
5451
+ Returns `Key` otherwise.
5452
+
5453
+ @example
5454
+ ```
5455
+ type Filtered = Filter<'foo', 'foo'>;
5456
+ //=> never
5457
+ ```
5458
+
5459
+ @example
5460
+ ```
5461
+ type Filtered = Filter<'bar', string>;
5462
+ //=> never
5463
+ ```
5464
+
5465
+ @example
5466
+ ```
5467
+ type Filtered = Filter<'bar', 'foo'>;
5468
+ //=> 'bar'
5469
+ ```
5470
+
5471
+ @see {Except}
5472
+ */
5473
+ type Filter<KeyType, ExcludeType> = IsEqual<KeyType, ExcludeType> extends true ? never : (KeyType extends ExcludeType ? never : KeyType);
5474
+
5475
+ type ExceptOptions = {
5476
+ /**
5477
+ Disallow assigning non-specified properties.
5478
+
5479
+ Note that any omitted properties in the resulting type will be present in autocomplete as `undefined`.
5480
+
5481
+ @default false
5482
+ */
5483
+ requireExactProps?: boolean;
5484
+ };
5485
+
5486
+ /**
5487
+ Create a type from an object type without certain keys.
5488
+
5489
+ We recommend setting the `requireExactProps` option to `true`.
5490
+
5491
+ This type is a stricter version of [`Omit`](https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-5.html#the-omit-helper-type). The `Omit` type does not restrict the omitted keys to be keys present on the given type, while `Except` does. The benefits of a stricter type are avoiding typos and allowing the compiler to pick up on rename refactors automatically.
5492
+
5493
+ This type was proposed to the TypeScript team, which declined it, saying they prefer that libraries implement stricter versions of the built-in types ([microsoft/TypeScript#30825](https://github.com/microsoft/TypeScript/issues/30825#issuecomment-523668235)).
5494
+
5495
+ @example
5496
+ ```
5497
+ import type {Except} from 'type-fest';
5498
+
5499
+ type Foo = {
5500
+ a: number;
5501
+ b: string;
5502
+ };
5503
+
5504
+ type FooWithoutA = Except<Foo, 'a'>;
5505
+ //=> {b: string}
5506
+
5507
+ const fooWithoutA: FooWithoutA = {a: 1, b: '2'};
5508
+ //=> errors: 'a' does not exist in type '{ b: string; }'
5509
+
5510
+ type FooWithoutB = Except<Foo, 'b', {requireExactProps: true}>;
5511
+ //=> {a: number} & Partial<Record<"b", never>>
5512
+
5513
+ const fooWithoutB: FooWithoutB = {a: 1, b: '2'};
5514
+ //=> errors at 'b': Type 'string' is not assignable to type 'undefined'.
5515
+ ```
5516
+
5517
+ @category Object
5518
+ */
5519
+ type Except<ObjectType, KeysType extends keyof ObjectType, Options extends ExceptOptions = {requireExactProps: false}> = {
5520
+ [KeyType in keyof ObjectType as Filter<KeyType, KeysType>]: ObjectType[KeyType];
5521
+ } & (Options['requireExactProps'] extends true
5522
+ ? Partial<Record<KeysType, never>>
5523
+ : {});
5524
+
5525
+ /**
5526
+ Extract the keys from a type where the value type of the key extends the given `Condition`.
5527
+
5528
+ Internally this is used for the `ConditionalPick` and `ConditionalExcept` types.
5529
+
5530
+ @example
5531
+ ```
5532
+ import type {ConditionalKeys} from 'type-fest';
5533
+
5534
+ interface Example {
5535
+ a: string;
5536
+ b: string | number;
5537
+ c?: string;
5538
+ d: {};
5539
+ }
5540
+
5541
+ type StringKeysOnly = ConditionalKeys<Example, string>;
5542
+ //=> 'a'
5543
+ ```
5544
+
5545
+ To support partial types, make sure your `Condition` is a union of undefined (for example, `string | undefined`) as demonstrated below.
5546
+
5547
+ @example
5548
+ ```
5549
+ import type {ConditionalKeys} from 'type-fest';
5550
+
5551
+ type StringKeysAndUndefined = ConditionalKeys<Example, string | undefined>;
5552
+ //=> 'a' | 'c'
5553
+ ```
5554
+
5555
+ @category Object
5556
+ */
5557
+ type ConditionalKeys<Base, Condition> = NonNullable<
5558
+ // Wrap in `NonNullable` to strip away the `undefined` type from the produced union.
5559
+ {
5560
+ // Map through all the keys of the given base type.
5561
+ [Key in keyof Base]:
5562
+ // Pick only keys with types extending the given `Condition` type.
5563
+ Base[Key] extends Condition
5564
+ // Retain this key since the condition passes.
5565
+ ? Key
5566
+ // Discard this key since the condition fails.
5567
+ : never;
5568
+
5569
+ // Convert the produced object into a union type of the keys which passed the conditional test.
5570
+ }[keyof Base]
5571
+ >;
5572
+
5573
+ /**
5574
+ Exclude keys from a shape that matches the given `Condition`.
5575
+
5576
+ This is useful when you want to create a new type with a specific set of keys from a shape. For example, you might want to exclude all the primitive properties from a class and form a new shape containing everything but the primitive properties.
5577
+
5578
+ @example
5579
+ ```
5580
+ import type {Primitive, ConditionalExcept} from 'type-fest';
5581
+
5582
+ class Awesome {
5583
+ name: string;
5584
+ successes: number;
5585
+ failures: bigint;
5586
+
5587
+ run() {}
5588
+ }
5589
+
5590
+ type ExceptPrimitivesFromAwesome = ConditionalExcept<Awesome, Primitive>;
5591
+ //=> {run: () => void}
5592
+ ```
5593
+
5594
+ @example
5595
+ ```
5596
+ import type {ConditionalExcept} from 'type-fest';
5597
+
5598
+ interface Example {
5599
+ a: string;
5600
+ b: string | number;
5601
+ c: () => void;
5602
+ d: {};
5603
+ }
5604
+
5605
+ type NonStringKeysOnly = ConditionalExcept<Example, string>;
5606
+ //=> {b: string | number; c: () => void; d: {}}
5607
+ ```
5608
+
5609
+ @category Object
5610
+ */
5611
+ type ConditionalExcept<Base, Condition> = Except<
5612
+ Base,
5613
+ ConditionalKeys<Base, Condition>
5614
+ >;
5615
+
5616
+ /**
5617
+ * Descriptors are objects that describe the API of a module, and the module
5618
+ * can either be a REST module or a host module.
5619
+ * This type is recursive, so it can describe nested modules.
5620
+ */
5621
+ type Descriptors = RESTFunctionDescriptor | AmbassadorFunctionDescriptor | HostModule<any, any> | EventDefinition<any> | ServicePluginDefinition<any> | {
5622
+ [key: string]: Descriptors | PublicMetadata | any;
5623
+ };
5624
+ /**
5625
+ * This type takes in a descriptors object of a certain Host (including an `unknown` host)
5626
+ * and returns an object with the same structure, but with all descriptors replaced with their API.
5627
+ * Any non-descriptor properties are removed from the returned object, including descriptors that
5628
+ * do not match the given host (as they will not work with the given host).
5629
+ */
5630
+ type BuildDescriptors<T extends Descriptors, H extends Host<any> | undefined, Depth extends number = 5> = {
5631
+ done: T;
5632
+ recurse: T extends {
5633
+ __type: typeof SERVICE_PLUGIN_ERROR_TYPE;
5634
+ } ? never : T extends AmbassadorFunctionDescriptor ? BuildAmbassadorFunction<T> : T extends RESTFunctionDescriptor ? BuildRESTFunction<T> : T extends EventDefinition<any> ? BuildEventDefinition<T> : T extends ServicePluginDefinition<any> ? BuildServicePluginDefinition<T> : T extends HostModule<any, any> ? HostModuleAPI<T> : ConditionalExcept<{
5635
+ [Key in keyof T]: T[Key] extends Descriptors ? BuildDescriptors<T[Key], H, [
5636
+ -1,
5637
+ 0,
5638
+ 1,
5639
+ 2,
5640
+ 3,
5641
+ 4,
5642
+ 5
5643
+ ][Depth]> : never;
5644
+ }, EmptyObject>;
5645
+ }[Depth extends -1 ? 'done' : 'recurse'];
5646
+ type PublicMetadata = {
5647
+ PACKAGE_NAME?: string;
5648
+ };
5649
+
5650
+ declare global {
5651
+ interface ContextualClient {
5652
+ }
5653
+ }
5654
+ /**
5655
+ * A type used to create concerete types from SDK descriptors in
5656
+ * case a contextual client is available.
5657
+ */
5658
+ type MaybeContext<T extends Descriptors> = globalThis.ContextualClient extends {
5659
+ host: Host;
5660
+ } ? BuildDescriptors<T, globalThis.ContextualClient['host']> : T;
5661
+
4440
5662
  interface TimeSlot {
4441
5663
  /** Start date and time of this time slot. */
4442
5664
  startDate?: Date;
@@ -4650,7 +5872,7 @@ interface CheckTimeSlotOptions {
4650
5872
  declare function getTimeSlots$1(httpClient: HttpClient): GetTimeSlotsSignature;
4651
5873
  interface GetTimeSlotsSignature {
4652
5874
  /**
4653
- * Returns a list of time slots at a given restaurant on a given `date`, and their availability for a given `partySize`.
5875
+ * Returns a list of time slots at a given reservation location on a given `date`, and their availability for a given `partySize`.
4654
5876
  *
4655
5877
  * Without passing optional parameters, the list will contain a single time slot at the given `date`.
4656
5878
  * Use `slotsBefore` and `slotsAfter` to get additional time slots before and after the given `date`.
@@ -4658,7 +5880,7 @@ interface GetTimeSlotsSignature {
4658
5880
  * If you do not provide a `duration`, the duration will be calculated automatically based on the reservation location's configuration.
4659
5881
  * The reservation location's settings used to determine the duration are its `defaultTurnoverTime` and `turnoverTimeRules`. These specify how much time should be allotted for a reservation of a party of a given size.
4660
5882
  *
4661
- * The `startDate`s of time slots in the response are 15 minutes apart regardless of the `duration` provided.
5883
+ * The interval between `startDate`s of time slots in the response is determined by the reservation location's `timeSlotInterval`. This interval is not affected by the `duration` provided.
4662
5884
  * @param - ID of the reservation location for which to retrieve time slots.
4663
5885
  * @param - Date and time for which to retrieve a time slot in [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#coordinated_Universal_Time_(UTC)) format.
4664
5886
  * @param - Size of the party that needs to be seated during this time slot.
@@ -4679,8 +5901,8 @@ interface CheckTimeSlotSignature {
4679
5901
  (reservationLocationId: string, options?: CheckTimeSlotOptions | undefined): Promise<CheckTimeSlotResponse & CheckTimeSlotResponseNonNullableFields>;
4680
5902
  }
4681
5903
 
4682
- declare const getTimeSlots: BuildRESTFunction<typeof getTimeSlots$1> & typeof getTimeSlots$1;
4683
- declare const checkTimeSlot: BuildRESTFunction<typeof checkTimeSlot$1> & typeof checkTimeSlot$1;
5904
+ declare const getTimeSlots: MaybeContext<BuildRESTFunction<typeof getTimeSlots$1> & typeof getTimeSlots$1>;
5905
+ declare const checkTimeSlot: MaybeContext<BuildRESTFunction<typeof checkTimeSlot$1> & typeof checkTimeSlot$1>;
4684
5906
 
4685
5907
  type index_d_CheckReservationDetailsRequest = CheckReservationDetailsRequest;
4686
5908
  type index_d_CheckReservationDetailsResponse = CheckReservationDetailsResponse;