wpapi: some missing function

This commit is contained in:
Guo Yunhe
2018-03-17 23:21:45 +02:00
parent d337cc5fc5
commit b3f5f3c9e5
+22
View File
@@ -27,6 +27,9 @@ declare class WPAPI {
*/
static discover(url: string): Promise<WPAPI>;
/** Start a request of plugin authors endpoint */
authors(): WPAPI.WPRequest;
/** Start a request against /categories endpoint */
categories(): WPAPI.WPRequest;
@@ -251,6 +254,13 @@ declare namespace WPAPI {
*/
get(callback?: Function): Promise<any>;
/**
* Set the id of resource.
*
* @param id An ID of item
*/
id(id: number): WPRequest;
/**
* Include specific resource IDs in the response collection.
*
@@ -373,6 +383,18 @@ declare namespace WPAPI {
*/
toString(): string;
/**
* Update the specified resource with the provided data
*
* This is the public interface for creating PATCH requests
*
* TODO: callback type
*
* @param data The data for the PATCH request
* @param callback A callback to invoke with the results of the PATCH request
*/
update(data: Object, callback?: Function): Promise<any>;
/**
* Validate whether the specified path parts are valid for this endpoint
*