Skip to content

Documentation / joplin-api / NoteApi

Class: NoteApi

TODO 可以考虑使用 fields() 方法设置然后产生一个新的 Api 实例

Constructors

new NoteApi()

new NoteApi(ajax): NoteApi

Parameters

ajax: Ajax

Returns

NoteApi

Defined in

api/NoteApi.ts:20

Methods

create()

create(param): Promise<NoteCreateRes>

Parameters

param: RequiredField<Partial<NoteProperties>, "title">

Returns

Promise<NoteCreateRes>

Defined in

api/NoteApi.ts:39


get()

get(id)

get(id): Promise<NoteGetRes & CommonType>

Parameters

id: string

Returns

Promise<NoteGetRes & CommonType>

Defined in

api/NoteApi.ts:30

get(id, fields)

get<K>(id, fields?): Promise<Pick<NoteProperties, K> & CommonType>

Type Parameters

K extends keyof NoteProperties = "id" | "title" | "parent_id"

Parameters

id: string

fields?: K[]

Returns

Promise<Pick<NoteProperties, K> & CommonType>

Defined in

api/NoteApi.ts:31


list()

list(undefined)

list(): Promise<PageRes<NoteGetRes>>

Returns

Promise<PageRes<NoteGetRes>>

Defined in

api/NoteApi.ts:22

list(pageParam)

list<K>(pageParam): Promise<PageRes<Pick<NoteProperties, K>>>

Type Parameters

K extends keyof NoteProperties = "id" | "title" | "parent_id"

Parameters

pageParam: PageParam<NoteProperties> & FieldsParam<K>

Returns

Promise<PageRes<Pick<NoteProperties, K>>>

Defined in

api/NoteApi.ts:23


remove()

remove(id): Promise<void>

Parameters

id: string

Returns

Promise<void>

Defined in

api/NoteApi.ts:48


resourcesById()

resourcesById(id)

resourcesById(id): Promise<ResourceGetRes[]>

Parameters

id: string

Returns

Promise<ResourceGetRes[]>

Defined in

api/NoteApi.ts:59

resourcesById(id, fields)

resourcesById<K>(id, fields): Promise<Pick<ResourceProperties, K> & CommonType[]>

Type Parameters

K extends keyof ResourceProperties = "id" | "title"

Parameters

id: string

fields: K[]

Returns

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

Defined in

api/NoteApi.ts:60


tagsById()

tagsById(id): Promise<TagGetRes[]>

Parameters

id: string

Returns

Promise<TagGetRes[]>

Defined in

api/NoteApi.ts:52


update()

update(param): Promise<NoteUpdateRes>

Parameters

param: RequiredField<Partial<NoteProperties>, "id">

Returns

Promise<NoteUpdateRes>

Defined in

api/NoteApi.ts:43

Released under the MIT License.