@refinio/one.models
    Preparing search index...

    Implements

    Index

    Constructors

    Methods

    • Get all available group topics.

      Returns Promise<Topic[]>

    • Get all available one to one topics.

      Returns Promise<Topic[]>

    • Get all possible group topic ids from groups in the leute model.

      Returns Promise<string[]>

    • Get all possible one to one topic ids with other people in the leute model.

      Returns Promise<string[]>

    • Get all possible topic ids, includes one to one and group topics.

      Returns Promise<string[]>

    • Get and listen for new messages in a chat. Ensure to call shutdown() on the returned object when you are done listening for messages.

      Parameters

      • topicId: string
      • onMessagesUpdate: (messages: CachedChatMessage[]) => void | Promise<void>
      • onNewMessages: () => void | Promise<void>
      • onAttachmentUpdate: () => void | Promise<void>
      • options: {
            authorId?: SHA256IdHash<Person>;
            batchSize?: number;
            onAsyncError?: (error: any) => void;
            ownerId?: SHA256IdHash<Person>;
        }
        • OptionalauthorId?: SHA256IdHash<Person>

          author of the messages, if not set, will use the main identity of the leute model

        • OptionalbatchSize?: number

          number of messages to load at a time

        • OptionalonAsyncError?: (error: any) => void

          called when there is an error in the async process

        • OptionalownerId?: SHA256IdHash<Person>

          owner of the channel, if not set, will try to find the owner of the topicId channel or use no owner if not found

      Returns Promise<{ loadNextBatch: () => void; shutdown: () => void }>

      if the channel is not found

    • Get a channel iterator for the selected chat.

      Parameters

      • topicId: string
      • OptionalownerId: SHA256IdHash<Person>

      Returns Promise<undefined | AsyncIterableIterator<RawChannelEntry, any, any>>

      if the channel is not found

    • Get a topic by id. If the topic does not exist, it will be created.

      Parameters

      • topicId: string

      Returns Promise<Topic>

    • Get the topic room owner of the channel.

      Parameters

      • topicId: string
      • OptionalownerId: SHA256IdHash<Person>

      Returns Promise<null | SHA256IdHash<Person>>

      ownerId or null, if no owner is set

      if the channel is not found

    • Send a message to a topic. If the topic does not exist, it will be created.

      Parameters

      Returns Promise<void>

      if the channel is not found