A CelineModule is a wrapper around an Observable runtime, a derived Observable runtime module, and a document.
Its various cell constructors alter both the module and the document to create reactive cells.
CelineModule(document: Document,module: Runtime.Module,)
Creates a new CelineModule instance.
_cell(observerVisibility: ObserverVisibility,name: string,inputsOrDefinition: Inputs | Definition,maybeDefinition?: Definition,): void
Internal method for creating cells with specified visibility.
cell(): void
Declares a reactive cell that renders its value above its element container. The cell can depend on other cells and its definition can return values of type T, Promise, Iterator, or AsyncIterator.
The element's id must match the name parameter.
cell(name: string,definition: Definition,): void
Renders a Markdown string using the Observable stdlib.
Declares a cell and returns a reference that can be mutated. Mutations propagate to cells that depend upon it.
silentCell(): void
Declares a cell that doesn't render a value above an element container.
Otherwise behaves the same as cell()
.
silentCell(name: string,definition: Definition,): void
silentMutable<T>(name: string,value: T,): Mutable
Like mutable, but doesn't render the value above the element container.
Renders a TeX string using the Observable stdlib.
viewof(): void
Special constructor designed to work with Observable Inputs. It declares two reactive cells:
- The "name" cell for the value
- The "viewof name" cell for the DOM element itself
For creating custom inputs, see the Observable "Synchronized Inputs" guide.
viewof(name: string,definition: Definition,): void
usingExistingObservableModule(document: Document,module: Runtime.Module,): CelineModule
Creates a new CelineModule using an existing Observable module. This is just an alias of the default constructor.
usingNewObservableRuntime(document: Document): CelineModule
Creates a new CelineModule with a fresh Observable runtime.
usingNewObservableRuntimeAndModule(document: Document): CelineModule
Creates a new CelineModule with a fresh Observable runtime and module.