File tree Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Expand file tree Collapse file tree 3 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ declare module 'replicate' {
69
69
70
70
export type Training = Prediction ;
71
71
72
- interface Page < T > {
72
+ export interface Page < T > {
73
73
previous ?: string ;
74
74
next ?: string ;
75
75
results : T [ ] ;
@@ -80,13 +80,13 @@ declare module 'replicate' {
80
80
auth ?: string ;
81
81
userAgent ?: string ;
82
82
baseUrl ?: string ;
83
- fetch ?: Function ;
83
+ fetch ?: ( input : Request | string , init ?: RequestInit ) => Promise < Response >
84
84
} ) ;
85
85
86
86
auth : string ;
87
87
userAgent ?: string ;
88
88
baseUrl ?: string ;
89
- fetch : Function ;
89
+ fetch : ( input : Request | string , init ?: RequestInit ) => Promise < Response >
90
90
91
91
run (
92
92
identifier : `${string } /${string } ` | `${string } /${string } :${string } `,
Original file line number Diff line number Diff line change @@ -188,9 +188,9 @@ class Replicate {
188
188
data,
189
189
} = options ;
190
190
191
- Object . entries ( params ) . forEach ( ( [ key , value ] ) => {
191
+ for ( const [ key , value ] of Object . entries ( params ) ) {
192
192
url . searchParams . append ( key , value ) ;
193
- } ) ;
193
+ }
194
194
195
195
const headers = new Headers ( ) ;
196
196
if ( auth ) {
@@ -199,9 +199,9 @@ class Replicate {
199
199
headers . append ( 'Content-Type' , 'application/json' ) ;
200
200
headers . append ( 'User-Agent' , userAgent ) ;
201
201
if ( options . headers ) {
202
- options . headers . forEach ( ( value , key ) => {
202
+ for ( const [ key , value ] of options . headers . entries ( ) ) {
203
203
headers . append ( key , value ) ;
204
- } ) ;
204
+ }
205
205
}
206
206
207
207
const init = {
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ const BASE_URL = 'https://api.replicate.com/v1';
9
9
nock . disableNetConnect ( ) ;
10
10
11
11
describe ( 'Replicate client' , ( ) => {
12
- let unmatched : Object [ ] = [ ] ;
12
+ let unmatched : any [ ] = [ ] ;
13
13
const handleNoMatch = ( req : unknown , options : any , body : string ) =>
14
14
unmatched . push ( { req, options, body } ) ;
15
15
You can’t perform that action at this time.
0 commit comments