@connectycube/chat-widget
Version:
A React component that seamlessly integrates ConnectyCube's real-time chat capabilities into your web applications. This widget offers an out-of-the-box solution for embedding chat features—such as instant messaging, user presence, and file sharing—withou
34 lines (33 loc) • 2.71 kB
TypeScript
import { Config, Users, Auth, Chat, EmptyResponse, PushNotifications } from 'connectycube/types';
import { PushSubscriptionData } from './notifications';
export declare const SESSION_KEY = "@connectycube/chat-widget:session";
export declare const initConnectyCubeSDK: (credentials: Config.Credentials, config?: Config.Options) => void;
export declare const tryReuseSession: (userName?: string, userId?: string, userAvatar?: string, userProfileLink?: string) => Promise<boolean>;
export declare const tryRestoreSession: () => Promise<Auth.Session | null>;
export declare const createUserSession: (login: string, password: string) => Promise<Auth.Session>;
export declare const createSession: (userId?: string, userName?: string, userAvatar?: string, userProfileLink?: string) => Promise<Auth.Session | null>;
export declare const destroyUserSession: () => Promise<void>;
export declare const userSignup: (login: string, password: string, name?: string, externalId?: string, userAvatar?: string, userProfileLink?: string) => Promise<Auth.Session>;
export declare const chatCredentials: () => Chat.ConnectionParams | null;
export declare const updateUserProfileIfNeeded: (session: Auth.Session, name?: string, externalId?: string, avatar?: string, userProfileLink?: string) => Promise<Auth.Session>;
export declare const setSessionToLocalStorage: (session: Auth.Session) => void;
export declare const getSessionFromLocalStorage: () => Auth.Session | null;
export declare const clearSessionInLocalStorage: () => void;
export declare const getCurrentUser: () => Users.User | null | undefined;
export declare const getUserSettings: () => {
[key: string]: any;
} | null;
export declare const updateUserSettings: (settings: {
[key: string]: any;
}) => Promise<Users.User>;
export declare const getSessionToken: () => string | null;
export declare const getSessionUserId: () => number | null;
export declare const isSessionExpired: () => boolean;
export declare const isUserIdChanged: (userId?: string) => boolean;
export declare const sha256: (str: string) => Promise<string>;
export declare const getUserName: (user: Users.User | null | undefined, force?: boolean) => string;
export declare const getPhotoUrl: (photoOrAvatar?: string | null) => string;
export declare const generateConnectyCubeLogin: (userId?: string) => string;
export declare const createUserReport: (reportedUserId: number, reason: string) => Promise<import("connectycube/types").Data.DataRecord>;
export declare const subscribeToPushNotifications: (pushSubscriptionData?: PushSubscriptionData) => Promise<PushNotifications.Subscription | undefined>;
export declare const unsubscribeFromPushNotifications: () => Promise<EmptyResponse[]>;