stream-chat 5.6.0 → 6.2.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.
Files changed (40) hide show
  1. package/README.md +59 -114
  2. package/dist/browser.es.js +464 -366
  3. package/dist/browser.es.js.map +1 -1
  4. package/dist/browser.full-bundle.min.js +1 -1
  5. package/dist/browser.full-bundle.min.js.map +1 -1
  6. package/dist/browser.js +464 -366
  7. package/dist/browser.js.map +1 -1
  8. package/dist/index.es.js +464 -366
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/index.js +464 -366
  11. package/dist/index.js.map +1 -1
  12. package/dist/types/channel.d.ts +124 -124
  13. package/dist/types/channel.d.ts.map +1 -1
  14. package/dist/types/channel_state.d.ts +41 -41
  15. package/dist/types/channel_state.d.ts.map +1 -1
  16. package/dist/types/client.d.ts +190 -163
  17. package/dist/types/client.d.ts.map +1 -1
  18. package/dist/types/client_state.d.ts +6 -6
  19. package/dist/types/client_state.d.ts.map +1 -1
  20. package/dist/types/connection.d.ts +10 -10
  21. package/dist/types/connection.d.ts.map +1 -1
  22. package/dist/types/connection_fallback.d.ts +7 -7
  23. package/dist/types/connection_fallback.d.ts.map +1 -1
  24. package/dist/types/insights.d.ts +2 -2
  25. package/dist/types/token_manager.d.ts +6 -6
  26. package/dist/types/token_manager.d.ts.map +1 -1
  27. package/dist/types/types.d.ts +404 -236
  28. package/dist/types/types.d.ts.map +1 -1
  29. package/dist/types/utils.d.ts +2 -2
  30. package/dist/types/utils.d.ts.map +1 -1
  31. package/package.json +2 -2
  32. package/src/channel.ts +196 -290
  33. package/src/channel_state.ts +54 -219
  34. package/src/client.ts +297 -524
  35. package/src/client_state.ts +6 -6
  36. package/src/connection.ts +7 -22
  37. package/src/connection_fallback.ts +7 -21
  38. package/src/token_manager.ts +6 -6
  39. package/src/types.ts +540 -487
  40. package/src/utils.ts +7 -11
package/src/utils.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import FormData from 'form-data';
2
- import { AscDesc, LiteralStringForUnion, OwnUserBase, OwnUserResponse, UR, UserResponse } from './types';
2
+ import { AscDesc, ExtendableGenerics, DefaultGenerics, OwnUserBase, OwnUserResponse, UserResponse } from './types';
3
3
 
4
4
  /**
5
5
  * logChatPromiseExecution - utility function for logging the execution of a promise..
@@ -54,18 +54,14 @@ function isFileWebAPI(uri: unknown): uri is File {
54
54
  return typeof window !== 'undefined' && 'File' in window && uri instanceof File;
55
55
  }
56
56
 
57
- function isBlobWebAPI(uri: unknown): uri is Blob {
58
- return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
57
+ export function isOwnUser<StreamChatGenerics extends ExtendableGenerics = DefaultGenerics>(
58
+ user?: OwnUserResponse<StreamChatGenerics> | UserResponse<StreamChatGenerics>,
59
+ ): user is OwnUserResponse<StreamChatGenerics> {
60
+ return (user as OwnUserResponse<StreamChatGenerics>)?.total_unread_count !== undefined;
59
61
  }
60
62
 
61
- export function isOwnUser<
62
- ChannelType extends UR = UR,
63
- CommandType extends string = LiteralStringForUnion,
64
- UserType extends UR = UR
65
- >(
66
- user?: OwnUserResponse<ChannelType, CommandType, UserType> | UserResponse<UserType>,
67
- ): user is OwnUserResponse<ChannelType, CommandType, UserType> {
68
- return (user as OwnUserResponse<ChannelType, CommandType, UserType>)?.total_unread_count !== undefined;
63
+ function isBlobWebAPI(uri: unknown): uri is Blob {
64
+ return typeof window !== 'undefined' && 'Blob' in window && uri instanceof Blob;
69
65
  }
70
66
 
71
67
  export function isOwnUserBaseProperty(property: string) {