@@ -191,6 +191,13 @@ declare namespace COS {
191191 ) => void ,
192192 }
193193
194+ type StringOrBuffer = Buffer | String ;
195+ interface Util {
196+ md5 : ( StringOrBuffer ) => string ,
197+ xml2json : ( string ) => string,
198+ json2xml : ( string ) => string,
199+ }
200+
194201 interface StaticGetAuthorizationOptions {
195202 /** 计算签名用的密钥 SecretId,必选 */
196203 SecretId : string ,
@@ -217,6 +224,7 @@ declare namespace COS {
217224 /** 校正时间的偏移值,单位 ms(毫秒),计算签名时会用设备当前时间戳加上该偏移值,在设备时间有误时可用于校正签名用的时间参数。 */
218225 SystemClockOffset ?: number ,
219226 }
227+
220228 /** 计算签名或获取临时密钥可能需要的参数列表 */
221229 interface GetAuthorizationOptions {
222230 /** 存储桶的名称,格式为<bucketname-appid>,例如examplebucket-1250000000 */
@@ -1832,9 +1840,11 @@ Bulk:批量模式,恢复时间为24 - 48小时。 */
18321840
18331841 // request
18341842 /** request 接口参数 */
1835- interface RequestParams extends ObjectParams {
1843+ interface RequestParams extends BucketParams {
18361844 /** 操作方法,如 get,post,delete, head 等 HTTP 方法 */
18371845 Method : string ,
1846+ /** 请求的对象键,最前面不带 / */
1847+ Key ?: Key ,
18381848 /** 请求里的 Url Query 参数 */
18391849 Query ?: Query ,
18401850 /** 请求里的 Body 参数 */
@@ -1843,7 +1853,9 @@ Bulk:批量模式,恢复时间为24 - 48小时。 */
18431853 Action : Action
18441854 }
18451855 /** Request 接口返回值 */
1846- interface RequestResult extends GeneralResult { }
1856+ interface RequestResult extends GeneralResult {
1857+ Body ?: Buffer ,
1858+ }
18471859
18481860 // getObjectUrl
18491861 /** getObjectUrl 接口参数 */
@@ -1920,6 +1932,9 @@ declare class COS {
19201932 /** 计算签名 */
19211933 static getAuthorization : ( options : COS . StaticGetAuthorizationOptions ) => string ;
19221934
1935+ /** 工具 */
1936+ static util : COS . Util ;
1937+
19231938 // 实例方法
19241939 /** 获取用户的 bucket 列表 @see https://cloud.tencent.com/document/product/436/8291 */
19251940 getService ( params : COS . GetServiceParams , callback : ( err : COS . CosError , data : COS . GetServiceResult ) => void ) : void ;
0 commit comments