@sanity/client 7.14.1 → 7.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1099,6 +1099,20 @@ export declare interface CurrentSanityUser {
1099
1099
  /** @public */
1100
1100
  export declare type DatasetAclMode = 'public' | 'private' | 'custom'
1101
1101
 
1102
+ /** @public */
1103
+ export declare type DatasetCreateOptions = {
1104
+ aclMode?: DatasetAclMode
1105
+ embeddings?: {
1106
+ enabled: boolean
1107
+ projection?: string
1108
+ }
1109
+ }
1110
+
1111
+ /** @public */
1112
+ export declare type DatasetEditOptions = {
1113
+ aclMode?: DatasetAclMode
1114
+ }
1115
+
1102
1116
  /** @public */
1103
1117
  export declare type DatasetResponse = {
1104
1118
  datasetName: string
@@ -1113,26 +1127,16 @@ export declare class DatasetsClient {
1113
1127
  * Create a new dataset with the given name
1114
1128
  *
1115
1129
  * @param name - Name of the dataset to create
1116
- * @param options - Options for the dataset
1130
+ * @param options - Options for the dataset, including optional embeddings configuration
1117
1131
  */
1118
- create(
1119
- name: string,
1120
- options?: {
1121
- aclMode?: DatasetAclMode
1122
- },
1123
- ): Promise<DatasetResponse>
1132
+ create(name: string, options?: DatasetCreateOptions): Promise<DatasetResponse>
1124
1133
  /**
1125
1134
  * Edit a dataset with the given name
1126
1135
  *
1127
1136
  * @param name - Name of the dataset to edit
1128
1137
  * @param options - New options for the dataset
1129
1138
  */
1130
- edit(
1131
- name: string,
1132
- options?: {
1133
- aclMode?: DatasetAclMode
1134
- },
1135
- ): Promise<DatasetResponse>
1139
+ edit(name: string, options?: DatasetEditOptions): Promise<DatasetResponse>
1136
1140
  /**
1137
1141
  * Delete a dataset with the given name
1138
1142
  *
@@ -1145,6 +1149,19 @@ export declare class DatasetsClient {
1145
1149
  * Fetch a list of datasets for the configured project
1146
1150
  */
1147
1151
  list(): Promise<DatasetsResponse>
1152
+ /**
1153
+ * Get embeddings settings for a dataset
1154
+ *
1155
+ * @param name - Name of the dataset
1156
+ */
1157
+ getEmbeddingsSettings(name: string): Promise<EmbeddingsSettings>
1158
+ /**
1159
+ * Edit embeddings settings for a dataset
1160
+ *
1161
+ * @param name - Name of the dataset
1162
+ * @param settings - Embeddings settings to apply
1163
+ */
1164
+ editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Promise<void>
1148
1165
  }
1149
1166
 
1150
1167
  /** @public */
@@ -1355,6 +1372,19 @@ export declare interface EditReleaseAction {
1355
1372
  patch: PatchOperations
1356
1373
  }
1357
1374
 
1375
+ /** @public */
1376
+ export declare type EmbeddingsSettings = {
1377
+ enabled: boolean
1378
+ projection?: string
1379
+ status: string
1380
+ }
1381
+
1382
+ /** @public */
1383
+ export declare type EmbeddingsSettingsBody = {
1384
+ enabled: boolean
1385
+ projection?: string
1386
+ }
1387
+
1358
1388
  /** @public */
1359
1389
  export declare interface ErrorProps {
1360
1390
  message: string
@@ -1995,7 +2025,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
1995
2025
  */
1996
2026
  export declare function _listen<
1997
2027
  R extends Record<string, Any> = Record<string, Any>,
1998
- Opts extends ListenOptions = ListenOptions,
2028
+ Opts extends ListenOptions | ResumableListenOptions = ListenOptions | ResumableListenOptions,
1999
2029
  >(
2000
2030
  this: SanityClient | ObservableSanityClient,
2001
2031
  query: string,
@@ -2004,9 +2034,11 @@ export declare function _listen<
2004
2034
  ): Observable<ListenEventFromOptions<R, Opts>>
2005
2035
 
2006
2036
  /** @public */
2007
- export declare type ListenEvent<R extends Record<string, Any>> =
2037
+ export declare type ListenEvent<R extends Record<string, Any> = Record<string, Any>> =
2008
2038
  | MutationEvent<R>
2009
2039
  | ReconnectEvent
2040
+ | WelcomeBackEvent
2041
+ | ResetEvent
2010
2042
  | WelcomeEvent
2011
2043
  | OpenEvent
2012
2044
 
@@ -2021,9 +2053,9 @@ export declare type ListenEvent<R extends Record<string, Any>> =
2021
2053
  */
2022
2054
  declare type ListenEventFromOptions<
2023
2055
  R extends Record<string, Any> = Record<string, Any>,
2024
- Opts extends ListenOptions | undefined = undefined,
2025
- > = Opts extends ListenOptions
2026
- ? Opts['events'] extends ListenEventName[]
2056
+ Opts extends ListenOptions | ResumableListenOptions | undefined = undefined,
2057
+ > = Opts extends ListenOptions | ResumableListenOptions
2058
+ ? Opts['events'] extends (ResumableListenEventNames | ListenEventName)[]
2027
2059
  ? MapListenEventNamesToListenEvents<R, Opts['events']>
2028
2060
  : ListenEvent<R>
2029
2061
  : MutationEvent<R>
@@ -2076,7 +2108,7 @@ export declare interface ListenOptions {
2076
2108
  visibility?: 'transaction' | 'query'
2077
2109
  /**
2078
2110
  * Array of event names to include in the observable. By default, only mutation events are included.
2079
- *
2111
+ * Note: `welcomeback` and `reset` events requires `enableResume: true`
2080
2112
  * @defaultValue `['mutation']`
2081
2113
  */
2082
2114
  events?: ListenEventName[]
@@ -2096,6 +2128,13 @@ export declare interface ListenOptions {
2096
2128
  * @defaultValue `undefined`
2097
2129
  */
2098
2130
  tag?: string
2131
+ /**
2132
+ * If this is enabled, the client will normally resume events upon reconnect
2133
+ * When if enabling this, you should also add the `reset` to the events array and handle the case where the backend is unable to resume.
2134
+ * @beta
2135
+ * @defaultValue `false`
2136
+ */
2137
+ enableResume?: boolean
2099
2138
  }
2100
2139
 
2101
2140
  /** @public */
@@ -2186,7 +2225,10 @@ export declare type Logger =
2186
2225
  */
2187
2226
  declare type MapListenEventNamesToListenEvents<
2188
2227
  R extends Record<string, Any> = Record<string, Any>,
2189
- Events extends ListenEventName[] = ListenEventName[],
2228
+ Events extends (ResumableListenEventNames | ListenEventName)[] = (
2229
+ | ResumableListenEventNames
2230
+ | ListenEventName
2231
+ )[],
2190
2232
  > = Events extends (infer E)[]
2191
2233
  ? E extends 'welcome'
2192
2234
  ? WelcomeEvent
@@ -2194,9 +2236,13 @@ declare type MapListenEventNamesToListenEvents<
2194
2236
  ? MutationEvent<R>
2195
2237
  : E extends 'reconnect'
2196
2238
  ? ReconnectEvent
2197
- : E extends 'open'
2198
- ? OpenEvent
2199
- : never
2239
+ : E extends 'welcomeback'
2240
+ ? WelcomeBackEvent
2241
+ : E extends 'reset'
2242
+ ? ResetEvent
2243
+ : E extends 'open'
2244
+ ? OpenEvent
2245
+ : never
2200
2246
  : never
2201
2247
 
2202
2248
  /** @public */
@@ -2537,26 +2583,16 @@ export declare class ObservableDatasetsClient {
2537
2583
  * Create a new dataset with the given name
2538
2584
  *
2539
2585
  * @param name - Name of the dataset to create
2540
- * @param options - Options for the dataset
2586
+ * @param options - Options for the dataset, including optional embeddings configuration
2541
2587
  */
2542
- create(
2543
- name: string,
2544
- options?: {
2545
- aclMode?: DatasetAclMode
2546
- },
2547
- ): Observable<DatasetResponse>
2588
+ create(name: string, options?: DatasetCreateOptions): Observable<DatasetResponse>
2548
2589
  /**
2549
2590
  * Edit a dataset with the given name
2550
2591
  *
2551
2592
  * @param name - Name of the dataset to edit
2552
2593
  * @param options - New options for the dataset
2553
2594
  */
2554
- edit(
2555
- name: string,
2556
- options?: {
2557
- aclMode?: DatasetAclMode
2558
- },
2559
- ): Observable<DatasetResponse>
2595
+ edit(name: string, options?: DatasetEditOptions): Observable<DatasetResponse>
2560
2596
  /**
2561
2597
  * Delete a dataset with the given name
2562
2598
  *
@@ -2569,6 +2605,19 @@ export declare class ObservableDatasetsClient {
2569
2605
  * Fetch a list of datasets for the configured project
2570
2606
  */
2571
2607
  list(): Observable<DatasetsResponse>
2608
+ /**
2609
+ * Get embeddings settings for a dataset
2610
+ *
2611
+ * @param name - Name of the dataset
2612
+ */
2613
+ getEmbeddingsSettings(name: string): Observable<EmbeddingsSettings>
2614
+ /**
2615
+ * Edit embeddings settings for a dataset
2616
+ *
2617
+ * @param name - Name of the dataset
2618
+ * @param settings - Embeddings settings to apply
2619
+ */
2620
+ editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Observable<void>
2572
2621
  }
2573
2622
 
2574
2623
  /** @internal */
@@ -4738,6 +4787,19 @@ export declare interface RequestOptions {
4738
4787
  signal?: AbortSignal
4739
4788
  }
4740
4789
 
4790
+ /**
4791
+ * The listener can't be resumed or otherwise need to reset its local state
4792
+ *
4793
+ * If resumability is unavailable, even listeners created with `enableResume: true` may still
4794
+ * emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
4795
+ * the same way they would otherwise treat a `reset` event.
4796
+ *
4797
+ * @public
4798
+ */
4799
+ export declare type ResetEvent = {
4800
+ type: 'reset'
4801
+ }
4802
+
4741
4803
  export {ResolveStudioUrl}
4742
4804
 
4743
4805
  /** @public */
@@ -4770,6 +4832,32 @@ export declare interface ResponseQueryOptions extends RequestOptions {
4770
4832
  cacheMode?: 'noStale'
4771
4833
  }
4772
4834
 
4835
+ /** @public */
4836
+ export declare type ResumableListenEventNames =
4837
+ | ListenEventName
4838
+ /** The listener has reconnected and successfully resumed from where it left off */
4839
+ | 'welcomeback'
4840
+ /** The listener can't be resumed or otherwise need to reset its local state */
4841
+ | 'reset'
4842
+
4843
+ /** @public */
4844
+ export declare interface ResumableListenOptions
4845
+ extends Omit<ListenOptions, 'events' | 'enableResume'> {
4846
+ /**
4847
+ * If this is enabled, the client will normally resume events upon reconnect
4848
+ * Note that you should also subscribe to `reset`-events and handle the case where the backend is unable to resume
4849
+ * @beta
4850
+ * @defaultValue `false`
4851
+ */
4852
+ enableResume: true
4853
+ /**
4854
+ * Array of event names to include in the observable. By default, only mutation events are included.
4855
+ *
4856
+ * @defaultValue `['mutation']`
4857
+ */
4858
+ events?: ResumableListenEventNames[]
4859
+ }
4860
+
4773
4861
  /** @internal */
4774
4862
  export declare interface SanityAssetDocument extends SanityDocument {
4775
4863
  url: string
@@ -6501,8 +6589,33 @@ export declare interface VideoPlaybackTokens {
6501
6589
  }
6502
6590
 
6503
6591
  /**
6504
- * The listener has been established, and will start receiving events.
6505
- * Note that this is also emitted upon _reconnection_.
6592
+ * Emitted when the listener reconnects and successfully resumes from
6593
+ * its previous position.
6594
+ *
6595
+ * Even if the listener is created with `enableResume: true`, resume support
6596
+ * may not be available. In that case, a reconnect will emit `welcome`
6597
+ * instead of `welcomeback`.
6598
+ *
6599
+ * If resumability is unavailable, even listeners created with `enableResume: true` may still
6600
+ * emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
6601
+ * the same way they would otherwise treat a `reset` event.
6602
+ *
6603
+ * @public
6604
+ */
6605
+ export declare type WelcomeBackEvent = {
6606
+ type: 'welcomeback'
6607
+ listenerName: string
6608
+ }
6609
+
6610
+ /**
6611
+ * Emitted when the listener connection has been successfully established
6612
+ * and is ready to receive events.
6613
+ *
6614
+ * If the listener was created with `enableResume: true` and resume support
6615
+ * is available, the `welcome` event will only be emitted on the initial
6616
+ * connection. On subsequent reconnects, a `welcomeback` event will be
6617
+ * emitted instead, followed by any events that were missed while the
6618
+ * connection was disconnected.
6506
6619
  *
6507
6620
  * @public
6508
6621
  */
@@ -1099,6 +1099,20 @@ export declare interface CurrentSanityUser {
1099
1099
  /** @public */
1100
1100
  export declare type DatasetAclMode = 'public' | 'private' | 'custom'
1101
1101
 
1102
+ /** @public */
1103
+ export declare type DatasetCreateOptions = {
1104
+ aclMode?: DatasetAclMode
1105
+ embeddings?: {
1106
+ enabled: boolean
1107
+ projection?: string
1108
+ }
1109
+ }
1110
+
1111
+ /** @public */
1112
+ export declare type DatasetEditOptions = {
1113
+ aclMode?: DatasetAclMode
1114
+ }
1115
+
1102
1116
  /** @public */
1103
1117
  export declare type DatasetResponse = {
1104
1118
  datasetName: string
@@ -1113,26 +1127,16 @@ export declare class DatasetsClient {
1113
1127
  * Create a new dataset with the given name
1114
1128
  *
1115
1129
  * @param name - Name of the dataset to create
1116
- * @param options - Options for the dataset
1130
+ * @param options - Options for the dataset, including optional embeddings configuration
1117
1131
  */
1118
- create(
1119
- name: string,
1120
- options?: {
1121
- aclMode?: DatasetAclMode
1122
- },
1123
- ): Promise<DatasetResponse>
1132
+ create(name: string, options?: DatasetCreateOptions): Promise<DatasetResponse>
1124
1133
  /**
1125
1134
  * Edit a dataset with the given name
1126
1135
  *
1127
1136
  * @param name - Name of the dataset to edit
1128
1137
  * @param options - New options for the dataset
1129
1138
  */
1130
- edit(
1131
- name: string,
1132
- options?: {
1133
- aclMode?: DatasetAclMode
1134
- },
1135
- ): Promise<DatasetResponse>
1139
+ edit(name: string, options?: DatasetEditOptions): Promise<DatasetResponse>
1136
1140
  /**
1137
1141
  * Delete a dataset with the given name
1138
1142
  *
@@ -1145,6 +1149,19 @@ export declare class DatasetsClient {
1145
1149
  * Fetch a list of datasets for the configured project
1146
1150
  */
1147
1151
  list(): Promise<DatasetsResponse>
1152
+ /**
1153
+ * Get embeddings settings for a dataset
1154
+ *
1155
+ * @param name - Name of the dataset
1156
+ */
1157
+ getEmbeddingsSettings(name: string): Promise<EmbeddingsSettings>
1158
+ /**
1159
+ * Edit embeddings settings for a dataset
1160
+ *
1161
+ * @param name - Name of the dataset
1162
+ * @param settings - Embeddings settings to apply
1163
+ */
1164
+ editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Promise<void>
1148
1165
  }
1149
1166
 
1150
1167
  /** @public */
@@ -1355,6 +1372,19 @@ export declare interface EditReleaseAction {
1355
1372
  patch: PatchOperations
1356
1373
  }
1357
1374
 
1375
+ /** @public */
1376
+ export declare type EmbeddingsSettings = {
1377
+ enabled: boolean
1378
+ projection?: string
1379
+ status: string
1380
+ }
1381
+
1382
+ /** @public */
1383
+ export declare type EmbeddingsSettingsBody = {
1384
+ enabled: boolean
1385
+ projection?: string
1386
+ }
1387
+
1358
1388
  /** @public */
1359
1389
  export declare interface ErrorProps {
1360
1390
  message: string
@@ -1995,7 +2025,7 @@ export declare function _listen<R extends Record<string, Any> = Record<string, A
1995
2025
  */
1996
2026
  export declare function _listen<
1997
2027
  R extends Record<string, Any> = Record<string, Any>,
1998
- Opts extends ListenOptions = ListenOptions,
2028
+ Opts extends ListenOptions | ResumableListenOptions = ListenOptions | ResumableListenOptions,
1999
2029
  >(
2000
2030
  this: SanityClient | ObservableSanityClient,
2001
2031
  query: string,
@@ -2004,9 +2034,11 @@ export declare function _listen<
2004
2034
  ): Observable<ListenEventFromOptions<R, Opts>>
2005
2035
 
2006
2036
  /** @public */
2007
- export declare type ListenEvent<R extends Record<string, Any>> =
2037
+ export declare type ListenEvent<R extends Record<string, Any> = Record<string, Any>> =
2008
2038
  | MutationEvent<R>
2009
2039
  | ReconnectEvent
2040
+ | WelcomeBackEvent
2041
+ | ResetEvent
2010
2042
  | WelcomeEvent
2011
2043
  | OpenEvent
2012
2044
 
@@ -2021,9 +2053,9 @@ export declare type ListenEvent<R extends Record<string, Any>> =
2021
2053
  */
2022
2054
  declare type ListenEventFromOptions<
2023
2055
  R extends Record<string, Any> = Record<string, Any>,
2024
- Opts extends ListenOptions | undefined = undefined,
2025
- > = Opts extends ListenOptions
2026
- ? Opts['events'] extends ListenEventName[]
2056
+ Opts extends ListenOptions | ResumableListenOptions | undefined = undefined,
2057
+ > = Opts extends ListenOptions | ResumableListenOptions
2058
+ ? Opts['events'] extends (ResumableListenEventNames | ListenEventName)[]
2027
2059
  ? MapListenEventNamesToListenEvents<R, Opts['events']>
2028
2060
  : ListenEvent<R>
2029
2061
  : MutationEvent<R>
@@ -2076,7 +2108,7 @@ export declare interface ListenOptions {
2076
2108
  visibility?: 'transaction' | 'query'
2077
2109
  /**
2078
2110
  * Array of event names to include in the observable. By default, only mutation events are included.
2079
- *
2111
+ * Note: `welcomeback` and `reset` events requires `enableResume: true`
2080
2112
  * @defaultValue `['mutation']`
2081
2113
  */
2082
2114
  events?: ListenEventName[]
@@ -2096,6 +2128,13 @@ export declare interface ListenOptions {
2096
2128
  * @defaultValue `undefined`
2097
2129
  */
2098
2130
  tag?: string
2131
+ /**
2132
+ * If this is enabled, the client will normally resume events upon reconnect
2133
+ * When if enabling this, you should also add the `reset` to the events array and handle the case where the backend is unable to resume.
2134
+ * @beta
2135
+ * @defaultValue `false`
2136
+ */
2137
+ enableResume?: boolean
2099
2138
  }
2100
2139
 
2101
2140
  /** @public */
@@ -2186,7 +2225,10 @@ export declare type Logger =
2186
2225
  */
2187
2226
  declare type MapListenEventNamesToListenEvents<
2188
2227
  R extends Record<string, Any> = Record<string, Any>,
2189
- Events extends ListenEventName[] = ListenEventName[],
2228
+ Events extends (ResumableListenEventNames | ListenEventName)[] = (
2229
+ | ResumableListenEventNames
2230
+ | ListenEventName
2231
+ )[],
2190
2232
  > = Events extends (infer E)[]
2191
2233
  ? E extends 'welcome'
2192
2234
  ? WelcomeEvent
@@ -2194,9 +2236,13 @@ declare type MapListenEventNamesToListenEvents<
2194
2236
  ? MutationEvent<R>
2195
2237
  : E extends 'reconnect'
2196
2238
  ? ReconnectEvent
2197
- : E extends 'open'
2198
- ? OpenEvent
2199
- : never
2239
+ : E extends 'welcomeback'
2240
+ ? WelcomeBackEvent
2241
+ : E extends 'reset'
2242
+ ? ResetEvent
2243
+ : E extends 'open'
2244
+ ? OpenEvent
2245
+ : never
2200
2246
  : never
2201
2247
 
2202
2248
  /** @public */
@@ -2537,26 +2583,16 @@ export declare class ObservableDatasetsClient {
2537
2583
  * Create a new dataset with the given name
2538
2584
  *
2539
2585
  * @param name - Name of the dataset to create
2540
- * @param options - Options for the dataset
2586
+ * @param options - Options for the dataset, including optional embeddings configuration
2541
2587
  */
2542
- create(
2543
- name: string,
2544
- options?: {
2545
- aclMode?: DatasetAclMode
2546
- },
2547
- ): Observable<DatasetResponse>
2588
+ create(name: string, options?: DatasetCreateOptions): Observable<DatasetResponse>
2548
2589
  /**
2549
2590
  * Edit a dataset with the given name
2550
2591
  *
2551
2592
  * @param name - Name of the dataset to edit
2552
2593
  * @param options - New options for the dataset
2553
2594
  */
2554
- edit(
2555
- name: string,
2556
- options?: {
2557
- aclMode?: DatasetAclMode
2558
- },
2559
- ): Observable<DatasetResponse>
2595
+ edit(name: string, options?: DatasetEditOptions): Observable<DatasetResponse>
2560
2596
  /**
2561
2597
  * Delete a dataset with the given name
2562
2598
  *
@@ -2569,6 +2605,19 @@ export declare class ObservableDatasetsClient {
2569
2605
  * Fetch a list of datasets for the configured project
2570
2606
  */
2571
2607
  list(): Observable<DatasetsResponse>
2608
+ /**
2609
+ * Get embeddings settings for a dataset
2610
+ *
2611
+ * @param name - Name of the dataset
2612
+ */
2613
+ getEmbeddingsSettings(name: string): Observable<EmbeddingsSettings>
2614
+ /**
2615
+ * Edit embeddings settings for a dataset
2616
+ *
2617
+ * @param name - Name of the dataset
2618
+ * @param settings - Embeddings settings to apply
2619
+ */
2620
+ editEmbeddingsSettings(name: string, settings: EmbeddingsSettingsBody): Observable<void>
2572
2621
  }
2573
2622
 
2574
2623
  /** @internal */
@@ -4738,6 +4787,19 @@ export declare interface RequestOptions {
4738
4787
  signal?: AbortSignal
4739
4788
  }
4740
4789
 
4790
+ /**
4791
+ * The listener can't be resumed or otherwise need to reset its local state
4792
+ *
4793
+ * If resumability is unavailable, even listeners created with `enableResume: true` may still
4794
+ * emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
4795
+ * the same way they would otherwise treat a `reset` event.
4796
+ *
4797
+ * @public
4798
+ */
4799
+ export declare type ResetEvent = {
4800
+ type: 'reset'
4801
+ }
4802
+
4741
4803
  export {ResolveStudioUrl}
4742
4804
 
4743
4805
  /** @public */
@@ -4770,6 +4832,32 @@ export declare interface ResponseQueryOptions extends RequestOptions {
4770
4832
  cacheMode?: 'noStale'
4771
4833
  }
4772
4834
 
4835
+ /** @public */
4836
+ export declare type ResumableListenEventNames =
4837
+ | ListenEventName
4838
+ /** The listener has reconnected and successfully resumed from where it left off */
4839
+ | 'welcomeback'
4840
+ /** The listener can't be resumed or otherwise need to reset its local state */
4841
+ | 'reset'
4842
+
4843
+ /** @public */
4844
+ export declare interface ResumableListenOptions
4845
+ extends Omit<ListenOptions, 'events' | 'enableResume'> {
4846
+ /**
4847
+ * If this is enabled, the client will normally resume events upon reconnect
4848
+ * Note that you should also subscribe to `reset`-events and handle the case where the backend is unable to resume
4849
+ * @beta
4850
+ * @defaultValue `false`
4851
+ */
4852
+ enableResume: true
4853
+ /**
4854
+ * Array of event names to include in the observable. By default, only mutation events are included.
4855
+ *
4856
+ * @defaultValue `['mutation']`
4857
+ */
4858
+ events?: ResumableListenEventNames[]
4859
+ }
4860
+
4773
4861
  /** @internal */
4774
4862
  export declare interface SanityAssetDocument extends SanityDocument {
4775
4863
  url: string
@@ -6501,8 +6589,33 @@ export declare interface VideoPlaybackTokens {
6501
6589
  }
6502
6590
 
6503
6591
  /**
6504
- * The listener has been established, and will start receiving events.
6505
- * Note that this is also emitted upon _reconnection_.
6592
+ * Emitted when the listener reconnects and successfully resumes from
6593
+ * its previous position.
6594
+ *
6595
+ * Even if the listener is created with `enableResume: true`, resume support
6596
+ * may not be available. In that case, a reconnect will emit `welcome`
6597
+ * instead of `welcomeback`.
6598
+ *
6599
+ * If resumability is unavailable, even listeners created with `enableResume: true` may still
6600
+ * emit `welcome` when reconnected. Subscribers should therefore treat `welcome` after a reconnect
6601
+ * the same way they would otherwise treat a `reset` event.
6602
+ *
6603
+ * @public
6604
+ */
6605
+ export declare type WelcomeBackEvent = {
6606
+ type: 'welcomeback'
6607
+ listenerName: string
6608
+ }
6609
+
6610
+ /**
6611
+ * Emitted when the listener connection has been successfully established
6612
+ * and is ready to receive events.
6613
+ *
6614
+ * If the listener was created with `enableResume: true` and resume support
6615
+ * is available, the `welcome` event will only be emitted on the initial
6616
+ * connection. On subsequent reconnects, a `welcomeback` event will be
6617
+ * emitted instead, followed by any events that were missed while the
6618
+ * connection was disconnected.
6506
6619
  *
6507
6620
  * @public
6508
6621
  */