Skip to content

Commit

Permalink
Make "UploadResult" type public
Browse files Browse the repository at this point in the history
  • Loading branch information
ljwagerfield committed Apr 24, 2024
1 parent b6ba4a6 commit 98152df
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
3 changes: 1 addition & 2 deletions src/private/UploadManagerBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ import { PreUploadInfo } from "./model/PreUploadInfo";
import { UploadSourceBlob } from "./model/UploadSourceProcessed";
import { PutUploadPartResult } from "./model/PutUploadPartResult";
import { AddCancellationHandler } from "./model/AddCancellationHandler";
import { UploadResult } from "./model/UploadResult";
import { UploadManagerParams, UploadProgress, UploadSource } from "../public/shared/CommonTypes";
import { UploadManagerParams, UploadProgress, UploadSource, UploadResult } from "../public/shared/CommonTypes";

/**
* Methods common to UploadManagerNode and UploadManagerBrowser.
Expand Down
8 changes: 0 additions & 8 deletions src/private/model/UploadResult.ts

This file was deleted.

9 changes: 8 additions & 1 deletion src/public/shared/CommonTypes.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BeginMultipartUploadRequest } from "./generated";
import { BeginMultipartUploadRequest, FileDetails } from "./generated";

/**
* Workaround for tsc aliases, where we cannot export implementation-less modules in our dists.
Expand All @@ -23,6 +23,13 @@ export interface UploadProgress {
progress: number;
}

export type UploadResult = Omit<FileDetails, "etag"> & {
/**
* The file's ETag, short for "entity tag", reflects the file's version and changes whenever the file is modified.
*/
etag: string;
};

export type UploadSource = NodeJS.ReadableStream | BlobLike | Buffer | string;

export interface UploadManagerParams extends Omit<BeginMultipartUploadRequest, "size" | "protocol"> {
Expand Down

0 comments on commit 98152df

Please sign in to comment.