@mongrov/types
v0.3.0
Published
Shared type definitions for @mongrov packages
Readme
@mongrov/types
Shared type definitions for @mongrov packages. Zero runtime — interfaces only.
Installation
pnpm add @mongrov/typesUsage
import type {
Message,
Conversation,
Participant,
Pagination,
} from '@mongrov/types'
// Create a message
const message: Message = {
id: 'msg-1',
conversationId: 'conv-1',
sender: { id: 'user-1', name: 'John', type: 'human' },
content: { type: 'text', text: 'Hello!' },
deliveryStatus: 'sent',
createdAt: new Date().toISOString(),
}Types
Message Types
Message— Full message with sender, content, attachments, reactions- v0.3.0: Added
editedBy,updatedAt,systemTypefields
- v0.3.0: Added
MessageContent— Content payload (text, image, audio, video, file, voice, location, sticker)- v0.3.0: Added
locationandstickertypes withlatitude/longitudesupport
- v0.3.0: Added
Attachment— File attachment with metadataReaction— Emoji reaction with user listDeliveryStatus—'sending' | 'sent' | 'delivered' | 'read' | 'failed'
Conversation Types
Conversation— Chat room with members, state, unread count- v0.3.0: Added
topic,description,metadatafields
- v0.3.0: Added
Member— Participant with role in a conversationCreateConversationConfig— Config for creating new conversationsConversationType—'1:1' | 'group' | 'channel'GroupState—'invited' | 'open' | 'read-only' | 'closed' | 'archived'
Participant Types
Participant— User or bot identityParticipantType—'human' | 'ai' | 'bot' | 'system'MemberRole—'owner' | 'admin' | 'moderator' | 'member'PresenceStatus—'online' | 'away' | 'busy' | 'offline'
Common Types
Pagination— Cursor-based pagination optionsUnsubscribe— Cleanup function type() => voidConnectionStatus—'connected' | 'connecting' | 'disconnected' | 'reconnecting'FileUpload— File metadata for uploadsSearchOpts— Search query options
Design
This package provides shared interfaces used by both @mongrov/ai and @mongrov/collab. By centralizing types here:
- AI and collab packages don't depend on each other
- Message format is consistent across the platform
@mongrov/corestays focused on logging (one package, one purpose)
License
MIT
