@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
48 lines • 2.06 kB
TypeScript
import { IManagedObject } from '@c8y/client';
import { WidgetSettings } from '@c8y/ngx-components';
export interface HtmlWidgetConfig {
device: IManagedObject;
settings: WidgetSettings;
config: HtmlWidget;
/**
* On HTML WIdget 1.0 this property was used to store the HTML code.
* It is not used anymore, but we need to keep it for backward compatibility.
* The HTML code is now stored in the config property.
* @deprecated Use config.code instead.
*/
html?: any;
}
export type C8yProperties = Array<PathProperty | ComputedProperty>;
export interface HtmlWidget {
css: string;
code: string;
props?: C8yProperties;
options: HtmlWidgetOptions;
legacy: boolean;
devMode: boolean;
latestCodeHash?: string;
}
export interface HtmlWidgetOptions {
cssEncapsulation: boolean;
advancedSecurity: boolean;
}
export interface WebcomponentContext extends HTMLElement {
c8yContext: IManagedObject;
}
export interface PathProperty {
name: string;
path: string;
query?: never;
reducer?: never;
}
export interface ComputedProperty {
name: string;
path?: never;
query: string;
reducer?: string;
}
export declare const INITIAL_HTML_FORMATTED = "<div>\n <h1>Hello from HTML widget</h1>\n <p>\n You can use HTML and Javascript template literals here:\n ${this.c8yContext ? this.c8yContext.name : 'No device selected'}\n </p>\n\n <a class=\"btn btn-primary\" href=\"#/group\">Go to groups</a>\n\n <p>\n Use the CSS editor to add CSS. You can use <span class=\"branded\">any design-token CSS variable</span> in there.\n </p>\n</div>";
export declare const INITIAL_CSS_FORMATTED = "\n:host > div {\n padding-left: var(--c8y-root-component-padding);\n padding-right: var(--c8y-root-component-padding);\n}\nspan.branded { \n color: var(--c8y-brand-primary); \n}";
export declare const defaultWebComponentName = "DefaultWebComponent";
export declare const defaultWebComponentAttributeNameContext = "c8yContext";
//# sourceMappingURL=html-widget.model.d.ts.map