Skip to content

Commit d40a609

Browse files
committed
fix: 优化类型声明
1 parent e91f2da commit d40a609

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

dist/cos-js-sdk-v5.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12705,7 +12705,8 @@ var defaultOptions = {
1270512705
// 周期性上报,单位毫秒。0代表实时上报
1270612706
CustomId: '',
1270712707
// 自定义上报id
12708-
AutoSwitchHost: true
12708+
AutoSwitchHost: true,
12709+
CopySourceParser: null // 自定义拷贝源解析器
1270912710
};
1271012711

1271112712
// 对外暴露的类

dist/cos-js-sdk-v5.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.d.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ declare namespace COS {
126126
/** 上传/下载的进度回调方法 */
127127
type onProgress = (params: ProgressInfo) => any;
128128

129+
type CopySourceParserFunction = (source: string) => null | { Bucket: string; Region: string; Key: string };
130+
129131
// 实例参数
130132
interface COSOptions {
131133
/** 固定密钥的 SecretId,可从{@link https://console.cloud.tencent.com/cam/capi|API密钥管理}获取 */
@@ -193,7 +195,7 @@ declare namespace COS {
193195
CustomId?: string;
194196
/** 链路上报 */
195197
AutoSwitchHost?: boolean;
196-
CopySourceParser?: (source: string) => null | { Bucket: string; Region: string; Key: string };
198+
CopySourceParser?: null | CopySourceParserFunction;
197199
/** 获取签名的回调方法,如果没有 SecretId、SecretKey 时,必选 */
198200
getAuthorization?: (
199201
options: GetAuthorizationOptions,

src/cos.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ var defaultOptions = {
4343
TrackerDelay: 5000, // 周期性上报,单位毫秒。0代表实时上报
4444
CustomId: '', // 自定义上报id
4545
AutoSwitchHost: true,
46+
CopySourceParser: null, // 自定义拷贝源解析器
4647
};
4748

4849
// 对外暴露的类

0 commit comments

Comments
 (0)