rimmel
Version:
A Stream-Oriented UI library for the Rx.Observable Universe
57 lines • 1.46 kB
TypeScript
import type { BindingConfiguration, RMLTemplateExpression } from "../types/internal";
import type { HTMLString } from "../types/dom";
export declare const addRef: (ref: string, data: BindingConfiguration) => void;
/**
* rml — the main entry point for Rimmel.js
*
* rml is a tag function. You call it by tagging it with an ES6 template literal
* of HTML text interleaved with references to any JavaScript entity that's in scope.
*
* Any JavaScript expression inside the template literal will be evaluated and the
* resulting value will be inserted into the HTML template literal. Async expressions
* such as Promises and Observables will be rendered as they resolve/emit.
*
* ## Example
*
* ```ts
* import { rml } from 'rimmel';
*
* const Component = () => {
* const content = 'hello world';
*
* return rml`
* <div>${content}</div>
* `;
* };
* ```
*
* ## Example
*
* ```ts
* import { rml } from 'rimmel';
*
* const Component = () => {
* const num = 123;
*
* return rml`
* <input type="number" value="${number}">
* `;
* };
* ```
*
* ## Example
*
* ```ts
* import { rml } from 'rimmel';
*
* const Component = () => {
* const data = fetch('/api').then(res => res.text());
*
* return rml`
* <div>${data}</div>
* `;
* };
* ```
**/
export declare function rml(strings: TemplateStringsArray, ...expressions: RMLTemplateExpression[]): HTMLString;
//# sourceMappingURL=parser.d.ts.map