@@ -69,12 +69,11 @@ export type ExtendOptions = {
6969 mutableDefaults ?: boolean ;
7070} & Except < OptionsInit , 'url' > ;
7171
72- type OptionsInitWithoutUrl = Except < OptionsInit , 'url' > ;
72+ export type StreamOptions = Except < OptionsInit , 'url' > ;
7373
74- export type StrictOptions = Except < OptionsInitWithoutUrl , 'responseType' | 'resolveBodyOnly' > ;
75- export type StreamOptions = OptionsInitWithoutUrl ;
74+ export type StrictOptions = Except < StreamOptions , 'responseType' | 'resolveBodyOnly' > ;
7675
77- export type OptionsWithPagination < T = unknown , R = unknown > = Merge < OptionsInitWithoutUrl , { pagination ?: PaginationOptions < T , R > } > ;
76+ export type OptionsWithPagination < T = unknown , R = unknown > = Merge < StreamOptions , { pagination ?: PaginationOptions < T , R > } > ;
7877
7978/**
8079An instance of `got.paginate`.
@@ -150,6 +149,7 @@ export type OptionsOfBufferResponseBody = Merge<StrictOptions, {responseType?: '
150149export type OptionsOfBufferResponseBodyOnly = Merge < StrictOptions , { resolveBodyOnly : true ; responseType ?: 'buffer' } > ;
151150export type OptionsOfBufferResponseBodyWrapped = Merge < StrictOptions , { resolveBodyOnly : false ; responseType ?: 'buffer' } > ;
152151
152+ // TODO: Remove in the next major version - it's a pure alias for `StrictOptions`.
153153export type OptionsOfUnknownResponseBody = StrictOptions ;
154154export type OptionsOfUnknownResponseBodyOnly = Merge < StrictOptions , { resolveBodyOnly : true } > ;
155155export type OptionsOfUnknownResponseBodyWrapped = Merge < StrictOptions , { resolveBodyOnly : false } > ;
@@ -200,12 +200,12 @@ export type GotRequestFunction<U extends ExtendOptions = Record<string, unknown>
200200 ( options : OptionsOfBufferResponseBodyOnly ) : RequestPromise < Uint8Array < ArrayBuffer > > ;
201201
202202 // Fallback
203- ( url : string | URL , options ?: OptionsInitWithoutUrl ) : RequestPromise | Request ;
203+ ( url : string | URL , options ?: StreamOptions ) : RequestPromise ;
204204
205- ( options : OptionsInitWithoutUrl ) : RequestPromise | Request ;
205+ ( options : StreamOptions ) : RequestPromise ;
206206
207207 // Internal usage
208- ( url : undefined , options : undefined , defaults : Options ) : RequestPromise | Request ;
208+ ( url : undefined , options : undefined , defaults : Options ) : RequestPromise ;
209209} ;
210210
211211/**
0 commit comments