import { HttpTransfer, TransferSpec, DataTransferResponse, ConnectStyleFile, VideoPlayerOptions, FolderData } from './models'; declare class HttpGatewayGlobals { /** The URL of the server to use with the SDK */ serverUrl: string; /** Server information */ serverInfo: ServerInfo; /** Chunk size to use for uploads in bytes */ chunkSize: number; /** Indication that the server has been verified as working */ serverVerified: boolean; /** The ID to use for HTTP Gateway needed DOM items */ mainContainerId: string; /** The Element that is added to document for containing all items */ mainContainer: HTMLElement; /** The ID to use for the form container for forms */ formContainerId: string; /** The form container Element that is added to document */ formContainer: HTMLElement; /** The ID to use for the download container */ downloadsContainerId: string; /** The download container Element that is added to document to store download IFRAMEs */ downloadsContainer: HTMLElement; /** Map of all forms currently in the container */ formsAvailable: Map; /** Map of form with files from drop events */ formsFilesFromDrop: Map; /** Map of folders with files from drop events */ folderFiles: Map>; /** Indicates if running in software mode (no DOM) */ softwareMode: boolean; /** Indicates if multiple server support should be used (will not lock out if gateway server is not working) */ supportMultipleServers: boolean; /** Number of concurrent uploads to support */ concurrentUploads: number; /** Map of dropzones created by querySelector */ dropzonesCreated: Map void; }[]>; /** * Add a form item to the form container for transferring if form already exists the existing one is returned * * @param id ID to use for the form reference */ createOrUseForm(id: string): HTMLFormElement; /** * Delete a form from the container by the ID * * @param id the form to delete */ deleteFormFromContainer(id: string): void; /** * Removes all forms from the Parent container */ removeAllFormsFromContainer(): void; /** * Get or create an array of Files to store drop events in * * @param id the form to associate the files with */ getOrCreateFormFileListFromDrop(id: string): File[]; /** * Get or create an array of Folder data to store folder entries * * @param id the form to associate the folders with */ getOrCreateFolderDataList(id: string): Map; /** * Setup HTTP Gateway SDK server and formContainer * * @param serverUrl URL to use for the server * @param softwareMode indicate if software mode is in use * @param supportMultipleServers indicate if multiple servers are supported */ setUpServer(serverUrl: string, softwareMode?: boolean, supportMultipleServers?: boolean): void; backupDownloadMethod(url: string): void; /** * Download a file based on a URL. By default a hidden IFRAME attempts to download * the file but if that fails a fallback of opening a new window happens. * * @param url the URL of the file to download */ triggerDownloadFromUrl(url: string): void; } export declare class ServerInfo { /** The version of the HTTP Gateway Server */ version: string; /** The name of the HTTP Gateway Server */ name: string; /** List of endpoints supported on this HTTP Gateway Server */ endpoints: string[]; /** UI Item indicating that the SDK failed to verify this gateway setup */ sdkVerificationFailed?: boolean; } export declare class TransferResponse { iteration_token: string; result_count: number; transfers: HttpTransfer[]; } export declare class ActivityTracking { /** Map of transfers by ID */ private transfers; /** Map of callbacks that receive transfers */ private callbacks; /** Indicate if a callback should happen */ private needCallback; /** Queued uploads */ queuedUploads: { id: string; transferSpec: TransferSpec; files: File[]; }[]; constructor(); /** * Get transfer response object including all transfers * * @returns transfer data object with transfers array */ getAllTransfersResponse(): TransferResponse; /** * Remove all transfers that are not active */ clearNonActiveTransfers(): void; /** * Poll transfer callbacks */ pollCallbacks(): void; /** * Trigger activity callback on activity events */ triggerActivityCallbacks(): void; /** * Register a callback for getting transfers back to the consumer * * @param callback the function to call with the array of transfers * * @returns the ID of the callback index */ setCallback(callback: (transfers: TransferResponse) => void): string; /** * Remove the callback (deregister) from the list of callbacks * * @param id the string of the callback to remove */ removeCallback(id: string): void; /** * Set the transfer in the transfers map * * @param id transfer id for tracking transfers * @param transfer transfer object */ setTransfer(id: string, transfer: HttpTransfer): void; /** * Get the status of a specific transfer by ID (only returns for items during the session) * * @param id the ID of the transfer to retrieve that has been started during the session * * @returns an HttpTransfer object that includes the transfer info and status */ getTransferById(id: string): HttpTransfer; /** * Get all active transfers (transfers that are not completed or failed) */ getActiveTransfers(): HttpTransfer[]; /** * Remove a transfer from the transfer list * * @param id the ID of the transfer to remove */ removeTransfer(id: string): void; /** * Get the list of transfers started during the session for checking status * * @param returnMap boolean to indicate if the raw Map should be returned instead of an array * * @returns an Array of transfers or a Map of transfers (with the ID as key). Array is default */ getAllTransfers(returnMap?: boolean): any; } export declare class HttpGateway { /** Global information about the HTTP Gateway */ globals: HttpGatewayGlobals; /** Activity tracking for watching transfers */ activityTracking: ActivityTracking; /** Function to init the HTTP Gateway */ initHttpGateway: (serverUrl: string, softwareMode?: boolean) => Promise; /** Function to test the HTTP Gateway status */ testHttpGatewayConnection: () => Promise; /** Function to download from the HTTP Gateway */ download: (transferSpec: TransferSpec) => Promise; /** Function to upload to the HTTP Gateway */ upload: (transferSpec: TransferSpec, id: string, overrideFiles?: File[]) => Promise; /** Request file picker to get files for uploading */ getFilesForUpload: (callback: (data: DataTransferResponse) => void, id: string) => void; /** Request file picker to get files for uploading using Promises */ getFilesForUploadPromise: (id: string) => Promise; /** Request folder picker to get folder for uploading */ getFoldersForUpload: (callback: (data: DataTransferResponse) => void, id: string) => void; /** Request folder picker to get folder for uploading using Promises */ getFoldersForUploadPromise: (id: string) => Promise; /** Create dropzone for drop events of files */ createDropzone: (callback: (data: { event: any; files: { dataTransfer: { files: ConnectStyleFile[]; }; }; }) => void, elementSelector: string, formId: string) => void; /** Remove dropzone for drop events of files */ removeDropzone: (elementSelector: string, formId: string) => void; /** Register callback for the transfer activity monitor */ registerActivityCallback: (callback: (transfers: TransferResponse) => void) => string; /** Deregister callback to remove it from the callbacks getting transfer data */ deregisterActivityCallback: (id: string) => void; /** Get HTTP Gateway transfer by ID */ getTransferById: (id: string) => { transfer_info: HttpTransfer; }; /** Get all HTTP Gateway transfers */ getAllTransfers: () => TransferResponse; /** Clear all transfers that are not active */ clearNonActiveTransfers: () => void; /** Remove transfer by uuid */ removeTransfer: (id: string) => void; /** Cancel transfer by uuid */ cancelTransfer: (id: string) => void; /** Start a video stream */ startStream: (transferSpec: TransferSpec, videoDomQuery?: string, videoOptions?: VideoPlayerOptions) => Promise; /** Inject a stream into the DOM */ injectStreamToDom: (url: string, videoDomQuery: string, videoOptions?: VideoPlayerOptions) => void; /** * Check if the HTTP Server is ready to be used and has been verified * * @returns a boolean indicating if SDK can be used for transfers */ get isReady(): boolean; /** * If the user attempts to leave the page warn that by leaving they will have their transfer abort * NOTE: Only IE will show custom text. No way to indicate why they are being blocked. */ checkForPageLeave: (event: BeforeUnloadEvent) => string; /** * Overwrite default chunk size for chunking transfer data. * This is an optional function, a default recommended size is set on start. * * @param size the size to use */ overwriteDefaultChunkSize(size: number): void; /** * Overwrite default concurrent transfer number for parallel transfers * This is an optional function, a default recommended number is set on start. * * @param transfers the number of concurrent uploads to use */ overwriteDefaultConcurrentUploads(transfers: number): void; } export {};