@@ -13,14 +13,7 @@ import { WP_ADMIN_USER, WP_BASE_URL } from '../config';
13
13
import type { User } from './login' ;
14
14
import { login } from './login' ;
15
15
import { listMedia , uploadMedia , deleteMedia , deleteAllMedia } from './media' ;
16
- import {
17
- setupRest ,
18
- rest ,
19
- getMaxBatchSize ,
20
- batchRest ,
21
- RestOptions ,
22
- BatchRequest ,
23
- } from './rest' ;
16
+ import { setupRest , rest , getMaxBatchSize , batchRest } from './rest' ;
24
17
import { getPluginsMap , activatePlugin , deactivatePlugin } from './plugins' ;
25
18
import { deleteAllTemplates } from './templates' ;
26
19
import { activateTheme } from './themes' ;
@@ -117,13 +110,11 @@ class RequestUtils {
117
110
118
111
login = login . bind ( this ) ;
119
112
setupRest = setupRest . bind ( this ) ;
120
- rest = rest . bind ( this ) as < RestResponse = any > (
121
- options : RestOptions
122
- ) => Promise < RestResponse > ;
113
+ // .bind() drops the generic types. Re-casting it to keep the type signature.
114
+ rest = rest . bind ( this ) as typeof rest ;
123
115
getMaxBatchSize = getMaxBatchSize . bind ( this ) ;
124
- batchRest = batchRest . bind ( this ) as < BatchResponse > (
125
- requests : BatchRequest [ ]
126
- ) => Promise < BatchResponse [ ] > ;
116
+ // .bind() drops the generic types. Re-casting it to keep the type signature.
117
+ batchRest = batchRest . bind ( this ) as typeof batchRest ;
127
118
getPluginsMap = getPluginsMap . bind ( this ) ;
128
119
activatePlugin = activatePlugin . bind ( this ) ;
129
120
deactivatePlugin = deactivatePlugin . bind ( this ) ;
0 commit comments