import { ErrorResponse, InstallerUrlInfo, PromiseObject, TransferSpec } from '../models/models'; /** * Generates promise object that can be resolved or rejected via functions * * @returns an object containing the promise, the resolver and rejecter */ export declare const generatePromiseObjects: () => PromiseObject; /** * Log errors from Aspera SDK * * @param message the message indicating the error encountered * @param debugData the data with useful debugging information */ export declare const errorLog: (message: string, debugData?: any) => void; /** * Generate error object for rejecter responses * * @param message the message indicating the error encountered * @param debugData the data with useful debugging information * * @returns object containing standardized error response */ export declare const generateErrorBody: (message: string, debugData?: any) => ErrorResponse; /** * Validate if transferSpec is valid for server communication * * @param transferSpec the transferSpec to test * * @returns boolean indicating whether supplied transferSpec is valid */ export declare const isValidTransferSpec: (transferSpec: TransferSpec) => boolean; /** * Returns a string indicating the websocket URL to use for talking to the server * * @returns a string of the full Websocket URL */ export declare const getWebsocketUrl: (serverUrl: string) => string; /** * Simple function to get the current platform. * * @returns a string indicating the current platform */ export declare const getCurrentPlatform: () => "macos" | "windows" | "linux" | "unknown"; /** * Function used to create a random UUID * * @returns string */ export declare const randomUUID: () => string; /** * Return a rejected promise * * @param message the message indicating the error encountered * @param debugData the data with useful debugging information * * @returns a rejected promise */ export declare const throwError: (message: string, debugData?: any) => Promise; /** * Check if the given string is a valid URL * * @param url string to check if valid URL * * @returns boolean */ export declare const isValidURL: (url: string) => boolean; /** * Checks if the current browser is Safari. * @returns {boolean} Whether the browser is Safari. */ export declare const isSafari: () => boolean; /** * Get the URLs for installer management. * * @returns Info on URLs where installers live */ export declare const getInstallerUrls: () => InstallerUrlInfo; /** * Try to stringify a JSON string and log failures * * @param json - Object to make into a string * * @returns string representing JSON or empty string on error */ export declare const safeJsonString: (json: unknown) => string; /** * Try to parse a JSON string and log failures * * @param json - String to make into an object * * @returns object or array from the JSON string. Or undefined */ export declare const safeJsonParse: (json: string) => any | undefined; /** * Race a promise against a timeout. Rejects with an Error('timeout') if the * given milliseconds elapse before the promise settles. */ export declare const withTimeout: (promise: Promise, ms: number) => Promise; declare const _default: { errorLog: (message: string, debugData?: any) => void; generateErrorBody: (message: string, debugData?: any) => ErrorResponse; generatePromiseObjects: () => PromiseObject; getCurrentPlatform: () => "macos" | "windows" | "linux" | "unknown"; getWebsocketUrl: (serverUrl: string) => string; isSafari: () => boolean; isValidURL: (url: string) => boolean; isValidTransferSpec: (transferSpec: TransferSpec) => boolean; randomUUID: () => string; throwError: (message: string, debugData?: any) => Promise; getInstallerUrls: () => InstallerUrlInfo; safeJsonString: (json: unknown) => string; safeJsonParse: (json: string) => any | undefined; withTimeout: (promise: Promise, ms: number) => Promise; }; export default _default;