@@ -191,6 +191,13 @@ declare namespace COS {
191
191
) => void ,
192
192
}
193
193
194
+ type StringOrBuffer = Buffer | String ;
195
+ interface Util {
196
+ md5 : ( StringOrBuffer ) => string ,
197
+ xml2json : ( string ) => string,
198
+ json2xml : ( string ) => string,
199
+ }
200
+
194
201
interface StaticGetAuthorizationOptions {
195
202
/** 计算签名用的密钥 SecretId,必选 */
196
203
SecretId : string ,
@@ -217,6 +224,7 @@ declare namespace COS {
217
224
/** 校正时间的偏移值,单位 ms(毫秒),计算签名时会用设备当前时间戳加上该偏移值,在设备时间有误时可用于校正签名用的时间参数。 */
218
225
SystemClockOffset ?: number ,
219
226
}
227
+
220
228
/** 计算签名或获取临时密钥可能需要的参数列表 */
221
229
interface GetAuthorizationOptions {
222
230
/** 存储桶的名称,格式为<bucketname-appid>,例如examplebucket-1250000000 */
@@ -1832,9 +1840,11 @@ Bulk:批量模式,恢复时间为24 - 48小时。 */
1832
1840
1833
1841
// request
1834
1842
/** request 接口参数 */
1835
- interface RequestParams extends ObjectParams {
1843
+ interface RequestParams extends BucketParams {
1836
1844
/** 操作方法,如 get,post,delete, head 等 HTTP 方法 */
1837
1845
Method : string ,
1846
+ /** 请求的对象键,最前面不带 / */
1847
+ Key ?: Key ,
1838
1848
/** 请求里的 Url Query 参数 */
1839
1849
Query ?: Query ,
1840
1850
/** 请求里的 Body 参数 */
@@ -1843,7 +1853,9 @@ Bulk:批量模式,恢复时间为24 - 48小时。 */
1843
1853
Action : Action
1844
1854
}
1845
1855
/** Request 接口返回值 */
1846
- interface RequestResult extends GeneralResult { }
1856
+ interface RequestResult extends GeneralResult {
1857
+ Body ?: Buffer ,
1858
+ }
1847
1859
1848
1860
// getObjectUrl
1849
1861
/** getObjectUrl 接口参数 */
@@ -1920,6 +1932,9 @@ declare class COS {
1920
1932
/** 计算签名 */
1921
1933
static getAuthorization : ( options : COS . StaticGetAuthorizationOptions ) => string ;
1922
1934
1935
+ /** 工具 */
1936
+ static util : COS . Util ;
1937
+
1923
1938
// 实例方法
1924
1939
/** 获取用户的 bucket 列表 @see https://cloud.tencent.com/document/product/436/8291 */
1925
1940
getService ( params : COS . GetServiceParams , callback : ( err : COS . CosError , data : COS . GetServiceResult ) => void ) : void ;
0 commit comments