{"version":3,"sources":["../src/types/channels.ts"],"names":["ChannelType"],"mappings":";AAUO,IAAMA,EAAc,CACzB,QAAS,UACT,MAAO,QACP,MAAO,QACP,KAAM,OACN,QAAS,UACT,OAAQ,SACR,MAAO,OACT","sourcesContent":["import type { ReactNativeFile } from 'apollo-upload-client';\nimport { Subscription } from 'zen-observable-ts';\n\nimport { AccountApi } from '@/api/account.api';\nimport { ChatApi } from '@/api/chat.api';\nimport { EventsApi } from '@/api/events.api';\nimport { GatewayApi } from '@/api/gateway.api';\nimport { NewMessageSubscription } from '@/generated/graphql';\nimport { ChatMessage } from './messages';\n\nexport const ChannelType = {\n  CHANNEL: 'channel',\n  NOTES: 'notes',\n  SLEEP: 'sleep',\n  FOOD: 'food',\n  THOUGHT: 'thought',\n  LESSON: 'lesson',\n  GROUP: 'group',\n} as const;\n\nexport type ChannelType = (typeof ChannelType)[keyof typeof ChannelType];\n\nexport interface ChannelUser {\n  id: string;\n  reference: string;\n  userId: string;\n  metadata?: MetadataInput[];\n}\n\nexport interface Channel {\n  id: string;\n  name: string;\n  type: ChannelType;\n  lastMessageId?: string;\n  status?: string;\n  createdAt: Date;\n  updatedAt: Date;\n  unreadCount: number;\n  chat?: Partial<ChatMessage>;\n  users: ChannelUser[];\n  metadata?: MetadataInput[];\n}\n\nexport interface ChatChannelOptions {\n  chatClient: ChatApi;\n  gatewayClient: GatewayApi;\n  accountClient: AccountApi;\n  eventsClient?: EventsApi;\n  roomId?: string;\n  senderId?: string;\n  lastKey?: string;\n  lastKeys: Map<string, string[]>;\n}\n\nexport interface GetMessagesParams {\n  limit?: number;\n  after?: string;\n}\n\nexport interface GetMessagesResponse {\n  roomId: string;\n  count: number;\n  lastKey?: string;\n  chats: ChatMessage[] | [];\n}\n\nexport interface SendTextMessageParams {\n  message: string;\n  replyTo?: string;\n}\n\nexport interface SubscriptionObserver<T> {\n  start?: (subscription: Subscription) => void;\n  next: (value: T) => void;\n  error?: (error: any) => void;\n  complete?: () => void;\n}\n\nexport interface NewMessageData {\n  data: NewMessageSubscription;\n}\n\nexport type SubscriptionCallback<TData = any> = ({\n  data,\n  error,\n  connected,\n}: {\n  data?: TData;\n  error?: Error;\n  connected?: boolean;\n}) => void;\n\nexport interface SendMediaMessageParams {\n  file: ReactNativeFile | any;\n  replyTo?: string;\n}\n\nexport type MetadataInput = {\n  key: string;\n  value: string;\n};\n\nexport type GetIndividualMessageParam = {\n  id: string;\n  roomId?: string;\n};\n\nexport type NaluriLogout = {\n  success: boolean;\n};\n"]}