claritykit-svelte
Version:
A comprehensive Svelte component library focused on accessibility, ADHD-optimized design, developer experience, and full SSR compatibility
295 lines • 8.13 kB
TypeScript
export interface MediaBlock {
id: string;
type: 'media';
mediaType: 'image' | 'video' | 'audio' | 'file';
url: string;
filename: string;
size: number;
mimeType: string;
thumbnail?: string;
metadata?: {
duration?: number;
dimensions?: {
width: number;
height: number;
};
alt?: string;
caption?: string;
};
uploadProgress?: number;
uploadStatus?: 'pending' | 'uploading' | 'completed' | 'error';
error?: string;
}
export interface FileUploadState {
id: string;
file: File;
progress: number;
status: 'pending' | 'uploading' | 'completed' | 'error';
url?: string;
thumbnail?: string;
error?: string;
}
export interface MessageReaction {
id: string;
emoji: string;
users: Array<{
id: string;
name: string;
avatar?: string;
}>;
count: number;
createdAt: string;
}
export interface ReactionSet {
id: string;
name: string;
description?: string;
emojis: Array<{
emoji: string;
label: string;
keywords?: string[];
}>;
}
export interface ChatMessage {
id: string;
content: string;
timestamp: string;
sender: {
id: string;
name: string;
type: 'user' | 'agent';
avatar?: string;
};
status?: 'sending' | 'sent' | 'delivered' | 'read' | 'error';
reactions?: MessageReaction[];
pinned?: boolean;
bookmarked?: boolean;
unread?: boolean;
readBy?: Array<{
userId: string;
timestamp: string;
}>;
actions?: Array<{
id: string;
label: string;
icon?: string;
action: 'copy' | 'edit' | 'delete' | 'reply' | 'quote' | 'pin' | 'bookmark' | 'react' | 'custom';
shortcut?: string;
visible?: boolean;
}>;
metadata?: {
edited?: boolean;
editedAt?: string;
replyTo?: string;
quotedMessage?: string;
threadId?: string;
blockId?: string;
semanticTags?: string[];
blockLinks?: string[];
transclusions?: string[];
relatedMessages?: string[];
conceptClusters?: string[];
topicTags?: string[];
attachments?: Array<{
id: string;
name: string;
type: string;
url: string;
}>;
};
}
export interface RichTextChatMessage extends Omit<ChatMessage, 'content'> {
content: {
text?: string;
html?: string;
json?: any;
blocks?: any[];
};
}
export interface MessageThread {
id: string;
parentMessageId?: string;
messages: ChatMessage[];
collapsed?: boolean;
depth: number;
summary?: string;
participants?: Array<{
id: string;
name: string;
avatar?: string;
}>;
unreadCount?: number;
lastActivity?: string;
notifications?: boolean;
}
export interface ChatThreadProps {
messages: ChatMessage[];
currentUserId: string;
isTyping?: boolean;
typingUser?: {
id: string;
name: string;
avatar?: string;
};
class?: string;
onMessageAction?: (messageId: string, action: string, data?: any) => void;
onScrollToTop?: () => void;
onScrollToBottom?: () => void;
showTimestamps?: boolean;
showAvatars?: boolean;
maxHeight?: string;
enableRichText?: boolean;
enableThreading?: boolean;
enableKnowledgeIntegration?: boolean;
enableReactions?: boolean;
enableSearch?: boolean;
enableKeyboardShortcuts?: boolean;
reactionSets?: ReactionSet[];
defaultReactionSet?: string;
enableMediaUpload?: boolean;
acceptedFileTypes?: string[];
maxFileSize?: number;
maxFiles?: number;
onMessageSend?: (content: string | RichTextContent, replyTo?: string, quotedMessage?: string, attachments?: MediaBlock[]) => void;
onFileUpload?: (files: File[]) => Promise<MediaBlock[]>;
onMessageEdit?: (messageId: string, content: string | RichTextContent) => void;
onMessageDelete?: (messageId: string) => void;
onMessageReact?: (messageId: string, emoji: string) => void;
onMessagePin?: (messageId: string, pinned: boolean) => void;
onMessageBookmark?: (messageId: string, bookmarked: boolean) => void;
onMessageQuote?: (messageId: string) => void;
onBlockLink?: (sourceBlockId: string, targetBlockId: string) => void;
onBlockTransclude?: (sourceBlockId: string, targetBlockId: string) => void;
onSemanticTag?: (messageId: string, concepts: string[]) => void;
onReplyToMessage?: (messageId: string) => void;
onToggleThread?: (threadId: string) => void;
onJumpToMessage?: (messageId: string) => void;
onSearch?: (query: string) => void;
searchResults?: Array<{
messageId: string;
highlight: string;
context: string;
}>;
unreadMessageIds?: string[];
onMarkAsRead?: (messageId: string) => void;
}
export interface RichTextContent {
text?: string;
html?: string;
json?: any;
}
export interface BlockMessageProps {
message: ChatMessage | RichTextChatMessage;
currentUserId: string;
showAvatar?: boolean;
showTimestamp?: boolean;
showActions?: boolean;
enableRichText?: boolean;
compact?: boolean;
threaded?: boolean;
threadDepth?: number;
enableReactions?: boolean;
reactionSets?: ReactionSet[];
defaultReactionSet?: string;
showContextMenu?: boolean;
highlighted?: boolean;
unread?: boolean;
onAction?: (messageId: string, action: string, data?: any) => void;
onReact?: (messageId: string, emoji: string) => void;
onQuote?: (messageId: string) => void;
onPin?: (messageId: string, pinned: boolean) => void;
onBookmark?: (messageId: string, bookmarked: boolean) => void;
onBlockLink?: (sourceBlockId: string, targetBlockId: string) => void;
onBlockTransclude?: (sourceBlockId: string, targetBlockId: string) => void;
onSemanticTag?: (messageId: string, concepts: string[]) => void;
class?: string;
}
export interface SearchOptions {
query: string;
caseSensitive?: boolean;
wholeWords?: boolean;
useRegex?: boolean;
includeMetadata?: boolean;
dateRange?: {
start: string;
end: string;
};
senders?: string[];
messageTypes?: Array<'user' | 'agent'>;
}
export interface SearchResult {
messageId: string;
message: ChatMessage;
highlights: Array<{
field: 'content' | 'metadata';
text: string;
startIndex: number;
endIndex: number;
}>;
context: {
before: string;
after: string;
};
relevanceScore: number;
}
export interface ContextMenuItem {
id: string;
label: string;
icon?: string;
shortcut?: string;
action: string;
enabled?: boolean;
visible?: boolean;
divider?: boolean;
submenu?: ContextMenuItem[];
}
export interface KeyboardShortcut {
id: string;
key: string;
modifiers?: Array<'ctrl' | 'alt' | 'shift' | 'meta'>;
action: string;
description: string;
enabled?: boolean;
scope?: 'global' | 'message' | 'composer';
}
export interface ConceptCluster {
id: string;
name: string;
concepts: string[];
messageIds: string[];
weight: number;
color?: string;
}
export interface RelatedContent {
messageId: string;
relationType: 'similar' | 'referenced' | 'followup' | 'contradiction';
confidence: number;
reason: string;
}
export interface ConversationSummary {
id: string;
title: string;
summary: string;
keyConcepts: string[];
participants: string[];
messageCount: number;
timeRange: {
start: string;
end: string;
};
topics: Array<{
name: string;
weight: number;
}>;
}
export interface ThreadNotification {
id: string;
threadId: string;
messageId: string;
type: 'mention' | 'reply' | 'reaction' | 'new_message';
userId: string;
timestamp: string;
read: boolean;
data?: any;
}
//# sourceMappingURL=types.d.ts.map