/** * ------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. * See License in the project root for license information. * ------------------------------------------------------------------------------------------- */ import { Client } from "../index"; import { UploadEventHandlers } from "./FileUploadTask/Interfaces/IUploadEventHandlers"; import { FileObject, LargeFileUploadSession, LargeFileUploadTask, LargeFileUploadTaskOptions } from "./LargeFileUploadTask"; /** * @interface * Signature to define options when creating an upload task * @property {string} fileName - Specifies the name of a file to be uploaded (with extension) * @property {string} [fileDescription] - Specifies the description of the file to be uploaded * @property {string} [path] - The path to which the file needs to be uploaded * @property {number} [rangeSize] - Specifies the range chunk size * @property {string} [conflictBehavior] - Conflict behaviour option * @property {UploadEventHandlers} [uploadEventHandlers] - UploadEventHandlers attached to an upload task */ export interface OneDriveLargeFileUploadOptions { fileName: string; fileDescription?: string; path?: string; rangeSize?: number; conflictBehavior?: string; uploadEventHandlers?: UploadEventHandlers; uploadSessionURL?: string; } /** * @interface * Signature to define options when creating an upload task * @property {string} fileName - Specifies the name of a file to be uploaded (with extension) * @property {string} [fileDescription] - Specifies the description of the file to be uploaded * @property {string} [conflictBehavior] - Conflict behaviour option */ interface OneDriveFileUploadSessionPayLoad { fileName: string; fileDescription?: string; conflictBehavior?: string; } /** * @class * Class representing OneDriveLargeFileUploadTask */ export declare class OneDriveLargeFileUploadTask extends LargeFileUploadTask { /** * @private * @static * Default path for the file being uploaded */ private static DEFAULT_UPLOAD_PATH; /** * @private * @static * Constructs the create session url for Onedrive * @param {string} fileName - The name of the file * @param {path} [path = OneDriveLargeFileUploadTask.DEFAULT_UPLOAD_PATH] - The path for the upload * @returns The constructed create session url */ private static constructCreateSessionUrl; /** * @private * @static * Get file information * @param {Blob | Uint8Array | File} file - The file entity * @param {string} fileName - The file name * @returns {FileInfo} The file information */ private static getFileInfo; /** * @public * @static * @async * Creates a OneDriveLargeFileUploadTask * @param {Client} client - The GraphClient instance * @param {Blob | Uint8Array | File} file - File represented as Blob, Uint8Array or File * @param {OneDriveLargeFileUploadOptions} options - The options for upload task * @returns The promise that will be resolves to OneDriveLargeFileUploadTask instance */ static create(client: Client, file: Blob | Uint8Array | File, options: OneDriveLargeFileUploadOptions): Promise>; /** * @public * @static * @async * Creates a OneDriveLargeFileUploadTask * @param {Client} client - The GraphClient instance * @param {FileObject} fileObject - FileObject instance * @param {OneDriveLargeFileUploadOptions} options - The options for upload task * @returns The promise that will be resolves to OneDriveLargeFileUploadTask instance */ static createTaskWithFileObject(client: Client, fileObject: FileObject, options: OneDriveLargeFileUploadOptions): Promise>; /** * @public * @static * @async * Makes request to the server to create an upload session * @param {Client} client - The GraphClient instance * @param {string} requestUrl - The URL to create the upload session * @param {string} payloadOptions - The payload option. Default conflictBehavior is 'rename' * @returns The promise that resolves to LargeFileUploadSession */ static createUploadSession(client: Client, requestUrl: string, payloadOptions: OneDriveFileUploadSessionPayLoad): Promise; /** * @public * @constructor * Constructs a OneDriveLargeFileUploadTask * @param {Client} client - The GraphClient instance * @param {FileObject} file - The FileObject holding details of a file that needs to be uploaded * @param {LargeFileUploadSession} uploadSession - The upload session to which the upload has to be done * @param {LargeFileUploadTaskOptions} options - The upload task options * @returns An instance of OneDriveLargeFileUploadTask */ constructor(client: Client, file: FileObject, uploadSession: LargeFileUploadSession, options: LargeFileUploadTaskOptions); /** * @public * Commits upload session to end uploading * @param {string} requestUrl - The URL to commit the upload session * @param {string} conflictBehavior - Conflict behaviour option. Default is 'rename' * @returns The promise resolves to committed response */ commit(requestUrl: string, conflictBehavior?: string): Promise; } export {};