stream-chat-expo 5.15.0 → 5.15.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "stream-chat-expo",
3
3
  "description": "The official Expo SDK for Stream Chat, a service for building chat applications",
4
- "version": "5.15.0",
4
+ "version": "5.15.1-beta.2",
5
5
  "author": {
6
6
  "company": "Stream.io Inc",
7
7
  "name": "Stream.io Inc"
@@ -10,7 +10,7 @@
10
10
  "main": "src/index.js",
11
11
  "types": "types/index.d.ts",
12
12
  "dependencies": {
13
- "stream-chat-react-native-core": "5.15.0"
13
+ "stream-chat-react-native-core": "5.15.1-beta.2"
14
14
  },
15
15
  "peerDependencies": {
16
16
  "@react-native-community/netinfo": ">=6.0.0",
@@ -1,6 +1,16 @@
1
1
  import * as MediaLibrary from 'expo-media-library';
2
+ import type { Asset } from 'stream-chat-react-native-core';
2
3
 
3
- export const getPhotos = async ({ after, first }: MediaLibrary.AssetsOptions) => {
4
+ type ReturnType = {
5
+ assets: Array<Omit<Asset, 'source'> & { source: 'picker' }>;
6
+ endCursor: string | undefined;
7
+ hasNextPage: boolean;
8
+ };
9
+
10
+ export const getPhotos = async ({
11
+ after,
12
+ first,
13
+ }: MediaLibrary.AssetsOptions): Promise<ReturnType> => {
4
14
  try {
5
15
  const { status } = await MediaLibrary.requestPermissionsAsync();
6
16
  if (status !== 'granted') {
@@ -17,7 +27,7 @@ export const getPhotos = async ({ after, first }: MediaLibrary.AssetsOptions) =>
17
27
  filename: asset.filename,
18
28
  height: asset.height,
19
29
  id: asset.id,
20
- source: 'picker',
30
+ source: 'picker' as const,
21
31
  type: asset.mediaType,
22
32
  uri: asset.uri,
23
33
  width: asset.width,