@senx/discovery-widgets
Version:
Discovery Widgets Elements
61 lines (60 loc) • 1.95 kB
TypeScript
import { Param } from '../model/param';
import { DataModel, DiscoveryEvent } from '../model/types';
export declare class Utils {
static DEFICON: string;
static getNavigatorLanguage: () => string;
static clone(inObject: any): any;
static throttle(func: any, delay: number, ctx?: any): (...args: any[]) => void;
static httpPost(theUrl: string, payload: string, headers: {
[key: string]: string;
}): Promise<{
data: any;
headers: {
[key: string]: string;
};
status: {
ops: number;
elapsed: number;
fetched: number;
};
}>;
static merge(options: Param | string, options2: Param): any;
static sanitize(data: string | DataModel): string | DataModel;
static mergeDeep<T>(base: T, ext: any): T;
static getLabelColor(el: HTMLElement): string;
static getGridColor(el: HTMLElement): string;
static getCSSColor(el: HTMLElement, property: string, defColor: string): string;
static getContentBounds(el: HTMLElement): {
w: number;
h: number;
};
static unsescape(str: string): string;
static parseEventData(evt: DiscoveryEvent, eventHandler: string, id: string): {
style: any;
data: any;
xpath: any;
popup: any;
vars: any;
audio: any;
zoom: any;
focus: any;
margin: any;
bounds: any;
title: any;
description: any;
selected: any;
link: any;
hasEvent: boolean;
poi: any[];
};
static parseXML(xmlString: string, contentType: DOMParserSupportedType): Document;
/**
* Compute the backend url if it is a relative one
*
* @param url
*/
static getUrl(url: string): string;
static deepEqual(object1: any, object2: any): boolean;
static isObject(object: any): boolean;
static execAction(macro: string, widget: any): void;
}