Fixed transport.request querystring type (#1240)
This commit is contained in:
committed by
GitHub
parent
71a74be321
commit
aa7d7b02ad
2
lib/Transport.d.ts
vendored
2
lib/Transport.d.ts
vendored
@ -80,7 +80,7 @@ export interface TransportRequestParams {
|
||||
path: string;
|
||||
body?: RequestBody;
|
||||
bulkBody?: RequestNDBody;
|
||||
querystring?: Record<string, any>;
|
||||
querystring?: Record<string, any> | string;
|
||||
}
|
||||
|
||||
export interface TransportRequestOptions {
|
||||
|
||||
@ -102,6 +102,16 @@ expectType<Transport>(transport)
|
||||
|
||||
expectType<TransportRequestCallback>(transport.request(params, options, (err, result) => {}))
|
||||
|
||||
// querystring as string
|
||||
transport.request({
|
||||
method: 'GET',
|
||||
path: '/search',
|
||||
querystring: 'baz=faz'
|
||||
}, options, (err, result) => {
|
||||
expectType<ApiError>(err)
|
||||
expectType<ApiResponse>(result)
|
||||
})
|
||||
|
||||
// body as object
|
||||
transport.request(params, options, (err, result) => {
|
||||
expectType<ApiError>(err)
|
||||
|
||||
Reference in New Issue
Block a user