@microsoft/msgraph-sdk-core
Version:
Core functionalities for the Microsoft Graph JavaScript SDK
46 lines • 2.43 kB
TypeScript
/**
* -------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License.
* See License in the project root for license information.
* -------------------------------------------------------------------------------------------
*/
import { ErrorMappings, Parsable, ParsableFactory, RequestAdapter } from "@microsoft/kiota-abstractions";
import { UploadResult, UploadSession } from "./LargeFileUploadTask.js";
import { SeekableStreamReader } from "./SeekableStreamReader.js";
/**
* @class
* Represents a slice of a file to be uploaded.
*
* @template T - The type of the parsable object.
*/
export declare class UploadSlice<T extends Parsable> {
readonly requestAdapter: RequestAdapter;
readonly sessionUrl: string;
readonly rangeBegin: number;
readonly rangeEnd: number;
readonly totalSessionLength: number;
readonly parsableFactory: ParsableFactory<T>;
readonly errorMappings: ErrorMappings;
readonly seekableStreamReader: SeekableStreamReader;
/**
* Constructs an instance of the UploadSlice class.
*
* @param {RequestAdapter} requestAdapter - The request adapter to use for making HTTP requests.
* @param {string} sessionUrl - The URL of the upload session.
* @param {number} rangeBegin - The beginning byte position of the slice.
* @param {number} rangeEnd - The ending byte position of the slice.
* @param {number} totalSessionLength - The total length of the upload session.
* @param {ParsableFactory<T>} parsableFactory - The factory to create parsable objects.
* @param {ErrorMappings} errorMappings - The mappings for handling errors.
* @param {SeekableStreamReader} seekableStreamReader - The stream reader to read the file slice.
*/
constructor(requestAdapter: RequestAdapter, sessionUrl: string, rangeBegin: number, rangeEnd: number, totalSessionLength: number, parsableFactory: ParsableFactory<T>, errorMappings: ErrorMappings, seekableStreamReader: SeekableStreamReader);
/**
* Uploads a slice of the file to the server.
*
* @returns {Promise<UploadResult<T> | undefined>} - The result of the upload operation.
*/
uploadSlice(): Promise<UploadResult<T> | UploadSession | undefined>;
private isUploadSessionResponse;
}
//# sourceMappingURL=UploadSlice.d.ts.map