Skip to content
Classcorev0.10.0

PaginatorBase

Holds a paginator's cursor and renders one page. Each transport extends this to add the nav handler and the method that sends the first page.

abstract class PaginatorBase<Item, Prefix extends string, Ctx>

Member visibility

Filter class members by access level.

constructor

Constructs a new instance of the PaginatorBase class

protected PaginatorBase(config: PaginatorConfig<Item, Prefix, Ctx>)

Showing members with Protected visibility and higher.

Properties

Methods

Item

The item type, inferred from the source.

Item

Prefix

The route prefix, inferred from config.prefix.

Prefix extends string

Ctx

The transport's page context.

Ctx

cursor

The page cursor, pass it to your @ButtonRoute.

public readonly cursor: PageCursor<Prefix>

buildPage()

Build one page as a ReplyResponse. Each transport wraps this in a page() taking its handler.

protected async buildPage(
    ctx: Ctx,
    n: number
): Promise<ReplyResponse>