UNPKG

@sujalchoudhari/solaris-ui

Version:

A UI framework to create HTML pages with just JavaScript.

34 lines (33 loc) 882 B
import { AtomizerTemplate } from './atomizer'; /** * Atom * ----- * An atom is a single HTML element with its properties. * An atom has a template string and the props that are to be rendered in the template. * @author Sujal Choudhari <sjlchoudhari.gmail.com> */ export default class Atom { /** * The template string */ template: AtomizerTemplate; /** * The props that are to be rendered in the template */ props: { [key: string]: any; }; /** * Creates a new Atom * @param template The template string * @param props The props that are to be rendered in the template */ constructor(template: AtomizerTemplate, props: { [key: string]: any; }); /** * Get the HTML equivalent of the atom * @returns The rendered template string with the props */ toString(): string; }