File tree Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Expand file tree Collapse file tree 2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change 1+ import { Writable , Readable } from 'node:stream' ;
2+ import { IncomingHttpHeaders } from 'node:http' ;
13import { expectType } from 'tsd' ;
2- import { Writable , Readable } from 'stream' ;
34import {
45 GetObjectOptions ,
56 IObjectSimple ,
@@ -36,7 +37,7 @@ class SimpleClient implements IObjectSimple {
3637 status : 200 ,
3738 res : {
3839 status : 200 ,
39- headers : { } ,
40+ headers : { } as IncomingHttpHeaders ,
4041 size : 0 ,
4142 rt : 0 ,
4243 } ,
@@ -78,7 +79,8 @@ expectType<Promise<GetObjectResult>>(simpleClient.get('foo'));
7879const result = await simpleClient . getStream ( 'foo' ) ;
7980expectType < Readable > ( result . stream ) ;
8081expectType < number > ( result . res . status ) ;
81- expectType < string > ( result . res . headers . etag ) ;
82+ expectType < string | undefined > ( result . res . headers . etag ) ;
83+ expectType < string | string [ ] | undefined > ( result . res . headers [ 'set-cookie' ] ) ;
8284
8385let listResult = await simpleClient . list ( { prefix : 'foo' } ) ;
8486expectType < number > ( listResult . objects . length ) ;
Original file line number Diff line number Diff line change 11import { Readable , Writable } from 'node:stream' ;
2+ import { IncomingHttpHeaders } from 'node:http' ;
23
34export type StorageType = 'Standard' | 'IA' | 'Archive' ;
45
@@ -33,7 +34,7 @@ export interface NormalSuccessResponse {
3334 /** response status */
3435 status : number ;
3536 /** response headers */
36- headers : Record < string , string > ;
37+ headers : Record < string , string > | IncomingHttpHeaders ;
3738 /** response size */
3839 size : number ;
3940 /** request total use time (ms) */
You can’t perform that action at this time.
0 commit comments