Skip to content

Documentation / joplin-api / PageUtil

Class: PageUtil

Constructors

new PageUtil()

new PageUtil(): PageUtil

Returns

PageUtil

Methods

pageToAllList()

pageToAllList(fn, pageParam)

static pageToAllList<F>(fn, pageParam?): Promise<PageResValueType<ReturnType<F>>[]>

循环获取所有分页的数据 每次都获取最大分页数量,尽可能减少请求次数

Type Parameters

F extends (pageParam) => Promise<PageRes<any>>

Parameters

fn: F

pageParam?: Omit<Parameters<F>[0], "page" | "limit">

Returns

Promise<PageResValueType<ReturnType<F>>[]>

Defined in

util/PageUtil.ts:21

pageToAllList(fn, pageParam)

static pageToAllList<K, F>(fn, pageParam): Promise<Pick<NoteProperties, K> & CommonType[]>

Type Parameters

K extends keyof NoteProperties

F extends (pageParam) => Promise<PageRes<Pick<NoteProperties, K> & CommonType>>

Parameters

fn: F

pageParam: object & PageParam<NoteProperties> & FieldsParam<K>

Returns

Promise<Pick<NoteProperties, K> & CommonType[]>

Defined in

util/PageUtil.ts:25

Released under the MIT License.