import { CustomBrandingOptions, DataTransferResponse, DropzoneEventData, DropzoneEventType, DropzoneOptions, AsperaSdkSpec, AsperaSdkTransfer, FileDialogOptions, FolderDialogOptions, SaveFileDialogOptions, InitOptions, InstallerInfoResponse, InstallerOptions, ModifyTransferOptions, Pagination, PaginatedFilesResponse, ResumeTransferOptions, SafariExtensionEvent, SdkStatus, TransferSpec, WebsocketEvent, InstallerUrlInfo, SdkCapabilities, GetChecksumOptions, ChecksumFileResponse, ReadDirectoryOptions, ReadDirectoryResponse, ShowPreferencesPageOptions, TestSshPortsOptions, TransferClient } from './models'; import { HttpGatewayInfo } from '../http-gateway/models'; import * as ConnectTypes from '@ibm-aspera/connect-sdk-js/dist/esm/core/types'; import { Connect, ConnectInstaller } from '@ibm-aspera/connect-sdk-js'; export declare class AsperaSdkGlobals { /** The URL of the IBM Aspera HTTP server to use with the SDK */ asperaAppUrl: string; /** The URL of the IBM Aspera Desktop HTTP server to use with the SDK */ rpcPort: number; /** The list of RPC methods supported by the running IBM Aspera for desktop application */ rpcMethods: string[]; /** The default URL to check for latest Aspera installers */ installerUrl: string; /** Aspera SDK info */ asperaSdkInfo: AsperaSdkClientInfo; /** Indicate that the server has been verified as working */ asperaAppVerified: boolean; /** The unique ID for the website */ appId: string; /** Indicate if multiple session is supported */ supportMultipleUsers: boolean; /** The session ID for the current user */ sessionId?: string; /** Map of drop zones created by querySelector */ dropZonesCreated: Map void; }[]>; /** HTTP Gateway URL after successful passing */ httpGatewayUrl?: string; /** Version-based route prefix for HTTP Gateway API endpoints (e.g. "/v3" for v3+, "" for v2) */ httpGatewayRoutePrefix: string; /** Indicate that the HTTP Gateway has been verified as working */ httpGatewayVerified: boolean; /** HTTP Gateway info */ httpGatewayInfo?: HttpGatewayInfo; /** Http Gateway IFRAME container */ httpGatewayIframeContainer?: HTMLDivElement; /** Connect raw AW4 objects */ connectAW4?: { Connect: typeof Connect; ConnectInstaller: typeof ConnectInstaller; }; /** Connect instance */ connect?: ConnectTypes.ConnectClientType; /** Connect installer instance */ connectInstaller?: ConnectTypes.ConnectInstallerClientType; /** Connect status */ connectStatus: ConnectTypes.ConnectStatusStrings; /** Connect application version, populated when Connect transitions to RUNNING. */ connectVersion?: string; backupLaunchMethod(url: string): void; /** * Launch the IBM Aspera App via protocol url. By default, a hidden IFRAME attempts to * open the app but if that fails a fallback of opening a new window happens. */ launch(): void; get sdkResponseData(): AsperaSdkInfo; } export interface AsperaSdkClientInfo { /** The version of IBM Aspera SDK */ version: string; /** The public key corresponding to the SSH private key generated by IBM Aspera */ client_pubkey?: string; } export type AsperaSdkInfo = AsperaSdkClientInfo & { verified: boolean; httpGateway: { verified: boolean; url?: string; info?: HttpGatewayInfo; }; connect: { active: boolean; status: ConnectTypes.ConnectStatusStrings; /** Connect application version, available once Connect has reached the RUNNING status. */ version?: string; }; }; export interface TransferResponse { transfers: AsperaSdkTransfer[]; } export type ActivityMessageTypes = 'transferUpdated' | 'transferRemoved'; export interface ActivityMessage { type: ActivityMessageTypes; data: unknown; } export declare class ActivityTracking { /** Map of callbacks that receive transfer update events */ private activity_callbacks; /** * Notify all consumers when a message is received from the transfer client. * * @param message the message received */ handleTransferActivity(message: ActivityMessage): void; /** * Handle and notify when a connection webSocketEvent occurs. For example, when the SDK * websocket connection to IBM Aspera App is closed or reconnected. * * Bridges WebSocket events to StatusService as SdkStatus values. * * @param webSocketEvent the event type. */ handleWebSocketEvents(webSocketEvent: WebsocketEvent): void; /** * Trigger manual event for other event types (e.g. Connect status strings). * Bridges to StatusService. */ sendManualEventCallback(status: string): void; /** * Notify all consumers when the client changes status. For example, when * IBM Aspera App is launched or closed. * * @param running whether the client is running or not. */ handleClientEvents(running: boolean): void; /** * Notify all consumers when a Safari extension safariExtensionEvent occurs (enabled/disabled). * * @param safariExtensionEvent the event type. */ handleSafariExtensionEvents(safariExtensionEvent: SafariExtensionEvent): void; /** * Set up the activity tracking with IBM Aspera. * * @returns a promise that resolves when the websocket connection is established. * Currently, this promise does not reject. */ setup(): Promise; /** * 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; private registerDesktopAppSession; } export declare class AsperaSdk { /** Global information about IBM Aspera */ globals: AsperaSdkGlobals; /** Activity tracking for watching transfers */ /** @ignore */ activityTracking: ActivityTracking; /** HTTP Gateway file store. Key is the file name. */ httpGatewaySelectedFiles: Map; /** Function to initialize IBM Aspera */ init: (options: InitOptions) => Promise; /** Function to test the IBM Aspera status */ testConnection: () => Promise; /** Function to initiate a transfer */ startTransfer: (transferSpec: TransferSpec, AsperaSdkSpec: AsperaSdkSpec) => Promise; /** Function to launch IBM Aspera */ launch: () => 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; /** Register callback for connection status events from the app */ registerStatusCallback: (callback: (status: SdkStatus) => void) => string; /** Deregister callback to remove it from the callbacks getting connection events */ deregisterStatusCallback: (id: string) => void; /** Non-blocking initialization. Status events communicate lifecycle via registerStatusCallback. */ initSession: (options?: InitOptions) => void; /** Get current SDK lifecycle status synchronously. */ getStatus: () => SdkStatus | undefined; /** Function to remove a transfer */ removeTransfer: (transferId: string) => Promise; /** Function to show the transfer's download directory in Finder or Windows Explorer */ showDirectory: (transferId: string) => Promise; /** Function to stop a transfer */ stopTransfer: (transferId: string) => Promise; /** Function to resume a transfer */ resumeTransfer: (transferId: string, options?: ResumeTransferOptions) => Promise; /** Function to get a list of all transfers */ getAllTransfers: () => Promise; /** Function to get information for a specific transfer */ getTransfer: (transferId: string) => Promise; /** Function to display a file dialog for the user to select files. */ showSelectFileDialog: (options?: FileDialogOptions) => Promise; /** Function to display a folder dialog for the user to select folders. */ showSelectFolderDialog: (options?: FolderDialogOptions) => Promise; /** Function to display a save file dialog for the user to choose a save location */ showSaveFileDialog: (options?: SaveFileDialogOptions) => Promise; /** Function to show the about page of the transfer client */ showAbout: () => Promise; /** Function to display the IBM Aspera preferences page */ showPreferences: () => Promise; /** Function to show the transfer manager UI */ showTransferManager: () => Promise; /** Function to open a specific preferences page */ showPreferencesPage: (options: ShowPreferencesPageOptions) => Promise; /** Function to show the transfer rate monitor for a specific transfer */ showTransferMonitor: (transferId: string) => Promise; /** Function to authenticate a transfer specification against the remote server */ authenticate: (transferSpec: TransferSpec) => Promise; /** Function to test SSH port connectivity to a transfer server */ testSshPorts: (options: TestSshPortsOptions) => Promise; /** Function to modify a running transfer */ modifyTransfer: (transferId: string, options: ModifyTransferOptions) => Promise; /** Function to set custom branding for IBM Aspera */ setBranding: (id: string, options: CustomBrandingOptions) => Promise; /** Create dropzone for drop events of files */ createDropzone: (callback: (data: DropzoneEventData) => void, elementSelector: string, options?: DropzoneOptions) => void; /** Remove dropzone for drop events of files */ removeDropzone: (elementSelector: string) => void; /** Function to get latest installer information */ getInstallerInfo: (options: InstallerOptions) => Promise; /** Initialize drag and drop */ initDragDrop: () => Promise; /** Function to get paginated file-level progress for a transfer */ getFilesList: (transferId: string, pagination?: Pagination) => Promise; /** Function to get information about the IBM Aspera instance */ getInfo: () => Promise; /** Function to read an entire file as an array buffer (base64-encoded) */ readAsArrayBuffer: (path: string) => Promise<{ data: string; type: string; }>; /** Function to read a chunk of a file as an array buffer (base64-encoded) */ readChunkAsArrayBuffer: (path: string, offset: number, chunkSize: number) => Promise<{ data: string; type: string; }>; /** Function to get whether IBM Aspera is running on Safari */ isSafari: () => boolean; /** Function to get URLs for installer management. */ getInstallerUrls: () => InstallerUrlInfo; /** Function to get the SDK capabilities. */ getCapabilities: () => SdkCapabilities; /** Function to check whether the SDK supports the specified capability */ hasCapability: (capability: keyof SdkCapabilities) => boolean; /** Function to get a checksum for a file */ getChecksum: (options: GetChecksumOptions) => Promise; /** Function to read directory contents and return entries as a flat list */ readDirectory: (options: ReadDirectoryOptions) => Promise; currentTransferClient: () => TransferClient | undefined; /** Function to update HTTP Gateway settings. */ updateHttpGatewaySettings: (settings: { chunkSize?: number; concurrentUploads?: number; }) => void; /** Indicate if Safari Extension is enabled. If the extension is disabled during the lifecycle this will not update to disabled. */ SAFARI_EXTENSION_STATUS: SafariExtensionEvent; /** Aspera HTTP Gateway calls. This normally is not needed by clients but expose just in case. */ httpGatewayCalls: unknown; /** Store of HTTP Gateway transfers */ httpGatewayTransferStore: Map; /** Store of active HTTP Gateway XMLHttpRequests for cancellation. Key is transfer UUID. */ httpGatewayRequestStore: Map; /** HTTP Gateway in app threshold limit. This can be changed globally for the app. */ httpGatewayInBrowserDownloadThreshold: number; /** * Check if IBM Aspera for desktop is ready to be used and has been verified. * * @returns a boolean indicating if IBM Aspera for desktop can be used for requests */ get isReady(): boolean; /** Indicate that Connect is available. */ get useConnect(): boolean; /** Indicate that HTTP Gateway is available. */ get httpGatewayIsReady(): boolean; /** Indicates if internal calls should use Gateway */ get useHttpGateway(): boolean; /** Indicates if old HTTP Gateway SDK should be used (v2 and lower) */ get useOldHttpGateway(): boolean; }