Skip to content

Documentation / joplin-api / PageUtil

Class: PageUtil

Defined in: util/PageUtil.ts:9

Constructors

new PageUtil()

new PageUtil(): PageUtil

Returns

PageUtil

Methods

pageToAllList()

Call Signature

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

Defined in: util/PageUtil.ts:23

Get all list from page Get max limit each time, reduce request times

Type Parameters

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

Parameters
fn

F

The function to get page data

pageParam?

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

The page parameter

Returns

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

The all list

Call Signature

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

Defined in: util/PageUtil.ts:27

Get all list from page Get max limit each time, reduce request times

Type Parameters

K extends keyof NoteProperties

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

Parameters
fn

F

The function to get page data

pageParam

object & PageParam<NoteProperties> & FieldsParam<K>

The page parameter

Returns

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

The all list

Released under the MIT License.