@yorkie-js/react 0.7.9 → 0.7.10-rc

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.
@@ -137,7 +137,8 @@ export { Tree }
137
137
  * `useChannel` is a custom hook that returns the channel state.
138
138
  * It must be used within a ChannelProvider.
139
139
  *
140
- * @returns An object containing sessionCount, loading, and error state
140
+ * @returns An object containing sessionCount, loading, error state and
141
+ * a `detach` function for permanently stopping the channel.
141
142
  *
142
143
  * @example
143
144
  * ```tsx
@@ -155,6 +156,7 @@ export declare const useChannel: () => {
155
156
  sessionCount: number;
156
157
  loading: boolean;
157
158
  error: Error | undefined;
159
+ detach: () => Promise<void>;
158
160
  };
159
161
 
160
162
  /**
@@ -331,6 +333,21 @@ export declare function useYorkieDoc<R, P extends Indexable = Indexable>(apiKey:
331
333
  * `YorkieProvider` is a component that provides the Yorkie client to its children.
332
334
  * It initializes the Yorkie client with the given API key and RPC address.
333
335
  */
334
- export declare const YorkieProvider: React.FC<PropsWithChildren<ClientOptions>>;
336
+ export declare const YorkieProvider: React.FC<PropsWithChildren<YorkieProviderProps>>;
337
+
338
+ /**
339
+ * `YorkieProviderProps` extends `ClientOptions` with provider-level options.
340
+ *
341
+ * - `activate` (default `true`): whether to call `client.activate()` on mount
342
+ * and `client.deactivate()` on unmount. Set to `false` for apps that only
343
+ * use Channels — under the RefreshChannel-only lifecycle the SDK
344
+ * lazy-attaches the client on the first heartbeat, so explicit activate
345
+ * round trips become unnecessary. Document use cases (`useDocument`,
346
+ * `useYorkieDoc`) still require activation, so leave this `true` if any
347
+ * descendant attaches a document.
348
+ */
349
+ declare type YorkieProviderProps = ClientOptions & {
350
+ activate?: boolean;
351
+ };
335
352
 
336
353
  export { }