File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -24,7 +24,10 @@ import {
2424 Video ,
2525} from './optionalDependencies' ;
2626
27- registerNativeHandlers ( {
27+ /**
28+ * The default native handlers this package registers with the core SDK.
29+ */
30+ export const defaultNativeHandlers = {
2831 Audio,
2932 compressImage,
3033 deleteFile,
@@ -39,13 +42,17 @@ registerNativeHandlers({
3942 pickDocument,
4043 pickImage,
4144 saveFile,
42- SDK : 'stream-chat-expo' ,
4345 setClipboardString,
4446 shareImage,
4547 Sound,
4648 takePhoto,
4749 triggerHaptic,
4850 Video,
51+ } ;
52+
53+ registerNativeHandlers ( {
54+ ...defaultNativeHandlers ,
55+ SDK : 'stream-chat-expo' ,
4956} ) ;
5057
5158export * from 'stream-chat-react-native-core' ;
Original file line number Diff line number Diff line change 1+ import { registerNativeHandlers } from 'stream-chat-react-native-core' ;
2+
13export * from 'stream-chat-react-native-core' ;
4+
5+ /**
6+ * The default native handlers this package registers with the core SDK.
7+ *
8+ * Exposed so integrators can compose or wrap a single handler (for example to
9+ * force `takePhoto` to capture images only) without reimplementing it or
10+ * reaching into internal module paths. Register your override *after* importing
11+ * this package so it takes precedence.
12+ *
13+ * Example:
14+ *
15+ * ```ts
16+ * import { registerNativeHandlers, defaultNativeHandlers } from 'stream-chat-expo';
17+ *
18+ * const localTakePhoto = defaultNativeHandlers.takePhoto;
19+ *
20+ * registerNativeHandlers({
21+ * takePhoto: localTakePhoto
22+ * ? (options) => {
23+ * console.log('[#3379 demo] wrapped takePhoto — forcing mediaType "image"', options);
24+ * return localTakePhoto({ ...options, mediaType: 'image' });
25+ * }
26+ * : undefined,
27+ * });
28+ * ```
29+ */
30+ export declare const defaultNativeHandlers : Parameters < typeof registerNativeHandlers > [ 0 ] ;
Original file line number Diff line number Diff line change @@ -25,7 +25,10 @@ import {
2525 Video ,
2626} from './optionalDependencies' ;
2727
28- registerNativeHandlers ( {
28+ /**
29+ * The default native handlers this package registers with the core SDK.
30+ */
31+ export const defaultNativeHandlers = {
2932 Audio,
3033 compressImage,
3134 deleteFile,
@@ -40,13 +43,17 @@ registerNativeHandlers({
4043 pickDocument,
4144 pickImage,
4245 saveFile,
43- SDK : 'stream-chat-react-native' ,
4446 setClipboardString,
4547 shareImage,
4648 Sound,
4749 takePhoto,
4850 triggerHaptic,
4951 Video,
52+ } ;
53+
54+ registerNativeHandlers ( {
55+ ...defaultNativeHandlers ,
56+ SDK : 'stream-chat-react-native' ,
5057} ) ;
5158
5259if ( Platform . OS === 'android' ) {
Original file line number Diff line number Diff line change 1+ import { registerNativeHandlers } from 'stream-chat-react-native-core' ;
2+
13export * from 'stream-chat-react-native-core' ;
4+
5+ /**
6+ * The default native handlers this package registers with the core SDK.
7+ *
8+ * Exposed so integrators can compose or wrap a single handler (for example to
9+ * force `takePhoto` to capture images only) without reimplementing it or
10+ * reaching into internal module paths. Register your override *after* importing
11+ * this package so it takes precedence.
12+ *
13+ * Example:
14+ *
15+ * ```ts
16+ * import { registerNativeHandlers, defaultNativeHandlers } from 'stream-chat-expo';
17+ *
18+ * const localTakePhoto = defaultNativeHandlers.takePhoto;
19+ *
20+ * registerNativeHandlers({
21+ * takePhoto: localTakePhoto
22+ * ? (options) => {
23+ * console.log('[#3379 demo] wrapped takePhoto — forcing mediaType "image"', options);
24+ * return localTakePhoto({ ...options, mediaType: 'image' });
25+ * }
26+ * : undefined,
27+ * });
28+ * ```
29+ */
30+ export declare const defaultNativeHandlers : Parameters < typeof registerNativeHandlers > [ 0 ] ;
You can’t perform that action at this time.
0 commit comments