Documentation - v0.27.1
    Preparing search index...
    Index

    Constructors

    Properties

    catchingUp: boolean = false
    catchUpOnStart: boolean
    channelDiffTimeouts: Map<number, Timer> = ...
    channelsOpened: Map<number, number> = ...
    cpts: Map<number, number> = ...
    cptsMod: Map<number, number> = ...
    date?: number
    hasTimedoutPostponed: boolean = false
    keepAliveInterval?: Interval
    lock: AsyncLock = ...
    log: Logger
    noDispatchEnabled: boolean
    noDispatchMsg: Map<number, Set<number>> = ...
    noDispatchPts: Map<number, Set<number>> = ...
    noDispatchQts: Set<number> = ...
    oldDate?: number
    oldPts?: number
    oldQts?: number
    oldSeq?: number
    pendingPtsUpdates: SortedArray<PendingUpdate> = ...
    pendingPtsUpdatesPostponed: SortedArray<PendingUpdate> = ...
    pendingQtsUpdates: SortedArray<PendingUpdate> = ...
    pendingQtsUpdatesPostponed: SortedArray<PendingUpdate> = ...
    pendingUnorderedUpdates: Deque<PendingUpdate> = ...
    pendingUpdateContainers: SortedArray<PendingUpdateContainer> = ...
    postponedTimer: EarlyTimer = ...
    pts?: number
    qts?: number
    seq?: number
    updatesLoopActive: boolean = false
    updatesLoopCv: ConditionVariable = ...

    Methods

    • Parameters

      • requestedDiff: Map<number, Promise<void>>
      • channelId: number
      • OptionalfallbackPts: number

      Returns void

    • Catch up with the server by loading missed updates. .

      Note: In case the storage was not properly closed the last time, "catching up" might result in duplicate updates.

      Returns void

    • ADVANCED

      Notify the updates manager that some channel was "closed". Basically the opposite of notifyChannelOpened. This is a low-level method, prefer using closeChat instead.

      Parameters

      • channelId: number

        Bare channel ID

      Returns boolean

      true if the chat was closed for the last time, false otherwise

    • ADVANCED

      Notify the updates manager that some channel was "opened". Channel difference for "opened" channels will be fetched on a regular basis. This is a low-level method, prefer using openChat instead.

      Channel must be resolve-able with resolvePeer method (i.e. be in cache); base chat PTS must either be passed (e.g. from Dialog), or cached in storage.

      Parameters

      • channelId: number

        Bare ID of the channel

      • Optionalpts: number

        PTS of the channel, if known (e.g. from Dialog)

      Returns boolean

      true if the channel was opened for the first time, false if it is already opened

    • Start updates loop.

      You must first call enableUpdatesProcessing to use this method.

      It is recommended to use this method in callback to start, or otherwise make sure the user is logged in.

      Note: If you are using UpdatesManagerParams.catchUp option, catching up will be done in background, you can't await it. Instead, listen for the updating and connected connection state events.

      Returns Promise<void>