import { AnyVirtualDOM, CSSAttribute } from '@youwol/rx-vdom'; import { Observable, Subject } from 'rxjs'; /** * Implementation of the `display` function used in {@link JsCellView}. * * @param output$ The Subject in which the associated rendered element is emitted. * @param elements The element to display. * @param factory Display factory. */ export declare function display(output$: Subject, factory: DisplayFactory, ...elements: (unknown | Observable)[]): void; /** * Represents the type of component of {@link DisplayFactory}. */ export type DisplayComponent = { /** * Name of the component. */ name: string; /** * Return `true` if this display component handle the target data `t`. */ isCompatible: (t: T) => boolean; /** * Create the view from the target data `t`, `t` does satisfy the condition of `isCompatible`. */ view: (t: T) => AnyVirtualDOM; }; /** * Represents a factory to display elements on the page. * * It is usually composed by the elements of the {@link defaultDisplayFactory}, and eventually includes custom * components provided to the {@link NotebookPage} constructor. */ export type DisplayFactory = DisplayComponent[]; /** * Defines default factory regarding elements passed to the `display` function. * * It creates the associated virtual DOM: * * For `string`, `number` of `boolean` : returns a `div` element with `innerText` set as the value. * * For virtual DOM : returns it. * * For HTMLElement: returns a `div` element with the value a single child. * * Otherwise (for `unknown`): returns an object explorer. * * @returns The default factory. */ export declare function defaultDisplayFactory(): DisplayFactory; /** * Convert an inlined style defined in a DOM element, to a CSS dictionary `styleAttribute -> value`. * * @param styleString The string (e.g. `"width:100%; height:100%"`). * @returns The CSS dictionary. */ export declare function parseStyle(styleString: string): CSSAttribute;