From b3f5f3c9e567c0d84ed3f94d5e67896ce772e63b Mon Sep 17 00:00:00 2001 From: Guo Yunhe Date: Sat, 17 Mar 2018 23:21:45 +0200 Subject: [PATCH] wpapi: some missing function --- types/wpapi/index.d.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/types/wpapi/index.d.ts b/types/wpapi/index.d.ts index 62d4583042..3f3c293119 100644 --- a/types/wpapi/index.d.ts +++ b/types/wpapi/index.d.ts @@ -27,6 +27,9 @@ declare class WPAPI { */ static discover(url: string): Promise; + /** 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; + /** + * 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; + /** * Validate whether the specified path parts are valid for this endpoint *