import { InputStream, OutputStream } from '@raytecvision/guacamole-common-js'; import { HttpClient } from '@angular/common/http'; import * as i0 from "@angular/core"; /** * Service for operating on the tunnels of in-progress connections (and their * underlying objects) via the REST API. */ export declare class TunnelRestApiService { private document; private http; private apiUrl; private token; private window; constructor(document: Document, http: HttpClient); initialize(apiUrl: string): void; setToken(token: string): void; /** * Makes a request to the REST API to get the list of all tunnels * associated with in-progress connections, returning a promise that * provides an array of their UUIDs (strings) if successful. * * @returns {Promise.>} * A promise which will resolve with an array of UUID strings, uniquely * identifying each active tunnel. */ getTunnels(): Promise; /** * Makes a request to the REST API to retrieve the underlying protocol of * the connection associated with a particular tunnel, returning a promise * that provides a @link{Protocol} object if successful. * * @param {String} tunnel * The UUID of the tunnel associated with the Guacamole connection * whose underlying protocol is being retrieved. * * @returns {Promise.} * A promise which will resolve with a @link{Protocol} object upon * success. */ getProtocol(tunnel: string): Promise; /** * Retrieves the set of sharing profiles that the current user can use to * share the active connection of the given tunnel. * * @param {String} tunnel * The UUID of the tunnel associated with the Guacamole connection * whose sharing profiles are being retrieved. * * @returns {Promise.>} * A promise which will resolve with a map of @link{SharingProfile} * objects where each key is the identifier of the corresponding * sharing profile. */ getSharingProfiles(tunnel: string): Promise; /** * Makes a request to the REST API to generate credentials which have * access strictly to the active connection associated with the given * tunnel, using the restrictions defined by the given sharing profile, * returning a promise that provides the resulting @link{UserCredentials} * object if successful. * * @param {String} tunnel * The UUID of the tunnel associated with the Guacamole connection * being shared. * * @param {String} sharingProfile * The identifier of the connection object dictating the * semantics/restrictions which apply to the shared session. * * @returns {Promise.} * A promise which will resolve with a @link{UserCredentials} object * upon success. */ getSharingCredentials(tunnel: string, sharingProfile: string): Promise; /** * Sanitize a filename, replacing all URL path seperators with safe * characters. * * @param filename * An unsanitized filename that may need cleanup. * * @returns * The sanitized filename. */ static sanitizeFilename(filename: string): string; /** * Makes a request to the REST API to retrieve the contents of a stream * which has been created within the active Guacamole connection associated * with the given tunnel. The contents of the stream will automatically be * downloaded by the browser. * * WARNING: Like Guacamole's various reader implementations, this function * relies on assigning an "onend" handler to the stream object for the sake * of cleaning up resources after the stream closes. If the "onend" handler * is overwritten after this function returns, resources may not be * properly cleaned up. * * @param {String} tunnelUuid * The UUID of the tunnel associated with the Guacamole connection * whose stream should be downloaded as a file. * * @param {Guacamole.InputStream} stream * The stream whose contents should be downloaded. * * @param {String} mimetype * The mimetype of the stream being downloaded. This is currently * ignored, with the download forced by using * "application/octet-stream". * * @param {String} filename * The filename that should be given to the downloaded file. */ downloadStream(tunnelUuid: string, stream: InputStream, mimetype: string, filename: string): void; /** * Makes a request to the REST API to send the contents of the given file * along a stream which has been created within the active Guacamole * connection associated with the given tunnel. The contents of the file * will automatically be split into individual "blob" instructions, as if * sent by the connected Guacamole client. * * @param {String} tunnel * The UUID of the tunnel associated with the Guacamole connection * whose stream should receive the given file. * * @param {Guacamole.OutputStream} stream * The stream that should receive the given file. * * @param {File} file * The file that should be sent along the given stream. * * @param {Function} [progressCallback] * An optional callback which, if provided, will be invoked as the * file upload progresses. The current position within the file, in * bytes, will be provided to the callback as the sole argument. * * @return {Promise} * A promise which resolves when the upload has completed, and is * rejected with an Error if the upload fails. The Guacamole protocol * status code describing the failure will be included in the Error if * available. If the status code is available, the type of the Error * will be STREAM_ERROR. */ uploadToStream(tunnel: string, stream: OutputStream, file: File, progressCallback: (a: any) => void): Promise; private checkServiceState; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; }