@sodacore/ui
Version:
Sodacore UI is a powerful JSON-based DSL for describing web pages that can be rendered by a frontend JavaScript framework.
38 lines • 1.15 kB
TypeScript
import type BaseElement from './base';
import Layout from './layout';
export default class Page {
protected title: string;
protected layout: Layout;
protected elements: BaseElement[];
constructor(title: string);
setTitle(title: string): this;
getTitle(): string;
setLayout(layout: Layout): this;
getLayout(): Layout;
addElement(element: BaseElement): this;
addElements(...elements: BaseElement[]): this;
removeElement(element: BaseElement): this;
getElements(): BaseElement[];
getElement(key: string): BaseElement | undefined;
toJSON(): {
title: string;
layout: {
areas: string[][];
uniqueAreas: string[];
columns: string;
rows: string;
gap: string | number;
};
elements: {
component: string;
key: string;
area: string | null;
label: string;
classes: string[];
styles: Record<string, string>;
attributes: Record<string, string>;
value: string | null;
}[];
};
}
//# sourceMappingURL=page.d.ts.map