Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Feed

Feed is an API module for paginating post and annotation block types

extends

API

Hierarchy

  • API
    • Feed

Index

Constructors

Methods

Constructors

constructor

Methods

list

  • list(thread?: undefined | string, offset?: undefined | string, limit?: undefined | number, mode?: FeedModes): Promise<FeedItemList>
  • Retrieves post (join|leave|files|message) and annotation (comment|like) block type

    The mode option dictates how the feed is displayed:

    • chrono: All feed block types are shown. Annotations always nest their target post, i.e., the post a comment is about.
    • annotated: Annotations are nested under post targets, but are not shown in the top-level feed.
    • stacks: Related blocks are chronologically grouped into 'stacks'. A new stack is started if an unrelated block breaks continuity. This mode is used by Textile Photos. Stacks may include:
      • The initial post with some nested annotations. Newer annotations may have already been listed.
      • One or more annotations about a post. The newest annotation assumes the 'top' position in the stack. Additional annotations are nested under the target.
      • Newer annotations may have already been listed in the case as well.

    Parameters

    • Optional thread: undefined | string

      Thread ID (can also use ‘default’)

    • Optional offset: undefined | string

      Offset ID to start listing from (omit for latest)

    • Optional limit: undefined | number

      List page size (default: 5)

    • Optional mode: FeedModes

      Feed mode (one of 'chrono’, 'annotated’, or ‘stacks’)

    Returns Promise<FeedItemList>