@astralibx/chat-types
v0.4.0
Published
Shared TypeScript type definitions, enums, and event contracts for the chat ecosystem
Downloads
92
Maintainers
Readme
@astralibx/chat-types
Shared TypeScript type definitions, enums, and socket event contracts for the astralib chat ecosystem. This is a pure types package with zero runtime dependencies.
Install
npm install @astralibx/chat-typesQuick Start
import {
ChatSessionStatus,
ChatSenderType,
ChatContentType,
ChatMessageStatus,
SessionMode,
AgentStatus,
VisitorEvent,
ServerToVisitorEvent,
AgentEvent,
ServerToAgentEvent,
} from '@astralibx/chat-types';
import type {
ChatMessage,
ChatSessionSummary,
ChatAgentInfo,
ChatWidgetConfig,
ConnectPayload,
ConnectedPayload,
AiResponseInput,
AiResponseOutput,
} from '@astralibx/chat-types';Features
- Enums -- Session status, sender type, content type, message status, session mode, agent status. Details
- Socket event constants -- Typed
as constobjects for all visitor-server and agent-server event channels. Details - Message types --
ChatMessage,MessagePayload,MessageReceivedPayload,MessageStatusPayload. Details - Session types --
ChatSessionSummary,VisitorContext,ChatUserInfo,SessionStats,ChatFeedback. Details - Agent types --
ChatAgentInfo,AgentIdentity,DashboardStats. Details - Event payload types -- 13 payload interfaces for all socket events (connect, typing, status, transfer, escalate, feedback, etc.). Details
- Config types -- Widget configuration, features, branding, offline mode, post-chat surveys, translations. Details
- Flow types -- Pre-chat flow configuration with 6 step types: welcome, FAQ, guided questions, form, agent selector, custom HTML. Details
- Adapter types -- Contracts for agent assignment, AI response, visitor identity, event tracking, metrics, and error context. Details
Reference
Types -- Full type, enum, and constant reference
Links
License
MIT
