import { Observable } from 'rxjs/Observable'; import 'rxjs/add/operator/toPromise'; import { RequestOptions } from '@angular/http'; import { RequestQueryParams } from './service/RequestQueryParams'; import { DebugElement } from '@angular/core'; import { Comparator, State } from '@clr/angular'; /** * Convert the different async channels to the Promise type. * ** * template T * ** deprecated param {(Observable | Promise | T)} async * returns {Promise} */ export declare function toPromise(async: Observable | Promise | T): Promise; /** * The default cookie key used to store current used language preference. */ export declare const DEFAULT_LANG_COOKIE_KEY = "harbor-lang"; /** * Declare what languages are supported now. */ export declare const DEFAULT_SUPPORTING_LANGS: string[]; /** * The default language. */ export declare const DEFAULT_LANG = "en-us"; export declare const HTTP_JSON_OPTIONS: RequestOptions; export declare const HTTP_GET_OPTIONS: RequestOptions; export declare const FILE_UPLOAD_OPTION: RequestOptions; /** * Build http request options * ** * ** deprecated param {RequestQueryParams} params * returns {RequestOptions} */ export declare function buildHttpRequestOptions(params: RequestQueryParams): RequestOptions; /** Button events to pass to `DebugElement.triggerEventHandler` for RouterLink event handler */ export declare const ButtonClickEvents: { left: { button: number; }; right: { button: number; }; }; /** Simulate element click. Defaults to mouse left-button click event. */ export declare function click(el: DebugElement | HTMLElement, eventObj?: any): void; /** * Comparator for fields with specific type. * */ export declare class CustomComparator implements Comparator { fieldName: string; type: string; constructor(fieldName: string, type: string); compare(a: { [key: string]: any | any[]; }, b: { [key: string]: any | any[]; }): number; } /** * The default page size */ export declare const DEFAULT_PAGE_SIZE: number; /** * The state of vulnerability scanning */ export declare const VULNERABILITY_SCAN_STATUS: { unknown: string; pending: string; running: string; error: string; stopped: string; finished: string; }; /** * Calculate page number by state */ export declare function calculatePage(state: State): number; /** * Filter columns via RegExp * ** * ** deprecated param {State} state * returns {void} */ export declare function doFiltering(items: T[], state: State): T[]; /** * Match items via RegExp * ** * ** deprecated param {string} terms * ** deprecated param {*} testedValue * returns {boolean} */ export declare function regexpFilter(terms: string, testedValue: any): boolean; /** * Sorting the data by column * ** * template T * ** deprecated param {T[]} items * ** deprecated param {State} state * returns {T[]} */ export declare function doSorting(items: T[], state: State): T[]; /** * Compare the two objects to adjust if they're equal * ** * ** deprecated param {*} a * ** deprecated param {*} b * returns {boolean} */ export declare function compareValue(a: any, b: any): boolean; /** * Check if the object is null or empty '{}' * ** * ** deprecated param {*} obj * returns {boolean} */ export declare function isEmptyObject(obj: any): boolean; /** * Deeper clone all * ** * ** deprecated param {*} srcObj * returns {*} */ export declare function clone(srcObj: any): any; export declare function downloadFile(fileData: any): void;