Skip to content

Commit

Permalink
fix: 优化类型声明
Browse files Browse the repository at this point in the history
  • Loading branch information
livehigh committed Mar 5, 2024
1 parent e91f2da commit d40a609
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion dist/cos-js-sdk-v5.js
Original file line number Diff line number Diff line change
Expand Up @@ -12705,7 +12705,8 @@ var defaultOptions = {
// 周期性上报,单位毫秒。0代表实时上报
CustomId: '',
// 自定义上报id
AutoSwitchHost: true
AutoSwitchHost: true,
CopySourceParser: null // 自定义拷贝源解析器
};

// 对外暴露的类
Expand Down
2 changes: 1 addition & 1 deletion dist/cos-js-sdk-v5.min.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ declare namespace COS {
/** 上传/下载的进度回调方法 */
type onProgress = (params: ProgressInfo) => any;

type CopySourceParserFunction = (source: string) => null | { Bucket: string; Region: string; Key: string };

// 实例参数
interface COSOptions {
/** 固定密钥的 SecretId,可从{@link https://console.cloud.tencent.com/cam/capi|API密钥管理}获取 */
Expand Down Expand Up @@ -193,7 +195,7 @@ declare namespace COS {
CustomId?: string;
/** 链路上报 */
AutoSwitchHost?: boolean;
CopySourceParser?: (source: string) => null | { Bucket: string; Region: string; Key: string };
CopySourceParser?: null | CopySourceParserFunction;
/** 获取签名的回调方法,如果没有 SecretId、SecretKey 时,必选 */
getAuthorization?: (
options: GetAuthorizationOptions,
Expand Down
1 change: 1 addition & 0 deletions src/cos.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ var defaultOptions = {
TrackerDelay: 5000, // 周期性上报,单位毫秒。0代表实时上报
CustomId: '', // 自定义上报id
AutoSwitchHost: true,
CopySourceParser: null, // 自定义拷贝源解析器
};

// 对外暴露的类
Expand Down

0 comments on commit d40a609

Please sign in to comment.