Skip to content

Commit

Permalink
Add comments
Browse files Browse the repository at this point in the history
  • Loading branch information
WCByrne committed Sep 30, 2024
1 parent f8e4c15 commit fd8902a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ export type AssetItem = {
const MAX_UNCHUNKED_UPLOAD_SIZE = 20000000;
const MAX_UPLOAD_CHUNK_SIZE = 10000000;

/**
* An upload is created for the underlying asset file and its metadata.
* Item data can be provided when callin upload.
*/
export class Upload {
size: number;
filePath: string;
Expand Down Expand Up @@ -72,6 +76,11 @@ export class Upload {
this.assetData = json;
}

/**
* Begin the file upload.
* @param item Optional item data to place the asset in a kit. If no item is provided, the asset will be uploaded to the library.
* @returns
*/
async upload(item?: AssetItem & { type?: ItemType; data?: ItemData }) {
const json: Record<string, unknown> = { ...this.assetData };
if (item) {
Expand Down

0 comments on commit fd8902a

Please sign in to comment.