Skip to content

Commit 9279ee1

Browse files
🤖 Merge PR DefinitelyTyped#74410 [ali-oss] Add cancel and isCancel methods by @shangzhenyang
1 parent 4e6b83f commit 9279ee1

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

‎types/ali-oss/ali-oss-tests.ts‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,3 +147,15 @@ const userMeta: OSS.UserMeta = {
147147
pid: 0,
148148
anything: "anything",
149149
};
150+
151+
// $ExpectType void
152+
client.cancel();
153+
154+
// $ExpectType void
155+
client.cancel({ name: "object-name", uploadId: "upload-id" });
156+
157+
// $ExpectType void
158+
client.cancel({ name: "object-name", uploadId: "upload-id", options: { timeout: 1000 } });
159+
160+
// $ExpectType boolean
161+
client.isCancel();

‎types/ali-oss/index.d.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1209,6 +1209,17 @@ declare class OSS {
12091209
options?: OSS.RequestOptions,
12101210
): Promise<OSS.NormalSuccessResponse>;
12111211

1212+
/**
1213+
* Cancel the current multipart upload operation.
1214+
* If abort is provided, it will also call abortMultipartUpload.
1215+
*/
1216+
cancel(abort?: { name: string; uploadId: string; options?: OSS.RequestOptions }): void;
1217+
1218+
/**
1219+
* Check if the upload has been cancelled.
1220+
*/
1221+
isCancel(): boolean;
1222+
12121223
/**
12131224
* get postObject params.
12141225
*/

0 commit comments

Comments
 (0)