@codingfactory/messenger-client 0.1.6 → 0.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.
@@ -0,0 +1,32 @@
1
+ import { type ComputedRef } from 'vue';
2
+ import { type ConnectionStatus } from '../services/echo';
3
+ type ConnectionSource = 'app' | 'messenger';
4
+ interface ConnectionStatusIcons {
5
+ connected: string;
6
+ connecting: string;
7
+ disconnected: string;
8
+ error: string;
9
+ unknown: string;
10
+ }
11
+ interface UseConnectionStatusOptions {
12
+ source?: ConnectionSource;
13
+ icons?: Partial<ConnectionStatusIcons>;
14
+ }
15
+ interface UseConnectionStatusResult {
16
+ connectionStatus: ComputedRef<ConnectionStatus>;
17
+ isConnected: ComputedRef<boolean>;
18
+ isConnecting: ComputedRef<boolean>;
19
+ isDisconnected: ComputedRef<boolean>;
20
+ isError: ComputedRef<boolean>;
21
+ hasConnectionIssues: ComputedRef<boolean>;
22
+ statusMessage: ComputedRef<string>;
23
+ statusColor: ComputedRef<'success' | 'warning' | 'danger' | 'medium'>;
24
+ statusIcon: ComputedRef<string>;
25
+ showConnectionBanner: ComputedRef<boolean>;
26
+ lastConnectionTime: ComputedRef<Date | null>;
27
+ connectionUptime: ComputedRef<string | null>;
28
+ reconnectAttempts: ComputedRef<number>;
29
+ reconnect: () => Promise<void>;
30
+ }
31
+ export declare function useConnectionStatus(options?: UseConnectionStatusOptions): UseConnectionStatusResult;
32
+ export {};
@@ -0,0 +1 @@
1
+ export declare function usePresence(): void;
@@ -0,0 +1,13 @@
1
+ import { type ComputedRef, type MaybeRefOrGetter } from 'vue';
2
+ import { type TypingUser } from '../stores/messaging';
3
+ interface UseTypingChannelResult {
4
+ isSubscribed: ComputedRef<boolean>;
5
+ error: ComputedRef<string | null>;
6
+ typingUsers: ComputedRef<TypingUser[]>;
7
+ formatTypingIndicator: ComputedRef<string>;
8
+ hasTypingUsers: ComputedRef<boolean>;
9
+ subscribe: () => void;
10
+ unsubscribe: () => void;
11
+ }
12
+ export declare function useTypingChannel(conversationIdSource: MaybeRefOrGetter<string | null | undefined>): UseTypingChannelResult;
13
+ export {};
@@ -1,16 +1,21 @@
1
1
  import { type MessagingHttpClient } from './services/auth';
2
2
  import { type EchoRuntimeConfig } from './services/echo';
3
+ import { type MainEchoRuntimeConfig } from './services/mainEcho';
4
+ import { type PresenceRuntimeConfig } from './services/presenceRuntime';
3
5
  import { type MessagingMediaApi } from './services/mediaApi';
4
6
  import { type UseMessagingAuthStore } from './stores/auth';
5
7
  import { type PlayMessageNotification } from './composables/useNotificationSound';
6
8
  import { type CreateLogger } from './utils/logger';
7
9
  export interface MessengerClientConfig {
8
10
  apiClient?: MessagingHttpClient;
11
+ mainApiClient?: MessagingHttpClient;
9
12
  authStore?: UseMessagingAuthStore;
10
13
  mediaApi?: MessagingMediaApi;
11
14
  createLogger?: CreateLogger;
12
15
  playMessageNotification?: PlayMessageNotification;
13
16
  echo?: EchoRuntimeConfig;
17
+ mainEcho?: MainEchoRuntimeConfig;
18
+ presence?: PresenceRuntimeConfig;
14
19
  }
15
20
  export declare function configureMessengerClient(config: MessengerClientConfig): void;
16
21
  export declare function resetMessengerClientConfig(): void;
package/dist/index.d.ts CHANGED
@@ -1,11 +1,20 @@
1
1
  export * from './composables/useConversationChannel';
2
+ export * from './composables/useConnectionStatus';
2
3
  export * from './composables/useGlobalMessaging';
4
+ export * from './composables/usePresence';
5
+ export * from './composables/useTypingChannel';
3
6
  export * from './configure';
4
7
  export * from './services/api/messaging';
5
8
  export * from './services/auth';
6
9
  export * from './services/echo';
10
+ export * from './services/mainApi';
11
+ export * from './services/mainEcho';
7
12
  export * from './services/mediaApi';
13
+ export * from './services/messengerEcho';
14
+ export * from './services/presenceRuntime';
8
15
  export * from './stores/auth';
9
16
  export * from './stores/messaging';
17
+ export * from './types/typing';
10
18
  export * from './utils/errorUtils';
11
19
  export * from './utils/logger';
20
+ export * from './utils/presence';