Skip to content

Commit f588044

Browse files
committed
update request return
Request should return Promise according to axios
1 parent 15f61f6 commit f588044

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

index.d.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export default class WooCommerceRestApi {
124124
endpoint: string,
125125
data: any,
126126
params: any
127-
): any
127+
): Promise<any>
128128

129129
/**
130130
* GET requests
@@ -134,8 +134,8 @@ export default class WooCommerceRestApi {
134134
*
135135
* @return {Object}
136136
*/
137-
public get(endpoint: string): any
138-
public get(endpoint: string, params: any): any
137+
public get(endpoint: string): Promise<any>
138+
public get(endpoint: string, params: any): Promise<any>
139139

140140
/**
141141
* POST requests
@@ -146,8 +146,8 @@ export default class WooCommerceRestApi {
146146
*
147147
* @return {Object}
148148
*/
149-
public post(endpoint: string, data: any): any
150-
public post(endpoint: string, data: any, params: any): any
149+
public post(endpoint: string, data: any): Promise<any>
150+
public post(endpoint: string, data: any, params: any): Promise<any>
151151

152152
/**
153153
* PUT requests
@@ -158,8 +158,8 @@ export default class WooCommerceRestApi {
158158
*
159159
* @return {Object}
160160
*/
161-
public put(endpoint: string, data: any): any
162-
public put(endpoint: string, data: any, params: any): any
161+
public put(endpoint: string, data: any): Promise<any>
162+
public put(endpoint: string, data: any, params: any): Promise<any>
163163

164164
/**
165165
* DELETE requests
@@ -170,8 +170,8 @@ export default class WooCommerceRestApi {
170170
*
171171
* @return {Object}
172172
*/
173-
public delete(endpoint: string): any
174-
public delete(endpoint: string, params: any): any
173+
public delete(endpoint: string): Promise<any>
174+
public delete(endpoint: string, params: any): Promise<any>
175175

176176
/**
177177
* OPTIONS requests
@@ -181,8 +181,8 @@ export default class WooCommerceRestApi {
181181
*
182182
* @return {Object}
183183
*/
184-
public options(endpoint: string): any
185-
public options(endpoint: string, params: any): any
184+
public options(endpoint: string): Promise<any>
185+
public options(endpoint: string, params: any): Promise<any>
186186
}
187187

188188
/**

0 commit comments

Comments
 (0)