@sodacore/ui
Version:
Sodacore UI is a powerful JSON-based DSL for describing web pages that can be rendered by a frontend JavaScript framework.
45 lines • 1.59 kB
TypeScript
export default class BaseElement {
protected label?: string | undefined;
protected component: string;
protected key: string | null;
protected area: string | null;
protected classes: string[];
protected styles: Record<string, string>;
protected attributes: Record<string, string>;
protected value: string | null;
constructor(label?: string | undefined);
setKey(key: string): this;
getKey(): string | null;
setLabel(label: string): this;
getLabel(): string | undefined;
setArea(area: string): this;
getArea(): string | null;
addClass(className: string): this;
removeClass(className: string): this;
hasClass(className: string): boolean;
setClasses(classes: string[]): this;
getClasses(): string[];
addStyle(key: string, value: string): this;
removeStyle(key: string): this;
hasStyle(key: string): boolean;
setStyles(styles: Record<string, string>): this;
getStyles(): Record<string, string>;
addAttribute(key: string, value: string): this;
removeAttribute(key: string): this;
hasAttribute(key: string): boolean;
setAttributes(attributes: Record<string, string>): this;
getAttributes(): Record<string, string>;
setValue(value: string): this;
getValue(): string | null;
toJSON(): {
component: string;
key: string;
area: string | null;
label: string;
classes: string[];
styles: Record<string, string>;
attributes: Record<string, string>;
value: string | null;
};
}
//# sourceMappingURL=base.d.ts.map