@codingfactory/messenger-client 0.2.6 → 0.2.8
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/dist/services/echo.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Message, ReactionSummary } from '../stores/messaging';
|
|
2
2
|
import type { TypingSubscriptionCallbacks } from '../types/typing';
|
|
3
3
|
export type ConnectionStatus = 'connecting' | 'connected' | 'disconnected' | 'error';
|
|
4
|
+
export type MessagingAccessState = 'available' | 'account_suspended';
|
|
4
5
|
export interface EchoChannel {
|
|
5
6
|
listen(event: string, callback: (payload: unknown) => void): unknown;
|
|
6
7
|
stopListening?(event: string, callback?: (payload: unknown) => void): unknown;
|
|
@@ -78,7 +79,9 @@ export interface EchoRuntimeConfig {
|
|
|
78
79
|
initializedEvent?: string;
|
|
79
80
|
getEcho?: () => EchoClient | null;
|
|
80
81
|
getConnectionStatus?: () => ConnectionStatus;
|
|
82
|
+
getAccessState?: () => MessagingAccessState;
|
|
81
83
|
onConnectionStatusChange?: (callback: (status: ConnectionStatus) => void) => () => void;
|
|
84
|
+
onAccessStateChange?: (callback: (state: MessagingAccessState) => void) => () => void;
|
|
82
85
|
reconnect?: () => Promise<void>;
|
|
83
86
|
subscribeToPresenceStatus?: (callback: (event: PresenceStatusChangedEvent) => void) => void;
|
|
84
87
|
unsubscribeFromPresenceStatus?: () => void;
|
|
@@ -91,7 +94,9 @@ export declare const getEchoInitializedEvent: () => string;
|
|
|
91
94
|
export declare const getEcho: () => EchoClient | null;
|
|
92
95
|
export declare const getEchoConnectionStatus: () => ConnectionStatus;
|
|
93
96
|
export declare const getConnectionStatus: () => ConnectionStatus;
|
|
97
|
+
export declare const getMessagingAccessState: () => MessagingAccessState;
|
|
94
98
|
export declare const onConnectionStatusChange: (callback: (status: ConnectionStatus) => void) => (() => void);
|
|
99
|
+
export declare const onMessagingAccessStateChange: (callback: (state: MessagingAccessState) => void) => (() => void);
|
|
95
100
|
export declare const reconnectEcho: () => Promise<void>;
|
|
96
101
|
export declare const subscribeToPresenceStatus: (callback: (event: PresenceStatusChangedEvent) => void) => void;
|
|
97
102
|
export declare const unsubscribeFromPresenceStatus: () => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MessagingHttpClient } from './auth';
|
|
2
|
-
import type { ConnectionStatus, EchoClient, EchoRuntimeConfig } from './echo';
|
|
2
|
+
import type { ConnectionStatus, EchoClient, EchoRuntimeConfig, MessagingAccessState } from './echo';
|
|
3
3
|
import { type CreateLogger } from '../utils/logger';
|
|
4
4
|
export interface MessengerBootstrapPayload {
|
|
5
5
|
auth: {
|
|
@@ -42,6 +42,7 @@ export interface MessengerEchoRuntime extends EchoRuntimeConfig {
|
|
|
42
42
|
apiClient: MessagingHttpClient;
|
|
43
43
|
getEcho(): EchoClient | null;
|
|
44
44
|
getConnectionStatus(): ConnectionStatus;
|
|
45
|
+
getAccessState(): MessagingAccessState;
|
|
45
46
|
reconnect(): Promise<void>;
|
|
46
47
|
clearRuntime(): void;
|
|
47
48
|
}
|
|
@@ -3749,7 +3749,7 @@ export declare const useMessagingStore: import("pinia").StoreDefinition<"messagi
|
|
|
3749
3749
|
fetchConversation(id: string): Promise<Conversation>;
|
|
3750
3750
|
fetchRequests(cursor?: string): Promise<PaginatedResponse<Conversation>>;
|
|
3751
3751
|
fetchMessages(conversationId: string, cursor?: string): Promise<PaginatedResponse<Message>>;
|
|
3752
|
-
sendMessage(conversationId: string, body?: string, attachments?: File[], replyToId?: string | null, replyToPreview?: ReplyToPreview | null, sharedPostId?: string | null): Promise<Message>;
|
|
3752
|
+
sendMessage(conversationId: string, body?: string, attachments?: File[], replyToId?: string | null, replyToPreview?: ReplyToPreview | null, sharedPostId?: string | null, sharedPostPreview?: SharedPostPreview | null): Promise<Message>;
|
|
3753
3753
|
editMessage(conversationId: string, messageId: string, body: string): Promise<Message>;
|
|
3754
3754
|
deleteMessage(conversationId: string, messageId: string): Promise<void>;
|
|
3755
3755
|
markAsRead(conversationId: string): Promise<void>;
|